compute-gen.go 5.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120147121147122147123147124147125147126147127147128147129147130147131147132147133147134147135147136147137147138147139147140147141147142147143147144147145147146147147147148147149147150147151147152147153147154147155147156147157147158147159147160147161147162147163147164147165147166147167147168147169147170147171147172147173147174147175147176147177147178147179147180147181147182147183147184147185147186147187147188147189147190147191147192147193147194147195147196147197147198147199147200147201147202147203147204147205147206147207147208147209147210147211147212147213147214147215147216147217147218147219147220147221147222147223147224147225147226147227147228147229147230147231147232147233147234147235147236147237147238147239147240147241147242147243147244147245147246147247147248147249147250147251147252147253147254147255147256147257147258147259147260147261147262147263147264147265147266147267147268147269147270147271147272147273147274147275147276147277147278147279147280147281147282147283147284147285147286147287147288147289147290147291147292147293147294147295147296147297147298147299147300147301147302147303147304147305147306147307147308147309147310147311147312147313147314147315147316147317147318147319147320147321147322147323147324147325147326147327147328147329147330147331147332147333147334147335147336147337147338147339147340147341147342147343147344147345147346147347147348147349147350147351147352147353147354147355147356147357147358147359147360147361147362147363147364147365147366147367147368147369147370147371147372147373147374147375147376147377147378147379147380147381147382147383147384147385147386147387147388147389147390147391147392147393147394147395147396147397147398147399147400147401147402147403147404147405147406147407147408147409147410147411147412147413147414147415147416147417147418147419147420147421147422147423147424147425147426147427147428147429147430147431147432147433147434147435147436147437147438147439147440147441147442147443147444147445147446147447147448147449147450147451147452147453147454147455147456147457147458147459147460147461147462147463147464147465147466147467147468147469147470147471147472147473147474147475147476147477147478147479147480147481147482147483147484147485147486147487147488147489147490147491147492147493147494147495147496147497147498147499147500147501147502147503147504147505147506147507147508147509147510147511147512147513147514147515147516147517147518147519147520147521147522147523147524147525147526147527147528147529147530147531147532147533147534147535147536147537147538147539147540147541147542147543147544147545147546147547147548147549147550147551147552147553147554147555147556147557147558147559147560147561147562147563147564147565147566147567147568147569147570147571147572147573147574147575147576147577147578147579147580147581147582147583147584147585147586147587147588147589147590147591147592147593147594147595147596147597147598147599147600147601147602147603147604147605147606147607147608147609147610147611147612147613147614147615147616147617147618147619147620147621147622147623147624147625147626147627147628147629147630147631147632147633147634147635147636147637147638147639147640147641147642147643147644147645147646147647147648147649147650147651147652147653147654147655147656147657147658147659147660147661147662147663147664147665147666147667147668147669147670147671147672147673147674147675147676147677147678147679147680147681147682147683147684147685147686147687147688147689147690147691147692147693147694147695147696147697147698147699147700147701147702147703147704147705147706147707147708147709147710147711147712147713147714147715147716147717147718147719147720147721147722147723147724147725147726147727147728147729147730147731147732147733147734147735147736147737147738147739147740147741147742147743147744147745147746147747147748147749147750147751147752147753147754147755147756147757147758147759147760147761147762147763147764147765147766147767147768147769147770147771147772147773147774147775147776147777147778147779147780147781147782147783147784147785147786147787147788147789147790147791147792147793147794147795147796147797147798147799147800147801147802147803147804147805147806147807147808147809147810147811147812147813147814147815147816147817147818147819147820147821147822147823147824147825147826147827147828147829147830147831147832147833147834147835147836147837147838147839147840147841147842147843147844147845147846147847147848147849147850147851147852147853147854147855147856147857147858147859147860147861147862147863147864147865147866147867147868147869147870147871147872147873147874147875147876147877147878147879147880147881147882147883147884147885147886147887147888147889147890147891147892147893147894147895147896147897147898147899147900147901147902147903147904147905147906147907147908147909147910147911147912147913147914147915147916147917147918147919147920147921147922147923147924147925147926147927147928147929147930147931147932147933147934147935147936147937147938147939147940147941147942147943147944147945147946147947147948147949147950147951147952147953147954147955147956147957147958147959147960147961147962147963147964147965147966147967147968147969147970147971147972147973147974147975147976147977147978147979147980147981147982147983147984147985147986147987147988147989147990147991147992147993147994147995147996147997147998147999148000148001148002148003148004148005148006148007148008148009148010148011148012148013148014148015148016148017148018148019148020148021148022148023148024148025148026148027148028148029148030148031148032148033148034148035148036148037148038148039148040148041148042148043148044148045148046148047148048148049148050148051148052148053148054148055148056148057148058148059148060148061148062148063148064148065148066148067148068148069148070148071148072148073148074148075148076148077148078148079148080148081148082148083148084148085148086148087148088148089148090148091148092148093148094148095148096148097148098148099148100148101148102148103148104148105148106148107148108148109148110148111148112148113148114148115148116148117148118148119148120148121148122148123148124148125148126148127148128148129148130148131148132148133148134148135148136148137148138148139148140148141148142148143148144148145148146148147148148148149148150148151148152148153148154148155148156148157148158148159148160148161148162148163148164148165148166148167148168148169148170148171148172148173148174148175148176148177148178148179148180148181148182148183148184148185148186148187148188148189148190148191148192148193148194148195148196148197148198148199148200148201148202148203148204148205148206148207148208148209148210148211148212148213148214148215148216148217148218148219148220148221148222148223148224148225148226148227148228148229148230148231148232148233148234148235148236148237148238148239148240148241148242148243148244148245148246148247148248148249148250148251148252148253148254148255148256148257148258148259148260148261148262148263148264148265148266148267148268148269148270148271148272148273148274148275148276148277148278148279148280148281148282148283148284148285148286148287148288148289148290148291148292148293148294148295148296148297148298148299148300148301148302148303148304148305148306148307148308148309148310148311148312148313148314148315148316148317148318148319148320148321148322148323148324148325148326148327148328148329148330148331148332148333148334148335148336148337148338148339148340148341148342148343148344148345148346148347148348148349148350148351148352148353148354148355148356148357148358148359148360148361148362148363148364148365148366148367148368148369148370148371148372148373148374148375148376148377148378148379148380148381148382148383148384148385148386148387148388148389148390148391148392148393148394148395148396148397148398148399148400148401148402148403148404148405148406148407148408148409148410148411148412148413148414148415148416148417148418148419148420148421148422148423148424148425148426148427148428148429148430148431148432148433148434148435148436148437148438148439148440148441148442148443148444148445148446148447148448148449148450148451148452148453148454148455148456148457148458148459148460148461148462148463148464148465148466148467148468148469148470148471148472148473148474148475148476148477148478148479148480148481148482148483148484148485148486148487148488148489148490148491148492148493148494148495148496148497148498148499148500148501148502148503148504148505148506148507148508148509148510148511148512148513148514148515148516148517148518148519148520148521148522148523148524148525148526148527148528148529148530148531148532148533148534148535148536148537148538148539148540148541148542148543148544148545148546148547148548148549148550148551148552148553148554148555148556148557148558148559148560148561148562148563148564148565148566148567148568148569148570148571148572148573148574148575148576148577148578148579148580148581148582148583148584148585148586148587148588148589148590148591148592148593148594148595148596148597148598148599148600148601148602148603148604148605148606148607148608148609148610148611148612148613148614148615148616148617148618148619148620148621148622148623148624148625148626148627148628148629148630148631148632148633148634148635148636148637
  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.alpha"
  12. // ...
  13. // computeService, err := compute.New(oauthHttpClient)
  14. package compute // import "google.golang.org/api/compute/v0.alpha"
  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:alpha"
  43. const apiName = "compute"
  44. const apiVersion = "alpha"
  45. const basePath = "https://www.googleapis.com/compute/alpha/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.GlobalOrganizationOperations = NewGlobalOrganizationOperationsService(s)
  80. s.HealthChecks = NewHealthChecksService(s)
  81. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  82. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  83. s.Images = NewImagesService(s)
  84. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  85. s.InstanceGroups = NewInstanceGroupsService(s)
  86. s.InstanceTemplates = NewInstanceTemplatesService(s)
  87. s.Instances = NewInstancesService(s)
  88. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  89. s.InterconnectLocations = NewInterconnectLocationsService(s)
  90. s.Interconnects = NewInterconnectsService(s)
  91. s.LicenseCodes = NewLicenseCodesService(s)
  92. s.Licenses = NewLicensesService(s)
  93. s.MachineImages = NewMachineImagesService(s)
  94. s.MachineTypes = NewMachineTypesService(s)
  95. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  96. s.Networks = NewNetworksService(s)
  97. s.NodeGroups = NewNodeGroupsService(s)
  98. s.NodeTemplates = NewNodeTemplatesService(s)
  99. s.NodeTypes = NewNodeTypesService(s)
  100. s.OrganizationSecurityPolicies = NewOrganizationSecurityPoliciesService(s)
  101. s.Projects = NewProjectsService(s)
  102. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  103. s.RegionBackendServices = NewRegionBackendServicesService(s)
  104. s.RegionCommitments = NewRegionCommitmentsService(s)
  105. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  106. s.RegionDisks = NewRegionDisksService(s)
  107. s.RegionHealthChecks = NewRegionHealthChecksService(s)
  108. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  109. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  110. s.RegionOperations = NewRegionOperationsService(s)
  111. s.RegionSslCertificates = NewRegionSslCertificatesService(s)
  112. s.RegionTargetHttpProxies = NewRegionTargetHttpProxiesService(s)
  113. s.RegionTargetHttpsProxies = NewRegionTargetHttpsProxiesService(s)
  114. s.RegionUrlMaps = NewRegionUrlMapsService(s)
  115. s.Regions = NewRegionsService(s)
  116. s.ResourcePolicies = NewResourcePoliciesService(s)
  117. s.Routers = NewRoutersService(s)
  118. s.Routes = NewRoutesService(s)
  119. s.SecurityPolicies = NewSecurityPoliciesService(s)
  120. s.Snapshots = NewSnapshotsService(s)
  121. s.SslCertificates = NewSslCertificatesService(s)
  122. s.SslPolicies = NewSslPoliciesService(s)
  123. s.Subnetworks = NewSubnetworksService(s)
  124. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  125. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  126. s.TargetInstances = NewTargetInstancesService(s)
  127. s.TargetPools = NewTargetPoolsService(s)
  128. s.TargetSslProxies = NewTargetSslProxiesService(s)
  129. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  130. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  131. s.UrlMaps = NewUrlMapsService(s)
  132. s.VpnGateways = NewVpnGatewaysService(s)
  133. s.VpnTunnels = NewVpnTunnelsService(s)
  134. s.ZoneOperations = NewZoneOperationsService(s)
  135. s.Zones = NewZonesService(s)
  136. return s, nil
  137. }
  138. type Service struct {
  139. client *http.Client
  140. BasePath string // API endpoint base URL
  141. UserAgent string // optional additional User-Agent fragment
  142. AcceleratorTypes *AcceleratorTypesService
  143. Addresses *AddressesService
  144. Allocations *AllocationsService
  145. Autoscalers *AutoscalersService
  146. BackendBuckets *BackendBucketsService
  147. BackendServices *BackendServicesService
  148. DiskTypes *DiskTypesService
  149. Disks *DisksService
  150. Firewalls *FirewallsService
  151. ForwardingRules *ForwardingRulesService
  152. GlobalAddresses *GlobalAddressesService
  153. GlobalForwardingRules *GlobalForwardingRulesService
  154. GlobalOperations *GlobalOperationsService
  155. GlobalOrganizationOperations *GlobalOrganizationOperationsService
  156. HealthChecks *HealthChecksService
  157. HttpHealthChecks *HttpHealthChecksService
  158. HttpsHealthChecks *HttpsHealthChecksService
  159. Images *ImagesService
  160. InstanceGroupManagers *InstanceGroupManagersService
  161. InstanceGroups *InstanceGroupsService
  162. InstanceTemplates *InstanceTemplatesService
  163. Instances *InstancesService
  164. InterconnectAttachments *InterconnectAttachmentsService
  165. InterconnectLocations *InterconnectLocationsService
  166. Interconnects *InterconnectsService
  167. LicenseCodes *LicenseCodesService
  168. Licenses *LicensesService
  169. MachineImages *MachineImagesService
  170. MachineTypes *MachineTypesService
  171. NetworkEndpointGroups *NetworkEndpointGroupsService
  172. Networks *NetworksService
  173. NodeGroups *NodeGroupsService
  174. NodeTemplates *NodeTemplatesService
  175. NodeTypes *NodeTypesService
  176. OrganizationSecurityPolicies *OrganizationSecurityPoliciesService
  177. Projects *ProjectsService
  178. RegionAutoscalers *RegionAutoscalersService
  179. RegionBackendServices *RegionBackendServicesService
  180. RegionCommitments *RegionCommitmentsService
  181. RegionDiskTypes *RegionDiskTypesService
  182. RegionDisks *RegionDisksService
  183. RegionHealthChecks *RegionHealthChecksService
  184. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  185. RegionInstanceGroups *RegionInstanceGroupsService
  186. RegionOperations *RegionOperationsService
  187. RegionSslCertificates *RegionSslCertificatesService
  188. RegionTargetHttpProxies *RegionTargetHttpProxiesService
  189. RegionTargetHttpsProxies *RegionTargetHttpsProxiesService
  190. RegionUrlMaps *RegionUrlMapsService
  191. Regions *RegionsService
  192. ResourcePolicies *ResourcePoliciesService
  193. Routers *RoutersService
  194. Routes *RoutesService
  195. SecurityPolicies *SecurityPoliciesService
  196. Snapshots *SnapshotsService
  197. SslCertificates *SslCertificatesService
  198. SslPolicies *SslPoliciesService
  199. Subnetworks *SubnetworksService
  200. TargetHttpProxies *TargetHttpProxiesService
  201. TargetHttpsProxies *TargetHttpsProxiesService
  202. TargetInstances *TargetInstancesService
  203. TargetPools *TargetPoolsService
  204. TargetSslProxies *TargetSslProxiesService
  205. TargetTcpProxies *TargetTcpProxiesService
  206. TargetVpnGateways *TargetVpnGatewaysService
  207. UrlMaps *UrlMapsService
  208. VpnGateways *VpnGatewaysService
  209. VpnTunnels *VpnTunnelsService
  210. ZoneOperations *ZoneOperationsService
  211. Zones *ZonesService
  212. }
  213. func (s *Service) userAgent() string {
  214. if s.UserAgent == "" {
  215. return googleapi.UserAgent
  216. }
  217. return googleapi.UserAgent + " " + s.UserAgent
  218. }
  219. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  220. rs := &AcceleratorTypesService{s: s}
  221. return rs
  222. }
  223. type AcceleratorTypesService struct {
  224. s *Service
  225. }
  226. func NewAddressesService(s *Service) *AddressesService {
  227. rs := &AddressesService{s: s}
  228. return rs
  229. }
  230. type AddressesService struct {
  231. s *Service
  232. }
  233. func NewAllocationsService(s *Service) *AllocationsService {
  234. rs := &AllocationsService{s: s}
  235. return rs
  236. }
  237. type AllocationsService struct {
  238. s *Service
  239. }
  240. func NewAutoscalersService(s *Service) *AutoscalersService {
  241. rs := &AutoscalersService{s: s}
  242. return rs
  243. }
  244. type AutoscalersService struct {
  245. s *Service
  246. }
  247. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  248. rs := &BackendBucketsService{s: s}
  249. return rs
  250. }
  251. type BackendBucketsService struct {
  252. s *Service
  253. }
  254. func NewBackendServicesService(s *Service) *BackendServicesService {
  255. rs := &BackendServicesService{s: s}
  256. return rs
  257. }
  258. type BackendServicesService struct {
  259. s *Service
  260. }
  261. func NewDiskTypesService(s *Service) *DiskTypesService {
  262. rs := &DiskTypesService{s: s}
  263. return rs
  264. }
  265. type DiskTypesService struct {
  266. s *Service
  267. }
  268. func NewDisksService(s *Service) *DisksService {
  269. rs := &DisksService{s: s}
  270. return rs
  271. }
  272. type DisksService struct {
  273. s *Service
  274. }
  275. func NewFirewallsService(s *Service) *FirewallsService {
  276. rs := &FirewallsService{s: s}
  277. return rs
  278. }
  279. type FirewallsService struct {
  280. s *Service
  281. }
  282. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  283. rs := &ForwardingRulesService{s: s}
  284. return rs
  285. }
  286. type ForwardingRulesService struct {
  287. s *Service
  288. }
  289. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  290. rs := &GlobalAddressesService{s: s}
  291. return rs
  292. }
  293. type GlobalAddressesService struct {
  294. s *Service
  295. }
  296. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  297. rs := &GlobalForwardingRulesService{s: s}
  298. return rs
  299. }
  300. type GlobalForwardingRulesService struct {
  301. s *Service
  302. }
  303. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  304. rs := &GlobalOperationsService{s: s}
  305. return rs
  306. }
  307. type GlobalOperationsService struct {
  308. s *Service
  309. }
  310. func NewGlobalOrganizationOperationsService(s *Service) *GlobalOrganizationOperationsService {
  311. rs := &GlobalOrganizationOperationsService{s: s}
  312. return rs
  313. }
  314. type GlobalOrganizationOperationsService struct {
  315. s *Service
  316. }
  317. func NewHealthChecksService(s *Service) *HealthChecksService {
  318. rs := &HealthChecksService{s: s}
  319. return rs
  320. }
  321. type HealthChecksService struct {
  322. s *Service
  323. }
  324. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  325. rs := &HttpHealthChecksService{s: s}
  326. return rs
  327. }
  328. type HttpHealthChecksService struct {
  329. s *Service
  330. }
  331. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  332. rs := &HttpsHealthChecksService{s: s}
  333. return rs
  334. }
  335. type HttpsHealthChecksService struct {
  336. s *Service
  337. }
  338. func NewImagesService(s *Service) *ImagesService {
  339. rs := &ImagesService{s: s}
  340. return rs
  341. }
  342. type ImagesService struct {
  343. s *Service
  344. }
  345. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  346. rs := &InstanceGroupManagersService{s: s}
  347. return rs
  348. }
  349. type InstanceGroupManagersService struct {
  350. s *Service
  351. }
  352. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  353. rs := &InstanceGroupsService{s: s}
  354. return rs
  355. }
  356. type InstanceGroupsService struct {
  357. s *Service
  358. }
  359. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  360. rs := &InstanceTemplatesService{s: s}
  361. return rs
  362. }
  363. type InstanceTemplatesService struct {
  364. s *Service
  365. }
  366. func NewInstancesService(s *Service) *InstancesService {
  367. rs := &InstancesService{s: s}
  368. return rs
  369. }
  370. type InstancesService struct {
  371. s *Service
  372. }
  373. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  374. rs := &InterconnectAttachmentsService{s: s}
  375. return rs
  376. }
  377. type InterconnectAttachmentsService struct {
  378. s *Service
  379. }
  380. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  381. rs := &InterconnectLocationsService{s: s}
  382. return rs
  383. }
  384. type InterconnectLocationsService struct {
  385. s *Service
  386. }
  387. func NewInterconnectsService(s *Service) *InterconnectsService {
  388. rs := &InterconnectsService{s: s}
  389. return rs
  390. }
  391. type InterconnectsService struct {
  392. s *Service
  393. }
  394. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  395. rs := &LicenseCodesService{s: s}
  396. return rs
  397. }
  398. type LicenseCodesService struct {
  399. s *Service
  400. }
  401. func NewLicensesService(s *Service) *LicensesService {
  402. rs := &LicensesService{s: s}
  403. return rs
  404. }
  405. type LicensesService struct {
  406. s *Service
  407. }
  408. func NewMachineImagesService(s *Service) *MachineImagesService {
  409. rs := &MachineImagesService{s: s}
  410. return rs
  411. }
  412. type MachineImagesService struct {
  413. s *Service
  414. }
  415. func NewMachineTypesService(s *Service) *MachineTypesService {
  416. rs := &MachineTypesService{s: s}
  417. return rs
  418. }
  419. type MachineTypesService struct {
  420. s *Service
  421. }
  422. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  423. rs := &NetworkEndpointGroupsService{s: s}
  424. return rs
  425. }
  426. type NetworkEndpointGroupsService struct {
  427. s *Service
  428. }
  429. func NewNetworksService(s *Service) *NetworksService {
  430. rs := &NetworksService{s: s}
  431. return rs
  432. }
  433. type NetworksService struct {
  434. s *Service
  435. }
  436. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  437. rs := &NodeGroupsService{s: s}
  438. return rs
  439. }
  440. type NodeGroupsService struct {
  441. s *Service
  442. }
  443. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  444. rs := &NodeTemplatesService{s: s}
  445. return rs
  446. }
  447. type NodeTemplatesService struct {
  448. s *Service
  449. }
  450. func NewNodeTypesService(s *Service) *NodeTypesService {
  451. rs := &NodeTypesService{s: s}
  452. return rs
  453. }
  454. type NodeTypesService struct {
  455. s *Service
  456. }
  457. func NewOrganizationSecurityPoliciesService(s *Service) *OrganizationSecurityPoliciesService {
  458. rs := &OrganizationSecurityPoliciesService{s: s}
  459. return rs
  460. }
  461. type OrganizationSecurityPoliciesService struct {
  462. s *Service
  463. }
  464. func NewProjectsService(s *Service) *ProjectsService {
  465. rs := &ProjectsService{s: s}
  466. return rs
  467. }
  468. type ProjectsService struct {
  469. s *Service
  470. }
  471. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  472. rs := &RegionAutoscalersService{s: s}
  473. return rs
  474. }
  475. type RegionAutoscalersService struct {
  476. s *Service
  477. }
  478. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  479. rs := &RegionBackendServicesService{s: s}
  480. return rs
  481. }
  482. type RegionBackendServicesService struct {
  483. s *Service
  484. }
  485. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  486. rs := &RegionCommitmentsService{s: s}
  487. return rs
  488. }
  489. type RegionCommitmentsService struct {
  490. s *Service
  491. }
  492. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  493. rs := &RegionDiskTypesService{s: s}
  494. return rs
  495. }
  496. type RegionDiskTypesService struct {
  497. s *Service
  498. }
  499. func NewRegionDisksService(s *Service) *RegionDisksService {
  500. rs := &RegionDisksService{s: s}
  501. return rs
  502. }
  503. type RegionDisksService struct {
  504. s *Service
  505. }
  506. func NewRegionHealthChecksService(s *Service) *RegionHealthChecksService {
  507. rs := &RegionHealthChecksService{s: s}
  508. return rs
  509. }
  510. type RegionHealthChecksService struct {
  511. s *Service
  512. }
  513. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  514. rs := &RegionInstanceGroupManagersService{s: s}
  515. return rs
  516. }
  517. type RegionInstanceGroupManagersService struct {
  518. s *Service
  519. }
  520. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  521. rs := &RegionInstanceGroupsService{s: s}
  522. return rs
  523. }
  524. type RegionInstanceGroupsService struct {
  525. s *Service
  526. }
  527. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  528. rs := &RegionOperationsService{s: s}
  529. return rs
  530. }
  531. type RegionOperationsService struct {
  532. s *Service
  533. }
  534. func NewRegionSslCertificatesService(s *Service) *RegionSslCertificatesService {
  535. rs := &RegionSslCertificatesService{s: s}
  536. return rs
  537. }
  538. type RegionSslCertificatesService struct {
  539. s *Service
  540. }
  541. func NewRegionTargetHttpProxiesService(s *Service) *RegionTargetHttpProxiesService {
  542. rs := &RegionTargetHttpProxiesService{s: s}
  543. return rs
  544. }
  545. type RegionTargetHttpProxiesService struct {
  546. s *Service
  547. }
  548. func NewRegionTargetHttpsProxiesService(s *Service) *RegionTargetHttpsProxiesService {
  549. rs := &RegionTargetHttpsProxiesService{s: s}
  550. return rs
  551. }
  552. type RegionTargetHttpsProxiesService struct {
  553. s *Service
  554. }
  555. func NewRegionUrlMapsService(s *Service) *RegionUrlMapsService {
  556. rs := &RegionUrlMapsService{s: s}
  557. return rs
  558. }
  559. type RegionUrlMapsService struct {
  560. s *Service
  561. }
  562. func NewRegionsService(s *Service) *RegionsService {
  563. rs := &RegionsService{s: s}
  564. return rs
  565. }
  566. type RegionsService struct {
  567. s *Service
  568. }
  569. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  570. rs := &ResourcePoliciesService{s: s}
  571. return rs
  572. }
  573. type ResourcePoliciesService struct {
  574. s *Service
  575. }
  576. func NewRoutersService(s *Service) *RoutersService {
  577. rs := &RoutersService{s: s}
  578. return rs
  579. }
  580. type RoutersService struct {
  581. s *Service
  582. }
  583. func NewRoutesService(s *Service) *RoutesService {
  584. rs := &RoutesService{s: s}
  585. return rs
  586. }
  587. type RoutesService struct {
  588. s *Service
  589. }
  590. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  591. rs := &SecurityPoliciesService{s: s}
  592. return rs
  593. }
  594. type SecurityPoliciesService struct {
  595. s *Service
  596. }
  597. func NewSnapshotsService(s *Service) *SnapshotsService {
  598. rs := &SnapshotsService{s: s}
  599. return rs
  600. }
  601. type SnapshotsService struct {
  602. s *Service
  603. }
  604. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  605. rs := &SslCertificatesService{s: s}
  606. return rs
  607. }
  608. type SslCertificatesService struct {
  609. s *Service
  610. }
  611. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  612. rs := &SslPoliciesService{s: s}
  613. return rs
  614. }
  615. type SslPoliciesService struct {
  616. s *Service
  617. }
  618. func NewSubnetworksService(s *Service) *SubnetworksService {
  619. rs := &SubnetworksService{s: s}
  620. return rs
  621. }
  622. type SubnetworksService struct {
  623. s *Service
  624. }
  625. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  626. rs := &TargetHttpProxiesService{s: s}
  627. return rs
  628. }
  629. type TargetHttpProxiesService struct {
  630. s *Service
  631. }
  632. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  633. rs := &TargetHttpsProxiesService{s: s}
  634. return rs
  635. }
  636. type TargetHttpsProxiesService struct {
  637. s *Service
  638. }
  639. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  640. rs := &TargetInstancesService{s: s}
  641. return rs
  642. }
  643. type TargetInstancesService struct {
  644. s *Service
  645. }
  646. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  647. rs := &TargetPoolsService{s: s}
  648. return rs
  649. }
  650. type TargetPoolsService struct {
  651. s *Service
  652. }
  653. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  654. rs := &TargetSslProxiesService{s: s}
  655. return rs
  656. }
  657. type TargetSslProxiesService struct {
  658. s *Service
  659. }
  660. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  661. rs := &TargetTcpProxiesService{s: s}
  662. return rs
  663. }
  664. type TargetTcpProxiesService struct {
  665. s *Service
  666. }
  667. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  668. rs := &TargetVpnGatewaysService{s: s}
  669. return rs
  670. }
  671. type TargetVpnGatewaysService struct {
  672. s *Service
  673. }
  674. func NewUrlMapsService(s *Service) *UrlMapsService {
  675. rs := &UrlMapsService{s: s}
  676. return rs
  677. }
  678. type UrlMapsService struct {
  679. s *Service
  680. }
  681. func NewVpnGatewaysService(s *Service) *VpnGatewaysService {
  682. rs := &VpnGatewaysService{s: s}
  683. return rs
  684. }
  685. type VpnGatewaysService struct {
  686. s *Service
  687. }
  688. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  689. rs := &VpnTunnelsService{s: s}
  690. return rs
  691. }
  692. type VpnTunnelsService struct {
  693. s *Service
  694. }
  695. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  696. rs := &ZoneOperationsService{s: s}
  697. return rs
  698. }
  699. type ZoneOperationsService struct {
  700. s *Service
  701. }
  702. func NewZonesService(s *Service) *ZonesService {
  703. rs := &ZonesService{s: s}
  704. return rs
  705. }
  706. type ZonesService struct {
  707. s *Service
  708. }
  709. // AcceleratorConfig: A specification of the type and number of
  710. // accelerator cards attached to the instance.
  711. type AcceleratorConfig struct {
  712. // AcceleratorCount: The number of the guest accelerator cards exposed
  713. // to this instance.
  714. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  715. // AcceleratorType: Full or partial URL of the accelerator type resource
  716. // to attach to this instance. If you are creating an instance template,
  717. // specify only the accelerator name.
  718. AcceleratorType string `json:"acceleratorType,omitempty"`
  719. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  720. // unconditionally include in API requests. By default, fields with
  721. // empty values are omitted from API requests. However, any non-pointer,
  722. // non-interface field appearing in ForceSendFields will be sent to the
  723. // server regardless of whether the field is empty or not. This may be
  724. // used to include empty fields in Patch requests.
  725. ForceSendFields []string `json:"-"`
  726. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  727. // include in API requests with the JSON null value. By default, fields
  728. // with empty values are omitted from API requests. However, any field
  729. // with an empty value appearing in NullFields will be sent to the
  730. // server as null. It is an error if a field in this list has a
  731. // non-empty value. This may be used to include null fields in Patch
  732. // requests.
  733. NullFields []string `json:"-"`
  734. }
  735. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  736. type NoMethod AcceleratorConfig
  737. raw := NoMethod(*s)
  738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  739. }
  740. // AcceleratorType: An Accelerator Type resource. (== resource_for
  741. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  742. type AcceleratorType struct {
  743. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  744. // format.
  745. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  746. // Deprecated: [Output Only] The deprecation status associated with this
  747. // accelerator type.
  748. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  749. // Description: [Output Only] An optional textual description of the
  750. // resource.
  751. Description string `json:"description,omitempty"`
  752. // Id: [Output Only] The unique identifier for the resource. This
  753. // identifier is defined by the server.
  754. Id uint64 `json:"id,omitempty,string"`
  755. // Kind: [Output Only] The type of the resource. Always
  756. // compute#acceleratorType for accelerator types.
  757. Kind string `json:"kind,omitempty"`
  758. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  759. // allowed per instance.
  760. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  761. // Name: [Output Only] Name of the resource.
  762. Name string `json:"name,omitempty"`
  763. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  764. // resource.
  765. SelfLink string `json:"selfLink,omitempty"`
  766. // Zone: [Output Only] The name of the zone where the accelerator type
  767. // resides, such as us-central1-a. You must specify this field as part
  768. // of the HTTP request URL. It is not settable as a field in the request
  769. // body.
  770. Zone string `json:"zone,omitempty"`
  771. // ServerResponse contains the HTTP response code and headers from the
  772. // server.
  773. googleapi.ServerResponse `json:"-"`
  774. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  775. // to unconditionally include in API requests. By default, fields with
  776. // empty values are omitted from API requests. However, any non-pointer,
  777. // non-interface field appearing in ForceSendFields will be sent to the
  778. // server regardless of whether the field is empty or not. This may be
  779. // used to include empty fields in Patch requests.
  780. ForceSendFields []string `json:"-"`
  781. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  782. // include in API requests with the JSON null value. By default, fields
  783. // with empty values are omitted from API requests. However, any field
  784. // with an empty value appearing in NullFields will be sent to the
  785. // server as null. It is an error if a field in this list has a
  786. // non-empty value. This may be used to include null fields in Patch
  787. // requests.
  788. NullFields []string `json:"-"`
  789. }
  790. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  791. type NoMethod AcceleratorType
  792. raw := NoMethod(*s)
  793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  794. }
  795. type AcceleratorTypeAggregatedList struct {
  796. // Id: [Output Only] Unique identifier for the resource; defined by the
  797. // server.
  798. Id string `json:"id,omitempty"`
  799. // Items: A list of AcceleratorTypesScopedList resources.
  800. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  801. // Kind: [Output Only] Type of resource. Always
  802. // compute#acceleratorTypeAggregatedList for aggregated lists of
  803. // accelerator types.
  804. Kind string `json:"kind,omitempty"`
  805. // NextPageToken: [Output Only] This token allows you to get the next
  806. // page of results for list requests. If the number of results is larger
  807. // than maxResults, use the nextPageToken as a value for the query
  808. // parameter pageToken in the next list request. Subsequent list
  809. // requests will have their own nextPageToken to continue paging through
  810. // the results.
  811. NextPageToken string `json:"nextPageToken,omitempty"`
  812. // SelfLink: [Output Only] Server-defined URL for this resource.
  813. SelfLink string `json:"selfLink,omitempty"`
  814. // Warning: [Output Only] Informational warning message.
  815. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  816. // ServerResponse contains the HTTP response code and headers from the
  817. // server.
  818. googleapi.ServerResponse `json:"-"`
  819. // ForceSendFields is a list of field names (e.g. "Id") to
  820. // unconditionally include in API requests. By default, fields with
  821. // empty values are omitted from API requests. However, any non-pointer,
  822. // non-interface field appearing in ForceSendFields will be sent to the
  823. // server regardless of whether the field is empty or not. This may be
  824. // used to include empty fields in Patch requests.
  825. ForceSendFields []string `json:"-"`
  826. // NullFields is a list of field names (e.g. "Id") to include in API
  827. // requests with the JSON null value. By default, fields with empty
  828. // values are omitted from API requests. However, any field with an
  829. // empty value appearing in NullFields will be sent to the server as
  830. // null. It is an error if a field in this list has a non-empty value.
  831. // This may be used to include null fields in Patch requests.
  832. NullFields []string `json:"-"`
  833. }
  834. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  835. type NoMethod AcceleratorTypeAggregatedList
  836. raw := NoMethod(*s)
  837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  838. }
  839. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  840. // warning message.
  841. type AcceleratorTypeAggregatedListWarning struct {
  842. // Code: [Output Only] A warning code, if applicable. For example,
  843. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  844. // the response.
  845. //
  846. // Possible values:
  847. // "CLEANUP_FAILED"
  848. // "DEPRECATED_RESOURCE_USED"
  849. // "DEPRECATED_TYPE_USED"
  850. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  851. // "EXPERIMENTAL_TYPE_USED"
  852. // "EXTERNAL_API_WARNING"
  853. // "FIELD_VALUE_OVERRIDEN"
  854. // "INJECTED_KERNELS_DEPRECATED"
  855. // "MISSING_TYPE_DEPENDENCY"
  856. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  857. // "NEXT_HOP_CANNOT_IP_FORWARD"
  858. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  859. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  860. // "NEXT_HOP_NOT_RUNNING"
  861. // "NOT_CRITICAL_ERROR"
  862. // "NO_RESULTS_ON_PAGE"
  863. // "REQUIRED_TOS_AGREEMENT"
  864. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  865. // "RESOURCE_NOT_DELETED"
  866. // "SCHEMA_VALIDATION_IGNORED"
  867. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  868. // "UNDECLARED_PROPERTIES"
  869. // "UNREACHABLE"
  870. Code string `json:"code,omitempty"`
  871. // Data: [Output Only] Metadata about this warning in key: value format.
  872. // For example:
  873. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  874. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  875. // Message: [Output Only] A human-readable description of the warning
  876. // code.
  877. Message string `json:"message,omitempty"`
  878. // ForceSendFields is a list of field names (e.g. "Code") to
  879. // unconditionally include in API requests. By default, fields with
  880. // empty values are omitted from API requests. However, any non-pointer,
  881. // non-interface field appearing in ForceSendFields will be sent to the
  882. // server regardless of whether the field is empty or not. This may be
  883. // used to include empty fields in Patch requests.
  884. ForceSendFields []string `json:"-"`
  885. // NullFields is a list of field names (e.g. "Code") to include in API
  886. // requests with the JSON null value. By default, fields with empty
  887. // values are omitted from API requests. However, any field with an
  888. // empty value appearing in NullFields will be sent to the server as
  889. // null. It is an error if a field in this list has a non-empty value.
  890. // This may be used to include null fields in Patch requests.
  891. NullFields []string `json:"-"`
  892. }
  893. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  894. type NoMethod AcceleratorTypeAggregatedListWarning
  895. raw := NoMethod(*s)
  896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  897. }
  898. type AcceleratorTypeAggregatedListWarningData struct {
  899. // Key: [Output Only] A key that provides more detail on the warning
  900. // being returned. For example, for warnings where there are no results
  901. // in a list request for a particular zone, this key might be scope and
  902. // the key value might be the zone name. Other examples might be a key
  903. // indicating a deprecated resource and a suggested replacement, or a
  904. // warning about invalid network settings (for example, if an instance
  905. // attempts to perform IP forwarding but is not enabled for IP
  906. // forwarding).
  907. Key string `json:"key,omitempty"`
  908. // Value: [Output Only] A warning data value corresponding to the key.
  909. Value string `json:"value,omitempty"`
  910. // ForceSendFields is a list of field names (e.g. "Key") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. // NullFields is a list of field names (e.g. "Key") to include in API
  918. // requests with the JSON null value. By default, fields with empty
  919. // values are omitted from API requests. However, any field with an
  920. // empty value appearing in NullFields will be sent to the server as
  921. // null. It is an error if a field in this list has a non-empty value.
  922. // This may be used to include null fields in Patch requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  926. type NoMethod AcceleratorTypeAggregatedListWarningData
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // AcceleratorTypeList: Contains a list of accelerator types.
  931. type AcceleratorTypeList struct {
  932. // Id: [Output Only] Unique identifier for the resource; defined by the
  933. // server.
  934. Id string `json:"id,omitempty"`
  935. // Items: A list of AcceleratorType resources.
  936. Items []*AcceleratorType `json:"items,omitempty"`
  937. // Kind: [Output Only] Type of resource. Always
  938. // compute#acceleratorTypeList for lists of accelerator types.
  939. Kind string `json:"kind,omitempty"`
  940. // NextPageToken: [Output Only] This token allows you to get the next
  941. // page of results for list requests. If the number of results is larger
  942. // than maxResults, use the nextPageToken as a value for the query
  943. // parameter pageToken in the next list request. Subsequent list
  944. // requests will have their own nextPageToken to continue paging through
  945. // the results.
  946. NextPageToken string `json:"nextPageToken,omitempty"`
  947. // SelfLink: [Output Only] Server-defined URL for this resource.
  948. SelfLink string `json:"selfLink,omitempty"`
  949. // Warning: [Output Only] Informational warning message.
  950. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  951. // ServerResponse contains the HTTP response code and headers from the
  952. // server.
  953. googleapi.ServerResponse `json:"-"`
  954. // ForceSendFields is a list of field names (e.g. "Id") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "Id") to include in API
  962. // requests with the JSON null value. By default, fields with empty
  963. // values are omitted from API requests. However, any field with an
  964. // empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  970. type NoMethod AcceleratorTypeList
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // AcceleratorTypeListWarning: [Output Only] Informational warning
  975. // message.
  976. type AcceleratorTypeListWarning struct {
  977. // Code: [Output Only] A warning code, if applicable. For example,
  978. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  979. // the response.
  980. //
  981. // Possible values:
  982. // "CLEANUP_FAILED"
  983. // "DEPRECATED_RESOURCE_USED"
  984. // "DEPRECATED_TYPE_USED"
  985. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  986. // "EXPERIMENTAL_TYPE_USED"
  987. // "EXTERNAL_API_WARNING"
  988. // "FIELD_VALUE_OVERRIDEN"
  989. // "INJECTED_KERNELS_DEPRECATED"
  990. // "MISSING_TYPE_DEPENDENCY"
  991. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  992. // "NEXT_HOP_CANNOT_IP_FORWARD"
  993. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  994. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  995. // "NEXT_HOP_NOT_RUNNING"
  996. // "NOT_CRITICAL_ERROR"
  997. // "NO_RESULTS_ON_PAGE"
  998. // "REQUIRED_TOS_AGREEMENT"
  999. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1000. // "RESOURCE_NOT_DELETED"
  1001. // "SCHEMA_VALIDATION_IGNORED"
  1002. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1003. // "UNDECLARED_PROPERTIES"
  1004. // "UNREACHABLE"
  1005. Code string `json:"code,omitempty"`
  1006. // Data: [Output Only] Metadata about this warning in key: value format.
  1007. // For example:
  1008. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1009. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  1010. // Message: [Output Only] A human-readable description of the warning
  1011. // code.
  1012. Message string `json:"message,omitempty"`
  1013. // ForceSendFields is a list of field names (e.g. "Code") to
  1014. // unconditionally include in API requests. By default, fields with
  1015. // empty values are omitted from API requests. However, any non-pointer,
  1016. // non-interface field appearing in ForceSendFields will be sent to the
  1017. // server regardless of whether the field is empty or not. This may be
  1018. // used to include empty fields in Patch requests.
  1019. ForceSendFields []string `json:"-"`
  1020. // NullFields is a list of field names (e.g. "Code") to include in API
  1021. // requests with the JSON null value. By default, fields with empty
  1022. // values are omitted from API requests. However, any field with an
  1023. // empty value appearing in NullFields will be sent to the server as
  1024. // null. It is an error if a field in this list has a non-empty value.
  1025. // This may be used to include null fields in Patch requests.
  1026. NullFields []string `json:"-"`
  1027. }
  1028. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  1029. type NoMethod AcceleratorTypeListWarning
  1030. raw := NoMethod(*s)
  1031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1032. }
  1033. type AcceleratorTypeListWarningData struct {
  1034. // Key: [Output Only] A key that provides more detail on the warning
  1035. // being returned. For example, for warnings where there are no results
  1036. // in a list request for a particular zone, this key might be scope and
  1037. // the key value might be the zone name. Other examples might be a key
  1038. // indicating a deprecated resource and a suggested replacement, or a
  1039. // warning about invalid network settings (for example, if an instance
  1040. // attempts to perform IP forwarding but is not enabled for IP
  1041. // forwarding).
  1042. Key string `json:"key,omitempty"`
  1043. // Value: [Output Only] A warning data value corresponding to the key.
  1044. Value string `json:"value,omitempty"`
  1045. // ForceSendFields is a list of field names (e.g. "Key") to
  1046. // unconditionally include in API requests. By default, fields with
  1047. // empty values are omitted from API requests. However, any non-pointer,
  1048. // non-interface field appearing in ForceSendFields will be sent to the
  1049. // server regardless of whether the field is empty or not. This may be
  1050. // used to include empty fields in Patch requests.
  1051. ForceSendFields []string `json:"-"`
  1052. // NullFields is a list of field names (e.g. "Key") to include in API
  1053. // requests with the JSON null value. By default, fields with empty
  1054. // values are omitted from API requests. However, any field with an
  1055. // empty value appearing in NullFields will be sent to the server as
  1056. // null. It is an error if a field in this list has a non-empty value.
  1057. // This may be used to include null fields in Patch requests.
  1058. NullFields []string `json:"-"`
  1059. }
  1060. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1061. type NoMethod AcceleratorTypeListWarningData
  1062. raw := NoMethod(*s)
  1063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1064. }
  1065. type AcceleratorTypesScopedList struct {
  1066. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1067. // in this scope.
  1068. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1069. // Warning: [Output Only] An informational warning that appears when the
  1070. // accelerator types list is empty.
  1071. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1072. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1073. // unconditionally include in API requests. By default, fields with
  1074. // empty values are omitted from API requests. However, any non-pointer,
  1075. // non-interface field appearing in ForceSendFields will be sent to the
  1076. // server regardless of whether the field is empty or not. This may be
  1077. // used to include empty fields in Patch requests.
  1078. ForceSendFields []string `json:"-"`
  1079. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1080. // include in API requests with the JSON null value. By default, fields
  1081. // with empty values are omitted from API requests. However, any field
  1082. // with an empty value appearing in NullFields will be sent to the
  1083. // server as null. It is an error if a field in this list has a
  1084. // non-empty value. This may be used to include null fields in Patch
  1085. // requests.
  1086. NullFields []string `json:"-"`
  1087. }
  1088. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1089. type NoMethod AcceleratorTypesScopedList
  1090. raw := NoMethod(*s)
  1091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1092. }
  1093. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1094. // warning that appears when the accelerator types list is empty.
  1095. type AcceleratorTypesScopedListWarning struct {
  1096. // Code: [Output Only] A warning code, if applicable. For example,
  1097. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1098. // the response.
  1099. //
  1100. // Possible values:
  1101. // "CLEANUP_FAILED"
  1102. // "DEPRECATED_RESOURCE_USED"
  1103. // "DEPRECATED_TYPE_USED"
  1104. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1105. // "EXPERIMENTAL_TYPE_USED"
  1106. // "EXTERNAL_API_WARNING"
  1107. // "FIELD_VALUE_OVERRIDEN"
  1108. // "INJECTED_KERNELS_DEPRECATED"
  1109. // "MISSING_TYPE_DEPENDENCY"
  1110. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1111. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1112. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1113. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1114. // "NEXT_HOP_NOT_RUNNING"
  1115. // "NOT_CRITICAL_ERROR"
  1116. // "NO_RESULTS_ON_PAGE"
  1117. // "REQUIRED_TOS_AGREEMENT"
  1118. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1119. // "RESOURCE_NOT_DELETED"
  1120. // "SCHEMA_VALIDATION_IGNORED"
  1121. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1122. // "UNDECLARED_PROPERTIES"
  1123. // "UNREACHABLE"
  1124. Code string `json:"code,omitempty"`
  1125. // Data: [Output Only] Metadata about this warning in key: value format.
  1126. // For example:
  1127. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1128. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1129. // Message: [Output Only] A human-readable description of the warning
  1130. // code.
  1131. Message string `json:"message,omitempty"`
  1132. // ForceSendFields is a list of field names (e.g. "Code") to
  1133. // unconditionally include in API requests. By default, fields with
  1134. // empty values are omitted from API requests. However, any non-pointer,
  1135. // non-interface field appearing in ForceSendFields will be sent to the
  1136. // server regardless of whether the field is empty or not. This may be
  1137. // used to include empty fields in Patch requests.
  1138. ForceSendFields []string `json:"-"`
  1139. // NullFields is a list of field names (e.g. "Code") to include in API
  1140. // requests with the JSON null value. By default, fields with empty
  1141. // values are omitted from API requests. However, any field with an
  1142. // empty value appearing in NullFields will be sent to the server as
  1143. // null. It is an error if a field in this list has a non-empty value.
  1144. // This may be used to include null fields in Patch requests.
  1145. NullFields []string `json:"-"`
  1146. }
  1147. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1148. type NoMethod AcceleratorTypesScopedListWarning
  1149. raw := NoMethod(*s)
  1150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1151. }
  1152. type AcceleratorTypesScopedListWarningData struct {
  1153. // Key: [Output Only] A key that provides more detail on the warning
  1154. // being returned. For example, for warnings where there are no results
  1155. // in a list request for a particular zone, this key might be scope and
  1156. // the key value might be the zone name. Other examples might be a key
  1157. // indicating a deprecated resource and a suggested replacement, or a
  1158. // warning about invalid network settings (for example, if an instance
  1159. // attempts to perform IP forwarding but is not enabled for IP
  1160. // forwarding).
  1161. Key string `json:"key,omitempty"`
  1162. // Value: [Output Only] A warning data value corresponding to the key.
  1163. Value string `json:"value,omitempty"`
  1164. // ForceSendFields is a list of field names (e.g. "Key") to
  1165. // unconditionally include in API requests. By default, fields with
  1166. // empty values are omitted from API requests. However, any non-pointer,
  1167. // non-interface field appearing in ForceSendFields will be sent to the
  1168. // server regardless of whether the field is empty or not. This may be
  1169. // used to include empty fields in Patch requests.
  1170. ForceSendFields []string `json:"-"`
  1171. // NullFields is a list of field names (e.g. "Key") to include in API
  1172. // requests with the JSON null value. By default, fields with empty
  1173. // values are omitted from API requests. However, any field with an
  1174. // empty value appearing in NullFields will be sent to the server as
  1175. // null. It is an error if a field in this list has a non-empty value.
  1176. // This may be used to include null fields in Patch requests.
  1177. NullFields []string `json:"-"`
  1178. }
  1179. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1180. type NoMethod AcceleratorTypesScopedListWarningData
  1181. raw := NoMethod(*s)
  1182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1183. }
  1184. // AccessConfig: An access configuration attached to an instance's
  1185. // network interface. Only one access config per instance is supported.
  1186. type AccessConfig struct {
  1187. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1188. // for access configs.
  1189. Kind string `json:"kind,omitempty"`
  1190. // Name: The name of this access configuration. The default and
  1191. // recommended name is External NAT but you can use any arbitrary string
  1192. // you would like. For example, My external IP or Network Access.
  1193. Name string `json:"name,omitempty"`
  1194. // NatIP: An external IP address associated with this instance. Specify
  1195. // an unused static external IP address available to the project or
  1196. // leave this field undefined to use an IP from a shared ephemeral IP
  1197. // address pool. If you specify a static external IP address, it must
  1198. // live in the same region as the zone of the instance.
  1199. NatIP string `json:"natIP,omitempty"`
  1200. // NetworkTier: This signifies the networking tier used for configuring
  1201. // this access configuration and can only take the following values:
  1202. // PREMIUM, STANDARD.
  1203. //
  1204. // If an AccessConfig is specified without a valid external IP address,
  1205. // an ephemeral IP will be created with this networkTier.
  1206. //
  1207. // If an AccessConfig with a valid external IP address is specified, it
  1208. // must match that of the networkTier associated with the Address
  1209. // resource owning that IP.
  1210. //
  1211. // Possible values:
  1212. // "PREMIUM"
  1213. // "SELECT"
  1214. // "STANDARD"
  1215. NetworkTier string `json:"networkTier,omitempty"`
  1216. // PublicDnsName: [Output Only] The public DNS domain name for the
  1217. // instance.
  1218. PublicDnsName string `json:"publicDnsName,omitempty"`
  1219. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1220. // This field can only be set when the set_public_ptr field is enabled.
  1221. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1222. // SetPublicDns: Specifies whether a public DNS ?A? record should be
  1223. // created for the external IP address of this access configuration.
  1224. SetPublicDns bool `json:"setPublicDns,omitempty"`
  1225. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1226. // created to map the external IP address of the instance to a DNS
  1227. // domain name.
  1228. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1229. // Type: The type of configuration. The default and only option is
  1230. // ONE_TO_ONE_NAT.
  1231. //
  1232. // Possible values:
  1233. // "ONE_TO_ONE_NAT" (default)
  1234. Type string `json:"type,omitempty"`
  1235. // ForceSendFields is a list of field names (e.g. "Kind") to
  1236. // unconditionally include in API requests. By default, fields with
  1237. // empty values are omitted from API requests. However, any non-pointer,
  1238. // non-interface field appearing in ForceSendFields will be sent to the
  1239. // server regardless of whether the field is empty or not. This may be
  1240. // used to include empty fields in Patch requests.
  1241. ForceSendFields []string `json:"-"`
  1242. // NullFields is a list of field names (e.g. "Kind") to include in API
  1243. // requests with the JSON null value. By default, fields with empty
  1244. // values are omitted from API requests. However, any field with an
  1245. // empty value appearing in NullFields will be sent to the server as
  1246. // null. It is an error if a field in this list has a non-empty value.
  1247. // This may be used to include null fields in Patch requests.
  1248. NullFields []string `json:"-"`
  1249. }
  1250. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1251. type NoMethod AccessConfig
  1252. raw := NoMethod(*s)
  1253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1254. }
  1255. // Address: A reserved address resource. (== resource_for beta.addresses
  1256. // ==) (== resource_for v1.addresses ==) (== resource_for
  1257. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1258. type Address struct {
  1259. // Address: The static IP address represented by this resource.
  1260. Address string `json:"address,omitempty"`
  1261. // AddressType: The type of address to reserve, either INTERNAL or
  1262. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1263. //
  1264. // Possible values:
  1265. // "DNS_FORWARDING"
  1266. // "EXTERNAL"
  1267. // "INTERNAL"
  1268. // "UNSPECIFIED_TYPE"
  1269. AddressType string `json:"addressType,omitempty"`
  1270. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1271. // format.
  1272. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1273. // Description: An optional description of this resource. Provide this
  1274. // property when you create the resource.
  1275. Description string `json:"description,omitempty"`
  1276. // Id: [Output Only] The unique identifier for the resource. This
  1277. // identifier is defined by the server.
  1278. Id uint64 `json:"id,omitempty,string"`
  1279. // IpVersion: The IP Version that will be used by this address. Valid
  1280. // options are IPV4 or IPV6. This can only be specified for a global
  1281. // address.
  1282. //
  1283. // Possible values:
  1284. // "IPV4"
  1285. // "IPV6"
  1286. // "UNSPECIFIED_VERSION"
  1287. IpVersion string `json:"ipVersion,omitempty"`
  1288. // Kind: [Output Only] Type of the resource. Always compute#address for
  1289. // addresses.
  1290. Kind string `json:"kind,omitempty"`
  1291. // LabelFingerprint: A fingerprint for the labels being applied to this
  1292. // Address, which is essentially a hash of the labels set used for
  1293. // optimistic locking. The fingerprint is initially generated by Compute
  1294. // Engine and changes after every request to modify or update labels.
  1295. // You must always provide an up-to-date fingerprint hash in order to
  1296. // update or change labels, otherwise the request will fail with error
  1297. // 412 conditionNotMet.
  1298. //
  1299. // To see the latest fingerprint, make a get() request to retrieve an
  1300. // Address.
  1301. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1302. // Labels: Labels to apply to this Address resource. These can be later
  1303. // modified by the setLabels method. Each label key/value must comply
  1304. // with RFC1035. Label values may be empty.
  1305. Labels map[string]string `json:"labels,omitempty"`
  1306. // Name: Name of the resource. Provided by the client when the resource
  1307. // is created. The name must be 1-63 characters long, and comply with
  1308. // RFC1035. Specifically, the name must be 1-63 characters long and
  1309. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1310. // the first character must be a lowercase letter, and all following
  1311. // characters must be a dash, lowercase letter, or digit, except the
  1312. // last character, which cannot be a dash.
  1313. Name string `json:"name,omitempty"`
  1314. // Network: The URL of the network in which to reserve the address. This
  1315. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1316. Network string `json:"network,omitempty"`
  1317. // NetworkTier: This signifies the networking tier used for configuring
  1318. // this Address and can only take the following values: PREMIUM,
  1319. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1320. // forwarding rules can be either Premium or Standard Tier. Standard
  1321. // Tier addresses applied to regional forwarding rules can be used with
  1322. // any external load balancer. Regional forwarding rules in Premium Tier
  1323. // can only be used with a Network load balancer.
  1324. //
  1325. // If this field is not specified, it is assumed to be PREMIUM.
  1326. //
  1327. // Possible values:
  1328. // "PREMIUM"
  1329. // "SELECT"
  1330. // "STANDARD"
  1331. NetworkTier string `json:"networkTier,omitempty"`
  1332. // PrefixLength: The prefix length if the resource reprensents an IP
  1333. // range.
  1334. PrefixLength int64 `json:"prefixLength,omitempty"`
  1335. // Purpose: The purpose of resource, only used with INTERNAL type.
  1336. //
  1337. // Possible values:
  1338. // "DNS_RESOLVER"
  1339. // "GCE_ENDPOINT"
  1340. // "NAT_AUTO"
  1341. // "VPC_PEERING"
  1342. Purpose string `json:"purpose,omitempty"`
  1343. // Region: [Output Only] URL of the region where the regional address
  1344. // resides. This field is not applicable to global addresses. You must
  1345. // specify this field as part of the HTTP request URL. You cannot set
  1346. // this field in the request body.
  1347. Region string `json:"region,omitempty"`
  1348. // SelfLink: [Output Only] Server-defined URL for the resource.
  1349. SelfLink string `json:"selfLink,omitempty"`
  1350. // Status: [Output Only] The status of the address, which can be one of
  1351. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1352. // currently in the process of being reserved. A RESERVED address is
  1353. // currently reserved and available to use. An IN_USE address is
  1354. // currently being used by another resource and is not available.
  1355. //
  1356. // Possible values:
  1357. // "IN_USE"
  1358. // "RESERVED"
  1359. // "RESERVING"
  1360. Status string `json:"status,omitempty"`
  1361. // Subnetwork: The URL of the subnetwork in which to reserve the
  1362. // address. If an IP address is specified, it must be within the
  1363. // subnetwork's IP range. This field can only be used with INTERNAL type
  1364. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1365. Subnetwork string `json:"subnetwork,omitempty"`
  1366. // Users: [Output Only] The URLs of the resources that are using this
  1367. // address.
  1368. Users []string `json:"users,omitempty"`
  1369. // ServerResponse contains the HTTP response code and headers from the
  1370. // server.
  1371. googleapi.ServerResponse `json:"-"`
  1372. // ForceSendFields is a list of field names (e.g. "Address") to
  1373. // unconditionally include in API requests. By default, fields with
  1374. // empty values are omitted from API requests. However, any non-pointer,
  1375. // non-interface field appearing in ForceSendFields will be sent to the
  1376. // server regardless of whether the field is empty or not. This may be
  1377. // used to include empty fields in Patch requests.
  1378. ForceSendFields []string `json:"-"`
  1379. // NullFields is a list of field names (e.g. "Address") to include in
  1380. // API requests with the JSON null value. By default, fields with empty
  1381. // values are omitted from API requests. However, any field with an
  1382. // empty value appearing in NullFields will be sent to the server as
  1383. // null. It is an error if a field in this list has a non-empty value.
  1384. // This may be used to include null fields in Patch requests.
  1385. NullFields []string `json:"-"`
  1386. }
  1387. func (s *Address) MarshalJSON() ([]byte, error) {
  1388. type NoMethod Address
  1389. raw := NoMethod(*s)
  1390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1391. }
  1392. type AddressAggregatedList struct {
  1393. // Id: [Output Only] Unique identifier for the resource; defined by the
  1394. // server.
  1395. Id string `json:"id,omitempty"`
  1396. // Items: A list of AddressesScopedList resources.
  1397. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1398. // Kind: [Output Only] Type of resource. Always
  1399. // compute#addressAggregatedList for aggregated lists of addresses.
  1400. Kind string `json:"kind,omitempty"`
  1401. // NextPageToken: [Output Only] This token allows you to get the next
  1402. // page of results for list requests. If the number of results is larger
  1403. // than maxResults, use the nextPageToken as a value for the query
  1404. // parameter pageToken in the next list request. Subsequent list
  1405. // requests will have their own nextPageToken to continue paging through
  1406. // the results.
  1407. NextPageToken string `json:"nextPageToken,omitempty"`
  1408. // SelfLink: [Output Only] Server-defined URL for this resource.
  1409. SelfLink string `json:"selfLink,omitempty"`
  1410. // Warning: [Output Only] Informational warning message.
  1411. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1412. // ServerResponse contains the HTTP response code and headers from the
  1413. // server.
  1414. googleapi.ServerResponse `json:"-"`
  1415. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1431. type NoMethod AddressAggregatedList
  1432. raw := NoMethod(*s)
  1433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1434. }
  1435. // AddressAggregatedListWarning: [Output Only] Informational warning
  1436. // message.
  1437. type AddressAggregatedListWarning struct {
  1438. // Code: [Output Only] A warning code, if applicable. For example,
  1439. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1440. // the response.
  1441. //
  1442. // Possible values:
  1443. // "CLEANUP_FAILED"
  1444. // "DEPRECATED_RESOURCE_USED"
  1445. // "DEPRECATED_TYPE_USED"
  1446. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1447. // "EXPERIMENTAL_TYPE_USED"
  1448. // "EXTERNAL_API_WARNING"
  1449. // "FIELD_VALUE_OVERRIDEN"
  1450. // "INJECTED_KERNELS_DEPRECATED"
  1451. // "MISSING_TYPE_DEPENDENCY"
  1452. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1453. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1454. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1455. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1456. // "NEXT_HOP_NOT_RUNNING"
  1457. // "NOT_CRITICAL_ERROR"
  1458. // "NO_RESULTS_ON_PAGE"
  1459. // "REQUIRED_TOS_AGREEMENT"
  1460. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1461. // "RESOURCE_NOT_DELETED"
  1462. // "SCHEMA_VALIDATION_IGNORED"
  1463. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1464. // "UNDECLARED_PROPERTIES"
  1465. // "UNREACHABLE"
  1466. Code string `json:"code,omitempty"`
  1467. // Data: [Output Only] Metadata about this warning in key: value format.
  1468. // For example:
  1469. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1470. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1471. // Message: [Output Only] A human-readable description of the warning
  1472. // code.
  1473. Message string `json:"message,omitempty"`
  1474. // ForceSendFields is a list of field names (e.g. "Code") to
  1475. // unconditionally include in API requests. By default, fields with
  1476. // empty values are omitted from API requests. However, any non-pointer,
  1477. // non-interface field appearing in ForceSendFields will be sent to the
  1478. // server regardless of whether the field is empty or not. This may be
  1479. // used to include empty fields in Patch requests.
  1480. ForceSendFields []string `json:"-"`
  1481. // NullFields is a list of field names (e.g. "Code") to include in API
  1482. // requests with the JSON null value. By default, fields with empty
  1483. // values are omitted from API requests. However, any field with an
  1484. // empty value appearing in NullFields will be sent to the server as
  1485. // null. It is an error if a field in this list has a non-empty value.
  1486. // This may be used to include null fields in Patch requests.
  1487. NullFields []string `json:"-"`
  1488. }
  1489. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1490. type NoMethod AddressAggregatedListWarning
  1491. raw := NoMethod(*s)
  1492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1493. }
  1494. type AddressAggregatedListWarningData struct {
  1495. // Key: [Output Only] A key that provides more detail on the warning
  1496. // being returned. For example, for warnings where there are no results
  1497. // in a list request for a particular zone, this key might be scope and
  1498. // the key value might be the zone name. Other examples might be a key
  1499. // indicating a deprecated resource and a suggested replacement, or a
  1500. // warning about invalid network settings (for example, if an instance
  1501. // attempts to perform IP forwarding but is not enabled for IP
  1502. // forwarding).
  1503. Key string `json:"key,omitempty"`
  1504. // Value: [Output Only] A warning data value corresponding to the key.
  1505. Value string `json:"value,omitempty"`
  1506. // ForceSendFields is a list of field names (e.g. "Key") to
  1507. // unconditionally include in API requests. By default, fields with
  1508. // empty values are omitted from API requests. However, any non-pointer,
  1509. // non-interface field appearing in ForceSendFields will be sent to the
  1510. // server regardless of whether the field is empty or not. This may be
  1511. // used to include empty fields in Patch requests.
  1512. ForceSendFields []string `json:"-"`
  1513. // NullFields is a list of field names (e.g. "Key") to include in API
  1514. // requests with the JSON null value. By default, fields with empty
  1515. // values are omitted from API requests. However, any field with an
  1516. // empty value appearing in NullFields will be sent to the server as
  1517. // null. It is an error if a field in this list has a non-empty value.
  1518. // This may be used to include null fields in Patch requests.
  1519. NullFields []string `json:"-"`
  1520. }
  1521. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1522. type NoMethod AddressAggregatedListWarningData
  1523. raw := NoMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1525. }
  1526. // AddressList: Contains a list of addresses.
  1527. type AddressList struct {
  1528. // Id: [Output Only] Unique identifier for the resource; defined by the
  1529. // server.
  1530. Id string `json:"id,omitempty"`
  1531. // Items: A list of Address resources.
  1532. Items []*Address `json:"items,omitempty"`
  1533. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1534. // lists of addresses.
  1535. Kind string `json:"kind,omitempty"`
  1536. // NextPageToken: [Output Only] This token allows you to get the next
  1537. // page of results for list requests. If the number of results is larger
  1538. // than maxResults, use the nextPageToken as a value for the query
  1539. // parameter pageToken in the next list request. Subsequent list
  1540. // requests will have their own nextPageToken to continue paging through
  1541. // the results.
  1542. NextPageToken string `json:"nextPageToken,omitempty"`
  1543. // SelfLink: [Output Only] Server-defined URL for this resource.
  1544. SelfLink string `json:"selfLink,omitempty"`
  1545. // Warning: [Output Only] Informational warning message.
  1546. Warning *AddressListWarning `json:"warning,omitempty"`
  1547. // ServerResponse contains the HTTP response code and headers from the
  1548. // server.
  1549. googleapi.ServerResponse `json:"-"`
  1550. // ForceSendFields is a list of field names (e.g. "Id") to
  1551. // unconditionally include in API requests. By default, fields with
  1552. // empty values are omitted from API requests. However, any non-pointer,
  1553. // non-interface field appearing in ForceSendFields will be sent to the
  1554. // server regardless of whether the field is empty or not. This may be
  1555. // used to include empty fields in Patch requests.
  1556. ForceSendFields []string `json:"-"`
  1557. // NullFields is a list of field names (e.g. "Id") to include in API
  1558. // requests with the JSON null value. By default, fields with empty
  1559. // values are omitted from API requests. However, any field with an
  1560. // empty value appearing in NullFields will be sent to the server as
  1561. // null. It is an error if a field in this list has a non-empty value.
  1562. // This may be used to include null fields in Patch requests.
  1563. NullFields []string `json:"-"`
  1564. }
  1565. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1566. type NoMethod AddressList
  1567. raw := NoMethod(*s)
  1568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1569. }
  1570. // AddressListWarning: [Output Only] Informational warning message.
  1571. type AddressListWarning struct {
  1572. // Code: [Output Only] A warning code, if applicable. For example,
  1573. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1574. // the response.
  1575. //
  1576. // Possible values:
  1577. // "CLEANUP_FAILED"
  1578. // "DEPRECATED_RESOURCE_USED"
  1579. // "DEPRECATED_TYPE_USED"
  1580. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1581. // "EXPERIMENTAL_TYPE_USED"
  1582. // "EXTERNAL_API_WARNING"
  1583. // "FIELD_VALUE_OVERRIDEN"
  1584. // "INJECTED_KERNELS_DEPRECATED"
  1585. // "MISSING_TYPE_DEPENDENCY"
  1586. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1587. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1588. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1589. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1590. // "NEXT_HOP_NOT_RUNNING"
  1591. // "NOT_CRITICAL_ERROR"
  1592. // "NO_RESULTS_ON_PAGE"
  1593. // "REQUIRED_TOS_AGREEMENT"
  1594. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1595. // "RESOURCE_NOT_DELETED"
  1596. // "SCHEMA_VALIDATION_IGNORED"
  1597. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1598. // "UNDECLARED_PROPERTIES"
  1599. // "UNREACHABLE"
  1600. Code string `json:"code,omitempty"`
  1601. // Data: [Output Only] Metadata about this warning in key: value format.
  1602. // For example:
  1603. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1604. Data []*AddressListWarningData `json:"data,omitempty"`
  1605. // Message: [Output Only] A human-readable description of the warning
  1606. // code.
  1607. Message string `json:"message,omitempty"`
  1608. // ForceSendFields is a list of field names (e.g. "Code") to
  1609. // unconditionally include in API requests. By default, fields with
  1610. // empty values are omitted from API requests. However, any non-pointer,
  1611. // non-interface field appearing in ForceSendFields will be sent to the
  1612. // server regardless of whether the field is empty or not. This may be
  1613. // used to include empty fields in Patch requests.
  1614. ForceSendFields []string `json:"-"`
  1615. // NullFields is a list of field names (e.g. "Code") to include in API
  1616. // requests with the JSON null value. By default, fields with empty
  1617. // values are omitted from API requests. However, any field with an
  1618. // empty value appearing in NullFields will be sent to the server as
  1619. // null. It is an error if a field in this list has a non-empty value.
  1620. // This may be used to include null fields in Patch requests.
  1621. NullFields []string `json:"-"`
  1622. }
  1623. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1624. type NoMethod AddressListWarning
  1625. raw := NoMethod(*s)
  1626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1627. }
  1628. type AddressListWarningData struct {
  1629. // Key: [Output Only] A key that provides more detail on the warning
  1630. // being returned. For example, for warnings where there are no results
  1631. // in a list request for a particular zone, this key might be scope and
  1632. // the key value might be the zone name. Other examples might be a key
  1633. // indicating a deprecated resource and a suggested replacement, or a
  1634. // warning about invalid network settings (for example, if an instance
  1635. // attempts to perform IP forwarding but is not enabled for IP
  1636. // forwarding).
  1637. Key string `json:"key,omitempty"`
  1638. // Value: [Output Only] A warning data value corresponding to the key.
  1639. Value string `json:"value,omitempty"`
  1640. // ForceSendFields is a list of field names (e.g. "Key") to
  1641. // unconditionally include in API requests. By default, fields with
  1642. // empty values are omitted from API requests. However, any non-pointer,
  1643. // non-interface field appearing in ForceSendFields will be sent to the
  1644. // server regardless of whether the field is empty or not. This may be
  1645. // used to include empty fields in Patch requests.
  1646. ForceSendFields []string `json:"-"`
  1647. // NullFields is a list of field names (e.g. "Key") to include in API
  1648. // requests with the JSON null value. By default, fields with empty
  1649. // values are omitted from API requests. However, any field with an
  1650. // empty value appearing in NullFields will be sent to the server as
  1651. // null. It is an error if a field in this list has a non-empty value.
  1652. // This may be used to include null fields in Patch requests.
  1653. NullFields []string `json:"-"`
  1654. }
  1655. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1656. type NoMethod AddressListWarningData
  1657. raw := NoMethod(*s)
  1658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1659. }
  1660. type AddressesScopedList struct {
  1661. // Addresses: [Output Only] A list of addresses contained in this scope.
  1662. Addresses []*Address `json:"addresses,omitempty"`
  1663. // Warning: [Output Only] Informational warning which replaces the list
  1664. // of addresses when the list is empty.
  1665. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1666. // ForceSendFields is a list of field names (e.g. "Addresses") 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. "Addresses") to include in
  1674. // API 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 *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1682. type NoMethod AddressesScopedList
  1683. raw := NoMethod(*s)
  1684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1685. }
  1686. // AddressesScopedListWarning: [Output Only] Informational warning which
  1687. // replaces the list of addresses when the list is empty.
  1688. type AddressesScopedListWarning struct {
  1689. // Code: [Output Only] A warning code, if applicable. For example,
  1690. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1691. // the response.
  1692. //
  1693. // Possible values:
  1694. // "CLEANUP_FAILED"
  1695. // "DEPRECATED_RESOURCE_USED"
  1696. // "DEPRECATED_TYPE_USED"
  1697. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1698. // "EXPERIMENTAL_TYPE_USED"
  1699. // "EXTERNAL_API_WARNING"
  1700. // "FIELD_VALUE_OVERRIDEN"
  1701. // "INJECTED_KERNELS_DEPRECATED"
  1702. // "MISSING_TYPE_DEPENDENCY"
  1703. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1704. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1705. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1706. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1707. // "NEXT_HOP_NOT_RUNNING"
  1708. // "NOT_CRITICAL_ERROR"
  1709. // "NO_RESULTS_ON_PAGE"
  1710. // "REQUIRED_TOS_AGREEMENT"
  1711. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1712. // "RESOURCE_NOT_DELETED"
  1713. // "SCHEMA_VALIDATION_IGNORED"
  1714. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1715. // "UNDECLARED_PROPERTIES"
  1716. // "UNREACHABLE"
  1717. Code string `json:"code,omitempty"`
  1718. // Data: [Output Only] Metadata about this warning in key: value format.
  1719. // For example:
  1720. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1721. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1722. // Message: [Output Only] A human-readable description of the warning
  1723. // code.
  1724. Message string `json:"message,omitempty"`
  1725. // ForceSendFields is a list of field names (e.g. "Code") to
  1726. // unconditionally include in API requests. By default, fields with
  1727. // empty values are omitted from API requests. However, any non-pointer,
  1728. // non-interface field appearing in ForceSendFields will be sent to the
  1729. // server regardless of whether the field is empty or not. This may be
  1730. // used to include empty fields in Patch requests.
  1731. ForceSendFields []string `json:"-"`
  1732. // NullFields is a list of field names (e.g. "Code") to include in API
  1733. // requests with the JSON null value. By default, fields with empty
  1734. // values are omitted from API requests. However, any field with an
  1735. // empty value appearing in NullFields will be sent to the server as
  1736. // null. It is an error if a field in this list has a non-empty value.
  1737. // This may be used to include null fields in Patch requests.
  1738. NullFields []string `json:"-"`
  1739. }
  1740. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1741. type NoMethod AddressesScopedListWarning
  1742. raw := NoMethod(*s)
  1743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1744. }
  1745. type AddressesScopedListWarningData struct {
  1746. // Key: [Output Only] A key that provides more detail on the warning
  1747. // being returned. For example, for warnings where there are no results
  1748. // in a list request for a particular zone, this key might be scope and
  1749. // the key value might be the zone name. Other examples might be a key
  1750. // indicating a deprecated resource and a suggested replacement, or a
  1751. // warning about invalid network settings (for example, if an instance
  1752. // attempts to perform IP forwarding but is not enabled for IP
  1753. // forwarding).
  1754. Key string `json:"key,omitempty"`
  1755. // Value: [Output Only] A warning data value corresponding to the key.
  1756. Value string `json:"value,omitempty"`
  1757. // ForceSendFields is a list of field names (e.g. "Key") to
  1758. // unconditionally include in API requests. By default, fields with
  1759. // empty values are omitted from API requests. However, any non-pointer,
  1760. // non-interface field appearing in ForceSendFields will be sent to the
  1761. // server regardless of whether the field is empty or not. This may be
  1762. // used to include empty fields in Patch requests.
  1763. ForceSendFields []string `json:"-"`
  1764. // NullFields is a list of field names (e.g. "Key") to include in API
  1765. // requests with the JSON null value. By default, fields with empty
  1766. // values are omitted from API requests. However, any field with an
  1767. // empty value appearing in NullFields will be sent to the server as
  1768. // null. It is an error if a field in this list has a non-empty value.
  1769. // This may be used to include null fields in Patch requests.
  1770. NullFields []string `json:"-"`
  1771. }
  1772. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1773. type NoMethod AddressesScopedListWarningData
  1774. raw := NoMethod(*s)
  1775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1776. }
  1777. // AliasIpRange: An alias IP range attached to an instance's network
  1778. // interface.
  1779. type AliasIpRange struct {
  1780. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1781. // This IP CIDR range must belong to the specified subnetwork and cannot
  1782. // contain IP addresses reserved by system or used by other network
  1783. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1784. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1785. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1786. // SubnetworkRangeName: Optional subnetwork secondary range name
  1787. // specifying the secondary range from which to allocate the IP CIDR
  1788. // range for this alias IP range. If left unspecified, the primary range
  1789. // of the subnetwork will be used.
  1790. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1791. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1792. // unconditionally include in API requests. By default, fields with
  1793. // empty values are omitted from API requests. However, any non-pointer,
  1794. // non-interface field appearing in ForceSendFields will be sent to the
  1795. // server regardless of whether the field is empty or not. This may be
  1796. // used to include empty fields in Patch requests.
  1797. ForceSendFields []string `json:"-"`
  1798. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1799. // in API requests with the JSON null value. By default, fields with
  1800. // empty values are omitted from API requests. However, any field with
  1801. // an empty value appearing in NullFields will be sent to the server as
  1802. // null. It is an error if a field in this list has a non-empty value.
  1803. // This may be used to include null fields in Patch requests.
  1804. NullFields []string `json:"-"`
  1805. }
  1806. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1807. type NoMethod AliasIpRange
  1808. raw := NoMethod(*s)
  1809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1810. }
  1811. // Allocation: Allocation resource
  1812. type Allocation struct {
  1813. // Commitment: Full or partial url for commitment in which this
  1814. // allocation is to be created. This field is ignored when allocations
  1815. // are created during committment creation.
  1816. Commitment string `json:"commitment,omitempty"`
  1817. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1818. // format.
  1819. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1820. Description string `json:"description,omitempty"`
  1821. // Id: [Output Only] The unique identifier for the resource. This
  1822. // identifier is defined by the server.
  1823. Id uint64 `json:"id,omitempty,string"`
  1824. // Kind: [Output Only] Type of the resource. Always compute#allocations
  1825. // for allocations.
  1826. Kind string `json:"kind,omitempty"`
  1827. // Name: The name of the resource, provided by the client when initially
  1828. // creating the resource. The resource name must be 1-63 characters
  1829. // long, and comply with RFC1035. Specifically, the name must be 1-63
  1830. // characters long and match the regular expression
  1831. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  1832. // a lowercase letter, and all following characters must be a dash,
  1833. // lowercase letter, or digit, except the last character, which cannot
  1834. // be a dash.
  1835. Name string `json:"name,omitempty"`
  1836. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1837. // resource.
  1838. SelfLink string `json:"selfLink,omitempty"`
  1839. SpecificAllocation *AllocationSpecificSKUAllocation `json:"specificAllocation,omitempty"`
  1840. // SpecificAllocationRequired: Indicates whether the allocation can be
  1841. // consumed by VMs with "any allocation" defined. If the field is set,
  1842. // then only VMs that target the allocation by name using
  1843. // --allocation-affinity can consume this allocation.
  1844. SpecificAllocationRequired bool `json:"specificAllocationRequired,omitempty"`
  1845. Zone string `json:"zone,omitempty"`
  1846. // ServerResponse contains the HTTP response code and headers from the
  1847. // server.
  1848. googleapi.ServerResponse `json:"-"`
  1849. // ForceSendFields is a list of field names (e.g. "Commitment") to
  1850. // unconditionally include in API requests. By default, fields with
  1851. // empty values are omitted from API requests. However, any non-pointer,
  1852. // non-interface field appearing in ForceSendFields will be sent to the
  1853. // server regardless of whether the field is empty or not. This may be
  1854. // used to include empty fields in Patch requests.
  1855. ForceSendFields []string `json:"-"`
  1856. // NullFields is a list of field names (e.g. "Commitment") to include in
  1857. // API requests with the JSON null value. By default, fields with empty
  1858. // values are omitted from API requests. However, any field with an
  1859. // empty value appearing in NullFields will be sent to the server as
  1860. // null. It is an error if a field in this list has a non-empty value.
  1861. // This may be used to include null fields in Patch requests.
  1862. NullFields []string `json:"-"`
  1863. }
  1864. func (s *Allocation) MarshalJSON() ([]byte, error) {
  1865. type NoMethod Allocation
  1866. raw := NoMethod(*s)
  1867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1868. }
  1869. // AllocationAffinity: AllocationAffinity is the configuration of
  1870. // desired allocation which this instance could take capacity from.
  1871. type AllocationAffinity struct {
  1872. // Possible values:
  1873. // "ANY_ALLOCATION"
  1874. // "NO_ALLOCATION"
  1875. // "SPECIFIC_ALLOCATION"
  1876. // "UNSPECIFIED"
  1877. ConsumeAllocationType string `json:"consumeAllocationType,omitempty"`
  1878. // Key: Corresponds to the label key of allocation resource.
  1879. Key string `json:"key,omitempty"`
  1880. // Values: Corresponds to the label values of allocation resource.
  1881. Values []string `json:"values,omitempty"`
  1882. // ForceSendFields is a list of field names (e.g.
  1883. // "ConsumeAllocationType") to unconditionally include in API requests.
  1884. // By default, fields with empty values are omitted from API requests.
  1885. // However, any non-pointer, non-interface field appearing in
  1886. // ForceSendFields will be sent to the server regardless of whether the
  1887. // field is empty or not. This may be used to include empty fields in
  1888. // Patch requests.
  1889. ForceSendFields []string `json:"-"`
  1890. // NullFields is a list of field names (e.g. "ConsumeAllocationType") to
  1891. // include in API requests with the JSON null value. By default, fields
  1892. // with empty values are omitted from API requests. However, any field
  1893. // with an empty value appearing in NullFields will be sent to the
  1894. // server as null. It is an error if a field in this list has a
  1895. // non-empty value. This may be used to include null fields in Patch
  1896. // requests.
  1897. NullFields []string `json:"-"`
  1898. }
  1899. func (s *AllocationAffinity) MarshalJSON() ([]byte, error) {
  1900. type NoMethod AllocationAffinity
  1901. raw := NoMethod(*s)
  1902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1903. }
  1904. // AllocationAggregatedList: Contains a list of allocations.
  1905. type AllocationAggregatedList struct {
  1906. // Id: [Output Only] Unique identifier for the resource; defined by the
  1907. // server.
  1908. Id string `json:"id,omitempty"`
  1909. // Items: A list of Allocation resources.
  1910. Items map[string]AllocationsScopedList `json:"items,omitempty"`
  1911. // Kind: Type of resource.
  1912. Kind string `json:"kind,omitempty"`
  1913. // NextPageToken: [Output Only] This token allows you to get the next
  1914. // page of results for list requests. If the number of results is larger
  1915. // than maxResults, use the nextPageToken as a value for the query
  1916. // parameter pageToken in the next list request. Subsequent list
  1917. // requests will have their own nextPageToken to continue paging through
  1918. // the results.
  1919. NextPageToken string `json:"nextPageToken,omitempty"`
  1920. // SelfLink: [Output Only] Server-defined URL for this resource.
  1921. SelfLink string `json:"selfLink,omitempty"`
  1922. // Warning: [Output Only] Informational warning message.
  1923. Warning *AllocationAggregatedListWarning `json:"warning,omitempty"`
  1924. // ServerResponse contains the HTTP response code and headers from the
  1925. // server.
  1926. googleapi.ServerResponse `json:"-"`
  1927. // ForceSendFields is a list of field names (e.g. "Id") to
  1928. // unconditionally include in API requests. By default, fields with
  1929. // empty values are omitted from API requests. However, any non-pointer,
  1930. // non-interface field appearing in ForceSendFields will be sent to the
  1931. // server regardless of whether the field is empty or not. This may be
  1932. // used to include empty fields in Patch requests.
  1933. ForceSendFields []string `json:"-"`
  1934. // NullFields is a list of field names (e.g. "Id") to include in API
  1935. // requests with the JSON null value. By default, fields with empty
  1936. // values are omitted from API requests. However, any field with an
  1937. // empty value appearing in NullFields will be sent to the server as
  1938. // null. It is an error if a field in this list has a non-empty value.
  1939. // This may be used to include null fields in Patch requests.
  1940. NullFields []string `json:"-"`
  1941. }
  1942. func (s *AllocationAggregatedList) MarshalJSON() ([]byte, error) {
  1943. type NoMethod AllocationAggregatedList
  1944. raw := NoMethod(*s)
  1945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1946. }
  1947. // AllocationAggregatedListWarning: [Output Only] Informational warning
  1948. // message.
  1949. type AllocationAggregatedListWarning struct {
  1950. // Code: [Output Only] A warning code, if applicable. For example,
  1951. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1952. // the response.
  1953. //
  1954. // Possible values:
  1955. // "CLEANUP_FAILED"
  1956. // "DEPRECATED_RESOURCE_USED"
  1957. // "DEPRECATED_TYPE_USED"
  1958. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1959. // "EXPERIMENTAL_TYPE_USED"
  1960. // "EXTERNAL_API_WARNING"
  1961. // "FIELD_VALUE_OVERRIDEN"
  1962. // "INJECTED_KERNELS_DEPRECATED"
  1963. // "MISSING_TYPE_DEPENDENCY"
  1964. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1965. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1966. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1967. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1968. // "NEXT_HOP_NOT_RUNNING"
  1969. // "NOT_CRITICAL_ERROR"
  1970. // "NO_RESULTS_ON_PAGE"
  1971. // "REQUIRED_TOS_AGREEMENT"
  1972. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1973. // "RESOURCE_NOT_DELETED"
  1974. // "SCHEMA_VALIDATION_IGNORED"
  1975. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1976. // "UNDECLARED_PROPERTIES"
  1977. // "UNREACHABLE"
  1978. Code string `json:"code,omitempty"`
  1979. // Data: [Output Only] Metadata about this warning in key: value format.
  1980. // For example:
  1981. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1982. Data []*AllocationAggregatedListWarningData `json:"data,omitempty"`
  1983. // Message: [Output Only] A human-readable description of the warning
  1984. // code.
  1985. Message string `json:"message,omitempty"`
  1986. // ForceSendFields is a list of field names (e.g. "Code") to
  1987. // unconditionally include in API requests. By default, fields with
  1988. // empty values are omitted from API requests. However, any non-pointer,
  1989. // non-interface field appearing in ForceSendFields will be sent to the
  1990. // server regardless of whether the field is empty or not. This may be
  1991. // used to include empty fields in Patch requests.
  1992. ForceSendFields []string `json:"-"`
  1993. // NullFields is a list of field names (e.g. "Code") to include in API
  1994. // requests with the JSON null value. By default, fields with empty
  1995. // values are omitted from API requests. However, any field with an
  1996. // empty value appearing in NullFields will be sent to the server as
  1997. // null. It is an error if a field in this list has a non-empty value.
  1998. // This may be used to include null fields in Patch requests.
  1999. NullFields []string `json:"-"`
  2000. }
  2001. func (s *AllocationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2002. type NoMethod AllocationAggregatedListWarning
  2003. raw := NoMethod(*s)
  2004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2005. }
  2006. type AllocationAggregatedListWarningData struct {
  2007. // Key: [Output Only] A key that provides more detail on the warning
  2008. // being returned. For example, for warnings where there are no results
  2009. // in a list request for a particular zone, this key might be scope and
  2010. // the key value might be the zone name. Other examples might be a key
  2011. // indicating a deprecated resource and a suggested replacement, or a
  2012. // warning about invalid network settings (for example, if an instance
  2013. // attempts to perform IP forwarding but is not enabled for IP
  2014. // forwarding).
  2015. Key string `json:"key,omitempty"`
  2016. // Value: [Output Only] A warning data value corresponding to the key.
  2017. Value string `json:"value,omitempty"`
  2018. // ForceSendFields is a list of field names (e.g. "Key") to
  2019. // unconditionally include in API requests. By default, fields with
  2020. // empty values are omitted from API requests. However, any non-pointer,
  2021. // non-interface field appearing in ForceSendFields will be sent to the
  2022. // server regardless of whether the field is empty or not. This may be
  2023. // used to include empty fields in Patch requests.
  2024. ForceSendFields []string `json:"-"`
  2025. // NullFields is a list of field names (e.g. "Key") to include in API
  2026. // requests with the JSON null value. By default, fields with empty
  2027. // values are omitted from API requests. However, any field with an
  2028. // empty value appearing in NullFields will be sent to the server as
  2029. // null. It is an error if a field in this list has a non-empty value.
  2030. // This may be used to include null fields in Patch requests.
  2031. NullFields []string `json:"-"`
  2032. }
  2033. func (s *AllocationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2034. type NoMethod AllocationAggregatedListWarningData
  2035. raw := NoMethod(*s)
  2036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2037. }
  2038. type AllocationList struct {
  2039. // Id: [Output Only] The unique identifier for the resource. This
  2040. // identifier is defined by the server.
  2041. Id string `json:"id,omitempty"`
  2042. // Items: [Output Only] A list of Allocation resources.
  2043. Items []*Allocation `json:"items,omitempty"`
  2044. // Kind: [Output Only] Type of resource.Always compute#allocationsList
  2045. // for listsof allocations
  2046. Kind string `json:"kind,omitempty"`
  2047. // NextPageToken: [Output Only] This token allows you to get the next
  2048. // page of results for list requests. If the number of results is larger
  2049. // than maxResults, use the nextPageToken as a value for the query
  2050. // parameter pageToken in the next list request. Subsequent list
  2051. // requests will have their own nextPageToken to continue paging through
  2052. // the results.
  2053. NextPageToken string `json:"nextPageToken,omitempty"`
  2054. // SelfLink: [Output Only] Server-defined URL for this resource.
  2055. SelfLink string `json:"selfLink,omitempty"`
  2056. // Warning: [Output Only] Informational warning message.
  2057. Warning *AllocationListWarning `json:"warning,omitempty"`
  2058. // ServerResponse contains the HTTP response code and headers from the
  2059. // server.
  2060. googleapi.ServerResponse `json:"-"`
  2061. // ForceSendFields is a list of field names (e.g. "Id") to
  2062. // unconditionally include in API requests. By default, fields with
  2063. // empty values are omitted from API requests. However, any non-pointer,
  2064. // non-interface field appearing in ForceSendFields will be sent to the
  2065. // server regardless of whether the field is empty or not. This may be
  2066. // used to include empty fields in Patch requests.
  2067. ForceSendFields []string `json:"-"`
  2068. // NullFields is a list of field names (e.g. "Id") to include in API
  2069. // requests with the JSON null value. By default, fields with empty
  2070. // values are omitted from API requests. However, any field with an
  2071. // empty value appearing in NullFields will be sent to the server as
  2072. // null. It is an error if a field in this list has a non-empty value.
  2073. // This may be used to include null fields in Patch requests.
  2074. NullFields []string `json:"-"`
  2075. }
  2076. func (s *AllocationList) MarshalJSON() ([]byte, error) {
  2077. type NoMethod AllocationList
  2078. raw := NoMethod(*s)
  2079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2080. }
  2081. // AllocationListWarning: [Output Only] Informational warning message.
  2082. type AllocationListWarning struct {
  2083. // Code: [Output Only] A warning code, if applicable. For example,
  2084. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2085. // the response.
  2086. //
  2087. // Possible values:
  2088. // "CLEANUP_FAILED"
  2089. // "DEPRECATED_RESOURCE_USED"
  2090. // "DEPRECATED_TYPE_USED"
  2091. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2092. // "EXPERIMENTAL_TYPE_USED"
  2093. // "EXTERNAL_API_WARNING"
  2094. // "FIELD_VALUE_OVERRIDEN"
  2095. // "INJECTED_KERNELS_DEPRECATED"
  2096. // "MISSING_TYPE_DEPENDENCY"
  2097. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2098. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2099. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2100. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2101. // "NEXT_HOP_NOT_RUNNING"
  2102. // "NOT_CRITICAL_ERROR"
  2103. // "NO_RESULTS_ON_PAGE"
  2104. // "REQUIRED_TOS_AGREEMENT"
  2105. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2106. // "RESOURCE_NOT_DELETED"
  2107. // "SCHEMA_VALIDATION_IGNORED"
  2108. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2109. // "UNDECLARED_PROPERTIES"
  2110. // "UNREACHABLE"
  2111. Code string `json:"code,omitempty"`
  2112. // Data: [Output Only] Metadata about this warning in key: value format.
  2113. // For example:
  2114. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2115. Data []*AllocationListWarningData `json:"data,omitempty"`
  2116. // Message: [Output Only] A human-readable description of the warning
  2117. // code.
  2118. Message string `json:"message,omitempty"`
  2119. // ForceSendFields is a list of field names (e.g. "Code") to
  2120. // unconditionally include in API requests. By default, fields with
  2121. // empty values are omitted from API requests. However, any non-pointer,
  2122. // non-interface field appearing in ForceSendFields will be sent to the
  2123. // server regardless of whether the field is empty or not. This may be
  2124. // used to include empty fields in Patch requests.
  2125. ForceSendFields []string `json:"-"`
  2126. // NullFields is a list of field names (e.g. "Code") to include in API
  2127. // requests with the JSON null value. By default, fields with empty
  2128. // values are omitted from API requests. However, any field with an
  2129. // empty value appearing in NullFields will be sent to the server as
  2130. // null. It is an error if a field in this list has a non-empty value.
  2131. // This may be used to include null fields in Patch requests.
  2132. NullFields []string `json:"-"`
  2133. }
  2134. func (s *AllocationListWarning) MarshalJSON() ([]byte, error) {
  2135. type NoMethod AllocationListWarning
  2136. raw := NoMethod(*s)
  2137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2138. }
  2139. type AllocationListWarningData struct {
  2140. // Key: [Output Only] A key that provides more detail on the warning
  2141. // being returned. For example, for warnings where there are no results
  2142. // in a list request for a particular zone, this key might be scope and
  2143. // the key value might be the zone name. Other examples might be a key
  2144. // indicating a deprecated resource and a suggested replacement, or a
  2145. // warning about invalid network settings (for example, if an instance
  2146. // attempts to perform IP forwarding but is not enabled for IP
  2147. // forwarding).
  2148. Key string `json:"key,omitempty"`
  2149. // Value: [Output Only] A warning data value corresponding to the key.
  2150. Value string `json:"value,omitempty"`
  2151. // ForceSendFields is a list of field names (e.g. "Key") to
  2152. // unconditionally include in API requests. By default, fields with
  2153. // empty values are omitted from API requests. However, any non-pointer,
  2154. // non-interface field appearing in ForceSendFields will be sent to the
  2155. // server regardless of whether the field is empty or not. This may be
  2156. // used to include empty fields in Patch requests.
  2157. ForceSendFields []string `json:"-"`
  2158. // NullFields is a list of field names (e.g. "Key") to include in API
  2159. // requests with the JSON null value. By default, fields with empty
  2160. // values are omitted from API requests. However, any field with an
  2161. // empty value appearing in NullFields will be sent to the server as
  2162. // null. It is an error if a field in this list has a non-empty value.
  2163. // This may be used to include null fields in Patch requests.
  2164. NullFields []string `json:"-"`
  2165. }
  2166. func (s *AllocationListWarningData) MarshalJSON() ([]byte, error) {
  2167. type NoMethod AllocationListWarningData
  2168. raw := NoMethod(*s)
  2169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2170. }
  2171. // AllocationSpecificSKUAllocation: This allocation type allows to pre
  2172. // allocate specific instance configuration.
  2173. type AllocationSpecificSKUAllocation struct {
  2174. // Count: Specifies number of resources that are allocated.
  2175. Count int64 `json:"count,omitempty,string"`
  2176. // InUseCount: [OutputOnly] Indicates how many resource are in use.
  2177. InUseCount int64 `json:"inUseCount,omitempty,string"`
  2178. InstanceProperties *AllocationSpecificSKUAllocationAllocatedInstanceProperties `json:"instanceProperties,omitempty"`
  2179. // ForceSendFields is a list of field names (e.g. "Count") 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. "Count") to include in API
  2187. // requests with the JSON null value. By default, fields with empty
  2188. // values are omitted from API requests. However, any field with an
  2189. // 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 *AllocationSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
  2195. type NoMethod AllocationSpecificSKUAllocation
  2196. raw := NoMethod(*s)
  2197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2198. }
  2199. // AllocationSpecificSKUAllocationAllocatedInstanceProperties:
  2200. // Properties of the SKU instances being reserved.
  2201. type AllocationSpecificSKUAllocationAllocatedInstanceProperties struct {
  2202. // GuestAccelerators: Specifies accelerator type and count.
  2203. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  2204. // LocalSsds: Specifies amount of local ssd to reserve with each
  2205. // instance. The type of disk is local-ssd.
  2206. LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk `json:"localSsds,omitempty"`
  2207. // MachineType: Specifies type of machine (name only) which has fixed
  2208. // number of vCPUs and fixed amount of memory. This also includes
  2209. // specifying custom machine type following
  2210. // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
  2211. MachineType string `json:"machineType,omitempty"`
  2212. // MinCpuPlatform: Minimum cpu platform the allocation.
  2213. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  2214. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  2215. // to unconditionally include in API requests. By default, fields with
  2216. // empty values are omitted from API requests. However, any non-pointer,
  2217. // non-interface field appearing in ForceSendFields will be sent to the
  2218. // server regardless of whether the field is empty or not. This may be
  2219. // used to include empty fields in Patch requests.
  2220. ForceSendFields []string `json:"-"`
  2221. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  2222. // include in API requests with the JSON null value. By default, fields
  2223. // with empty values are omitted from API requests. However, any field
  2224. // with an empty value appearing in NullFields will be sent to the
  2225. // server as null. It is an error if a field in this list has a
  2226. // non-empty value. This may be used to include null fields in Patch
  2227. // requests.
  2228. NullFields []string `json:"-"`
  2229. }
  2230. func (s *AllocationSpecificSKUAllocationAllocatedInstanceProperties) MarshalJSON() ([]byte, error) {
  2231. type NoMethod AllocationSpecificSKUAllocationAllocatedInstanceProperties
  2232. raw := NoMethod(*s)
  2233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2234. }
  2235. type AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk struct {
  2236. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2237. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2238. // Interface: Specifies the disk interface to use for attaching this
  2239. // disk, which is either SCSI or NVME. The default is SCSI. For
  2240. // performance characteristics of SCSI over NVMe, see Local SSD
  2241. // performance.
  2242. //
  2243. // Possible values:
  2244. // "NVDIMM"
  2245. // "NVME"
  2246. // "SCSI"
  2247. Interface string `json:"interface,omitempty"`
  2248. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  2249. // unconditionally include in API requests. By default, fields with
  2250. // empty values are omitted from API requests. However, any non-pointer,
  2251. // non-interface field appearing in ForceSendFields will be sent to the
  2252. // server regardless of whether the field is empty or not. This may be
  2253. // used to include empty fields in Patch requests.
  2254. ForceSendFields []string `json:"-"`
  2255. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  2256. // API requests with the JSON null value. By default, fields with empty
  2257. // values are omitted from API requests. However, any field with an
  2258. // empty value appearing in NullFields will be sent to the server as
  2259. // null. It is an error if a field in this list has a non-empty value.
  2260. // This may be used to include null fields in Patch requests.
  2261. NullFields []string `json:"-"`
  2262. }
  2263. func (s *AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk) MarshalJSON() ([]byte, error) {
  2264. type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk
  2265. raw := NoMethod(*s)
  2266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2267. }
  2268. type AllocationsScopedList struct {
  2269. // Allocations: A list of allocations contained in this scope.
  2270. Allocations []*Allocation `json:"allocations,omitempty"`
  2271. // Warning: Informational warning which replaces the list of allocations
  2272. // when the list is empty.
  2273. Warning *AllocationsScopedListWarning `json:"warning,omitempty"`
  2274. // ForceSendFields is a list of field names (e.g. "Allocations") to
  2275. // unconditionally include in API requests. By default, fields with
  2276. // empty values are omitted from API requests. However, any non-pointer,
  2277. // non-interface field appearing in ForceSendFields will be sent to the
  2278. // server regardless of whether the field is empty or not. This may be
  2279. // used to include empty fields in Patch requests.
  2280. ForceSendFields []string `json:"-"`
  2281. // NullFields is a list of field names (e.g. "Allocations") to include
  2282. // in API requests with the JSON null value. By default, fields with
  2283. // empty values are omitted from API requests. However, any field with
  2284. // an empty value appearing in NullFields will be sent to the server as
  2285. // null. It is an error if a field in this list has a non-empty value.
  2286. // This may be used to include null fields in Patch requests.
  2287. NullFields []string `json:"-"`
  2288. }
  2289. func (s *AllocationsScopedList) MarshalJSON() ([]byte, error) {
  2290. type NoMethod AllocationsScopedList
  2291. raw := NoMethod(*s)
  2292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2293. }
  2294. // AllocationsScopedListWarning: Informational warning which replaces
  2295. // the list of allocations when the list is empty.
  2296. type AllocationsScopedListWarning struct {
  2297. // Code: [Output Only] A warning code, if applicable. For example,
  2298. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2299. // the response.
  2300. //
  2301. // Possible values:
  2302. // "CLEANUP_FAILED"
  2303. // "DEPRECATED_RESOURCE_USED"
  2304. // "DEPRECATED_TYPE_USED"
  2305. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2306. // "EXPERIMENTAL_TYPE_USED"
  2307. // "EXTERNAL_API_WARNING"
  2308. // "FIELD_VALUE_OVERRIDEN"
  2309. // "INJECTED_KERNELS_DEPRECATED"
  2310. // "MISSING_TYPE_DEPENDENCY"
  2311. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2312. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2313. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2314. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2315. // "NEXT_HOP_NOT_RUNNING"
  2316. // "NOT_CRITICAL_ERROR"
  2317. // "NO_RESULTS_ON_PAGE"
  2318. // "REQUIRED_TOS_AGREEMENT"
  2319. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2320. // "RESOURCE_NOT_DELETED"
  2321. // "SCHEMA_VALIDATION_IGNORED"
  2322. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2323. // "UNDECLARED_PROPERTIES"
  2324. // "UNREACHABLE"
  2325. Code string `json:"code,omitempty"`
  2326. // Data: [Output Only] Metadata about this warning in key: value format.
  2327. // For example:
  2328. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2329. Data []*AllocationsScopedListWarningData `json:"data,omitempty"`
  2330. // Message: [Output Only] A human-readable description of the warning
  2331. // code.
  2332. Message string `json:"message,omitempty"`
  2333. // ForceSendFields is a list of field names (e.g. "Code") to
  2334. // unconditionally include in API requests. By default, fields with
  2335. // empty values are omitted from API requests. However, any non-pointer,
  2336. // non-interface field appearing in ForceSendFields will be sent to the
  2337. // server regardless of whether the field is empty or not. This may be
  2338. // used to include empty fields in Patch requests.
  2339. ForceSendFields []string `json:"-"`
  2340. // NullFields is a list of field names (e.g. "Code") to include in API
  2341. // requests with the JSON null value. By default, fields with empty
  2342. // values are omitted from API requests. However, any field with an
  2343. // empty value appearing in NullFields will be sent to the server as
  2344. // null. It is an error if a field in this list has a non-empty value.
  2345. // This may be used to include null fields in Patch requests.
  2346. NullFields []string `json:"-"`
  2347. }
  2348. func (s *AllocationsScopedListWarning) MarshalJSON() ([]byte, error) {
  2349. type NoMethod AllocationsScopedListWarning
  2350. raw := NoMethod(*s)
  2351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2352. }
  2353. type AllocationsScopedListWarningData struct {
  2354. // Key: [Output Only] A key that provides more detail on the warning
  2355. // being returned. For example, for warnings where there are no results
  2356. // in a list request for a particular zone, this key might be scope and
  2357. // the key value might be the zone name. Other examples might be a key
  2358. // indicating a deprecated resource and a suggested replacement, or a
  2359. // warning about invalid network settings (for example, if an instance
  2360. // attempts to perform IP forwarding but is not enabled for IP
  2361. // forwarding).
  2362. Key string `json:"key,omitempty"`
  2363. // Value: [Output Only] A warning data value corresponding to the key.
  2364. Value string `json:"value,omitempty"`
  2365. // ForceSendFields is a list of field names (e.g. "Key") to
  2366. // unconditionally include in API requests. By default, fields with
  2367. // empty values are omitted from API requests. However, any non-pointer,
  2368. // non-interface field appearing in ForceSendFields will be sent to the
  2369. // server regardless of whether the field is empty or not. This may be
  2370. // used to include empty fields in Patch requests.
  2371. ForceSendFields []string `json:"-"`
  2372. // NullFields is a list of field names (e.g. "Key") to include in API
  2373. // requests with the JSON null value. By default, fields with empty
  2374. // values are omitted from API requests. However, any field with an
  2375. // empty value appearing in NullFields will be sent to the server as
  2376. // null. It is an error if a field in this list has a non-empty value.
  2377. // This may be used to include null fields in Patch requests.
  2378. NullFields []string `json:"-"`
  2379. }
  2380. func (s *AllocationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  2381. type NoMethod AllocationsScopedListWarningData
  2382. raw := NoMethod(*s)
  2383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2384. }
  2385. type AllocationsUpdateResourceShapeRequest struct {
  2386. // Count: Number of allocated resources which are to be updated with
  2387. // minimum = 1 and maximum = 100.
  2388. Count int64 `json:"count,omitempty"`
  2389. // DestinationAllocation: The name of destination allocation where the
  2390. // modified machines are added. If existing, its machine spec must match
  2391. // the modified machine spec. If non existing, new allocation with this
  2392. // name and modified machine spec is created automatically.
  2393. DestinationAllocation string `json:"destinationAllocation,omitempty"`
  2394. UpdatedResourceProperties *AllocationSpecificSKUAllocationAllocatedInstanceProperties `json:"updatedResourceProperties,omitempty"`
  2395. // ForceSendFields is a list of field names (e.g. "Count") to
  2396. // unconditionally include in API requests. By default, fields with
  2397. // empty values are omitted from API requests. However, any non-pointer,
  2398. // non-interface field appearing in ForceSendFields will be sent to the
  2399. // server regardless of whether the field is empty or not. This may be
  2400. // used to include empty fields in Patch requests.
  2401. ForceSendFields []string `json:"-"`
  2402. // NullFields is a list of field names (e.g. "Count") to include in API
  2403. // requests with the JSON null value. By default, fields with empty
  2404. // values are omitted from API requests. However, any field with an
  2405. // empty value appearing in NullFields will be sent to the server as
  2406. // null. It is an error if a field in this list has a non-empty value.
  2407. // This may be used to include null fields in Patch requests.
  2408. NullFields []string `json:"-"`
  2409. }
  2410. func (s *AllocationsUpdateResourceShapeRequest) MarshalJSON() ([]byte, error) {
  2411. type NoMethod AllocationsUpdateResourceShapeRequest
  2412. raw := NoMethod(*s)
  2413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2414. }
  2415. // AttachedDisk: An instance-attached disk resource.
  2416. type AttachedDisk struct {
  2417. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  2418. // instance is deleted (but not when the disk is detached from the
  2419. // instance).
  2420. AutoDelete bool `json:"autoDelete,omitempty"`
  2421. // Boot: Indicates that this is a boot disk. The virtual machine will
  2422. // use the first partition of the disk for its root filesystem.
  2423. Boot bool `json:"boot,omitempty"`
  2424. // DeviceName: Specifies a unique device name of your choice that is
  2425. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  2426. // system running within the instance. This name can be used to
  2427. // reference the device for mounting, resizing, and so on, from within
  2428. // the instance.
  2429. //
  2430. // If not specified, the server chooses a default device name to apply
  2431. // to this disk, in the form persistent-disks-x, where x is a number
  2432. // assigned by Google Compute Engine. This field is only applicable for
  2433. // persistent disks.
  2434. DeviceName string `json:"deviceName,omitempty"`
  2435. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  2436. // customer-supplied encryption key.
  2437. //
  2438. // If you are creating a new disk, this field encrypts the new disk
  2439. // using an encryption key that you provide. If you are attaching an
  2440. // existing disk that is already encrypted, this field decrypts the disk
  2441. // using the customer-supplied encryption key.
  2442. //
  2443. // If you encrypt a disk using a customer-supplied key, you must provide
  2444. // the same key again when you attempt to use this resource at a later
  2445. // time. For example, you must provide the key when you create a
  2446. // snapshot or an image from the disk or when you attach the disk to a
  2447. // virtual machine instance.
  2448. //
  2449. // If you do not provide an encryption key, then the disk will be
  2450. // encrypted using an automatically generated key and you do not need to
  2451. // provide a key to use the disk later.
  2452. //
  2453. // Instance templates do not store customer-supplied encryption keys, so
  2454. // you cannot use your own keys to encrypt disks in a managed instance
  2455. // group.
  2456. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2457. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  2458. // disk_size_gb in InitializeParams.
  2459. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2460. // GuestOsFeatures: A list of features to enable on the guest operating
  2461. // system. Applicable only for bootable images. Read Enabling guest
  2462. // operating system features to see a list of available options.
  2463. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2464. // Index: [Output Only] A zero-based index to this disk, where 0 is
  2465. // reserved for the boot disk. If you have many disks attached to an
  2466. // instance, each disk would have a unique index number.
  2467. Index int64 `json:"index,omitempty"`
  2468. // InitializeParams: [Input Only] Specifies the parameters for a new
  2469. // disk that will be created alongside the new instance. Use
  2470. // initialization parameters to create boot disks or local SSDs attached
  2471. // to the new instance.
  2472. //
  2473. // This property is mutually exclusive with the source property; you can
  2474. // only define one or the other, but not both.
  2475. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  2476. // Interface: Specifies the disk interface to use for attaching this
  2477. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  2478. // disks must always use SCSI and the request will fail if you attempt
  2479. // to attach a persistent disk in any other format than SCSI. Local SSDs
  2480. // can use either NVME or SCSI. For performance characteristics of SCSI
  2481. // over NVMe, see Local SSD performance.
  2482. //
  2483. // Possible values:
  2484. // "NVDIMM"
  2485. // "NVME"
  2486. // "SCSI"
  2487. Interface string `json:"interface,omitempty"`
  2488. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  2489. // for attached disks.
  2490. Kind string `json:"kind,omitempty"`
  2491. // Licenses: [Output Only] Any valid publicly visible licenses.
  2492. Licenses []string `json:"licenses,omitempty"`
  2493. // Mode: The mode in which to attach this disk, either READ_WRITE or
  2494. // READ_ONLY. If not specified, the default is to attach the disk in
  2495. // READ_WRITE mode.
  2496. //
  2497. // Possible values:
  2498. // "READ_ONLY"
  2499. // "READ_WRITE"
  2500. Mode string `json:"mode,omitempty"`
  2501. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  2502. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  2503. // has been saved to a persistent location by customer request. (see the
  2504. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  2505. //
  2506. // Possible values:
  2507. // "DISK_SAVED_STATE_UNSPECIFIED"
  2508. // "PRESERVED"
  2509. SavedState string `json:"savedState,omitempty"`
  2510. // Source: Specifies a valid partial or full URL to an existing
  2511. // Persistent Disk resource. When creating a new instance, one of
  2512. // initializeParams.sourceImage or disks.source is required except for
  2513. // local SSD.
  2514. //
  2515. // If desired, you can also attach existing non-root persistent disks
  2516. // using this property. This field is only applicable for persistent
  2517. // disks.
  2518. //
  2519. // Note that for InstanceTemplate, specify the disk name, not the URL
  2520. // for the disk.
  2521. Source string `json:"source,omitempty"`
  2522. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  2523. // If not specified, the default is PERSISTENT.
  2524. //
  2525. // Possible values:
  2526. // "PERSISTENT"
  2527. // "SCRATCH"
  2528. Type string `json:"type,omitempty"`
  2529. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  2530. // unconditionally include in API requests. By default, fields with
  2531. // empty values are omitted from API requests. However, any non-pointer,
  2532. // non-interface field appearing in ForceSendFields will be sent to the
  2533. // server regardless of whether the field is empty or not. This may be
  2534. // used to include empty fields in Patch requests.
  2535. ForceSendFields []string `json:"-"`
  2536. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  2537. // API requests with the JSON null value. By default, fields with empty
  2538. // values are omitted from API requests. However, any field with an
  2539. // empty value appearing in NullFields will be sent to the server as
  2540. // null. It is an error if a field in this list has a non-empty value.
  2541. // This may be used to include null fields in Patch requests.
  2542. NullFields []string `json:"-"`
  2543. }
  2544. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  2545. type NoMethod AttachedDisk
  2546. raw := NoMethod(*s)
  2547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2548. }
  2549. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  2550. // for a new disk that will be created alongside the new instance. Use
  2551. // initialization parameters to create boot disks or local SSDs attached
  2552. // to the new instance.
  2553. //
  2554. // This property is mutually exclusive with the source property; you can
  2555. // only define one or the other, but not both.
  2556. type AttachedDiskInitializeParams struct {
  2557. // Description: An optional description. Provide this property when
  2558. // creating the disk.
  2559. Description string `json:"description,omitempty"`
  2560. // DiskName: Specifies the disk name. If not specified, the default is
  2561. // to use the name of the instance. If the disk with the instance name
  2562. // exists already in the given zone/region, a new name will be
  2563. // automatically generated.
  2564. DiskName string `json:"diskName,omitempty"`
  2565. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2566. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2567. // DiskType: Specifies the disk type to use to create the instance. If
  2568. // not specified, the default is pd-standard, specified using the full
  2569. // URL. For
  2570. // example:
  2571. // https://www.googleapis.com/compute/v1/projects/project/zones/
  2572. // zone/diskTypes/pd-standard
  2573. //
  2574. //
  2575. // Other values include pd-ssd and local-ssd. If you define this field,
  2576. // you can provide either the full or partial URL. For example, the
  2577. // following are valid values:
  2578. // -
  2579. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  2580. // - projects/project/zones/zone/diskTypes/diskType
  2581. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  2582. // is the name of the disk type, not URL.
  2583. DiskType string `json:"diskType,omitempty"`
  2584. // Labels: Labels to apply to this disk. These can be later modified by
  2585. // the disks.setLabels method. This field is only applicable for
  2586. // persistent disks.
  2587. Labels map[string]string `json:"labels,omitempty"`
  2588. // SourceImage: The source image to create this disk. When creating a
  2589. // new instance, one of initializeParams.sourceImage or disks.source is
  2590. // required except for local SSD.
  2591. //
  2592. // To create a disk with one of the public operating system images,
  2593. // specify the image by its family name. For example, specify
  2594. // family/debian-9 to use the latest Debian 9
  2595. // image:
  2596. // projects/debian-cloud/global/images/family/debian-9
  2597. //
  2598. //
  2599. // Alternati
  2600. // vely, use a specific version of a public operating system
  2601. // image:
  2602. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  2603. //
  2604. //
  2605. //
  2606. // To create a disk with a custom image that you created, specify the
  2607. // image name in the following
  2608. // format:
  2609. // global/images/my-custom-image
  2610. //
  2611. //
  2612. // You can also specify a custom image by its image family, which
  2613. // returns the latest version of the image in that family. Replace the
  2614. // image name with
  2615. // family/family-name:
  2616. // global/images/family/my-image-family
  2617. //
  2618. //
  2619. // If the source image is deleted later, this field will not be set.
  2620. SourceImage string `json:"sourceImage,omitempty"`
  2621. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2622. // source image. Required if the source image is protected by a
  2623. // customer-supplied encryption key.
  2624. //
  2625. // Instance templates do not store customer-supplied encryption keys, so
  2626. // you cannot create disks for instances in a managed instance group if
  2627. // the source images are encrypted with your own keys.
  2628. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2629. // SourceSnapshot: The source snapshot to create this disk. When
  2630. // creating a new instance, one of initializeParams.sourceSnapshot or
  2631. // disks.source is required except for local SSD.
  2632. //
  2633. // To create a disk with a snapshot that you created, specify the
  2634. // snapshot name in the following
  2635. // format:
  2636. // global/snapshots/my-backup
  2637. //
  2638. //
  2639. // If the source snapshot is deleted later, this field will not be set.
  2640. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  2641. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  2642. // the source snapshot.
  2643. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  2644. // ForceSendFields is a list of field names (e.g. "Description") to
  2645. // unconditionally include in API requests. By default, fields with
  2646. // empty values are omitted from API requests. However, any non-pointer,
  2647. // non-interface field appearing in ForceSendFields will be sent to the
  2648. // server regardless of whether the field is empty or not. This may be
  2649. // used to include empty fields in Patch requests.
  2650. ForceSendFields []string `json:"-"`
  2651. // NullFields is a list of field names (e.g. "Description") to include
  2652. // in API requests with the JSON null value. By default, fields with
  2653. // empty values are omitted from API requests. However, any field with
  2654. // an empty value appearing in NullFields will be sent to the server as
  2655. // null. It is an error if a field in this list has a non-empty value.
  2656. // This may be used to include null fields in Patch requests.
  2657. NullFields []string `json:"-"`
  2658. }
  2659. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2660. type NoMethod AttachedDiskInitializeParams
  2661. raw := NoMethod(*s)
  2662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2663. }
  2664. // AuditConfig: Specifies the audit configuration for a service. The
  2665. // configuration determines which permission types are logged, and what
  2666. // identities, if any, are exempted from logging. An AuditConfig must
  2667. // have one or more AuditLogConfigs.
  2668. //
  2669. // If there are AuditConfigs for both `allServices` and a specific
  2670. // service, the union of the two AuditConfigs is used for that service:
  2671. // the log_types specified in each AuditConfig are enabled, and the
  2672. // exempted_members in each AuditLogConfig are exempted.
  2673. //
  2674. // Example Policy with multiple AuditConfigs:
  2675. //
  2676. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2677. // [ { "log_type": "DATA_READ", "exempted_members": [
  2678. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2679. // "log_type": "ADMIN_READ", } ] }, { "service":
  2680. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2681. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2682. // "user:bar@gmail.com" ] } ] } ] }
  2683. //
  2684. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2685. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2686. // logging, and bar@gmail.com from DATA_WRITE logging.
  2687. type AuditConfig struct {
  2688. // AuditLogConfigs: The configuration for logging of each type of
  2689. // permission.
  2690. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2691. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2692. // Service: Specifies a service that will be enabled for audit logging.
  2693. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2694. // `allServices` is a special value that covers all services.
  2695. Service string `json:"service,omitempty"`
  2696. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2697. // unconditionally include in API requests. By default, fields with
  2698. // empty values are omitted from API requests. However, any non-pointer,
  2699. // non-interface field appearing in ForceSendFields will be sent to the
  2700. // server regardless of whether the field is empty or not. This may be
  2701. // used to include empty fields in Patch requests.
  2702. ForceSendFields []string `json:"-"`
  2703. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2704. // include in API requests with the JSON null value. By default, fields
  2705. // with empty values are omitted from API requests. However, any field
  2706. // with an empty value appearing in NullFields will be sent to the
  2707. // server as null. It is an error if a field in this list has a
  2708. // non-empty value. This may be used to include null fields in Patch
  2709. // requests.
  2710. NullFields []string `json:"-"`
  2711. }
  2712. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2713. type NoMethod AuditConfig
  2714. raw := NoMethod(*s)
  2715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2716. }
  2717. // AuditLogConfig: Provides the configuration for logging a type of
  2718. // permissions. Example:
  2719. //
  2720. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2721. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2722. // "DATA_WRITE", } ] }
  2723. //
  2724. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2725. // foo@gmail.com from DATA_READ logging.
  2726. type AuditLogConfig struct {
  2727. // ExemptedMembers: Specifies the identities that do not cause logging
  2728. // for this type of permission. Follows the same format of
  2729. // [Binding.members][].
  2730. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2731. // LogType: The log type that this config enables.
  2732. //
  2733. // Possible values:
  2734. // "ADMIN_READ"
  2735. // "DATA_READ"
  2736. // "DATA_WRITE"
  2737. // "LOG_TYPE_UNSPECIFIED"
  2738. LogType string `json:"logType,omitempty"`
  2739. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2740. // unconditionally include in API requests. By default, fields with
  2741. // empty values are omitted from API requests. However, any non-pointer,
  2742. // non-interface field appearing in ForceSendFields will be sent to the
  2743. // server regardless of whether the field is empty or not. This may be
  2744. // used to include empty fields in Patch requests.
  2745. ForceSendFields []string `json:"-"`
  2746. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2747. // include in API requests with the JSON null value. By default, fields
  2748. // with empty values are omitted from API requests. However, any field
  2749. // with an empty value appearing in NullFields will be sent to the
  2750. // server as null. It is an error if a field in this list has a
  2751. // non-empty value. This may be used to include null fields in Patch
  2752. // requests.
  2753. NullFields []string `json:"-"`
  2754. }
  2755. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2756. type NoMethod AuditLogConfig
  2757. raw := NoMethod(*s)
  2758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2759. }
  2760. // AuthorizationLoggingOptions: Authorization-related information used
  2761. // by Cloud Audit Logging.
  2762. type AuthorizationLoggingOptions struct {
  2763. // PermissionType: The type of the permission that was checked.
  2764. //
  2765. // Possible values:
  2766. // "ADMIN_READ"
  2767. // "ADMIN_WRITE"
  2768. // "DATA_READ"
  2769. // "DATA_WRITE"
  2770. // "PERMISSION_TYPE_UNSPECIFIED"
  2771. PermissionType string `json:"permissionType,omitempty"`
  2772. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2773. // unconditionally include in API requests. By default, fields with
  2774. // empty values are omitted from API requests. However, any non-pointer,
  2775. // non-interface field appearing in ForceSendFields will be sent to the
  2776. // server regardless of whether the field is empty or not. This may be
  2777. // used to include empty fields in Patch requests.
  2778. ForceSendFields []string `json:"-"`
  2779. // NullFields is a list of field names (e.g. "PermissionType") to
  2780. // include in API requests with the JSON null value. By default, fields
  2781. // with empty values are omitted from API requests. However, any field
  2782. // with an empty value appearing in NullFields will be sent to the
  2783. // server as null. It is an error if a field in this list has a
  2784. // non-empty value. This may be used to include null fields in Patch
  2785. // requests.
  2786. NullFields []string `json:"-"`
  2787. }
  2788. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2789. type NoMethod AuthorizationLoggingOptions
  2790. raw := NoMethod(*s)
  2791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2792. }
  2793. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2794. // to automatically scale virtual machine instances in managed instance
  2795. // groups according to an autoscaling policy that you define. For more
  2796. // information, read Autoscaling Groups of Instances. (== resource_for
  2797. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2798. // resource_for beta.regionAutoscalers ==) (== resource_for
  2799. // v1.regionAutoscalers ==)
  2800. type Autoscaler struct {
  2801. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2802. // algorithm. You can define one or more of the policies for an
  2803. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2804. // loadBalancingUtilization.
  2805. //
  2806. // If none of these are specified, the default will be to autoscale
  2807. // based on cpuUtilization to 0.6 or 60%.
  2808. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2809. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2810. // format.
  2811. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2812. // Description: An optional description of this resource. Provide this
  2813. // property when you create the resource.
  2814. Description string `json:"description,omitempty"`
  2815. // Id: [Output Only] The unique identifier for the resource. This
  2816. // identifier is defined by the server.
  2817. Id uint64 `json:"id,omitempty,string"`
  2818. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2819. // for autoscalers.
  2820. Kind string `json:"kind,omitempty"`
  2821. // Name: Name of the resource. Provided by the client when the resource
  2822. // is created. The name must be 1-63 characters long, and comply with
  2823. // RFC1035. Specifically, the name must be 1-63 characters long and
  2824. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2825. // the first character must be a lowercase letter, and all following
  2826. // characters must be a dash, lowercase letter, or digit, except the
  2827. // last character, which cannot be a dash.
  2828. Name string `json:"name,omitempty"`
  2829. // RecommendedSize: [Output Only] Target recommended MIG size (number of
  2830. // instances) computed by autoscaler. Autoscaler calculates recommended
  2831. // MIG size even when autoscaling policy mode is different from ON. This
  2832. // field is empty when autoscaler is not connected to the existing
  2833. // managed instance group or autoscaler did not generate its prediction.
  2834. RecommendedSize int64 `json:"recommendedSize,omitempty"`
  2835. // Region: [Output Only] URL of the region where the instance group
  2836. // resides (for autoscalers living in regional scope).
  2837. Region string `json:"region,omitempty"`
  2838. // SelfLink: [Output Only] Server-defined URL for the resource.
  2839. SelfLink string `json:"selfLink,omitempty"`
  2840. // Status: [Output Only] The status of the autoscaler configuration.
  2841. //
  2842. // Possible values:
  2843. // "ACTIVE"
  2844. // "DELETING"
  2845. // "ERROR"
  2846. // "PENDING"
  2847. Status string `json:"status,omitempty"`
  2848. // StatusDetails: [Output Only] Human-readable details about the current
  2849. // state of the autoscaler. Read the documentation for Commonly returned
  2850. // status messages for examples of status messages you might encounter.
  2851. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2852. // Target: URL of the managed instance group that this autoscaler will
  2853. // scale.
  2854. Target string `json:"target,omitempty"`
  2855. // Zone: [Output Only] URL of the zone where the instance group resides
  2856. // (for autoscalers living in zonal scope).
  2857. Zone string `json:"zone,omitempty"`
  2858. // ServerResponse contains the HTTP response code and headers from the
  2859. // server.
  2860. googleapi.ServerResponse `json:"-"`
  2861. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2862. // to unconditionally include in API requests. By default, fields with
  2863. // empty values are omitted from API requests. However, any non-pointer,
  2864. // non-interface field appearing in ForceSendFields will be sent to the
  2865. // server regardless of whether the field is empty or not. This may be
  2866. // used to include empty fields in Patch requests.
  2867. ForceSendFields []string `json:"-"`
  2868. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2869. // include in API requests with the JSON null value. By default, fields
  2870. // with empty values are omitted from API requests. However, any field
  2871. // with an empty value appearing in NullFields will be sent to the
  2872. // server as null. It is an error if a field in this list has a
  2873. // non-empty value. This may be used to include null fields in Patch
  2874. // requests.
  2875. NullFields []string `json:"-"`
  2876. }
  2877. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2878. type NoMethod Autoscaler
  2879. raw := NoMethod(*s)
  2880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2881. }
  2882. type AutoscalerAggregatedList struct {
  2883. // Id: [Output Only] Unique identifier for the resource; defined by the
  2884. // server.
  2885. Id string `json:"id,omitempty"`
  2886. // Items: A list of AutoscalersScopedList resources.
  2887. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2888. // Kind: [Output Only] Type of resource. Always
  2889. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2890. Kind string `json:"kind,omitempty"`
  2891. // NextPageToken: [Output Only] This token allows you to get the next
  2892. // page of results for list requests. If the number of results is larger
  2893. // than maxResults, use the nextPageToken as a value for the query
  2894. // parameter pageToken in the next list request. Subsequent list
  2895. // requests will have their own nextPageToken to continue paging through
  2896. // the results.
  2897. NextPageToken string `json:"nextPageToken,omitempty"`
  2898. // SelfLink: [Output Only] Server-defined URL for this resource.
  2899. SelfLink string `json:"selfLink,omitempty"`
  2900. // Warning: [Output Only] Informational warning message.
  2901. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2902. // ServerResponse contains the HTTP response code and headers from the
  2903. // server.
  2904. googleapi.ServerResponse `json:"-"`
  2905. // ForceSendFields is a list of field names (e.g. "Id") to
  2906. // unconditionally include in API requests. By default, fields with
  2907. // empty values are omitted from API requests. However, any non-pointer,
  2908. // non-interface field appearing in ForceSendFields will be sent to the
  2909. // server regardless of whether the field is empty or not. This may be
  2910. // used to include empty fields in Patch requests.
  2911. ForceSendFields []string `json:"-"`
  2912. // NullFields is a list of field names (e.g. "Id") to include in API
  2913. // requests with the JSON null value. By default, fields with empty
  2914. // values are omitted from API requests. However, any field with an
  2915. // empty value appearing in NullFields will be sent to the server as
  2916. // null. It is an error if a field in this list has a non-empty value.
  2917. // This may be used to include null fields in Patch requests.
  2918. NullFields []string `json:"-"`
  2919. }
  2920. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2921. type NoMethod AutoscalerAggregatedList
  2922. raw := NoMethod(*s)
  2923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2924. }
  2925. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2926. // message.
  2927. type AutoscalerAggregatedListWarning struct {
  2928. // Code: [Output Only] A warning code, if applicable. For example,
  2929. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2930. // the response.
  2931. //
  2932. // Possible values:
  2933. // "CLEANUP_FAILED"
  2934. // "DEPRECATED_RESOURCE_USED"
  2935. // "DEPRECATED_TYPE_USED"
  2936. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2937. // "EXPERIMENTAL_TYPE_USED"
  2938. // "EXTERNAL_API_WARNING"
  2939. // "FIELD_VALUE_OVERRIDEN"
  2940. // "INJECTED_KERNELS_DEPRECATED"
  2941. // "MISSING_TYPE_DEPENDENCY"
  2942. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2943. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2944. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2945. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2946. // "NEXT_HOP_NOT_RUNNING"
  2947. // "NOT_CRITICAL_ERROR"
  2948. // "NO_RESULTS_ON_PAGE"
  2949. // "REQUIRED_TOS_AGREEMENT"
  2950. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2951. // "RESOURCE_NOT_DELETED"
  2952. // "SCHEMA_VALIDATION_IGNORED"
  2953. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2954. // "UNDECLARED_PROPERTIES"
  2955. // "UNREACHABLE"
  2956. Code string `json:"code,omitempty"`
  2957. // Data: [Output Only] Metadata about this warning in key: value format.
  2958. // For example:
  2959. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2960. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2961. // Message: [Output Only] A human-readable description of the warning
  2962. // code.
  2963. Message string `json:"message,omitempty"`
  2964. // ForceSendFields is a list of field names (e.g. "Code") to
  2965. // unconditionally include in API requests. By default, fields with
  2966. // empty values are omitted from API requests. However, any non-pointer,
  2967. // non-interface field appearing in ForceSendFields will be sent to the
  2968. // server regardless of whether the field is empty or not. This may be
  2969. // used to include empty fields in Patch requests.
  2970. ForceSendFields []string `json:"-"`
  2971. // NullFields is a list of field names (e.g. "Code") to include in API
  2972. // requests with the JSON null value. By default, fields with empty
  2973. // values are omitted from API requests. However, any field with an
  2974. // empty value appearing in NullFields will be sent to the server as
  2975. // null. It is an error if a field in this list has a non-empty value.
  2976. // This may be used to include null fields in Patch requests.
  2977. NullFields []string `json:"-"`
  2978. }
  2979. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2980. type NoMethod AutoscalerAggregatedListWarning
  2981. raw := NoMethod(*s)
  2982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2983. }
  2984. type AutoscalerAggregatedListWarningData struct {
  2985. // Key: [Output Only] A key that provides more detail on the warning
  2986. // being returned. For example, for warnings where there are no results
  2987. // in a list request for a particular zone, this key might be scope and
  2988. // the key value might be the zone name. Other examples might be a key
  2989. // indicating a deprecated resource and a suggested replacement, or a
  2990. // warning about invalid network settings (for example, if an instance
  2991. // attempts to perform IP forwarding but is not enabled for IP
  2992. // forwarding).
  2993. Key string `json:"key,omitempty"`
  2994. // Value: [Output Only] A warning data value corresponding to the key.
  2995. Value string `json:"value,omitempty"`
  2996. // ForceSendFields is a list of field names (e.g. "Key") to
  2997. // unconditionally include in API requests. By default, fields with
  2998. // empty values are omitted from API requests. However, any non-pointer,
  2999. // non-interface field appearing in ForceSendFields will be sent to the
  3000. // server regardless of whether the field is empty or not. This may be
  3001. // used to include empty fields in Patch requests.
  3002. ForceSendFields []string `json:"-"`
  3003. // NullFields is a list of field names (e.g. "Key") to include in API
  3004. // requests with the JSON null value. By default, fields with empty
  3005. // values are omitted from API requests. However, any field with an
  3006. // empty value appearing in NullFields will be sent to the server as
  3007. // null. It is an error if a field in this list has a non-empty value.
  3008. // This may be used to include null fields in Patch requests.
  3009. NullFields []string `json:"-"`
  3010. }
  3011. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3012. type NoMethod AutoscalerAggregatedListWarningData
  3013. raw := NoMethod(*s)
  3014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3015. }
  3016. // AutoscalerList: Contains a list of Autoscaler resources.
  3017. type AutoscalerList struct {
  3018. // Id: [Output Only] Unique identifier for the resource; defined by the
  3019. // server.
  3020. Id string `json:"id,omitempty"`
  3021. // Items: A list of Autoscaler resources.
  3022. Items []*Autoscaler `json:"items,omitempty"`
  3023. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  3024. // for lists of autoscalers.
  3025. Kind string `json:"kind,omitempty"`
  3026. // NextPageToken: [Output Only] This token allows you to get the next
  3027. // page of results for list requests. If the number of results is larger
  3028. // than maxResults, use the nextPageToken as a value for the query
  3029. // parameter pageToken in the next list request. Subsequent list
  3030. // requests will have their own nextPageToken to continue paging through
  3031. // the results.
  3032. NextPageToken string `json:"nextPageToken,omitempty"`
  3033. // SelfLink: [Output Only] Server-defined URL for this resource.
  3034. SelfLink string `json:"selfLink,omitempty"`
  3035. // Warning: [Output Only] Informational warning message.
  3036. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  3037. // ServerResponse contains the HTTP response code and headers from the
  3038. // server.
  3039. googleapi.ServerResponse `json:"-"`
  3040. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  3048. // requests with the JSON null value. By default, fields with empty
  3049. // values are omitted from API requests. However, any field with an
  3050. // empty value appearing in NullFields will be sent to the server as
  3051. // null. It is an error if a field in this list has a non-empty value.
  3052. // This may be used to include null fields in Patch requests.
  3053. NullFields []string `json:"-"`
  3054. }
  3055. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  3056. type NoMethod AutoscalerList
  3057. raw := NoMethod(*s)
  3058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3059. }
  3060. // AutoscalerListWarning: [Output Only] Informational warning message.
  3061. type AutoscalerListWarning struct {
  3062. // Code: [Output Only] A warning code, if applicable. For example,
  3063. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3064. // the response.
  3065. //
  3066. // Possible values:
  3067. // "CLEANUP_FAILED"
  3068. // "DEPRECATED_RESOURCE_USED"
  3069. // "DEPRECATED_TYPE_USED"
  3070. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3071. // "EXPERIMENTAL_TYPE_USED"
  3072. // "EXTERNAL_API_WARNING"
  3073. // "FIELD_VALUE_OVERRIDEN"
  3074. // "INJECTED_KERNELS_DEPRECATED"
  3075. // "MISSING_TYPE_DEPENDENCY"
  3076. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3077. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3078. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3079. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3080. // "NEXT_HOP_NOT_RUNNING"
  3081. // "NOT_CRITICAL_ERROR"
  3082. // "NO_RESULTS_ON_PAGE"
  3083. // "REQUIRED_TOS_AGREEMENT"
  3084. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3085. // "RESOURCE_NOT_DELETED"
  3086. // "SCHEMA_VALIDATION_IGNORED"
  3087. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3088. // "UNDECLARED_PROPERTIES"
  3089. // "UNREACHABLE"
  3090. Code string `json:"code,omitempty"`
  3091. // Data: [Output Only] Metadata about this warning in key: value format.
  3092. // For example:
  3093. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3094. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  3095. // Message: [Output Only] A human-readable description of the warning
  3096. // code.
  3097. Message string `json:"message,omitempty"`
  3098. // ForceSendFields is a list of field names (e.g. "Code") to
  3099. // unconditionally include in API requests. By default, fields with
  3100. // empty values are omitted from API requests. However, any non-pointer,
  3101. // non-interface field appearing in ForceSendFields will be sent to the
  3102. // server regardless of whether the field is empty or not. This may be
  3103. // used to include empty fields in Patch requests.
  3104. ForceSendFields []string `json:"-"`
  3105. // NullFields is a list of field names (e.g. "Code") to include in API
  3106. // requests with the JSON null value. By default, fields with empty
  3107. // values are omitted from API requests. However, any field with an
  3108. // empty value appearing in NullFields will be sent to the server as
  3109. // null. It is an error if a field in this list has a non-empty value.
  3110. // This may be used to include null fields in Patch requests.
  3111. NullFields []string `json:"-"`
  3112. }
  3113. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  3114. type NoMethod AutoscalerListWarning
  3115. raw := NoMethod(*s)
  3116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3117. }
  3118. type AutoscalerListWarningData struct {
  3119. // Key: [Output Only] A key that provides more detail on the warning
  3120. // being returned. For example, for warnings where there are no results
  3121. // in a list request for a particular zone, this key might be scope and
  3122. // the key value might be the zone name. Other examples might be a key
  3123. // indicating a deprecated resource and a suggested replacement, or a
  3124. // warning about invalid network settings (for example, if an instance
  3125. // attempts to perform IP forwarding but is not enabled for IP
  3126. // forwarding).
  3127. Key string `json:"key,omitempty"`
  3128. // Value: [Output Only] A warning data value corresponding to the key.
  3129. Value string `json:"value,omitempty"`
  3130. // ForceSendFields is a list of field names (e.g. "Key") to
  3131. // unconditionally include in API requests. By default, fields with
  3132. // empty values are omitted from API requests. However, any non-pointer,
  3133. // non-interface field appearing in ForceSendFields will be sent to the
  3134. // server regardless of whether the field is empty or not. This may be
  3135. // used to include empty fields in Patch requests.
  3136. ForceSendFields []string `json:"-"`
  3137. // NullFields is a list of field names (e.g. "Key") to include in API
  3138. // requests with the JSON null value. By default, fields with empty
  3139. // values are omitted from API requests. However, any field with an
  3140. // empty value appearing in NullFields will be sent to the server as
  3141. // null. It is an error if a field in this list has a non-empty value.
  3142. // This may be used to include null fields in Patch requests.
  3143. NullFields []string `json:"-"`
  3144. }
  3145. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  3146. type NoMethod AutoscalerListWarningData
  3147. raw := NoMethod(*s)
  3148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3149. }
  3150. type AutoscalerStatusDetails struct {
  3151. // Message: The status message.
  3152. Message string `json:"message,omitempty"`
  3153. // Type: The type of error returned.
  3154. //
  3155. // Possible values:
  3156. // "ALL_INSTANCES_UNHEALTHY"
  3157. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  3158. // "CAPPED_AT_MAX_NUM_REPLICAS"
  3159. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  3160. // "CUSTOM_METRIC_INVALID"
  3161. // "MIN_EQUALS_MAX"
  3162. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  3163. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  3164. // "MORE_THAN_ONE_BACKEND_SERVICE"
  3165. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  3166. // "REGION_RESOURCE_STOCKOUT"
  3167. // "SCALING_TARGET_DOES_NOT_EXIST"
  3168. // "UNKNOWN"
  3169. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  3170. // "ZONE_RESOURCE_STOCKOUT"
  3171. Type string `json:"type,omitempty"`
  3172. // ForceSendFields is a list of field names (e.g. "Message") to
  3173. // unconditionally include in API requests. By default, fields with
  3174. // empty values are omitted from API requests. However, any non-pointer,
  3175. // non-interface field appearing in ForceSendFields will be sent to the
  3176. // server regardless of whether the field is empty or not. This may be
  3177. // used to include empty fields in Patch requests.
  3178. ForceSendFields []string `json:"-"`
  3179. // NullFields is a list of field names (e.g. "Message") to include in
  3180. // API requests with the JSON null value. By default, fields with empty
  3181. // values are omitted from API requests. However, any field with an
  3182. // empty value appearing in NullFields will be sent to the server as
  3183. // null. It is an error if a field in this list has a non-empty value.
  3184. // This may be used to include null fields in Patch requests.
  3185. NullFields []string `json:"-"`
  3186. }
  3187. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  3188. type NoMethod AutoscalerStatusDetails
  3189. raw := NoMethod(*s)
  3190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3191. }
  3192. type AutoscalersScopedList struct {
  3193. // Autoscalers: [Output Only] A list of autoscalers contained in this
  3194. // scope.
  3195. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  3196. // Warning: [Output Only] Informational warning which replaces the list
  3197. // of autoscalers when the list is empty.
  3198. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  3199. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  3200. // unconditionally include in API requests. By default, fields with
  3201. // empty values are omitted from API requests. However, any non-pointer,
  3202. // non-interface field appearing in ForceSendFields will be sent to the
  3203. // server regardless of whether the field is empty or not. This may be
  3204. // used to include empty fields in Patch requests.
  3205. ForceSendFields []string `json:"-"`
  3206. // NullFields is a list of field names (e.g. "Autoscalers") to include
  3207. // in API requests with the JSON null value. By default, fields with
  3208. // empty values are omitted from API requests. However, any field with
  3209. // an empty value appearing in NullFields will be sent to the server as
  3210. // null. It is an error if a field in this list has a non-empty value.
  3211. // This may be used to include null fields in Patch requests.
  3212. NullFields []string `json:"-"`
  3213. }
  3214. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  3215. type NoMethod AutoscalersScopedList
  3216. raw := NoMethod(*s)
  3217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3218. }
  3219. // AutoscalersScopedListWarning: [Output Only] Informational warning
  3220. // which replaces the list of autoscalers when the list is empty.
  3221. type AutoscalersScopedListWarning struct {
  3222. // Code: [Output Only] A warning code, if applicable. For example,
  3223. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3224. // the response.
  3225. //
  3226. // Possible values:
  3227. // "CLEANUP_FAILED"
  3228. // "DEPRECATED_RESOURCE_USED"
  3229. // "DEPRECATED_TYPE_USED"
  3230. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3231. // "EXPERIMENTAL_TYPE_USED"
  3232. // "EXTERNAL_API_WARNING"
  3233. // "FIELD_VALUE_OVERRIDEN"
  3234. // "INJECTED_KERNELS_DEPRECATED"
  3235. // "MISSING_TYPE_DEPENDENCY"
  3236. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3237. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3238. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3239. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3240. // "NEXT_HOP_NOT_RUNNING"
  3241. // "NOT_CRITICAL_ERROR"
  3242. // "NO_RESULTS_ON_PAGE"
  3243. // "REQUIRED_TOS_AGREEMENT"
  3244. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3245. // "RESOURCE_NOT_DELETED"
  3246. // "SCHEMA_VALIDATION_IGNORED"
  3247. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3248. // "UNDECLARED_PROPERTIES"
  3249. // "UNREACHABLE"
  3250. Code string `json:"code,omitempty"`
  3251. // Data: [Output Only] Metadata about this warning in key: value format.
  3252. // For example:
  3253. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3254. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  3255. // Message: [Output Only] A human-readable description of the warning
  3256. // code.
  3257. Message string `json:"message,omitempty"`
  3258. // ForceSendFields is a list of field names (e.g. "Code") to
  3259. // unconditionally include in API requests. By default, fields with
  3260. // empty values are omitted from API requests. However, any non-pointer,
  3261. // non-interface field appearing in ForceSendFields will be sent to the
  3262. // server regardless of whether the field is empty or not. This may be
  3263. // used to include empty fields in Patch requests.
  3264. ForceSendFields []string `json:"-"`
  3265. // NullFields is a list of field names (e.g. "Code") to include in API
  3266. // requests with the JSON null value. By default, fields with empty
  3267. // values are omitted from API requests. However, any field with an
  3268. // empty value appearing in NullFields will be sent to the server as
  3269. // null. It is an error if a field in this list has a non-empty value.
  3270. // This may be used to include null fields in Patch requests.
  3271. NullFields []string `json:"-"`
  3272. }
  3273. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  3274. type NoMethod AutoscalersScopedListWarning
  3275. raw := NoMethod(*s)
  3276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3277. }
  3278. type AutoscalersScopedListWarningData struct {
  3279. // Key: [Output Only] A key that provides more detail on the warning
  3280. // being returned. For example, for warnings where there are no results
  3281. // in a list request for a particular zone, this key might be scope and
  3282. // the key value might be the zone name. Other examples might be a key
  3283. // indicating a deprecated resource and a suggested replacement, or a
  3284. // warning about invalid network settings (for example, if an instance
  3285. // attempts to perform IP forwarding but is not enabled for IP
  3286. // forwarding).
  3287. Key string `json:"key,omitempty"`
  3288. // Value: [Output Only] A warning data value corresponding to the key.
  3289. Value string `json:"value,omitempty"`
  3290. // ForceSendFields is a list of field names (e.g. "Key") to
  3291. // unconditionally include in API requests. By default, fields with
  3292. // empty values are omitted from API requests. However, any non-pointer,
  3293. // non-interface field appearing in ForceSendFields will be sent to the
  3294. // server regardless of whether the field is empty or not. This may be
  3295. // used to include empty fields in Patch requests.
  3296. ForceSendFields []string `json:"-"`
  3297. // NullFields is a list of field names (e.g. "Key") to include in API
  3298. // requests with the JSON null value. By default, fields with empty
  3299. // values are omitted from API requests. However, any field with an
  3300. // empty value appearing in NullFields will be sent to the server as
  3301. // null. It is an error if a field in this list has a non-empty value.
  3302. // This may be used to include null fields in Patch requests.
  3303. NullFields []string `json:"-"`
  3304. }
  3305. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3306. type NoMethod AutoscalersScopedListWarningData
  3307. raw := NoMethod(*s)
  3308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3309. }
  3310. // AutoscalingPolicy: Cloud Autoscaler policy.
  3311. type AutoscalingPolicy struct {
  3312. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  3313. // wait before it starts collecting information from a new instance.
  3314. // This prevents the autoscaler from collecting information when the
  3315. // instance is initializing, during which the collected usage would not
  3316. // be reliable. The default time autoscaler waits is 60
  3317. // seconds.
  3318. //
  3319. // Virtual machine initialization times might vary because of numerous
  3320. // factors. We recommend that you test how long an instance may take to
  3321. // initialize. To do this, create an instance and time the startup
  3322. // process.
  3323. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  3324. // CpuUtilization: Defines the CPU utilization policy that allows the
  3325. // autoscaler to scale based on the average CPU utilization of a managed
  3326. // instance group.
  3327. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  3328. // CustomMetricUtilizations: Configuration parameters of autoscaling
  3329. // based on a custom metric.
  3330. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  3331. // LoadBalancingUtilization: Configuration parameters of autoscaling
  3332. // based on load balancer.
  3333. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  3334. // MaxNumReplicas: The maximum number of instances that the autoscaler
  3335. // can scale up to. This is required when creating or updating an
  3336. // autoscaler. The maximum number of replicas should not be lower than
  3337. // minimal number of replicas.
  3338. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  3339. // MinNumReplicas: The minimum number of replicas that the autoscaler
  3340. // can scale down to. This cannot be less than 0. If not provided,
  3341. // autoscaler will choose a default value depending on maximum number of
  3342. // instances allowed.
  3343. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  3344. // Mode: Defines operating mode for this policy.
  3345. //
  3346. // Possible values:
  3347. // "OFF"
  3348. // "ON"
  3349. // "ONLY_DOWN"
  3350. // "ONLY_UP"
  3351. Mode string `json:"mode,omitempty"`
  3352. // QueueBasedScaling: Configuration parameters of autoscaling based on
  3353. // queuing system.
  3354. QueueBasedScaling *AutoscalingPolicyQueueBasedScaling `json:"queueBasedScaling,omitempty"`
  3355. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  3356. // to unconditionally include in API requests. By default, fields with
  3357. // empty values are omitted from API requests. However, any non-pointer,
  3358. // non-interface field appearing in ForceSendFields will be sent to the
  3359. // server regardless of whether the field is empty or not. This may be
  3360. // used to include empty fields in Patch requests.
  3361. ForceSendFields []string `json:"-"`
  3362. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  3363. // include in API requests with the JSON null value. By default, fields
  3364. // with empty values are omitted from API requests. However, any field
  3365. // with an empty value appearing in NullFields will be sent to the
  3366. // server as null. It is an error if a field in this list has a
  3367. // non-empty value. This may be used to include null fields in Patch
  3368. // requests.
  3369. NullFields []string `json:"-"`
  3370. }
  3371. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  3372. type NoMethod AutoscalingPolicy
  3373. raw := NoMethod(*s)
  3374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3375. }
  3376. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  3377. type AutoscalingPolicyCpuUtilization struct {
  3378. // UtilizationTarget: The target CPU utilization that the autoscaler
  3379. // should maintain. Must be a float value in the range (0, 1]. If not
  3380. // specified, the default is 0.6.
  3381. //
  3382. // If the CPU level is below the target utilization, the autoscaler
  3383. // scales down the number of instances until it reaches the minimum
  3384. // number of instances you specified or until the average CPU of your
  3385. // instances reaches the target utilization.
  3386. //
  3387. // If the average CPU is above the target utilization, the autoscaler
  3388. // scales up until it reaches the maximum number of instances you
  3389. // specified or until the average utilization reaches the target
  3390. // utilization.
  3391. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3392. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3393. // to unconditionally include in API requests. By default, fields with
  3394. // empty values are omitted from API requests. However, any non-pointer,
  3395. // non-interface field appearing in ForceSendFields will be sent to the
  3396. // server regardless of whether the field is empty or not. This may be
  3397. // used to include empty fields in Patch requests.
  3398. ForceSendFields []string `json:"-"`
  3399. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3400. // include in API requests with the JSON null value. By default, fields
  3401. // with empty values are omitted from API requests. However, any field
  3402. // with an empty value appearing in NullFields will be sent to the
  3403. // server as null. It is an error if a field in this list has a
  3404. // non-empty value. This may be used to include null fields in Patch
  3405. // requests.
  3406. NullFields []string `json:"-"`
  3407. }
  3408. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  3409. type NoMethod AutoscalingPolicyCpuUtilization
  3410. raw := NoMethod(*s)
  3411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3412. }
  3413. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  3414. type NoMethod AutoscalingPolicyCpuUtilization
  3415. var s1 struct {
  3416. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3417. *NoMethod
  3418. }
  3419. s1.NoMethod = (*NoMethod)(s)
  3420. if err := json.Unmarshal(data, &s1); err != nil {
  3421. return err
  3422. }
  3423. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3424. return nil
  3425. }
  3426. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  3427. // policy.
  3428. type AutoscalingPolicyCustomMetricUtilization struct {
  3429. // Filter: A filter string, compatible with a Stackdriver Monitoring
  3430. // filter string for TimeSeries.list API call. This filter is used to
  3431. // select a specific TimeSeries for the purpose of autoscaling and to
  3432. // determine whether the metric is exporting per-instance or per-group
  3433. // data.
  3434. //
  3435. // For the filter to be valid for autoscaling purposes, the following
  3436. // rules apply:
  3437. // - You can only use the AND operator for joining selectors.
  3438. // - You can only use direct equality comparison operator (=) without
  3439. // any functions for each selector.
  3440. // - You can specify the metric in both the filter string and in the
  3441. // metric field. However, if specified in both places, the metric must
  3442. // be identical.
  3443. // - The monitored resource type determines what kind of values are
  3444. // expected for the metric. If it is a gce_instance, the autoscaler
  3445. // expects the metric to include a separate TimeSeries for each instance
  3446. // in a group. In such a case, you cannot filter on resource labels.
  3447. // If the resource type is any other value, the autoscaler expects this
  3448. // metric to contain values that apply to the entire autoscaled instance
  3449. // group and resource label filtering can be performed to point
  3450. // autoscaler at the correct TimeSeries to scale upon. This is called a
  3451. // per-group metric for the purpose of autoscaling.
  3452. //
  3453. // If not specified, the type defaults to gce_instance.
  3454. //
  3455. // You should provide a filter that is selective enough to pick just one
  3456. // TimeSeries for the autoscaled group or for each of the instances (if
  3457. // you are using gce_instance resource type). If multiple TimeSeries are
  3458. // returned upon the query execution, the autoscaler will sum their
  3459. // respective values to obtain its scaling value.
  3460. Filter string `json:"filter,omitempty"`
  3461. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  3462. // The metric cannot have negative values.
  3463. //
  3464. // The metric must have a value type of INT64 or DOUBLE.
  3465. Metric string `json:"metric,omitempty"`
  3466. // SingleInstanceAssignment: If scaling is based on a per-group metric
  3467. // value that represents the total amount of work to be done or resource
  3468. // usage, set this value to an amount assigned for a single instance of
  3469. // the scaled group. Autoscaler will keep the number of instances
  3470. // proportional to the value of this metric, the metric itself should
  3471. // not change value due to group resizing.
  3472. //
  3473. // A good metric to use with the target is for example
  3474. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  3475. // custom metric exporting the total number of requests coming to your
  3476. // instances.
  3477. //
  3478. // A bad example would be a metric exporting an average or median
  3479. // latency, since this value can't include a chunk assignable to a
  3480. // single instance, it could be better used with utilization_target
  3481. // instead.
  3482. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  3483. // UtilizationTarget: The target value of the metric that autoscaler
  3484. // should maintain. This must be a positive value. A utilization metric
  3485. // scales number of virtual machines handling requests to increase or
  3486. // decrease proportionally to the metric.
  3487. //
  3488. // For example, a good metric to use as a utilization_target is
  3489. // compute.googleapis.com/instance/network/received_bytes_count. The
  3490. // autoscaler will work to keep this value constant for each of the
  3491. // instances.
  3492. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3493. // UtilizationTargetType: Defines how target utilization value is
  3494. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  3495. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  3496. //
  3497. // Possible values:
  3498. // "DELTA_PER_MINUTE"
  3499. // "DELTA_PER_SECOND"
  3500. // "GAUGE"
  3501. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  3502. // ForceSendFields is a list of field names (e.g. "Filter") to
  3503. // unconditionally include in API requests. By default, fields with
  3504. // empty values are omitted from API requests. However, any non-pointer,
  3505. // non-interface field appearing in ForceSendFields will be sent to the
  3506. // server regardless of whether the field is empty or not. This may be
  3507. // used to include empty fields in Patch requests.
  3508. ForceSendFields []string `json:"-"`
  3509. // NullFields is a list of field names (e.g. "Filter") to include in API
  3510. // requests with the JSON null value. By default, fields with empty
  3511. // values are omitted from API requests. However, any field with an
  3512. // empty value appearing in NullFields will be sent to the server as
  3513. // null. It is an error if a field in this list has a non-empty value.
  3514. // This may be used to include null fields in Patch requests.
  3515. NullFields []string `json:"-"`
  3516. }
  3517. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  3518. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3519. raw := NoMethod(*s)
  3520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3521. }
  3522. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  3523. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3524. var s1 struct {
  3525. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  3526. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3527. *NoMethod
  3528. }
  3529. s1.NoMethod = (*NoMethod)(s)
  3530. if err := json.Unmarshal(data, &s1); err != nil {
  3531. return err
  3532. }
  3533. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  3534. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3535. return nil
  3536. }
  3537. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  3538. // of autoscaling based on load balancing.
  3539. type AutoscalingPolicyLoadBalancingUtilization struct {
  3540. // UtilizationTarget: Fraction of backend capacity utilization (set in
  3541. // HTTP(s) load balancing configuration) that autoscaler should
  3542. // maintain. Must be a positive float value. If not defined, the default
  3543. // is 0.8.
  3544. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3545. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3546. // to unconditionally include in API requests. By default, fields with
  3547. // empty values are omitted from API requests. However, any non-pointer,
  3548. // non-interface field appearing in ForceSendFields will be sent to the
  3549. // server regardless of whether the field is empty or not. This may be
  3550. // used to include empty fields in Patch requests.
  3551. ForceSendFields []string `json:"-"`
  3552. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3553. // include in API requests with the JSON null value. By default, fields
  3554. // with empty values are omitted from API requests. However, any field
  3555. // with an empty value appearing in NullFields will be sent to the
  3556. // server as null. It is an error if a field in this list has a
  3557. // non-empty value. This may be used to include null fields in Patch
  3558. // requests.
  3559. NullFields []string `json:"-"`
  3560. }
  3561. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  3562. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3563. raw := NoMethod(*s)
  3564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3565. }
  3566. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  3567. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3568. var s1 struct {
  3569. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3570. *NoMethod
  3571. }
  3572. s1.NoMethod = (*NoMethod)(s)
  3573. if err := json.Unmarshal(data, &s1); err != nil {
  3574. return err
  3575. }
  3576. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3577. return nil
  3578. }
  3579. // AutoscalingPolicyQueueBasedScaling: Configuration parameters of
  3580. // autoscaling based on queuing system.
  3581. type AutoscalingPolicyQueueBasedScaling struct {
  3582. // AcceptableBacklogPerInstance: Scaling based on the average number of
  3583. // tasks in the queue per each active instance. The autoscaler keeps the
  3584. // average number of tasks per instance below this number, based on data
  3585. // collected in the last couple of minutes. The autoscaler will also
  3586. // take into account incoming tasks when calculating when to scale.
  3587. AcceptableBacklogPerInstance float64 `json:"acceptableBacklogPerInstance,omitempty"`
  3588. // CloudPubSub: Configuration for Cloud Pub/Sub subscription queue.
  3589. CloudPubSub *AutoscalingPolicyQueueBasedScalingCloudPubSub `json:"cloudPubSub,omitempty"`
  3590. // SingleWorkerThroughputPerSec: The scaling algorithm will also
  3591. // calculate throughput estimates on its own; if you explicitly provide
  3592. // this value, the autoscaler will take into account your value as well
  3593. // as automatic estimates when deciding how to scale.
  3594. SingleWorkerThroughputPerSec float64 `json:"singleWorkerThroughputPerSec,omitempty"`
  3595. // ForceSendFields is a list of field names (e.g.
  3596. // "AcceptableBacklogPerInstance") to unconditionally include in API
  3597. // requests. By default, fields with empty values are omitted from API
  3598. // requests. However, any non-pointer, non-interface field appearing in
  3599. // ForceSendFields will be sent to the server regardless of whether the
  3600. // field is empty or not. This may be used to include empty fields in
  3601. // Patch requests.
  3602. ForceSendFields []string `json:"-"`
  3603. // NullFields is a list of field names (e.g.
  3604. // "AcceptableBacklogPerInstance") to include in API requests with the
  3605. // JSON null value. By default, fields with empty values are omitted
  3606. // from API requests. However, any field with an empty value appearing
  3607. // in NullFields will be sent to the server as null. It is an error if a
  3608. // field in this list has a non-empty value. This may be used to include
  3609. // null fields in Patch requests.
  3610. NullFields []string `json:"-"`
  3611. }
  3612. func (s *AutoscalingPolicyQueueBasedScaling) MarshalJSON() ([]byte, error) {
  3613. type NoMethod AutoscalingPolicyQueueBasedScaling
  3614. raw := NoMethod(*s)
  3615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3616. }
  3617. func (s *AutoscalingPolicyQueueBasedScaling) UnmarshalJSON(data []byte) error {
  3618. type NoMethod AutoscalingPolicyQueueBasedScaling
  3619. var s1 struct {
  3620. AcceptableBacklogPerInstance gensupport.JSONFloat64 `json:"acceptableBacklogPerInstance"`
  3621. SingleWorkerThroughputPerSec gensupport.JSONFloat64 `json:"singleWorkerThroughputPerSec"`
  3622. *NoMethod
  3623. }
  3624. s1.NoMethod = (*NoMethod)(s)
  3625. if err := json.Unmarshal(data, &s1); err != nil {
  3626. return err
  3627. }
  3628. s.AcceptableBacklogPerInstance = float64(s1.AcceptableBacklogPerInstance)
  3629. s.SingleWorkerThroughputPerSec = float64(s1.SingleWorkerThroughputPerSec)
  3630. return nil
  3631. }
  3632. // AutoscalingPolicyQueueBasedScalingCloudPubSub: Configuration
  3633. // parameters for scaling based on Cloud Pub/Sub subscription queue.
  3634. type AutoscalingPolicyQueueBasedScalingCloudPubSub struct {
  3635. // Subscription: Cloud Pub/Sub subscription used for scaling. Provide
  3636. // the partial URL (starting with projects/) or just the subscription
  3637. // name. The subscription must be assigned to the topic specified in
  3638. // topicName and must be in a pull configuration. The subscription must
  3639. // belong to the same project as the Autoscaler.
  3640. Subscription string `json:"subscription,omitempty"`
  3641. // Topic: Cloud Pub/Sub topic used for scaling. Provide the partial URL
  3642. // or partial URL (starting with projects/) or just the topic name. The
  3643. // topic must belong to the same project as the Autoscaler resource.
  3644. Topic string `json:"topic,omitempty"`
  3645. // ForceSendFields is a list of field names (e.g. "Subscription") to
  3646. // unconditionally include in API requests. By default, fields with
  3647. // empty values are omitted from API requests. However, any non-pointer,
  3648. // non-interface field appearing in ForceSendFields will be sent to the
  3649. // server regardless of whether the field is empty or not. This may be
  3650. // used to include empty fields in Patch requests.
  3651. ForceSendFields []string `json:"-"`
  3652. // NullFields is a list of field names (e.g. "Subscription") to include
  3653. // in API requests with the JSON null value. By default, fields with
  3654. // empty values are omitted from API requests. However, any field with
  3655. // an empty value appearing in NullFields will be sent to the server as
  3656. // null. It is an error if a field in this list has a non-empty value.
  3657. // This may be used to include null fields in Patch requests.
  3658. NullFields []string `json:"-"`
  3659. }
  3660. func (s *AutoscalingPolicyQueueBasedScalingCloudPubSub) MarshalJSON() ([]byte, error) {
  3661. type NoMethod AutoscalingPolicyQueueBasedScalingCloudPubSub
  3662. raw := NoMethod(*s)
  3663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3664. }
  3665. // Backend: Message containing information of one individual backend.
  3666. type Backend struct {
  3667. // BalancingMode: Specifies the balancing mode for this backend. For
  3668. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3669. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3670. // TCP/SSL).
  3671. //
  3672. // For Internal Load Balancing, the default and only supported mode is
  3673. // CONNECTION.
  3674. //
  3675. // Possible values:
  3676. // "CONNECTION"
  3677. // "RATE"
  3678. // "UTILIZATION"
  3679. BalancingMode string `json:"balancingMode,omitempty"`
  3680. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3681. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3682. // 1, which means the group will serve up to 100% of its configured
  3683. // capacity (depending on balancingMode). A setting of 0 means the group
  3684. // is completely drained, offering 0% of its available Capacity. Valid
  3685. // range is [0.0,1.0].
  3686. //
  3687. // This cannot be used for internal load balancing.
  3688. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3689. // Description: An optional description of this resource. Provide this
  3690. // property when you create the resource.
  3691. Description string `json:"description,omitempty"`
  3692. // Failover: This field designates whether this is a failover backend.
  3693. // More than one failover backend can be configured for a given
  3694. // BackendService.
  3695. Failover bool `json:"failover,omitempty"`
  3696. // Group: The fully-qualified URL of an Instance Group or Network
  3697. // Endpoint Group resource. In case of instance group this defines the
  3698. // list of instances that serve traffic. Member virtual machine
  3699. // instances from each instance group must live in the same zone as the
  3700. // instance group itself. No two backends in a backend service are
  3701. // allowed to use same Instance Group resource.
  3702. //
  3703. // For Network Endpoint Groups this defines list of endpoints. All
  3704. // endpoints of Network Endpoint Group must be hosted on instances
  3705. // located in the same zone as the Network Endpoint Group.
  3706. //
  3707. // Backend service can not contain mix of Instance Group and Network
  3708. // Endpoint Group backends.
  3709. //
  3710. // Note that you must specify an Instance Group or Network Endpoint
  3711. // Group resource using the fully-qualified URL, rather than a partial
  3712. // URL.
  3713. //
  3714. // When the BackendService has load balancing scheme INTERNAL, the
  3715. // instance group must be within the same region as the BackendService.
  3716. // Network Endpoint Groups are not supported for INTERNAL load balancing
  3717. // scheme.
  3718. Group string `json:"group,omitempty"`
  3719. // MaxConnections: The max number of simultaneous connections for the
  3720. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3721. // modes. For CONNECTION mode, either maxConnections or
  3722. // maxConnectionsPerInstance must be set.
  3723. //
  3724. // This cannot be used for internal load balancing.
  3725. MaxConnections int64 `json:"maxConnections,omitempty"`
  3726. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3727. // that a single backend network endpoint can handle. This is used to
  3728. // calculate the capacity of the group. Can be used in either CONNECTION
  3729. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3730. // maxConnections or maxConnectionsPerEndpoint must be set.
  3731. //
  3732. // This cannot be used for internal load balancing.
  3733. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3734. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3735. // that a single backend instance can handle. This is used to calculate
  3736. // the capacity of the group. Can be used in either CONNECTION or
  3737. // UTILIZATION balancing modes. For CONNECTION mode, either
  3738. // maxConnections or maxConnectionsPerInstance must be set.
  3739. //
  3740. // This cannot be used for internal load balancing.
  3741. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3742. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3743. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3744. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3745. // set.
  3746. //
  3747. // This cannot be used for internal load balancing.
  3748. MaxRate int64 `json:"maxRate,omitempty"`
  3749. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3750. // backend network endpoint can handle. This is used to calculate the
  3751. // capacity of the group. Can be used in either balancing mode. For RATE
  3752. // mode, either maxRate or maxRatePerEndpoint must be set.
  3753. //
  3754. // This cannot be used for internal load balancing.
  3755. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3756. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3757. // backend instance can handle. This is used to calculate the capacity
  3758. // of the group. Can be used in either balancing mode. For RATE mode,
  3759. // either maxRate or maxRatePerInstance must be set.
  3760. //
  3761. // This cannot be used for internal load balancing.
  3762. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3763. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3764. // defines the CPU utilization target for the group. The default is 0.8.
  3765. // Valid range is [0.0, 1.0].
  3766. //
  3767. // This cannot be used for internal load balancing.
  3768. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3769. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3770. // unconditionally include in API requests. By default, fields with
  3771. // empty values are omitted from API requests. However, any non-pointer,
  3772. // non-interface field appearing in ForceSendFields will be sent to the
  3773. // server regardless of whether the field is empty or not. This may be
  3774. // used to include empty fields in Patch requests.
  3775. ForceSendFields []string `json:"-"`
  3776. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3777. // in API requests with the JSON null value. By default, fields with
  3778. // empty values are omitted from API requests. However, any field with
  3779. // an empty value appearing in NullFields will be sent to the server as
  3780. // null. It is an error if a field in this list has a non-empty value.
  3781. // This may be used to include null fields in Patch requests.
  3782. NullFields []string `json:"-"`
  3783. }
  3784. func (s *Backend) MarshalJSON() ([]byte, error) {
  3785. type NoMethod Backend
  3786. raw := NoMethod(*s)
  3787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3788. }
  3789. func (s *Backend) UnmarshalJSON(data []byte) error {
  3790. type NoMethod Backend
  3791. var s1 struct {
  3792. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3793. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3794. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3795. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3796. *NoMethod
  3797. }
  3798. s1.NoMethod = (*NoMethod)(s)
  3799. if err := json.Unmarshal(data, &s1); err != nil {
  3800. return err
  3801. }
  3802. s.CapacityScaler = float64(s1.CapacityScaler)
  3803. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3804. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3805. s.MaxUtilization = float64(s1.MaxUtilization)
  3806. return nil
  3807. }
  3808. // BackendBucket: A BackendBucket resource. This resource defines a
  3809. // Cloud Storage bucket.
  3810. type BackendBucket struct {
  3811. // BucketName: Cloud Storage bucket name.
  3812. BucketName string `json:"bucketName,omitempty"`
  3813. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  3814. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  3815. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3816. // format.
  3817. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3818. // Description: An optional textual description of the resource;
  3819. // provided by the client when the resource is created.
  3820. Description string `json:"description,omitempty"`
  3821. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  3822. EnableCdn bool `json:"enableCdn,omitempty"`
  3823. // Id: [Output Only] Unique identifier for the resource; defined by the
  3824. // server.
  3825. Id uint64 `json:"id,omitempty,string"`
  3826. // Kind: Type of the resource.
  3827. Kind string `json:"kind,omitempty"`
  3828. // Name: Name of the resource. Provided by the client when the resource
  3829. // is created. The name must be 1-63 characters long, and comply with
  3830. // RFC1035. Specifically, the name must be 1-63 characters long and
  3831. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3832. // the first character must be a lowercase letter, and all following
  3833. // characters must be a dash, lowercase letter, or digit, except the
  3834. // last character, which cannot be a dash.
  3835. Name string `json:"name,omitempty"`
  3836. // SelfLink: [Output Only] Server-defined URL for the resource.
  3837. SelfLink string `json:"selfLink,omitempty"`
  3838. // ServerResponse contains the HTTP response code and headers from the
  3839. // server.
  3840. googleapi.ServerResponse `json:"-"`
  3841. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3842. // unconditionally include in API requests. By default, fields with
  3843. // empty values are omitted from API requests. However, any non-pointer,
  3844. // non-interface field appearing in ForceSendFields will be sent to the
  3845. // server regardless of whether the field is empty or not. This may be
  3846. // used to include empty fields in Patch requests.
  3847. ForceSendFields []string `json:"-"`
  3848. // NullFields is a list of field names (e.g. "BucketName") to include in
  3849. // API requests with the JSON null value. By default, fields with empty
  3850. // values are omitted from API requests. However, any field with an
  3851. // empty value appearing in NullFields will be sent to the server as
  3852. // null. It is an error if a field in this list has a non-empty value.
  3853. // This may be used to include null fields in Patch requests.
  3854. NullFields []string `json:"-"`
  3855. }
  3856. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3857. type NoMethod BackendBucket
  3858. raw := NoMethod(*s)
  3859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3860. }
  3861. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3862. // for a backend bucket.
  3863. type BackendBucketCdnPolicy struct {
  3864. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3865. // signed URL request will be considered fresh. After this time period,
  3866. // the response will be revalidated before being served. Defaults to 1hr
  3867. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3868. // will internally behave as though all responses from this backend had
  3869. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3870. // existing Cache-Control header. The actual headers served in responses
  3871. // will not be altered.
  3872. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3873. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3874. // request URLs.
  3875. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3876. // ForceSendFields is a list of field names (e.g.
  3877. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3878. // requests. By default, fields with empty values are omitted from API
  3879. // requests. However, any non-pointer, non-interface field appearing in
  3880. // ForceSendFields will be sent to the server regardless of whether the
  3881. // field is empty or not. This may be used to include empty fields in
  3882. // Patch requests.
  3883. ForceSendFields []string `json:"-"`
  3884. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3885. // to include in API requests with the JSON null value. By default,
  3886. // fields with empty values are omitted from API requests. However, any
  3887. // field with an empty value appearing in NullFields will be sent to the
  3888. // server as null. It is an error if a field in this list has a
  3889. // non-empty value. This may be used to include null fields in Patch
  3890. // requests.
  3891. NullFields []string `json:"-"`
  3892. }
  3893. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3894. type NoMethod BackendBucketCdnPolicy
  3895. raw := NoMethod(*s)
  3896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3897. }
  3898. // BackendBucketList: Contains a list of BackendBucket resources.
  3899. type BackendBucketList struct {
  3900. // Id: [Output Only] Unique identifier for the resource; defined by the
  3901. // server.
  3902. Id string `json:"id,omitempty"`
  3903. // Items: A list of BackendBucket resources.
  3904. Items []*BackendBucket `json:"items,omitempty"`
  3905. // Kind: Type of resource.
  3906. Kind string `json:"kind,omitempty"`
  3907. // NextPageToken: [Output Only] This token allows you to get the next
  3908. // page of results for list requests. If the number of results is larger
  3909. // than maxResults, use the nextPageToken as a value for the query
  3910. // parameter pageToken in the next list request. Subsequent list
  3911. // requests will have their own nextPageToken to continue paging through
  3912. // the results.
  3913. NextPageToken string `json:"nextPageToken,omitempty"`
  3914. // SelfLink: [Output Only] Server-defined URL for this resource.
  3915. SelfLink string `json:"selfLink,omitempty"`
  3916. // Warning: [Output Only] Informational warning message.
  3917. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3918. // ServerResponse contains the HTTP response code and headers from the
  3919. // server.
  3920. googleapi.ServerResponse `json:"-"`
  3921. // ForceSendFields is a list of field names (e.g. "Id") to
  3922. // unconditionally include in API requests. By default, fields with
  3923. // empty values are omitted from API requests. However, any non-pointer,
  3924. // non-interface field appearing in ForceSendFields will be sent to the
  3925. // server regardless of whether the field is empty or not. This may be
  3926. // used to include empty fields in Patch requests.
  3927. ForceSendFields []string `json:"-"`
  3928. // NullFields is a list of field names (e.g. "Id") to include in API
  3929. // requests with the JSON null value. By default, fields with empty
  3930. // values are omitted from API requests. However, any field with an
  3931. // empty value appearing in NullFields will be sent to the server as
  3932. // null. It is an error if a field in this list has a non-empty value.
  3933. // This may be used to include null fields in Patch requests.
  3934. NullFields []string `json:"-"`
  3935. }
  3936. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3937. type NoMethod BackendBucketList
  3938. raw := NoMethod(*s)
  3939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3940. }
  3941. // BackendBucketListWarning: [Output Only] Informational warning
  3942. // message.
  3943. type BackendBucketListWarning struct {
  3944. // Code: [Output Only] A warning code, if applicable. For example,
  3945. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3946. // the response.
  3947. //
  3948. // Possible values:
  3949. // "CLEANUP_FAILED"
  3950. // "DEPRECATED_RESOURCE_USED"
  3951. // "DEPRECATED_TYPE_USED"
  3952. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3953. // "EXPERIMENTAL_TYPE_USED"
  3954. // "EXTERNAL_API_WARNING"
  3955. // "FIELD_VALUE_OVERRIDEN"
  3956. // "INJECTED_KERNELS_DEPRECATED"
  3957. // "MISSING_TYPE_DEPENDENCY"
  3958. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3959. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3960. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3961. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3962. // "NEXT_HOP_NOT_RUNNING"
  3963. // "NOT_CRITICAL_ERROR"
  3964. // "NO_RESULTS_ON_PAGE"
  3965. // "REQUIRED_TOS_AGREEMENT"
  3966. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3967. // "RESOURCE_NOT_DELETED"
  3968. // "SCHEMA_VALIDATION_IGNORED"
  3969. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3970. // "UNDECLARED_PROPERTIES"
  3971. // "UNREACHABLE"
  3972. Code string `json:"code,omitempty"`
  3973. // Data: [Output Only] Metadata about this warning in key: value format.
  3974. // For example:
  3975. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3976. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3977. // Message: [Output Only] A human-readable description of the warning
  3978. // code.
  3979. Message string `json:"message,omitempty"`
  3980. // ForceSendFields is a list of field names (e.g. "Code") to
  3981. // unconditionally include in API requests. By default, fields with
  3982. // empty values are omitted from API requests. However, any non-pointer,
  3983. // non-interface field appearing in ForceSendFields will be sent to the
  3984. // server regardless of whether the field is empty or not. This may be
  3985. // used to include empty fields in Patch requests.
  3986. ForceSendFields []string `json:"-"`
  3987. // NullFields is a list of field names (e.g. "Code") to include in API
  3988. // requests with the JSON null value. By default, fields with empty
  3989. // values are omitted from API requests. However, any field with an
  3990. // empty value appearing in NullFields will be sent to the server as
  3991. // null. It is an error if a field in this list has a non-empty value.
  3992. // This may be used to include null fields in Patch requests.
  3993. NullFields []string `json:"-"`
  3994. }
  3995. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3996. type NoMethod BackendBucketListWarning
  3997. raw := NoMethod(*s)
  3998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3999. }
  4000. type BackendBucketListWarningData struct {
  4001. // Key: [Output Only] A key that provides more detail on the warning
  4002. // being returned. For example, for warnings where there are no results
  4003. // in a list request for a particular zone, this key might be scope and
  4004. // the key value might be the zone name. Other examples might be a key
  4005. // indicating a deprecated resource and a suggested replacement, or a
  4006. // warning about invalid network settings (for example, if an instance
  4007. // attempts to perform IP forwarding but is not enabled for IP
  4008. // forwarding).
  4009. Key string `json:"key,omitempty"`
  4010. // Value: [Output Only] A warning data value corresponding to the key.
  4011. Value string `json:"value,omitempty"`
  4012. // ForceSendFields is a list of field names (e.g. "Key") to
  4013. // unconditionally include in API requests. By default, fields with
  4014. // empty values are omitted from API requests. However, any non-pointer,
  4015. // non-interface field appearing in ForceSendFields will be sent to the
  4016. // server regardless of whether the field is empty or not. This may be
  4017. // used to include empty fields in Patch requests.
  4018. ForceSendFields []string `json:"-"`
  4019. // NullFields is a list of field names (e.g. "Key") to include in API
  4020. // requests with the JSON null value. By default, fields with empty
  4021. // values are omitted from API requests. However, any field with an
  4022. // empty value appearing in NullFields will be sent to the server as
  4023. // null. It is an error if a field in this list has a non-empty value.
  4024. // This may be used to include null fields in Patch requests.
  4025. NullFields []string `json:"-"`
  4026. }
  4027. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  4028. type NoMethod BackendBucketListWarningData
  4029. raw := NoMethod(*s)
  4030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4031. }
  4032. // BackendService: A BackendService resource. This resource defines a
  4033. // group of backend virtual machines and their serving capacity. (==
  4034. // resource_for v1.backendService ==) (== resource_for
  4035. // beta.backendService ==)
  4036. type BackendService struct {
  4037. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  4038. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  4039. // non-persistent and lasts only until the end of the browser session
  4040. // (or equivalent). The maximum allowed value for TTL is one day.
  4041. //
  4042. // When the load balancing scheme is INTERNAL, this field is not used.
  4043. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  4044. // AppEngineBackend: Directs request to an App Engine app.
  4045. // cloudFunctionBackend and backends[] must be empty if this is set.
  4046. AppEngineBackend *BackendServiceAppEngineBackend `json:"appEngineBackend,omitempty"`
  4047. // Backends: The list of backends that serve this BackendService.
  4048. Backends []*Backend `json:"backends,omitempty"`
  4049. // CdnPolicy: Cloud CDN configuration for this BackendService.
  4050. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  4051. // CloudFunctionBackend: Directs request to a cloud function.
  4052. // appEngineBackend and backends[] must be empty if this is set.
  4053. CloudFunctionBackend *BackendServiceCloudFunctionBackend `json:"cloudFunctionBackend,omitempty"`
  4054. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  4055. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4056. // format.
  4057. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4058. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  4059. // add to proxied requests.
  4060. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  4061. // Description: An optional description of this resource. Provide this
  4062. // property when you create the resource.
  4063. Description string `json:"description,omitempty"`
  4064. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  4065. //
  4066. // When the load balancing scheme is INTERNAL, this field is not used.
  4067. EnableCDN bool `json:"enableCDN,omitempty"`
  4068. FailoverPolicy *BackendServiceFailoverPolicy `json:"failoverPolicy,omitempty"`
  4069. // Fingerprint: Fingerprint of this resource. A hash of the contents
  4070. // stored in this object. This field is used in optimistic locking. This
  4071. // field will be ignored when inserting a BackendService. An up-to-date
  4072. // fingerprint must be provided in order to update the BackendService,
  4073. // otherwise the request will fail with error 412 conditionNotMet.
  4074. //
  4075. // To see the latest fingerprint, make a get() request to retrieve a
  4076. // BackendService.
  4077. Fingerprint string `json:"fingerprint,omitempty"`
  4078. // HealthChecks: The list of URLs to the HttpHealthCheck or
  4079. // HttpsHealthCheck resource for health checking this BackendService.
  4080. // Currently at most one health check can be specified, and a health
  4081. // check is required for Compute Engine backend services. A health check
  4082. // must not be specified for App Engine backend and Cloud Function
  4083. // backend.
  4084. //
  4085. // For internal load balancing, a URL to a HealthCheck resource must be
  4086. // specified instead.
  4087. HealthChecks []string `json:"healthChecks,omitempty"`
  4088. Iap *BackendServiceIAP `json:"iap,omitempty"`
  4089. // Id: [Output Only] The unique identifier for the resource. This
  4090. // identifier is defined by the server.
  4091. Id uint64 `json:"id,omitempty,string"`
  4092. // Kind: [Output Only] Type of resource. Always compute#backendService
  4093. // for backend services.
  4094. Kind string `json:"kind,omitempty"`
  4095. // LoadBalancingScheme: Indicates whether the backend service will be
  4096. // used with internal or external load balancing. A backend service
  4097. // created for one type of load balancing cannot be used with the other.
  4098. // Possible values are INTERNAL and EXTERNAL.
  4099. //
  4100. // Possible values:
  4101. // "EXTERNAL"
  4102. // "INTERNAL"
  4103. // "INTERNAL_MANAGED"
  4104. // "INTERNAL_SELF_MANAGED"
  4105. // "INVALID_LOAD_BALANCING_SCHEME"
  4106. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  4107. // LogConfig: This field denotes the logging options for the load
  4108. // balancer traffic served by this backend service. If logging is
  4109. // enabled, logs will be exported to Stackdriver.
  4110. LogConfig *BackendServiceLogConfig `json:"logConfig,omitempty"`
  4111. // Name: Name of the resource. Provided by the client when the resource
  4112. // is created. The name must be 1-63 characters long, and comply with
  4113. // RFC1035. Specifically, the name must be 1-63 characters long and
  4114. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4115. // the first character must be a lowercase letter, and all following
  4116. // characters must be a dash, lowercase letter, or digit, except the
  4117. // last character, which cannot be a dash.
  4118. Name string `json:"name,omitempty"`
  4119. // Port: Deprecated in favor of portName. The TCP port to connect on the
  4120. // backend. The default value is 80.
  4121. //
  4122. // This cannot be used for internal load balancing.
  4123. Port int64 `json:"port,omitempty"`
  4124. // PortName: Name of backend port. The same name should appear in the
  4125. // instance groups referenced by this service. Required when the load
  4126. // balancing scheme is EXTERNAL.
  4127. //
  4128. // When the load balancing scheme is INTERNAL, this field is not used.
  4129. PortName string `json:"portName,omitempty"`
  4130. // Protocol: The protocol this BackendService uses to communicate with
  4131. // backends.
  4132. //
  4133. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  4134. // HTTP.
  4135. //
  4136. // For internal load balancing, the possible values are TCP and UDP, and
  4137. // the default is TCP.
  4138. //
  4139. // Possible values:
  4140. // "HTTP"
  4141. // "HTTP2"
  4142. // "HTTPS"
  4143. // "SSL"
  4144. // "TCP"
  4145. // "UDP"
  4146. Protocol string `json:"protocol,omitempty"`
  4147. // Region: [Output Only] URL of the region where the regional backend
  4148. // service resides. This field is not applicable to global backend
  4149. // services. You must specify this field as part of the HTTP request
  4150. // URL. It is not settable as a field in the request body.
  4151. Region string `json:"region,omitempty"`
  4152. // SecurityPolicy: [Output Only] The resource URL for the security
  4153. // policy associated with this backend service.
  4154. SecurityPolicy string `json:"securityPolicy,omitempty"`
  4155. // SelfLink: [Output Only] Server-defined URL for the resource.
  4156. SelfLink string `json:"selfLink,omitempty"`
  4157. // SessionAffinity: Type of session affinity to use. The default is
  4158. // NONE.
  4159. //
  4160. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  4161. // or GENERATED_COOKIE.
  4162. //
  4163. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  4164. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  4165. //
  4166. // When the protocol is UDP, this field is not used.
  4167. //
  4168. // Possible values:
  4169. // "CLIENT_IP"
  4170. // "CLIENT_IP_PORT_PROTO"
  4171. // "CLIENT_IP_PROTO"
  4172. // "GENERATED_COOKIE"
  4173. // "NONE"
  4174. SessionAffinity string `json:"sessionAffinity,omitempty"`
  4175. // TimeoutSec: How many seconds to wait for the backend before
  4176. // considering it a failed request. Default is 30 seconds.
  4177. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  4178. // ServerResponse contains the HTTP response code and headers from the
  4179. // server.
  4180. googleapi.ServerResponse `json:"-"`
  4181. // ForceSendFields is a list of field names (e.g.
  4182. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  4183. // By default, fields with empty values are omitted from API requests.
  4184. // However, any non-pointer, non-interface field appearing in
  4185. // ForceSendFields will be sent to the server regardless of whether the
  4186. // field is empty or not. This may be used to include empty fields in
  4187. // Patch requests.
  4188. ForceSendFields []string `json:"-"`
  4189. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  4190. // include in API requests with the JSON null value. By default, fields
  4191. // with empty values are omitted from API requests. However, any field
  4192. // with an empty value appearing in NullFields will be sent to the
  4193. // server as null. It is an error if a field in this list has a
  4194. // non-empty value. This may be used to include null fields in Patch
  4195. // requests.
  4196. NullFields []string `json:"-"`
  4197. }
  4198. func (s *BackendService) MarshalJSON() ([]byte, error) {
  4199. type NoMethod BackendService
  4200. raw := NoMethod(*s)
  4201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4202. }
  4203. // BackendServiceAggregatedList: Contains a list of
  4204. // BackendServicesScopedList.
  4205. type BackendServiceAggregatedList struct {
  4206. // Id: [Output Only] Unique identifier for the resource; defined by the
  4207. // server.
  4208. Id string `json:"id,omitempty"`
  4209. // Items: A list of BackendServicesScopedList resources.
  4210. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  4211. // Kind: Type of resource.
  4212. Kind string `json:"kind,omitempty"`
  4213. // NextPageToken: [Output Only] This token allows you to get the next
  4214. // page of results for list requests. If the number of results is larger
  4215. // than maxResults, use the nextPageToken as a value for the query
  4216. // parameter pageToken in the next list request. Subsequent list
  4217. // requests will have their own nextPageToken to continue paging through
  4218. // the results.
  4219. NextPageToken string `json:"nextPageToken,omitempty"`
  4220. // SelfLink: [Output Only] Server-defined URL for this resource.
  4221. SelfLink string `json:"selfLink,omitempty"`
  4222. // Warning: [Output Only] Informational warning message.
  4223. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  4224. // ServerResponse contains the HTTP response code and headers from the
  4225. // server.
  4226. googleapi.ServerResponse `json:"-"`
  4227. // ForceSendFields is a list of field names (e.g. "Id") to
  4228. // unconditionally include in API requests. By default, fields with
  4229. // empty values are omitted from API requests. However, any non-pointer,
  4230. // non-interface field appearing in ForceSendFields will be sent to the
  4231. // server regardless of whether the field is empty or not. This may be
  4232. // used to include empty fields in Patch requests.
  4233. ForceSendFields []string `json:"-"`
  4234. // NullFields is a list of field names (e.g. "Id") to include in API
  4235. // requests with the JSON null value. By default, fields with empty
  4236. // values are omitted from API requests. However, any field with an
  4237. // empty value appearing in NullFields will be sent to the server as
  4238. // null. It is an error if a field in this list has a non-empty value.
  4239. // This may be used to include null fields in Patch requests.
  4240. NullFields []string `json:"-"`
  4241. }
  4242. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  4243. type NoMethod BackendServiceAggregatedList
  4244. raw := NoMethod(*s)
  4245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4246. }
  4247. // BackendServiceAggregatedListWarning: [Output Only] Informational
  4248. // warning message.
  4249. type BackendServiceAggregatedListWarning struct {
  4250. // Code: [Output Only] A warning code, if applicable. For example,
  4251. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4252. // the response.
  4253. //
  4254. // Possible values:
  4255. // "CLEANUP_FAILED"
  4256. // "DEPRECATED_RESOURCE_USED"
  4257. // "DEPRECATED_TYPE_USED"
  4258. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4259. // "EXPERIMENTAL_TYPE_USED"
  4260. // "EXTERNAL_API_WARNING"
  4261. // "FIELD_VALUE_OVERRIDEN"
  4262. // "INJECTED_KERNELS_DEPRECATED"
  4263. // "MISSING_TYPE_DEPENDENCY"
  4264. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4265. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4266. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4267. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4268. // "NEXT_HOP_NOT_RUNNING"
  4269. // "NOT_CRITICAL_ERROR"
  4270. // "NO_RESULTS_ON_PAGE"
  4271. // "REQUIRED_TOS_AGREEMENT"
  4272. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4273. // "RESOURCE_NOT_DELETED"
  4274. // "SCHEMA_VALIDATION_IGNORED"
  4275. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4276. // "UNDECLARED_PROPERTIES"
  4277. // "UNREACHABLE"
  4278. Code string `json:"code,omitempty"`
  4279. // Data: [Output Only] Metadata about this warning in key: value format.
  4280. // For example:
  4281. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4282. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  4283. // Message: [Output Only] A human-readable description of the warning
  4284. // code.
  4285. Message string `json:"message,omitempty"`
  4286. // ForceSendFields is a list of field names (e.g. "Code") to
  4287. // unconditionally include in API requests. By default, fields with
  4288. // empty values are omitted from API requests. However, any non-pointer,
  4289. // non-interface field appearing in ForceSendFields will be sent to the
  4290. // server regardless of whether the field is empty or not. This may be
  4291. // used to include empty fields in Patch requests.
  4292. ForceSendFields []string `json:"-"`
  4293. // NullFields is a list of field names (e.g. "Code") to include in API
  4294. // requests with the JSON null value. By default, fields with empty
  4295. // values are omitted from API requests. However, any field with an
  4296. // empty value appearing in NullFields will be sent to the server as
  4297. // null. It is an error if a field in this list has a non-empty value.
  4298. // This may be used to include null fields in Patch requests.
  4299. NullFields []string `json:"-"`
  4300. }
  4301. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4302. type NoMethod BackendServiceAggregatedListWarning
  4303. raw := NoMethod(*s)
  4304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4305. }
  4306. type BackendServiceAggregatedListWarningData struct {
  4307. // Key: [Output Only] A key that provides more detail on the warning
  4308. // being returned. For example, for warnings where there are no results
  4309. // in a list request for a particular zone, this key might be scope and
  4310. // the key value might be the zone name. Other examples might be a key
  4311. // indicating a deprecated resource and a suggested replacement, or a
  4312. // warning about invalid network settings (for example, if an instance
  4313. // attempts to perform IP forwarding but is not enabled for IP
  4314. // forwarding).
  4315. Key string `json:"key,omitempty"`
  4316. // Value: [Output Only] A warning data value corresponding to the key.
  4317. Value string `json:"value,omitempty"`
  4318. // ForceSendFields is a list of field names (e.g. "Key") to
  4319. // unconditionally include in API requests. By default, fields with
  4320. // empty values are omitted from API requests. However, any non-pointer,
  4321. // non-interface field appearing in ForceSendFields will be sent to the
  4322. // server regardless of whether the field is empty or not. This may be
  4323. // used to include empty fields in Patch requests.
  4324. ForceSendFields []string `json:"-"`
  4325. // NullFields is a list of field names (e.g. "Key") to include in API
  4326. // requests with the JSON null value. By default, fields with empty
  4327. // values are omitted from API requests. However, any field with an
  4328. // empty value appearing in NullFields will be sent to the server as
  4329. // null. It is an error if a field in this list has a non-empty value.
  4330. // This may be used to include null fields in Patch requests.
  4331. NullFields []string `json:"-"`
  4332. }
  4333. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4334. type NoMethod BackendServiceAggregatedListWarningData
  4335. raw := NoMethod(*s)
  4336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4337. }
  4338. // BackendServiceAppEngineBackend: Configuration of a App Engine
  4339. // backend.
  4340. type BackendServiceAppEngineBackend struct {
  4341. // AppEngineService: Optional. App Engine app service name.
  4342. AppEngineService string `json:"appEngineService,omitempty"`
  4343. // TargetProject: Required. Project ID of the project hosting the app.
  4344. // This is the project ID of this project. Reference to another project
  4345. // is not allowed.
  4346. TargetProject string `json:"targetProject,omitempty"`
  4347. // Version: Optional. Version of App Engine app service. When empty, App
  4348. // Engine will do its normal traffic split.
  4349. Version string `json:"version,omitempty"`
  4350. // ForceSendFields is a list of field names (e.g. "AppEngineService") to
  4351. // unconditionally include in API requests. By default, fields with
  4352. // empty values are omitted from API requests. However, any non-pointer,
  4353. // non-interface field appearing in ForceSendFields will be sent to the
  4354. // server regardless of whether the field is empty or not. This may be
  4355. // used to include empty fields in Patch requests.
  4356. ForceSendFields []string `json:"-"`
  4357. // NullFields is a list of field names (e.g. "AppEngineService") to
  4358. // include in API requests with the JSON null value. By default, fields
  4359. // with empty values are omitted from API requests. However, any field
  4360. // with an empty value appearing in NullFields will be sent to the
  4361. // server as null. It is an error if a field in this list has a
  4362. // non-empty value. This may be used to include null fields in Patch
  4363. // requests.
  4364. NullFields []string `json:"-"`
  4365. }
  4366. func (s *BackendServiceAppEngineBackend) MarshalJSON() ([]byte, error) {
  4367. type NoMethod BackendServiceAppEngineBackend
  4368. raw := NoMethod(*s)
  4369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4370. }
  4371. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  4372. // for a backend service.
  4373. type BackendServiceCdnPolicy struct {
  4374. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  4375. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  4376. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4377. // signed URL request will be considered fresh. After this time period,
  4378. // the response will be revalidated before being served. Defaults to 1hr
  4379. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4380. // will internally behave as though all responses from this backend had
  4381. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4382. // existing Cache-Control header. The actual headers served in responses
  4383. // will not be altered.
  4384. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4385. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4386. // request URLs.
  4387. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4388. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  4389. // unconditionally include in API requests. By default, fields with
  4390. // empty values are omitted from API requests. However, any non-pointer,
  4391. // non-interface field appearing in ForceSendFields will be sent to the
  4392. // server regardless of whether the field is empty or not. This may be
  4393. // used to include empty fields in Patch requests.
  4394. ForceSendFields []string `json:"-"`
  4395. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  4396. // include in API requests with the JSON null value. By default, fields
  4397. // with empty values are omitted from API requests. However, any field
  4398. // with an empty value appearing in NullFields will be sent to the
  4399. // server as null. It is an error if a field in this list has a
  4400. // non-empty value. This may be used to include null fields in Patch
  4401. // requests.
  4402. NullFields []string `json:"-"`
  4403. }
  4404. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  4405. type NoMethod BackendServiceCdnPolicy
  4406. raw := NoMethod(*s)
  4407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4408. }
  4409. // BackendServiceCloudFunctionBackend: Configuration of a Cloud Function
  4410. // backend.
  4411. type BackendServiceCloudFunctionBackend struct {
  4412. // FunctionName: Required. A cloud function name. Special value ?*?
  4413. // represents all cloud functions in the project.
  4414. FunctionName string `json:"functionName,omitempty"`
  4415. // TargetProject: Required. Project ID of the project hosting the cloud
  4416. // function.
  4417. TargetProject string `json:"targetProject,omitempty"`
  4418. // ForceSendFields is a list of field names (e.g. "FunctionName") 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. "FunctionName") to include
  4426. // in API requests with the JSON null value. By default, fields with
  4427. // empty values are omitted from API requests. However, any field with
  4428. // an 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 *BackendServiceCloudFunctionBackend) MarshalJSON() ([]byte, error) {
  4434. type NoMethod BackendServiceCloudFunctionBackend
  4435. raw := NoMethod(*s)
  4436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4437. }
  4438. type BackendServiceFailoverPolicy struct {
  4439. // DisableConnectionDrainOnFailover: On failover or failback, this field
  4440. // indicates whether connection drain will be honored. Setting this to
  4441. // true has the following effect: connections to the old active pool are
  4442. // not drained. Connections to the new active pool use the timeout of 10
  4443. // min (currently fixed). Setting to false has the following effect:
  4444. // both old and new connections will have a drain timeout of 10
  4445. // min.
  4446. //
  4447. // This can be set to true only if the protocol is TCP.
  4448. //
  4449. // The default is false.
  4450. DisableConnectionDrainOnFailover bool `json:"disableConnectionDrainOnFailover,omitempty"`
  4451. // DropTrafficIfUnhealthy: This option is used only when no healthy VMs
  4452. // are detected in the primary and backup instance groups. When set to
  4453. // true, traffic is dropped. When set to false, new connections are sent
  4454. // across all VMs in the primary group.
  4455. //
  4456. // The default is false.
  4457. DropTrafficIfUnhealthy bool `json:"dropTrafficIfUnhealthy,omitempty"`
  4458. // FailoverRatio: The value of the field must be in [0, 1]. If the ratio
  4459. // of the healthy VMs in the primary backend is at or below this number,
  4460. // traffic arriving at the load-balanced IP will be directed to the
  4461. // failover backend.
  4462. //
  4463. // In case where 'failoverRatio' is not set or all the VMs in the backup
  4464. // backend are unhealthy, the traffic will be directed back to the
  4465. // primary backend in the "force" mode, where traffic will be spread to
  4466. // the healthy VMs with the best effort, or to all VMs when no VM is
  4467. // healthy.
  4468. //
  4469. // This field is only used with l4 load balancing.
  4470. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  4471. // ForceSendFields is a list of field names (e.g.
  4472. // "DisableConnectionDrainOnFailover") to unconditionally include in API
  4473. // requests. By default, fields with empty values are omitted from API
  4474. // requests. However, any non-pointer, non-interface field appearing in
  4475. // ForceSendFields will be sent to the server regardless of whether the
  4476. // field is empty or not. This may be used to include empty fields in
  4477. // Patch requests.
  4478. ForceSendFields []string `json:"-"`
  4479. // NullFields is a list of field names (e.g.
  4480. // "DisableConnectionDrainOnFailover") to include in API requests with
  4481. // the JSON null value. By default, fields with empty values are omitted
  4482. // from API requests. However, any field with an empty value appearing
  4483. // in NullFields will be sent to the server as null. It is an error if a
  4484. // field in this list has a non-empty value. This may be used to include
  4485. // null fields in Patch requests.
  4486. NullFields []string `json:"-"`
  4487. }
  4488. func (s *BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
  4489. type NoMethod BackendServiceFailoverPolicy
  4490. raw := NoMethod(*s)
  4491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4492. }
  4493. func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
  4494. type NoMethod BackendServiceFailoverPolicy
  4495. var s1 struct {
  4496. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  4497. *NoMethod
  4498. }
  4499. s1.NoMethod = (*NoMethod)(s)
  4500. if err := json.Unmarshal(data, &s1); err != nil {
  4501. return err
  4502. }
  4503. s.FailoverRatio = float64(s1.FailoverRatio)
  4504. return nil
  4505. }
  4506. type BackendServiceGroupHealth struct {
  4507. // Annotations: Metadata defined as annotations on the network endpoint
  4508. // group.
  4509. Annotations map[string]string `json:"annotations,omitempty"`
  4510. // HealthStatus: Health state of the backend instances or endpoints in
  4511. // requested instance or network endpoint group, determined based on
  4512. // configured health checks.
  4513. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  4514. // Kind: [Output Only] Type of resource. Always
  4515. // compute#backendServiceGroupHealth for the health of backend services.
  4516. Kind string `json:"kind,omitempty"`
  4517. // ServerResponse contains the HTTP response code and headers from the
  4518. // server.
  4519. googleapi.ServerResponse `json:"-"`
  4520. // ForceSendFields is a list of field names (e.g. "Annotations") to
  4521. // unconditionally include in API requests. By default, fields with
  4522. // empty values are omitted from API requests. However, any non-pointer,
  4523. // non-interface field appearing in ForceSendFields will be sent to the
  4524. // server regardless of whether the field is empty or not. This may be
  4525. // used to include empty fields in Patch requests.
  4526. ForceSendFields []string `json:"-"`
  4527. // NullFields is a list of field names (e.g. "Annotations") to include
  4528. // in API requests with the JSON null value. By default, fields with
  4529. // empty values are omitted from API requests. However, any field with
  4530. // an empty value appearing in NullFields will be sent to the server as
  4531. // null. It is an error if a field in this list has a non-empty value.
  4532. // This may be used to include null fields in Patch requests.
  4533. NullFields []string `json:"-"`
  4534. }
  4535. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  4536. type NoMethod BackendServiceGroupHealth
  4537. raw := NoMethod(*s)
  4538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4539. }
  4540. // BackendServiceIAP: Identity-Aware Proxy
  4541. type BackendServiceIAP struct {
  4542. Enabled bool `json:"enabled,omitempty"`
  4543. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  4544. // Oauth2ClientInfo: [Input Only] OAuth client info required to generate
  4545. // client id to be used for IAP.
  4546. Oauth2ClientInfo *BackendServiceIAPOAuth2ClientInfo `json:"oauth2ClientInfo,omitempty"`
  4547. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  4548. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  4549. // field oauth2_client_secret above.
  4550. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  4551. // ForceSendFields is a list of field names (e.g. "Enabled") to
  4552. // unconditionally include in API requests. By default, fields with
  4553. // empty values are omitted from API requests. However, any non-pointer,
  4554. // non-interface field appearing in ForceSendFields will be sent to the
  4555. // server regardless of whether the field is empty or not. This may be
  4556. // used to include empty fields in Patch requests.
  4557. ForceSendFields []string `json:"-"`
  4558. // NullFields is a list of field names (e.g. "Enabled") to include in
  4559. // API requests with the JSON null value. By default, fields with empty
  4560. // values are omitted from API requests. However, any field with an
  4561. // empty value appearing in NullFields will be sent to the server as
  4562. // null. It is an error if a field in this list has a non-empty value.
  4563. // This may be used to include null fields in Patch requests.
  4564. NullFields []string `json:"-"`
  4565. }
  4566. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  4567. type NoMethod BackendServiceIAP
  4568. raw := NoMethod(*s)
  4569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4570. }
  4571. type BackendServiceIAPOAuth2ClientInfo struct {
  4572. // ApplicationName: Application name to be used in OAuth consent screen.
  4573. ApplicationName string `json:"applicationName,omitempty"`
  4574. // ClientName: Name of the client to be generated. Optional - If not
  4575. // provided, the name will be autogenerated by the backend.
  4576. ClientName string `json:"clientName,omitempty"`
  4577. // DeveloperEmailAddress: Developer's information to be used in OAuth
  4578. // consent screen.
  4579. DeveloperEmailAddress string `json:"developerEmailAddress,omitempty"`
  4580. // ForceSendFields is a list of field names (e.g. "ApplicationName") to
  4581. // unconditionally include in API requests. By default, fields with
  4582. // empty values are omitted from API requests. However, any non-pointer,
  4583. // non-interface field appearing in ForceSendFields will be sent to the
  4584. // server regardless of whether the field is empty or not. This may be
  4585. // used to include empty fields in Patch requests.
  4586. ForceSendFields []string `json:"-"`
  4587. // NullFields is a list of field names (e.g. "ApplicationName") to
  4588. // include in API requests with the JSON null value. By default, fields
  4589. // with empty values are omitted from API requests. However, any field
  4590. // with an empty value appearing in NullFields will be sent to the
  4591. // server as null. It is an error if a field in this list has a
  4592. // non-empty value. This may be used to include null fields in Patch
  4593. // requests.
  4594. NullFields []string `json:"-"`
  4595. }
  4596. func (s *BackendServiceIAPOAuth2ClientInfo) MarshalJSON() ([]byte, error) {
  4597. type NoMethod BackendServiceIAPOAuth2ClientInfo
  4598. raw := NoMethod(*s)
  4599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4600. }
  4601. // BackendServiceList: Contains a list of BackendService resources.
  4602. type BackendServiceList struct {
  4603. // Id: [Output Only] Unique identifier for the resource; defined by the
  4604. // server.
  4605. Id string `json:"id,omitempty"`
  4606. // Items: A list of BackendService resources.
  4607. Items []*BackendService `json:"items,omitempty"`
  4608. // Kind: [Output Only] Type of resource. Always
  4609. // compute#backendServiceList for lists of backend services.
  4610. Kind string `json:"kind,omitempty"`
  4611. // NextPageToken: [Output Only] This token allows you to get the next
  4612. // page of results for list requests. If the number of results is larger
  4613. // than maxResults, use the nextPageToken as a value for the query
  4614. // parameter pageToken in the next list request. Subsequent list
  4615. // requests will have their own nextPageToken to continue paging through
  4616. // the results.
  4617. NextPageToken string `json:"nextPageToken,omitempty"`
  4618. // SelfLink: [Output Only] Server-defined URL for this resource.
  4619. SelfLink string `json:"selfLink,omitempty"`
  4620. // Warning: [Output Only] Informational warning message.
  4621. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  4622. // ServerResponse contains the HTTP response code and headers from the
  4623. // server.
  4624. googleapi.ServerResponse `json:"-"`
  4625. // ForceSendFields is a list of field names (e.g. "Id") to
  4626. // unconditionally include in API requests. By default, fields with
  4627. // empty values are omitted from API requests. However, any non-pointer,
  4628. // non-interface field appearing in ForceSendFields will be sent to the
  4629. // server regardless of whether the field is empty or not. This may be
  4630. // used to include empty fields in Patch requests.
  4631. ForceSendFields []string `json:"-"`
  4632. // NullFields is a list of field names (e.g. "Id") to include in API
  4633. // requests with the JSON null value. By default, fields with empty
  4634. // values are omitted from API requests. However, any field with an
  4635. // empty value appearing in NullFields will be sent to the server as
  4636. // null. It is an error if a field in this list has a non-empty value.
  4637. // This may be used to include null fields in Patch requests.
  4638. NullFields []string `json:"-"`
  4639. }
  4640. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  4641. type NoMethod BackendServiceList
  4642. raw := NoMethod(*s)
  4643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4644. }
  4645. // BackendServiceListWarning: [Output Only] Informational warning
  4646. // message.
  4647. type BackendServiceListWarning struct {
  4648. // Code: [Output Only] A warning code, if applicable. For example,
  4649. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4650. // the response.
  4651. //
  4652. // Possible values:
  4653. // "CLEANUP_FAILED"
  4654. // "DEPRECATED_RESOURCE_USED"
  4655. // "DEPRECATED_TYPE_USED"
  4656. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4657. // "EXPERIMENTAL_TYPE_USED"
  4658. // "EXTERNAL_API_WARNING"
  4659. // "FIELD_VALUE_OVERRIDEN"
  4660. // "INJECTED_KERNELS_DEPRECATED"
  4661. // "MISSING_TYPE_DEPENDENCY"
  4662. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4663. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4664. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4665. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4666. // "NEXT_HOP_NOT_RUNNING"
  4667. // "NOT_CRITICAL_ERROR"
  4668. // "NO_RESULTS_ON_PAGE"
  4669. // "REQUIRED_TOS_AGREEMENT"
  4670. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4671. // "RESOURCE_NOT_DELETED"
  4672. // "SCHEMA_VALIDATION_IGNORED"
  4673. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4674. // "UNDECLARED_PROPERTIES"
  4675. // "UNREACHABLE"
  4676. Code string `json:"code,omitempty"`
  4677. // Data: [Output Only] Metadata about this warning in key: value format.
  4678. // For example:
  4679. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4680. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4681. // Message: [Output Only] A human-readable description of the warning
  4682. // code.
  4683. Message string `json:"message,omitempty"`
  4684. // ForceSendFields is a list of field names (e.g. "Code") to
  4685. // unconditionally include in API requests. By default, fields with
  4686. // empty values are omitted from API requests. However, any non-pointer,
  4687. // non-interface field appearing in ForceSendFields will be sent to the
  4688. // server regardless of whether the field is empty or not. This may be
  4689. // used to include empty fields in Patch requests.
  4690. ForceSendFields []string `json:"-"`
  4691. // NullFields is a list of field names (e.g. "Code") to include in API
  4692. // requests with the JSON null value. By default, fields with empty
  4693. // values are omitted from API requests. However, any field with an
  4694. // empty value appearing in NullFields will be sent to the server as
  4695. // null. It is an error if a field in this list has a non-empty value.
  4696. // This may be used to include null fields in Patch requests.
  4697. NullFields []string `json:"-"`
  4698. }
  4699. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4700. type NoMethod BackendServiceListWarning
  4701. raw := NoMethod(*s)
  4702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4703. }
  4704. type BackendServiceListWarningData struct {
  4705. // Key: [Output Only] A key that provides more detail on the warning
  4706. // being returned. For example, for warnings where there are no results
  4707. // in a list request for a particular zone, this key might be scope and
  4708. // the key value might be the zone name. Other examples might be a key
  4709. // indicating a deprecated resource and a suggested replacement, or a
  4710. // warning about invalid network settings (for example, if an instance
  4711. // attempts to perform IP forwarding but is not enabled for IP
  4712. // forwarding).
  4713. Key string `json:"key,omitempty"`
  4714. // Value: [Output Only] A warning data value corresponding to the key.
  4715. Value string `json:"value,omitempty"`
  4716. // ForceSendFields is a list of field names (e.g. "Key") to
  4717. // unconditionally include in API requests. By default, fields with
  4718. // empty values are omitted from API requests. However, any non-pointer,
  4719. // non-interface field appearing in ForceSendFields will be sent to the
  4720. // server regardless of whether the field is empty or not. This may be
  4721. // used to include empty fields in Patch requests.
  4722. ForceSendFields []string `json:"-"`
  4723. // NullFields is a list of field names (e.g. "Key") to include in API
  4724. // requests with the JSON null value. By default, fields with empty
  4725. // values are omitted from API requests. However, any field with an
  4726. // empty value appearing in NullFields will be sent to the server as
  4727. // null. It is an error if a field in this list has a non-empty value.
  4728. // This may be used to include null fields in Patch requests.
  4729. NullFields []string `json:"-"`
  4730. }
  4731. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  4732. type NoMethod BackendServiceListWarningData
  4733. raw := NoMethod(*s)
  4734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4735. }
  4736. // BackendServiceLogConfig: The available logging options for the load
  4737. // balancer traffic served by this backend service.
  4738. type BackendServiceLogConfig struct {
  4739. // Enable: This field denotes whether to enable logging for the load
  4740. // balancer traffic served by this backend service.
  4741. Enable bool `json:"enable,omitempty"`
  4742. // SampleRate: This field can only be specified if logging is enabled
  4743. // for this backend service. The value of the field must be in [0, 1].
  4744. // This configures the sampling rate of requests to the load balancer
  4745. // where 1.0 means all logged requests are reported and 0.0 means no
  4746. // logged requests are reported. The default value is 1.0.
  4747. SampleRate float64 `json:"sampleRate,omitempty"`
  4748. // ForceSendFields is a list of field names (e.g. "Enable") to
  4749. // unconditionally include in API requests. By default, fields with
  4750. // empty values are omitted from API requests. However, any non-pointer,
  4751. // non-interface field appearing in ForceSendFields will be sent to the
  4752. // server regardless of whether the field is empty or not. This may be
  4753. // used to include empty fields in Patch requests.
  4754. ForceSendFields []string `json:"-"`
  4755. // NullFields is a list of field names (e.g. "Enable") to include in API
  4756. // requests with the JSON null value. By default, fields with empty
  4757. // values are omitted from API requests. However, any field with an
  4758. // empty value appearing in NullFields will be sent to the server as
  4759. // null. It is an error if a field in this list has a non-empty value.
  4760. // This may be used to include null fields in Patch requests.
  4761. NullFields []string `json:"-"`
  4762. }
  4763. func (s *BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
  4764. type NoMethod BackendServiceLogConfig
  4765. raw := NoMethod(*s)
  4766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4767. }
  4768. func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
  4769. type NoMethod BackendServiceLogConfig
  4770. var s1 struct {
  4771. SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
  4772. *NoMethod
  4773. }
  4774. s1.NoMethod = (*NoMethod)(s)
  4775. if err := json.Unmarshal(data, &s1); err != nil {
  4776. return err
  4777. }
  4778. s.SampleRate = float64(s1.SampleRate)
  4779. return nil
  4780. }
  4781. type BackendServiceReference struct {
  4782. BackendService string `json:"backendService,omitempty"`
  4783. // ForceSendFields is a list of field names (e.g. "BackendService") to
  4784. // unconditionally include in API requests. By default, fields with
  4785. // empty values are omitted from API requests. However, any non-pointer,
  4786. // non-interface field appearing in ForceSendFields will be sent to the
  4787. // server regardless of whether the field is empty or not. This may be
  4788. // used to include empty fields in Patch requests.
  4789. ForceSendFields []string `json:"-"`
  4790. // NullFields is a list of field names (e.g. "BackendService") to
  4791. // include in API requests with the JSON null value. By default, fields
  4792. // with empty values are omitted from API requests. However, any field
  4793. // with an empty value appearing in NullFields will be sent to the
  4794. // server as null. It is an error if a field in this list has a
  4795. // non-empty value. This may be used to include null fields in Patch
  4796. // requests.
  4797. NullFields []string `json:"-"`
  4798. }
  4799. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  4800. type NoMethod BackendServiceReference
  4801. raw := NoMethod(*s)
  4802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4803. }
  4804. type BackendServicesScopedList struct {
  4805. // BackendServices: A list of BackendServices contained in this scope.
  4806. BackendServices []*BackendService `json:"backendServices,omitempty"`
  4807. // Warning: Informational warning which replaces the list of backend
  4808. // services when the list is empty.
  4809. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  4810. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  4811. // unconditionally include in API requests. By default, fields with
  4812. // empty values are omitted from API requests. However, any non-pointer,
  4813. // non-interface field appearing in ForceSendFields will be sent to the
  4814. // server regardless of whether the field is empty or not. This may be
  4815. // used to include empty fields in Patch requests.
  4816. ForceSendFields []string `json:"-"`
  4817. // NullFields is a list of field names (e.g. "BackendServices") to
  4818. // include in API requests with the JSON null value. By default, fields
  4819. // with empty values are omitted from API requests. However, any field
  4820. // with an empty value appearing in NullFields will be sent to the
  4821. // server as null. It is an error if a field in this list has a
  4822. // non-empty value. This may be used to include null fields in Patch
  4823. // requests.
  4824. NullFields []string `json:"-"`
  4825. }
  4826. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  4827. type NoMethod BackendServicesScopedList
  4828. raw := NoMethod(*s)
  4829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4830. }
  4831. // BackendServicesScopedListWarning: Informational warning which
  4832. // replaces the list of backend services when the list is empty.
  4833. type BackendServicesScopedListWarning struct {
  4834. // Code: [Output Only] A warning code, if applicable. For example,
  4835. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4836. // the response.
  4837. //
  4838. // Possible values:
  4839. // "CLEANUP_FAILED"
  4840. // "DEPRECATED_RESOURCE_USED"
  4841. // "DEPRECATED_TYPE_USED"
  4842. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4843. // "EXPERIMENTAL_TYPE_USED"
  4844. // "EXTERNAL_API_WARNING"
  4845. // "FIELD_VALUE_OVERRIDEN"
  4846. // "INJECTED_KERNELS_DEPRECATED"
  4847. // "MISSING_TYPE_DEPENDENCY"
  4848. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4849. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4850. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4851. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4852. // "NEXT_HOP_NOT_RUNNING"
  4853. // "NOT_CRITICAL_ERROR"
  4854. // "NO_RESULTS_ON_PAGE"
  4855. // "REQUIRED_TOS_AGREEMENT"
  4856. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4857. // "RESOURCE_NOT_DELETED"
  4858. // "SCHEMA_VALIDATION_IGNORED"
  4859. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4860. // "UNDECLARED_PROPERTIES"
  4861. // "UNREACHABLE"
  4862. Code string `json:"code,omitempty"`
  4863. // Data: [Output Only] Metadata about this warning in key: value format.
  4864. // For example:
  4865. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4866. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  4867. // Message: [Output Only] A human-readable description of the warning
  4868. // code.
  4869. Message string `json:"message,omitempty"`
  4870. // ForceSendFields is a list of field names (e.g. "Code") to
  4871. // unconditionally include in API requests. By default, fields with
  4872. // empty values are omitted from API requests. However, any non-pointer,
  4873. // non-interface field appearing in ForceSendFields will be sent to the
  4874. // server regardless of whether the field is empty or not. This may be
  4875. // used to include empty fields in Patch requests.
  4876. ForceSendFields []string `json:"-"`
  4877. // NullFields is a list of field names (e.g. "Code") to include in API
  4878. // requests with the JSON null value. By default, fields with empty
  4879. // values are omitted from API requests. However, any field with an
  4880. // empty value appearing in NullFields will be sent to the server as
  4881. // null. It is an error if a field in this list has a non-empty value.
  4882. // This may be used to include null fields in Patch requests.
  4883. NullFields []string `json:"-"`
  4884. }
  4885. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  4886. type NoMethod BackendServicesScopedListWarning
  4887. raw := NoMethod(*s)
  4888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4889. }
  4890. type BackendServicesScopedListWarningData struct {
  4891. // Key: [Output Only] A key that provides more detail on the warning
  4892. // being returned. For example, for warnings where there are no results
  4893. // in a list request for a particular zone, this key might be scope and
  4894. // the key value might be the zone name. Other examples might be a key
  4895. // indicating a deprecated resource and a suggested replacement, or a
  4896. // warning about invalid network settings (for example, if an instance
  4897. // attempts to perform IP forwarding but is not enabled for IP
  4898. // forwarding).
  4899. Key string `json:"key,omitempty"`
  4900. // Value: [Output Only] A warning data value corresponding to the key.
  4901. Value string `json:"value,omitempty"`
  4902. // ForceSendFields is a list of field names (e.g. "Key") to
  4903. // unconditionally include in API requests. By default, fields with
  4904. // empty values are omitted from API requests. However, any non-pointer,
  4905. // non-interface field appearing in ForceSendFields will be sent to the
  4906. // server regardless of whether the field is empty or not. This may be
  4907. // used to include empty fields in Patch requests.
  4908. ForceSendFields []string `json:"-"`
  4909. // NullFields is a list of field names (e.g. "Key") to include in API
  4910. // requests with the JSON null value. By default, fields with empty
  4911. // values are omitted from API requests. However, any field with an
  4912. // empty value appearing in NullFields will be sent to the server as
  4913. // null. It is an error if a field in this list has a non-empty value.
  4914. // This may be used to include null fields in Patch requests.
  4915. NullFields []string `json:"-"`
  4916. }
  4917. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4918. type NoMethod BackendServicesScopedListWarningData
  4919. raw := NoMethod(*s)
  4920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4921. }
  4922. // Binding: Associates `members` with a `role`.
  4923. type Binding struct {
  4924. // Condition: Unimplemented. The condition that is associated with this
  4925. // binding. NOTE: an unsatisfied condition will not allow user access
  4926. // via current binding. Different bindings, including their conditions,
  4927. // are examined independently.
  4928. Condition *Expr `json:"condition,omitempty"`
  4929. // Members: Specifies the identities requesting access for a Cloud
  4930. // Platform resource. `members` can have the following values:
  4931. //
  4932. // * `allUsers`: A special identifier that represents anyone who is on
  4933. // the internet; with or without a Google account.
  4934. //
  4935. // * `allAuthenticatedUsers`: A special identifier that represents
  4936. // anyone who is authenticated with a Google account or a service
  4937. // account.
  4938. //
  4939. // * `user:{emailid}`: An email address that represents a specific
  4940. // Google account. For example, `alice@gmail.com` .
  4941. //
  4942. //
  4943. //
  4944. // * `serviceAccount:{emailid}`: An email address that represents a
  4945. // service account. For example,
  4946. // `my-other-app@appspot.gserviceaccount.com`.
  4947. //
  4948. // * `group:{emailid}`: An email address that represents a Google group.
  4949. // For example, `admins@example.com`.
  4950. //
  4951. //
  4952. //
  4953. // * `domain:{domain}`: A Google Apps domain name that represents all
  4954. // the users of that domain. For example, `google.com` or `example.com`.
  4955. Members []string `json:"members,omitempty"`
  4956. // Role: Role that is assigned to `members`. For example,
  4957. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  4958. Role string `json:"role,omitempty"`
  4959. // ForceSendFields is a list of field names (e.g. "Condition") to
  4960. // unconditionally include in API requests. By default, fields with
  4961. // empty values are omitted from API requests. However, any non-pointer,
  4962. // non-interface field appearing in ForceSendFields will be sent to the
  4963. // server regardless of whether the field is empty or not. This may be
  4964. // used to include empty fields in Patch requests.
  4965. ForceSendFields []string `json:"-"`
  4966. // NullFields is a list of field names (e.g. "Condition") to include in
  4967. // API requests with the JSON null value. By default, fields with empty
  4968. // values are omitted from API requests. However, any field with an
  4969. // empty value appearing in NullFields will be sent to the server as
  4970. // null. It is an error if a field in this list has a non-empty value.
  4971. // This may be used to include null fields in Patch requests.
  4972. NullFields []string `json:"-"`
  4973. }
  4974. func (s *Binding) MarshalJSON() ([]byte, error) {
  4975. type NoMethod Binding
  4976. raw := NoMethod(*s)
  4977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4978. }
  4979. type CacheInvalidationRule struct {
  4980. // Host: If set, this invalidation rule will only apply to requests with
  4981. // a Host header matching host.
  4982. Host string `json:"host,omitempty"`
  4983. Path string `json:"path,omitempty"`
  4984. // ForceSendFields is a list of field names (e.g. "Host") to
  4985. // unconditionally include in API requests. By default, fields with
  4986. // empty values are omitted from API requests. However, any non-pointer,
  4987. // non-interface field appearing in ForceSendFields will be sent to the
  4988. // server regardless of whether the field is empty or not. This may be
  4989. // used to include empty fields in Patch requests.
  4990. ForceSendFields []string `json:"-"`
  4991. // NullFields is a list of field names (e.g. "Host") to include in API
  4992. // requests with the JSON null value. By default, fields with empty
  4993. // values are omitted from API requests. However, any field with an
  4994. // empty value appearing in NullFields will be sent to the server as
  4995. // null. It is an error if a field in this list has a non-empty value.
  4996. // This may be used to include null fields in Patch requests.
  4997. NullFields []string `json:"-"`
  4998. }
  4999. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  5000. type NoMethod CacheInvalidationRule
  5001. raw := NoMethod(*s)
  5002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5003. }
  5004. // CacheKeyPolicy: Message containing what to include in the cache key
  5005. // for a request for Cloud CDN.
  5006. type CacheKeyPolicy struct {
  5007. // IncludeHost: If true, requests to different hosts will be cached
  5008. // separately.
  5009. IncludeHost bool `json:"includeHost,omitempty"`
  5010. // IncludeProtocol: If true, http and https requests will be cached
  5011. // separately.
  5012. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  5013. // IncludeQueryString: If true, include query string parameters in the
  5014. // cache key according to query_string_whitelist and
  5015. // query_string_blacklist. If neither is set, the entire query string
  5016. // will be included. If false, the query string will be excluded from
  5017. // the cache key entirely.
  5018. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  5019. // QueryStringBlacklist: Names of query string parameters to exclude in
  5020. // cache keys. All other parameters will be included. Either specify
  5021. // query_string_whitelist or query_string_blacklist, not both. '&' and
  5022. // '=' will be percent encoded and not treated as delimiters.
  5023. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  5024. // QueryStringWhitelist: Names of query string parameters to include in
  5025. // cache keys. All other parameters will be excluded. Either specify
  5026. // query_string_whitelist or query_string_blacklist, not both. '&' and
  5027. // '=' will be percent encoded and not treated as delimiters.
  5028. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  5029. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  5030. // unconditionally include in API requests. By default, fields with
  5031. // empty values are omitted from API requests. However, any non-pointer,
  5032. // non-interface field appearing in ForceSendFields will be sent to the
  5033. // server regardless of whether the field is empty or not. This may be
  5034. // used to include empty fields in Patch requests.
  5035. ForceSendFields []string `json:"-"`
  5036. // NullFields is a list of field names (e.g. "IncludeHost") to include
  5037. // in API requests with the JSON null value. By default, fields with
  5038. // empty values are omitted from API requests. However, any field with
  5039. // an empty value appearing in NullFields will be sent to the server as
  5040. // null. It is an error if a field in this list has a non-empty value.
  5041. // This may be used to include null fields in Patch requests.
  5042. NullFields []string `json:"-"`
  5043. }
  5044. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  5045. type NoMethod CacheKeyPolicy
  5046. raw := NoMethod(*s)
  5047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5048. }
  5049. // Commitment: Represents a Commitment resource. Creating a Commitment
  5050. // resource means that you are purchasing a committed use contract with
  5051. // an explicit start and end time. You can create commitments based on
  5052. // vCPUs and memory usage and receive discounted rates. For full
  5053. // details, read Signing Up for Committed Use Discounts.
  5054. //
  5055. // Committed use discounts are subject to Google Cloud Platform's
  5056. // Service Specific Terms. By purchasing a committed use discount, you
  5057. // agree to these terms. Committed use discounts will not renew, so you
  5058. // must purchase a new commitment to continue receiving discounts. (==
  5059. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  5060. type Commitment struct {
  5061. // Allocations: List of allocations for this commitment.
  5062. Allocations []*Allocation `json:"allocations,omitempty"`
  5063. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5064. // format.
  5065. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5066. // Description: An optional description of this resource. Provide this
  5067. // property when you create the resource.
  5068. Description string `json:"description,omitempty"`
  5069. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  5070. // format.
  5071. EndTimestamp string `json:"endTimestamp,omitempty"`
  5072. // Id: [Output Only] The unique identifier for the resource. This
  5073. // identifier is defined by the server.
  5074. Id uint64 `json:"id,omitempty,string"`
  5075. // Kind: [Output Only] Type of the resource. Always compute#commitment
  5076. // for commitments.
  5077. Kind string `json:"kind,omitempty"`
  5078. // Name: Name of the resource. Provided by the client when the resource
  5079. // is created. The name must be 1-63 characters long, and comply with
  5080. // RFC1035. Specifically, the name must be 1-63 characters long and
  5081. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5082. // the first character must be a lowercase letter, and all following
  5083. // characters must be a dash, lowercase letter, or digit, except the
  5084. // last character, which cannot be a dash.
  5085. Name string `json:"name,omitempty"`
  5086. // Plan: The plan for this commitment, which determines duration and
  5087. // discount rate. The currently supported plans are TWELVE_MONTH (1
  5088. // year), and THIRTY_SIX_MONTH (3 years).
  5089. //
  5090. // Possible values:
  5091. // "INVALID"
  5092. // "THIRTY_SIX_MONTH"
  5093. // "TWELVE_MONTH"
  5094. Plan string `json:"plan,omitempty"`
  5095. // Region: [Output Only] URL of the region where this commitment may be
  5096. // used.
  5097. Region string `json:"region,omitempty"`
  5098. // Resources: A list of commitment amounts for particular resources.
  5099. // Note that VCPU and MEMORY resource commitments must occur together.
  5100. Resources []*ResourceCommitment `json:"resources,omitempty"`
  5101. // SelfLink: [Output Only] Server-defined URL for the resource.
  5102. SelfLink string `json:"selfLink,omitempty"`
  5103. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  5104. // format.
  5105. StartTimestamp string `json:"startTimestamp,omitempty"`
  5106. // Status: [Output Only] Status of the commitment with regards to
  5107. // eventual expiration (each commitment has an end date defined). One of
  5108. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  5109. //
  5110. // Possible values:
  5111. // "ACTIVE"
  5112. // "CREATING"
  5113. // "EXPIRED"
  5114. // "NOT_YET_ACTIVE"
  5115. Status string `json:"status,omitempty"`
  5116. // StatusMessage: [Output Only] An optional, human-readable explanation
  5117. // of the status.
  5118. StatusMessage string `json:"statusMessage,omitempty"`
  5119. // Type: The type of commitment, which affects the discount rate and the
  5120. // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that
  5121. // will only apply to memory optimized machines.
  5122. //
  5123. // Possible values:
  5124. // "GENERAL_PURPOSE"
  5125. // "MEMORY_OPTIMIZED"
  5126. // "TYPE_UNSPECIFIED"
  5127. Type string `json:"type,omitempty"`
  5128. // ServerResponse contains the HTTP response code and headers from the
  5129. // server.
  5130. googleapi.ServerResponse `json:"-"`
  5131. // ForceSendFields is a list of field names (e.g. "Allocations") to
  5132. // unconditionally include in API requests. By default, fields with
  5133. // empty values are omitted from API requests. However, any non-pointer,
  5134. // non-interface field appearing in ForceSendFields will be sent to the
  5135. // server regardless of whether the field is empty or not. This may be
  5136. // used to include empty fields in Patch requests.
  5137. ForceSendFields []string `json:"-"`
  5138. // NullFields is a list of field names (e.g. "Allocations") to include
  5139. // in API requests with the JSON null value. By default, fields with
  5140. // empty values are omitted from API requests. However, any field with
  5141. // an empty value appearing in NullFields will be sent to the server as
  5142. // null. It is an error if a field in this list has a non-empty value.
  5143. // This may be used to include null fields in Patch requests.
  5144. NullFields []string `json:"-"`
  5145. }
  5146. func (s *Commitment) MarshalJSON() ([]byte, error) {
  5147. type NoMethod Commitment
  5148. raw := NoMethod(*s)
  5149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5150. }
  5151. type CommitmentAggregatedList struct {
  5152. // Id: [Output Only] Unique identifier for the resource; defined by the
  5153. // server.
  5154. Id string `json:"id,omitempty"`
  5155. // Items: A list of CommitmentsScopedList resources.
  5156. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  5157. // Kind: [Output Only] Type of resource. Always
  5158. // compute#commitmentAggregatedList for aggregated lists of commitments.
  5159. Kind string `json:"kind,omitempty"`
  5160. // NextPageToken: [Output Only] This token allows you to get the next
  5161. // page of results for list requests. If the number of results is larger
  5162. // than maxResults, use the nextPageToken as a value for the query
  5163. // parameter pageToken in the next list request. Subsequent list
  5164. // requests will have their own nextPageToken to continue paging through
  5165. // the results.
  5166. NextPageToken string `json:"nextPageToken,omitempty"`
  5167. // SelfLink: [Output Only] Server-defined URL for this resource.
  5168. SelfLink string `json:"selfLink,omitempty"`
  5169. // Warning: [Output Only] Informational warning message.
  5170. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  5171. // ServerResponse contains the HTTP response code and headers from the
  5172. // server.
  5173. googleapi.ServerResponse `json:"-"`
  5174. // ForceSendFields is a list of field names (e.g. "Id") to
  5175. // unconditionally include in API requests. By default, fields with
  5176. // empty values are omitted from API requests. However, any non-pointer,
  5177. // non-interface field appearing in ForceSendFields will be sent to the
  5178. // server regardless of whether the field is empty or not. This may be
  5179. // used to include empty fields in Patch requests.
  5180. ForceSendFields []string `json:"-"`
  5181. // NullFields is a list of field names (e.g. "Id") to include in API
  5182. // requests with the JSON null value. By default, fields with empty
  5183. // values are omitted from API requests. However, any field with an
  5184. // empty value appearing in NullFields will be sent to the server as
  5185. // null. It is an error if a field in this list has a non-empty value.
  5186. // This may be used to include null fields in Patch requests.
  5187. NullFields []string `json:"-"`
  5188. }
  5189. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  5190. type NoMethod CommitmentAggregatedList
  5191. raw := NoMethod(*s)
  5192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5193. }
  5194. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  5195. // message.
  5196. type CommitmentAggregatedListWarning struct {
  5197. // Code: [Output Only] A warning code, if applicable. For example,
  5198. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5199. // the response.
  5200. //
  5201. // Possible values:
  5202. // "CLEANUP_FAILED"
  5203. // "DEPRECATED_RESOURCE_USED"
  5204. // "DEPRECATED_TYPE_USED"
  5205. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5206. // "EXPERIMENTAL_TYPE_USED"
  5207. // "EXTERNAL_API_WARNING"
  5208. // "FIELD_VALUE_OVERRIDEN"
  5209. // "INJECTED_KERNELS_DEPRECATED"
  5210. // "MISSING_TYPE_DEPENDENCY"
  5211. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5212. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5213. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5214. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5215. // "NEXT_HOP_NOT_RUNNING"
  5216. // "NOT_CRITICAL_ERROR"
  5217. // "NO_RESULTS_ON_PAGE"
  5218. // "REQUIRED_TOS_AGREEMENT"
  5219. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5220. // "RESOURCE_NOT_DELETED"
  5221. // "SCHEMA_VALIDATION_IGNORED"
  5222. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5223. // "UNDECLARED_PROPERTIES"
  5224. // "UNREACHABLE"
  5225. Code string `json:"code,omitempty"`
  5226. // Data: [Output Only] Metadata about this warning in key: value format.
  5227. // For example:
  5228. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5229. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  5230. // Message: [Output Only] A human-readable description of the warning
  5231. // code.
  5232. Message string `json:"message,omitempty"`
  5233. // ForceSendFields is a list of field names (e.g. "Code") to
  5234. // unconditionally include in API requests. By default, fields with
  5235. // empty values are omitted from API requests. However, any non-pointer,
  5236. // non-interface field appearing in ForceSendFields will be sent to the
  5237. // server regardless of whether the field is empty or not. This may be
  5238. // used to include empty fields in Patch requests.
  5239. ForceSendFields []string `json:"-"`
  5240. // NullFields is a list of field names (e.g. "Code") to include in API
  5241. // requests with the JSON null value. By default, fields with empty
  5242. // values are omitted from API requests. However, any field with an
  5243. // empty value appearing in NullFields will be sent to the server as
  5244. // null. It is an error if a field in this list has a non-empty value.
  5245. // This may be used to include null fields in Patch requests.
  5246. NullFields []string `json:"-"`
  5247. }
  5248. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5249. type NoMethod CommitmentAggregatedListWarning
  5250. raw := NoMethod(*s)
  5251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5252. }
  5253. type CommitmentAggregatedListWarningData struct {
  5254. // Key: [Output Only] A key that provides more detail on the warning
  5255. // being returned. For example, for warnings where there are no results
  5256. // in a list request for a particular zone, this key might be scope and
  5257. // the key value might be the zone name. Other examples might be a key
  5258. // indicating a deprecated resource and a suggested replacement, or a
  5259. // warning about invalid network settings (for example, if an instance
  5260. // attempts to perform IP forwarding but is not enabled for IP
  5261. // forwarding).
  5262. Key string `json:"key,omitempty"`
  5263. // Value: [Output Only] A warning data value corresponding to the key.
  5264. Value string `json:"value,omitempty"`
  5265. // ForceSendFields is a list of field names (e.g. "Key") to
  5266. // unconditionally include in API requests. By default, fields with
  5267. // empty values are omitted from API requests. However, any non-pointer,
  5268. // non-interface field appearing in ForceSendFields will be sent to the
  5269. // server regardless of whether the field is empty or not. This may be
  5270. // used to include empty fields in Patch requests.
  5271. ForceSendFields []string `json:"-"`
  5272. // NullFields is a list of field names (e.g. "Key") to include in API
  5273. // requests with the JSON null value. By default, fields with empty
  5274. // values are omitted from API requests. However, any field with an
  5275. // empty value appearing in NullFields will be sent to the server as
  5276. // null. It is an error if a field in this list has a non-empty value.
  5277. // This may be used to include null fields in Patch requests.
  5278. NullFields []string `json:"-"`
  5279. }
  5280. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5281. type NoMethod CommitmentAggregatedListWarningData
  5282. raw := NoMethod(*s)
  5283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5284. }
  5285. // CommitmentList: Contains a list of Commitment resources.
  5286. type CommitmentList struct {
  5287. // Id: [Output Only] Unique identifier for the resource; defined by the
  5288. // server.
  5289. Id string `json:"id,omitempty"`
  5290. // Items: A list of Commitment resources.
  5291. Items []*Commitment `json:"items,omitempty"`
  5292. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  5293. // for lists of commitments.
  5294. Kind string `json:"kind,omitempty"`
  5295. // NextPageToken: [Output Only] This token allows you to get the next
  5296. // page of results for list requests. If the number of results is larger
  5297. // than maxResults, use the nextPageToken as a value for the query
  5298. // parameter pageToken in the next list request. Subsequent list
  5299. // requests will have their own nextPageToken to continue paging through
  5300. // the results.
  5301. NextPageToken string `json:"nextPageToken,omitempty"`
  5302. // SelfLink: [Output Only] Server-defined URL for this resource.
  5303. SelfLink string `json:"selfLink,omitempty"`
  5304. // Warning: [Output Only] Informational warning message.
  5305. Warning *CommitmentListWarning `json:"warning,omitempty"`
  5306. // ServerResponse contains the HTTP response code and headers from the
  5307. // server.
  5308. googleapi.ServerResponse `json:"-"`
  5309. // ForceSendFields is a list of field names (e.g. "Id") to
  5310. // unconditionally include in API requests. By default, fields with
  5311. // empty values are omitted from API requests. However, any non-pointer,
  5312. // non-interface field appearing in ForceSendFields will be sent to the
  5313. // server regardless of whether the field is empty or not. This may be
  5314. // used to include empty fields in Patch requests.
  5315. ForceSendFields []string `json:"-"`
  5316. // NullFields is a list of field names (e.g. "Id") to include in API
  5317. // requests with the JSON null value. By default, fields with empty
  5318. // values are omitted from API requests. However, any field with an
  5319. // empty value appearing in NullFields will be sent to the server as
  5320. // null. It is an error if a field in this list has a non-empty value.
  5321. // This may be used to include null fields in Patch requests.
  5322. NullFields []string `json:"-"`
  5323. }
  5324. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  5325. type NoMethod CommitmentList
  5326. raw := NoMethod(*s)
  5327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5328. }
  5329. // CommitmentListWarning: [Output Only] Informational warning message.
  5330. type CommitmentListWarning struct {
  5331. // Code: [Output Only] A warning code, if applicable. For example,
  5332. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5333. // the response.
  5334. //
  5335. // Possible values:
  5336. // "CLEANUP_FAILED"
  5337. // "DEPRECATED_RESOURCE_USED"
  5338. // "DEPRECATED_TYPE_USED"
  5339. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5340. // "EXPERIMENTAL_TYPE_USED"
  5341. // "EXTERNAL_API_WARNING"
  5342. // "FIELD_VALUE_OVERRIDEN"
  5343. // "INJECTED_KERNELS_DEPRECATED"
  5344. // "MISSING_TYPE_DEPENDENCY"
  5345. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5346. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5347. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5348. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5349. // "NEXT_HOP_NOT_RUNNING"
  5350. // "NOT_CRITICAL_ERROR"
  5351. // "NO_RESULTS_ON_PAGE"
  5352. // "REQUIRED_TOS_AGREEMENT"
  5353. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5354. // "RESOURCE_NOT_DELETED"
  5355. // "SCHEMA_VALIDATION_IGNORED"
  5356. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5357. // "UNDECLARED_PROPERTIES"
  5358. // "UNREACHABLE"
  5359. Code string `json:"code,omitempty"`
  5360. // Data: [Output Only] Metadata about this warning in key: value format.
  5361. // For example:
  5362. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5363. Data []*CommitmentListWarningData `json:"data,omitempty"`
  5364. // Message: [Output Only] A human-readable description of the warning
  5365. // code.
  5366. Message string `json:"message,omitempty"`
  5367. // ForceSendFields is a list of field names (e.g. "Code") to
  5368. // unconditionally include in API requests. By default, fields with
  5369. // empty values are omitted from API requests. However, any non-pointer,
  5370. // non-interface field appearing in ForceSendFields will be sent to the
  5371. // server regardless of whether the field is empty or not. This may be
  5372. // used to include empty fields in Patch requests.
  5373. ForceSendFields []string `json:"-"`
  5374. // NullFields is a list of field names (e.g. "Code") to include in API
  5375. // requests with the JSON null value. By default, fields with empty
  5376. // values are omitted from API requests. However, any field with an
  5377. // empty value appearing in NullFields will be sent to the server as
  5378. // null. It is an error if a field in this list has a non-empty value.
  5379. // This may be used to include null fields in Patch requests.
  5380. NullFields []string `json:"-"`
  5381. }
  5382. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  5383. type NoMethod CommitmentListWarning
  5384. raw := NoMethod(*s)
  5385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5386. }
  5387. type CommitmentListWarningData struct {
  5388. // Key: [Output Only] A key that provides more detail on the warning
  5389. // being returned. For example, for warnings where there are no results
  5390. // in a list request for a particular zone, this key might be scope and
  5391. // the key value might be the zone name. Other examples might be a key
  5392. // indicating a deprecated resource and a suggested replacement, or a
  5393. // warning about invalid network settings (for example, if an instance
  5394. // attempts to perform IP forwarding but is not enabled for IP
  5395. // forwarding).
  5396. Key string `json:"key,omitempty"`
  5397. // Value: [Output Only] A warning data value corresponding to the key.
  5398. Value string `json:"value,omitempty"`
  5399. // ForceSendFields is a list of field names (e.g. "Key") to
  5400. // unconditionally include in API requests. By default, fields with
  5401. // empty values are omitted from API requests. However, any non-pointer,
  5402. // non-interface field appearing in ForceSendFields will be sent to the
  5403. // server regardless of whether the field is empty or not. This may be
  5404. // used to include empty fields in Patch requests.
  5405. ForceSendFields []string `json:"-"`
  5406. // NullFields is a list of field names (e.g. "Key") to include in API
  5407. // requests with the JSON null value. By default, fields with empty
  5408. // values are omitted from API requests. However, any field with an
  5409. // empty value appearing in NullFields will be sent to the server as
  5410. // null. It is an error if a field in this list has a non-empty value.
  5411. // This may be used to include null fields in Patch requests.
  5412. NullFields []string `json:"-"`
  5413. }
  5414. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  5415. type NoMethod CommitmentListWarningData
  5416. raw := NoMethod(*s)
  5417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5418. }
  5419. type CommitmentsScopedList struct {
  5420. // Commitments: [Output Only] A list of commitments contained in this
  5421. // scope.
  5422. Commitments []*Commitment `json:"commitments,omitempty"`
  5423. // Warning: [Output Only] Informational warning which replaces the list
  5424. // of commitments when the list is empty.
  5425. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  5426. // ForceSendFields is a list of field names (e.g. "Commitments") to
  5427. // unconditionally include in API requests. By default, fields with
  5428. // empty values are omitted from API requests. However, any non-pointer,
  5429. // non-interface field appearing in ForceSendFields will be sent to the
  5430. // server regardless of whether the field is empty or not. This may be
  5431. // used to include empty fields in Patch requests.
  5432. ForceSendFields []string `json:"-"`
  5433. // NullFields is a list of field names (e.g. "Commitments") to include
  5434. // in API requests with the JSON null value. By default, fields with
  5435. // empty values are omitted from API requests. However, any field with
  5436. // an empty value appearing in NullFields will be sent to the server as
  5437. // null. It is an error if a field in this list has a non-empty value.
  5438. // This may be used to include null fields in Patch requests.
  5439. NullFields []string `json:"-"`
  5440. }
  5441. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  5442. type NoMethod CommitmentsScopedList
  5443. raw := NoMethod(*s)
  5444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5445. }
  5446. // CommitmentsScopedListWarning: [Output Only] Informational warning
  5447. // which replaces the list of commitments when the list is empty.
  5448. type CommitmentsScopedListWarning struct {
  5449. // Code: [Output Only] A warning code, if applicable. For example,
  5450. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5451. // the response.
  5452. //
  5453. // Possible values:
  5454. // "CLEANUP_FAILED"
  5455. // "DEPRECATED_RESOURCE_USED"
  5456. // "DEPRECATED_TYPE_USED"
  5457. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5458. // "EXPERIMENTAL_TYPE_USED"
  5459. // "EXTERNAL_API_WARNING"
  5460. // "FIELD_VALUE_OVERRIDEN"
  5461. // "INJECTED_KERNELS_DEPRECATED"
  5462. // "MISSING_TYPE_DEPENDENCY"
  5463. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5464. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5465. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5466. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5467. // "NEXT_HOP_NOT_RUNNING"
  5468. // "NOT_CRITICAL_ERROR"
  5469. // "NO_RESULTS_ON_PAGE"
  5470. // "REQUIRED_TOS_AGREEMENT"
  5471. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5472. // "RESOURCE_NOT_DELETED"
  5473. // "SCHEMA_VALIDATION_IGNORED"
  5474. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5475. // "UNDECLARED_PROPERTIES"
  5476. // "UNREACHABLE"
  5477. Code string `json:"code,omitempty"`
  5478. // Data: [Output Only] Metadata about this warning in key: value format.
  5479. // For example:
  5480. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5481. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  5482. // Message: [Output Only] A human-readable description of the warning
  5483. // code.
  5484. Message string `json:"message,omitempty"`
  5485. // ForceSendFields is a list of field names (e.g. "Code") to
  5486. // unconditionally include in API requests. By default, fields with
  5487. // empty values are omitted from API requests. However, any non-pointer,
  5488. // non-interface field appearing in ForceSendFields will be sent to the
  5489. // server regardless of whether the field is empty or not. This may be
  5490. // used to include empty fields in Patch requests.
  5491. ForceSendFields []string `json:"-"`
  5492. // NullFields is a list of field names (e.g. "Code") to include in API
  5493. // requests with the JSON null value. By default, fields with empty
  5494. // values are omitted from API requests. However, any field with an
  5495. // empty value appearing in NullFields will be sent to the server as
  5496. // null. It is an error if a field in this list has a non-empty value.
  5497. // This may be used to include null fields in Patch requests.
  5498. NullFields []string `json:"-"`
  5499. }
  5500. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  5501. type NoMethod CommitmentsScopedListWarning
  5502. raw := NoMethod(*s)
  5503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5504. }
  5505. type CommitmentsScopedListWarningData struct {
  5506. // Key: [Output Only] A key that provides more detail on the warning
  5507. // being returned. For example, for warnings where there are no results
  5508. // in a list request for a particular zone, this key might be scope and
  5509. // the key value might be the zone name. Other examples might be a key
  5510. // indicating a deprecated resource and a suggested replacement, or a
  5511. // warning about invalid network settings (for example, if an instance
  5512. // attempts to perform IP forwarding but is not enabled for IP
  5513. // forwarding).
  5514. Key string `json:"key,omitempty"`
  5515. // Value: [Output Only] A warning data value corresponding to the key.
  5516. Value string `json:"value,omitempty"`
  5517. // ForceSendFields is a list of field names (e.g. "Key") to
  5518. // unconditionally include in API requests. By default, fields with
  5519. // empty values are omitted from API requests. However, any non-pointer,
  5520. // non-interface field appearing in ForceSendFields will be sent to the
  5521. // server regardless of whether the field is empty or not. This may be
  5522. // used to include empty fields in Patch requests.
  5523. ForceSendFields []string `json:"-"`
  5524. // NullFields is a list of field names (e.g. "Key") to include in API
  5525. // requests with the JSON null value. By default, fields with empty
  5526. // values are omitted from API requests. However, any field with an
  5527. // empty value appearing in NullFields will be sent to the server as
  5528. // null. It is an error if a field in this list has a non-empty value.
  5529. // This may be used to include null fields in Patch requests.
  5530. NullFields []string `json:"-"`
  5531. }
  5532. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5533. type NoMethod CommitmentsScopedListWarningData
  5534. raw := NoMethod(*s)
  5535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5536. }
  5537. // Condition: A condition to be met.
  5538. type Condition struct {
  5539. // Iam: Trusted attributes supplied by the IAM system.
  5540. //
  5541. // Possible values:
  5542. // "APPROVER"
  5543. // "ATTRIBUTION"
  5544. // "AUTHORITY"
  5545. // "CREDENTIALS_TYPE"
  5546. // "JUSTIFICATION_TYPE"
  5547. // "NO_ATTR"
  5548. // "SECURITY_REALM"
  5549. Iam string `json:"iam,omitempty"`
  5550. // Op: An operator to apply the subject with.
  5551. //
  5552. // Possible values:
  5553. // "DISCHARGED"
  5554. // "EQUALS"
  5555. // "IN"
  5556. // "NOT_EQUALS"
  5557. // "NOT_IN"
  5558. // "NO_OP"
  5559. Op string `json:"op,omitempty"`
  5560. // Svc: Trusted attributes discharged by the service.
  5561. Svc string `json:"svc,omitempty"`
  5562. // Sys: Trusted attributes supplied by any service that owns resources
  5563. // and uses the IAM system for access control.
  5564. //
  5565. // Possible values:
  5566. // "IP"
  5567. // "NAME"
  5568. // "NO_ATTR"
  5569. // "REGION"
  5570. // "SERVICE"
  5571. Sys string `json:"sys,omitempty"`
  5572. // Value: DEPRECATED. Use 'values' instead.
  5573. Value string `json:"value,omitempty"`
  5574. // Values: The objects of the condition. This is mutually exclusive with
  5575. // 'value'.
  5576. Values []string `json:"values,omitempty"`
  5577. // ForceSendFields is a list of field names (e.g. "Iam") to
  5578. // unconditionally include in API requests. By default, fields with
  5579. // empty values are omitted from API requests. However, any non-pointer,
  5580. // non-interface field appearing in ForceSendFields will be sent to the
  5581. // server regardless of whether the field is empty or not. This may be
  5582. // used to include empty fields in Patch requests.
  5583. ForceSendFields []string `json:"-"`
  5584. // NullFields is a list of field names (e.g. "Iam") to include in API
  5585. // requests with the JSON null value. By default, fields with empty
  5586. // values are omitted from API requests. However, any field with an
  5587. // empty value appearing in NullFields will be sent to the server as
  5588. // null. It is an error if a field in this list has a non-empty value.
  5589. // This may be used to include null fields in Patch requests.
  5590. NullFields []string `json:"-"`
  5591. }
  5592. func (s *Condition) MarshalJSON() ([]byte, error) {
  5593. type NoMethod Condition
  5594. raw := NoMethod(*s)
  5595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5596. }
  5597. // ConnectionDraining: Message containing connection draining
  5598. // configuration.
  5599. type ConnectionDraining struct {
  5600. // DrainingTimeoutSec: Time for which instance will be drained (not
  5601. // accept new connections, but still work to finish started).
  5602. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  5603. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  5604. // to unconditionally include in API requests. By default, fields with
  5605. // empty values are omitted from API requests. However, any non-pointer,
  5606. // non-interface field appearing in ForceSendFields will be sent to the
  5607. // server regardless of whether the field is empty or not. This may be
  5608. // used to include empty fields in Patch requests.
  5609. ForceSendFields []string `json:"-"`
  5610. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  5611. // include in API requests with the JSON null value. By default, fields
  5612. // with empty values are omitted from API requests. However, any field
  5613. // with an empty value appearing in NullFields will be sent to the
  5614. // server as null. It is an error if a field in this list has a
  5615. // non-empty value. This may be used to include null fields in Patch
  5616. // requests.
  5617. NullFields []string `json:"-"`
  5618. }
  5619. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  5620. type NoMethod ConnectionDraining
  5621. raw := NoMethod(*s)
  5622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5623. }
  5624. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  5625. type CustomerEncryptionKey struct {
  5626. // KmsKeyName: The name of the encryption key that is stored in Google
  5627. // Cloud KMS.
  5628. KmsKeyName string `json:"kmsKeyName,omitempty"`
  5629. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  5630. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  5631. RawKey string `json:"rawKey,omitempty"`
  5632. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  5633. // 2048-bit customer-supplied encryption key to either encrypt or
  5634. // decrypt this resource.
  5635. //
  5636. // The key must meet the following requirements before you can provide
  5637. // it to Compute Engine:
  5638. // - The key is wrapped using a RSA public key certificate provided by
  5639. // Google.
  5640. // - After being wrapped, the key must be encoded in RFC 4648 base64
  5641. // encoding. Gets the RSA public key certificate provided by Google
  5642. // at:
  5643. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  5644. // ss.pem
  5645. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  5646. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  5647. // customer-supplied encryption key that protects this resource.
  5648. Sha256 string `json:"sha256,omitempty"`
  5649. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  5650. // unconditionally include in API requests. By default, fields with
  5651. // empty values are omitted from API requests. However, any non-pointer,
  5652. // non-interface field appearing in ForceSendFields will be sent to the
  5653. // server regardless of whether the field is empty or not. This may be
  5654. // used to include empty fields in Patch requests.
  5655. ForceSendFields []string `json:"-"`
  5656. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  5657. // API requests with the JSON null value. By default, fields with empty
  5658. // values are omitted from API requests. However, any field with an
  5659. // empty value appearing in NullFields will be sent to the server as
  5660. // null. It is an error if a field in this list has a non-empty value.
  5661. // This may be used to include null fields in Patch requests.
  5662. NullFields []string `json:"-"`
  5663. }
  5664. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  5665. type NoMethod CustomerEncryptionKey
  5666. raw := NoMethod(*s)
  5667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5668. }
  5669. type CustomerEncryptionKeyProtectedDisk struct {
  5670. // DiskEncryptionKey: Decrypts data associated with the disk with a
  5671. // customer-supplied encryption key.
  5672. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5673. // Source: Specifies a valid partial or full URL to an existing
  5674. // Persistent Disk resource. This field is only applicable for
  5675. // persistent disks.
  5676. Source string `json:"source,omitempty"`
  5677. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  5678. // to unconditionally include in API requests. By default, fields with
  5679. // empty values are omitted from API requests. However, any non-pointer,
  5680. // non-interface field appearing in ForceSendFields will be sent to the
  5681. // server regardless of whether the field is empty or not. This may be
  5682. // used to include empty fields in Patch requests.
  5683. ForceSendFields []string `json:"-"`
  5684. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  5685. // include in API requests with the JSON null value. By default, fields
  5686. // with empty values are omitted from API requests. However, any field
  5687. // with an empty value appearing in NullFields will be sent to the
  5688. // server as null. It is an error if a field in this list has a
  5689. // non-empty value. This may be used to include null fields in Patch
  5690. // requests.
  5691. NullFields []string `json:"-"`
  5692. }
  5693. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  5694. type NoMethod CustomerEncryptionKeyProtectedDisk
  5695. raw := NoMethod(*s)
  5696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5697. }
  5698. // DeprecationStatus: Deprecation status for a public resource.
  5699. type DeprecationStatus struct {
  5700. // Deleted: An optional RFC3339 timestamp on or after which the state of
  5701. // this resource is intended to change to DELETED. This is only
  5702. // informational and the status will not change unless the client
  5703. // explicitly changes it.
  5704. Deleted string `json:"deleted,omitempty"`
  5705. // Deprecated: An optional RFC3339 timestamp on or after which the state
  5706. // of this resource is intended to change to DEPRECATED. This is only
  5707. // informational and the status will not change unless the client
  5708. // explicitly changes it.
  5709. Deprecated string `json:"deprecated,omitempty"`
  5710. // Obsolete: An optional RFC3339 timestamp on or after which the state
  5711. // of this resource is intended to change to OBSOLETE. This is only
  5712. // informational and the status will not change unless the client
  5713. // explicitly changes it.
  5714. Obsolete string `json:"obsolete,omitempty"`
  5715. // Replacement: The URL of the suggested replacement for a deprecated
  5716. // resource. The suggested replacement resource must be the same kind of
  5717. // resource as the deprecated resource.
  5718. Replacement string `json:"replacement,omitempty"`
  5719. // State: The deprecation state of this resource. This can be
  5720. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  5721. // resource using a DEPRECATED resource will return successfully, but
  5722. // with a warning indicating the deprecated resource and recommending
  5723. // its replacement. Operations which use OBSOLETE or DELETED resources
  5724. // will be rejected and result in an error.
  5725. //
  5726. // Possible values:
  5727. // "DELETED"
  5728. // "DEPRECATED"
  5729. // "OBSOLETE"
  5730. State string `json:"state,omitempty"`
  5731. // ForceSendFields is a list of field names (e.g. "Deleted") to
  5732. // unconditionally include in API requests. By default, fields with
  5733. // empty values are omitted from API requests. However, any non-pointer,
  5734. // non-interface field appearing in ForceSendFields will be sent to the
  5735. // server regardless of whether the field is empty or not. This may be
  5736. // used to include empty fields in Patch requests.
  5737. ForceSendFields []string `json:"-"`
  5738. // NullFields is a list of field names (e.g. "Deleted") to include in
  5739. // API requests with the JSON null value. By default, fields with empty
  5740. // values are omitted from API requests. However, any field with an
  5741. // empty value appearing in NullFields will be sent to the server as
  5742. // null. It is an error if a field in this list has a non-empty value.
  5743. // This may be used to include null fields in Patch requests.
  5744. NullFields []string `json:"-"`
  5745. }
  5746. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  5747. type NoMethod DeprecationStatus
  5748. raw := NoMethod(*s)
  5749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5750. }
  5751. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  5752. // resource_for v1.disks ==)
  5753. type Disk struct {
  5754. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5755. // format.
  5756. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5757. // Description: An optional description of this resource. Provide this
  5758. // property when you create the resource.
  5759. Description string `json:"description,omitempty"`
  5760. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  5761. // encryption key.
  5762. //
  5763. // After you encrypt a disk with a customer-supplied key, you must
  5764. // provide the same key if you use the disk later (e.g. to create a disk
  5765. // snapshot or an image, or to attach the disk to a virtual
  5766. // machine).
  5767. //
  5768. // Customer-supplied encryption keys do not protect access to metadata
  5769. // of the disk.
  5770. //
  5771. // If you do not provide an encryption key when creating the disk, then
  5772. // the disk will be encrypted using an automatically generated key and
  5773. // you do not need to provide a key to use the disk later.
  5774. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5775. // GuestOsFeatures: A list of features to enable on the guest operating
  5776. // system. Applicable only for bootable images. Read Enabling guest
  5777. // operating system features to see a list of available options.
  5778. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  5779. // Id: [Output Only] The unique identifier for the resource. This
  5780. // identifier is defined by the server.
  5781. Id uint64 `json:"id,omitempty,string"`
  5782. // Kind: [Output Only] Type of the resource. Always compute#disk for
  5783. // disks.
  5784. Kind string `json:"kind,omitempty"`
  5785. // LabelFingerprint: A fingerprint for the labels being applied to this
  5786. // disk, which is essentially a hash of the labels set used for
  5787. // optimistic locking. The fingerprint is initially generated by Compute
  5788. // Engine and changes after every request to modify or update labels.
  5789. // You must always provide an up-to-date fingerprint hash in order to
  5790. // update or change labels, otherwise the request will fail with error
  5791. // 412 conditionNotMet.
  5792. //
  5793. // To see the latest fingerprint, make a get() request to retrieve a
  5794. // disk.
  5795. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5796. // Labels: Labels to apply to this disk. These can be later modified by
  5797. // the setLabels method.
  5798. Labels map[string]string `json:"labels,omitempty"`
  5799. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  5800. // text format.
  5801. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  5802. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  5803. // text format.
  5804. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  5805. // LicenseCodes: Integer license codes indicating which licenses are
  5806. // attached to this disk.
  5807. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  5808. // Licenses: A list of publicly visible licenses. Reserved for Google's
  5809. // use.
  5810. Licenses []string `json:"licenses,omitempty"`
  5811. // Name: Name of the resource. Provided by the client when the resource
  5812. // is created. The name must be 1-63 characters long, and comply with
  5813. // RFC1035. Specifically, the name must be 1-63 characters long and
  5814. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5815. // the first character must be a lowercase letter, and all following
  5816. // characters must be a dash, lowercase letter, or digit, except the
  5817. // last character, which cannot be a dash.
  5818. Name string `json:"name,omitempty"`
  5819. // Options: Internal use only.
  5820. Options string `json:"options,omitempty"`
  5821. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  5822. // in bytes. If not present in a request, a default value is used.
  5823. // Currently supported sizes are 4096 and 16384, other sizes may be
  5824. // added in the future. If an unsupported value is requested, the error
  5825. // message will list the supported values for the caller's project.
  5826. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  5827. // Region: [Output Only] URL of the region where the disk resides. Only
  5828. // applicable for regional resources. You must specify this field as
  5829. // part of the HTTP request URL. It is not settable as a field in the
  5830. // request body.
  5831. Region string `json:"region,omitempty"`
  5832. // ReplicaZones: URLs of the zones where the disk should be replicated
  5833. // to. Only applicable for regional resources.
  5834. ReplicaZones []string `json:"replicaZones,omitempty"`
  5835. // ResourcePolicies: Resource policies applied to this disk for
  5836. // automatic snapshot creations.
  5837. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  5838. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5839. // resource.
  5840. SelfLink string `json:"selfLink,omitempty"`
  5841. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  5842. // this field when creating a persistent disk using the sourceImage or
  5843. // sourceSnapshot parameter, or specify it alone to create an empty
  5844. // persistent disk.
  5845. //
  5846. // If you specify this field along with sourceImage or sourceSnapshot,
  5847. // the value of sizeGb must not be less than the size of the sourceImage
  5848. // or the size of the snapshot. Acceptable values are 1 to 65536,
  5849. // inclusive.
  5850. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5851. // SourceImage: The source image used to create this disk. If the source
  5852. // image is deleted, this field will not be set.
  5853. //
  5854. // To create a disk with one of the public operating system images,
  5855. // specify the image by its family name. For example, specify
  5856. // family/debian-9 to use the latest Debian 9
  5857. // image:
  5858. // projects/debian-cloud/global/images/family/debian-9
  5859. //
  5860. //
  5861. // Alternati
  5862. // vely, use a specific version of a public operating system
  5863. // image:
  5864. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  5865. //
  5866. //
  5867. //
  5868. // To create a disk with a custom image that you created, specify the
  5869. // image name in the following
  5870. // format:
  5871. // global/images/my-custom-image
  5872. //
  5873. //
  5874. // You can also specify a custom image by its image family, which
  5875. // returns the latest version of the image in that family. Replace the
  5876. // image name with
  5877. // family/family-name:
  5878. // global/images/family/my-image-family
  5879. SourceImage string `json:"sourceImage,omitempty"`
  5880. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  5881. // source image. Required if the source image is protected by a
  5882. // customer-supplied encryption key.
  5883. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  5884. // SourceImageId: [Output Only] The ID value of the image used to create
  5885. // this disk. This value identifies the exact image that was used to
  5886. // create this persistent disk. For example, if you created the
  5887. // persistent disk from an image that was later deleted and recreated
  5888. // under the same name, the source image ID would identify the exact
  5889. // version of the image that was used.
  5890. SourceImageId string `json:"sourceImageId,omitempty"`
  5891. // SourceSnapshot: The source snapshot used to create this disk. You can
  5892. // provide this as a partial or full URL to the resource. For example,
  5893. // the following are valid values:
  5894. // -
  5895. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  5896. // - projects/project/global/snapshots/snapshot
  5897. // - global/snapshots/snapshot
  5898. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  5899. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  5900. // the source snapshot. Required if the source snapshot is protected by
  5901. // a customer-supplied encryption key.
  5902. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  5903. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  5904. // create this disk. This value identifies the exact snapshot that was
  5905. // used to create this persistent disk. For example, if you created the
  5906. // persistent disk from a snapshot that was later deleted and recreated
  5907. // under the same name, the source snapshot ID would identify the exact
  5908. // version of the snapshot that was used.
  5909. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  5910. // Status: [Output Only] The status of disk creation.
  5911. //
  5912. // Possible values:
  5913. // "CREATING"
  5914. // "FAILED"
  5915. // "READY"
  5916. // "RESTORING"
  5917. Status string `json:"status,omitempty"`
  5918. // StorageType: [Deprecated] Storage type of the persistent disk.
  5919. //
  5920. // Possible values:
  5921. // "HDD"
  5922. // "SSD"
  5923. StorageType string `json:"storageType,omitempty"`
  5924. // Type: URL of the disk type resource describing which disk type to use
  5925. // to create the disk. Provide this when creating the disk. For example:
  5926. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  5927. Type string `json:"type,omitempty"`
  5928. // Users: [Output Only] Links to the users of the disk (attached
  5929. // instances) in form: project/zones/zone/instances/instance
  5930. Users []string `json:"users,omitempty"`
  5931. // Zone: [Output Only] URL of the zone where the disk resides. You must
  5932. // specify this field as part of the HTTP request URL. It is not
  5933. // settable as a field in the request body.
  5934. Zone string `json:"zone,omitempty"`
  5935. // ServerResponse contains the HTTP response code and headers from the
  5936. // server.
  5937. googleapi.ServerResponse `json:"-"`
  5938. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5939. // to unconditionally include in API requests. By default, fields with
  5940. // empty values are omitted from API requests. However, any non-pointer,
  5941. // non-interface field appearing in ForceSendFields will be sent to the
  5942. // server regardless of whether the field is empty or not. This may be
  5943. // used to include empty fields in Patch requests.
  5944. ForceSendFields []string `json:"-"`
  5945. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5946. // include in API requests with the JSON null value. By default, fields
  5947. // with empty values are omitted from API requests. However, any field
  5948. // with an empty value appearing in NullFields will be sent to the
  5949. // server as null. It is an error if a field in this list has a
  5950. // non-empty value. This may be used to include null fields in Patch
  5951. // requests.
  5952. NullFields []string `json:"-"`
  5953. }
  5954. func (s *Disk) MarshalJSON() ([]byte, error) {
  5955. type NoMethod Disk
  5956. raw := NoMethod(*s)
  5957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5958. }
  5959. type DiskAggregatedList struct {
  5960. // Id: [Output Only] Unique identifier for the resource; defined by the
  5961. // server.
  5962. Id string `json:"id,omitempty"`
  5963. // Items: A list of DisksScopedList resources.
  5964. Items map[string]DisksScopedList `json:"items,omitempty"`
  5965. // Kind: [Output Only] Type of resource. Always
  5966. // compute#diskAggregatedList for aggregated lists of persistent disks.
  5967. Kind string `json:"kind,omitempty"`
  5968. // NextPageToken: [Output Only] This token allows you to get the next
  5969. // page of results for list requests. If the number of results is larger
  5970. // than maxResults, use the nextPageToken as a value for the query
  5971. // parameter pageToken in the next list request. Subsequent list
  5972. // requests will have their own nextPageToken to continue paging through
  5973. // the results.
  5974. NextPageToken string `json:"nextPageToken,omitempty"`
  5975. // SelfLink: [Output Only] Server-defined URL for this resource.
  5976. SelfLink string `json:"selfLink,omitempty"`
  5977. // Warning: [Output Only] Informational warning message.
  5978. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  5979. // ServerResponse contains the HTTP response code and headers from the
  5980. // server.
  5981. googleapi.ServerResponse `json:"-"`
  5982. // ForceSendFields is a list of field names (e.g. "Id") to
  5983. // unconditionally include in API requests. By default, fields with
  5984. // empty values are omitted from API requests. However, any non-pointer,
  5985. // non-interface field appearing in ForceSendFields will be sent to the
  5986. // server regardless of whether the field is empty or not. This may be
  5987. // used to include empty fields in Patch requests.
  5988. ForceSendFields []string `json:"-"`
  5989. // NullFields is a list of field names (e.g. "Id") to include in API
  5990. // requests with the JSON null value. By default, fields with empty
  5991. // values are omitted from API requests. However, any field with an
  5992. // empty value appearing in NullFields will be sent to the server as
  5993. // null. It is an error if a field in this list has a non-empty value.
  5994. // This may be used to include null fields in Patch requests.
  5995. NullFields []string `json:"-"`
  5996. }
  5997. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  5998. type NoMethod DiskAggregatedList
  5999. raw := NoMethod(*s)
  6000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6001. }
  6002. // DiskAggregatedListWarning: [Output Only] Informational warning
  6003. // message.
  6004. type DiskAggregatedListWarning struct {
  6005. // Code: [Output Only] A warning code, if applicable. For example,
  6006. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6007. // the response.
  6008. //
  6009. // Possible values:
  6010. // "CLEANUP_FAILED"
  6011. // "DEPRECATED_RESOURCE_USED"
  6012. // "DEPRECATED_TYPE_USED"
  6013. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6014. // "EXPERIMENTAL_TYPE_USED"
  6015. // "EXTERNAL_API_WARNING"
  6016. // "FIELD_VALUE_OVERRIDEN"
  6017. // "INJECTED_KERNELS_DEPRECATED"
  6018. // "MISSING_TYPE_DEPENDENCY"
  6019. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6020. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6021. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6022. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6023. // "NEXT_HOP_NOT_RUNNING"
  6024. // "NOT_CRITICAL_ERROR"
  6025. // "NO_RESULTS_ON_PAGE"
  6026. // "REQUIRED_TOS_AGREEMENT"
  6027. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6028. // "RESOURCE_NOT_DELETED"
  6029. // "SCHEMA_VALIDATION_IGNORED"
  6030. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6031. // "UNDECLARED_PROPERTIES"
  6032. // "UNREACHABLE"
  6033. Code string `json:"code,omitempty"`
  6034. // Data: [Output Only] Metadata about this warning in key: value format.
  6035. // For example:
  6036. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6037. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  6038. // Message: [Output Only] A human-readable description of the warning
  6039. // code.
  6040. Message string `json:"message,omitempty"`
  6041. // ForceSendFields is a list of field names (e.g. "Code") to
  6042. // unconditionally include in API requests. By default, fields with
  6043. // empty values are omitted from API requests. However, any non-pointer,
  6044. // non-interface field appearing in ForceSendFields will be sent to the
  6045. // server regardless of whether the field is empty or not. This may be
  6046. // used to include empty fields in Patch requests.
  6047. ForceSendFields []string `json:"-"`
  6048. // NullFields is a list of field names (e.g. "Code") to include in API
  6049. // requests with the JSON null value. By default, fields with empty
  6050. // values are omitted from API requests. However, any field with an
  6051. // empty value appearing in NullFields will be sent to the server as
  6052. // null. It is an error if a field in this list has a non-empty value.
  6053. // This may be used to include null fields in Patch requests.
  6054. NullFields []string `json:"-"`
  6055. }
  6056. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6057. type NoMethod DiskAggregatedListWarning
  6058. raw := NoMethod(*s)
  6059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6060. }
  6061. type DiskAggregatedListWarningData struct {
  6062. // Key: [Output Only] A key that provides more detail on the warning
  6063. // being returned. For example, for warnings where there are no results
  6064. // in a list request for a particular zone, this key might be scope and
  6065. // the key value might be the zone name. Other examples might be a key
  6066. // indicating a deprecated resource and a suggested replacement, or a
  6067. // warning about invalid network settings (for example, if an instance
  6068. // attempts to perform IP forwarding but is not enabled for IP
  6069. // forwarding).
  6070. Key string `json:"key,omitempty"`
  6071. // Value: [Output Only] A warning data value corresponding to the key.
  6072. Value string `json:"value,omitempty"`
  6073. // ForceSendFields is a list of field names (e.g. "Key") to
  6074. // unconditionally include in API requests. By default, fields with
  6075. // empty values are omitted from API requests. However, any non-pointer,
  6076. // non-interface field appearing in ForceSendFields will be sent to the
  6077. // server regardless of whether the field is empty or not. This may be
  6078. // used to include empty fields in Patch requests.
  6079. ForceSendFields []string `json:"-"`
  6080. // NullFields is a list of field names (e.g. "Key") to include in API
  6081. // requests with the JSON null value. By default, fields with empty
  6082. // values are omitted from API requests. However, any field with an
  6083. // empty value appearing in NullFields will be sent to the server as
  6084. // null. It is an error if a field in this list has a non-empty value.
  6085. // This may be used to include null fields in Patch requests.
  6086. NullFields []string `json:"-"`
  6087. }
  6088. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6089. type NoMethod DiskAggregatedListWarningData
  6090. raw := NoMethod(*s)
  6091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6092. }
  6093. // DiskInstantiationConfig: A specification of the desired way to
  6094. // instantiate a disk in the instance template when its created from a
  6095. // source instance.
  6096. type DiskInstantiationConfig struct {
  6097. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  6098. // instance is deleted (but not when the disk is detached from the
  6099. // instance).
  6100. AutoDelete bool `json:"autoDelete,omitempty"`
  6101. // CustomImage: The custom source image to be used to restore this disk
  6102. // when instantiating this instance template.
  6103. CustomImage string `json:"customImage,omitempty"`
  6104. // DeviceName: Specifies the device name of the disk to which the
  6105. // configurations apply to.
  6106. DeviceName string `json:"deviceName,omitempty"`
  6107. // InstantiateFrom: Specifies whether to include the disk and what image
  6108. // to use. Possible values are:
  6109. // - source-image: to use the same image that was used to create the
  6110. // source instance's corresponding disk. Applicable to the boot disk and
  6111. // additional read-write disks.
  6112. // - source-image-family: to use the same image family that was used to
  6113. // create the source instance's corresponding disk. Applicable to the
  6114. // boot disk and additional read-write disks.
  6115. // - custom-image: to use a user-provided image url for disk creation.
  6116. // Applicable to the boot disk and additional read-write disks.
  6117. // - attach-read-only: to attach a read-only disk. Applicable to
  6118. // read-only disks.
  6119. // - do-not-include: to exclude a disk from the template. Applicable to
  6120. // additional read-write disks, local SSDs, and read-only disks.
  6121. //
  6122. // Possible values:
  6123. // "ATTACH_READ_ONLY"
  6124. // "BLANK"
  6125. // "CUSTOM_IMAGE"
  6126. // "DEFAULT"
  6127. // "DO_NOT_INCLUDE"
  6128. // "SOURCE_IMAGE"
  6129. // "SOURCE_IMAGE_FAMILY"
  6130. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  6131. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  6132. // unconditionally include in API requests. By default, fields with
  6133. // empty values are omitted from API requests. However, any non-pointer,
  6134. // non-interface field appearing in ForceSendFields will be sent to the
  6135. // server regardless of whether the field is empty or not. This may be
  6136. // used to include empty fields in Patch requests.
  6137. ForceSendFields []string `json:"-"`
  6138. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  6139. // API requests with the JSON null value. By default, fields with empty
  6140. // values are omitted from API requests. However, any field with an
  6141. // empty value appearing in NullFields will be sent to the server as
  6142. // null. It is an error if a field in this list has a non-empty value.
  6143. // This may be used to include null fields in Patch requests.
  6144. NullFields []string `json:"-"`
  6145. }
  6146. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  6147. type NoMethod DiskInstantiationConfig
  6148. raw := NoMethod(*s)
  6149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6150. }
  6151. // DiskList: A list of Disk resources.
  6152. type DiskList struct {
  6153. // Id: [Output Only] Unique identifier for the resource; defined by the
  6154. // server.
  6155. Id string `json:"id,omitempty"`
  6156. // Items: A list of Disk resources.
  6157. Items []*Disk `json:"items,omitempty"`
  6158. // Kind: [Output Only] Type of resource. Always compute#diskList for
  6159. // lists of disks.
  6160. Kind string `json:"kind,omitempty"`
  6161. // NextPageToken: [Output Only] This token allows you to get the next
  6162. // page of results for list requests. If the number of results is larger
  6163. // than maxResults, use the nextPageToken as a value for the query
  6164. // parameter pageToken in the next list request. Subsequent list
  6165. // requests will have their own nextPageToken to continue paging through
  6166. // the results.
  6167. NextPageToken string `json:"nextPageToken,omitempty"`
  6168. // SelfLink: [Output Only] Server-defined URL for this resource.
  6169. SelfLink string `json:"selfLink,omitempty"`
  6170. // Warning: [Output Only] Informational warning message.
  6171. Warning *DiskListWarning `json:"warning,omitempty"`
  6172. // ServerResponse contains the HTTP response code and headers from the
  6173. // server.
  6174. googleapi.ServerResponse `json:"-"`
  6175. // ForceSendFields is a list of field names (e.g. "Id") to
  6176. // unconditionally include in API requests. By default, fields with
  6177. // empty values are omitted from API requests. However, any non-pointer,
  6178. // non-interface field appearing in ForceSendFields will be sent to the
  6179. // server regardless of whether the field is empty or not. This may be
  6180. // used to include empty fields in Patch requests.
  6181. ForceSendFields []string `json:"-"`
  6182. // NullFields is a list of field names (e.g. "Id") to include in API
  6183. // requests with the JSON null value. By default, fields with empty
  6184. // values are omitted from API requests. However, any field with an
  6185. // empty value appearing in NullFields will be sent to the server as
  6186. // null. It is an error if a field in this list has a non-empty value.
  6187. // This may be used to include null fields in Patch requests.
  6188. NullFields []string `json:"-"`
  6189. }
  6190. func (s *DiskList) MarshalJSON() ([]byte, error) {
  6191. type NoMethod DiskList
  6192. raw := NoMethod(*s)
  6193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6194. }
  6195. // DiskListWarning: [Output Only] Informational warning message.
  6196. type DiskListWarning struct {
  6197. // Code: [Output Only] A warning code, if applicable. For example,
  6198. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6199. // the response.
  6200. //
  6201. // Possible values:
  6202. // "CLEANUP_FAILED"
  6203. // "DEPRECATED_RESOURCE_USED"
  6204. // "DEPRECATED_TYPE_USED"
  6205. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6206. // "EXPERIMENTAL_TYPE_USED"
  6207. // "EXTERNAL_API_WARNING"
  6208. // "FIELD_VALUE_OVERRIDEN"
  6209. // "INJECTED_KERNELS_DEPRECATED"
  6210. // "MISSING_TYPE_DEPENDENCY"
  6211. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6212. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6213. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6214. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6215. // "NEXT_HOP_NOT_RUNNING"
  6216. // "NOT_CRITICAL_ERROR"
  6217. // "NO_RESULTS_ON_PAGE"
  6218. // "REQUIRED_TOS_AGREEMENT"
  6219. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6220. // "RESOURCE_NOT_DELETED"
  6221. // "SCHEMA_VALIDATION_IGNORED"
  6222. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6223. // "UNDECLARED_PROPERTIES"
  6224. // "UNREACHABLE"
  6225. Code string `json:"code,omitempty"`
  6226. // Data: [Output Only] Metadata about this warning in key: value format.
  6227. // For example:
  6228. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6229. Data []*DiskListWarningData `json:"data,omitempty"`
  6230. // Message: [Output Only] A human-readable description of the warning
  6231. // code.
  6232. Message string `json:"message,omitempty"`
  6233. // ForceSendFields is a list of field names (e.g. "Code") to
  6234. // unconditionally include in API requests. By default, fields with
  6235. // empty values are omitted from API requests. However, any non-pointer,
  6236. // non-interface field appearing in ForceSendFields will be sent to the
  6237. // server regardless of whether the field is empty or not. This may be
  6238. // used to include empty fields in Patch requests.
  6239. ForceSendFields []string `json:"-"`
  6240. // NullFields is a list of field names (e.g. "Code") to include in API
  6241. // requests with the JSON null value. By default, fields with empty
  6242. // values are omitted from API requests. However, any field with an
  6243. // empty value appearing in NullFields will be sent to the server as
  6244. // null. It is an error if a field in this list has a non-empty value.
  6245. // This may be used to include null fields in Patch requests.
  6246. NullFields []string `json:"-"`
  6247. }
  6248. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  6249. type NoMethod DiskListWarning
  6250. raw := NoMethod(*s)
  6251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6252. }
  6253. type DiskListWarningData struct {
  6254. // Key: [Output Only] A key that provides more detail on the warning
  6255. // being returned. For example, for warnings where there are no results
  6256. // in a list request for a particular zone, this key might be scope and
  6257. // the key value might be the zone name. Other examples might be a key
  6258. // indicating a deprecated resource and a suggested replacement, or a
  6259. // warning about invalid network settings (for example, if an instance
  6260. // attempts to perform IP forwarding but is not enabled for IP
  6261. // forwarding).
  6262. Key string `json:"key,omitempty"`
  6263. // Value: [Output Only] A warning data value corresponding to the key.
  6264. Value string `json:"value,omitempty"`
  6265. // ForceSendFields is a list of field names (e.g. "Key") to
  6266. // unconditionally include in API requests. By default, fields with
  6267. // empty values are omitted from API requests. However, any non-pointer,
  6268. // non-interface field appearing in ForceSendFields will be sent to the
  6269. // server regardless of whether the field is empty or not. This may be
  6270. // used to include empty fields in Patch requests.
  6271. ForceSendFields []string `json:"-"`
  6272. // NullFields is a list of field names (e.g. "Key") to include in API
  6273. // requests with the JSON null value. By default, fields with empty
  6274. // values are omitted from API requests. However, any field with an
  6275. // empty value appearing in NullFields will be sent to the server as
  6276. // null. It is an error if a field in this list has a non-empty value.
  6277. // This may be used to include null fields in Patch requests.
  6278. NullFields []string `json:"-"`
  6279. }
  6280. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  6281. type NoMethod DiskListWarningData
  6282. raw := NoMethod(*s)
  6283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6284. }
  6285. type DiskMoveRequest struct {
  6286. // DestinationZone: The URL of the destination zone to move the disk.
  6287. // This can be a full or partial URL. For example, the following are all
  6288. // valid URLs to a zone:
  6289. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  6290. //
  6291. // - projects/project/zones/zone
  6292. // - zones/zone
  6293. DestinationZone string `json:"destinationZone,omitempty"`
  6294. // TargetDisk: The URL of the target disk to move. This can be a full or
  6295. // partial URL. For example, the following are all valid URLs to a disk:
  6296. //
  6297. // -
  6298. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  6299. // - projects/project/zones/zone/disks/disk
  6300. // - zones/zone/disks/disk
  6301. TargetDisk string `json:"targetDisk,omitempty"`
  6302. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  6303. // unconditionally include in API requests. By default, fields with
  6304. // empty values are omitted from API requests. However, any non-pointer,
  6305. // non-interface field appearing in ForceSendFields will be sent to the
  6306. // server regardless of whether the field is empty or not. This may be
  6307. // used to include empty fields in Patch requests.
  6308. ForceSendFields []string `json:"-"`
  6309. // NullFields is a list of field names (e.g. "DestinationZone") to
  6310. // include in API requests with the JSON null value. By default, fields
  6311. // with empty values are omitted from API requests. However, any field
  6312. // with an empty value appearing in NullFields will be sent to the
  6313. // server as null. It is an error if a field in this list has a
  6314. // non-empty value. This may be used to include null fields in Patch
  6315. // requests.
  6316. NullFields []string `json:"-"`
  6317. }
  6318. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  6319. type NoMethod DiskMoveRequest
  6320. raw := NoMethod(*s)
  6321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6322. }
  6323. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  6324. // (== resource_for v1.diskTypes ==)
  6325. type DiskType struct {
  6326. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6327. // format.
  6328. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6329. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  6330. // GB.
  6331. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  6332. // Deprecated: [Output Only] The deprecation status associated with this
  6333. // disk type.
  6334. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  6335. // Description: [Output Only] An optional description of this resource.
  6336. Description string `json:"description,omitempty"`
  6337. // Id: [Output Only] The unique identifier for the resource. This
  6338. // identifier is defined by the server.
  6339. Id uint64 `json:"id,omitempty,string"`
  6340. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  6341. // disk types.
  6342. Kind string `json:"kind,omitempty"`
  6343. // Name: [Output Only] Name of the resource.
  6344. Name string `json:"name,omitempty"`
  6345. // Region: [Output Only] URL of the region where the disk type resides.
  6346. // Only applicable for regional resources. You must specify this field
  6347. // as part of the HTTP request URL. It is not settable as a field in the
  6348. // request body.
  6349. Region string `json:"region,omitempty"`
  6350. // SelfLink: [Output Only] Server-defined URL for the resource.
  6351. SelfLink string `json:"selfLink,omitempty"`
  6352. // ValidDiskSize: [Output Only] An optional textual description of the
  6353. // valid disk size, such as "10GB-10TB".
  6354. ValidDiskSize string `json:"validDiskSize,omitempty"`
  6355. // Zone: [Output Only] URL of the zone where the disk type resides. You
  6356. // must specify this field as part of the HTTP request URL. It is not
  6357. // settable as a field in the request body.
  6358. Zone string `json:"zone,omitempty"`
  6359. // ServerResponse contains the HTTP response code and headers from the
  6360. // server.
  6361. googleapi.ServerResponse `json:"-"`
  6362. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6363. // to unconditionally include in API requests. By default, fields with
  6364. // empty values are omitted from API requests. However, any non-pointer,
  6365. // non-interface field appearing in ForceSendFields will be sent to the
  6366. // server regardless of whether the field is empty or not. This may be
  6367. // used to include empty fields in Patch requests.
  6368. ForceSendFields []string `json:"-"`
  6369. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6370. // include in API requests with the JSON null value. By default, fields
  6371. // with empty values are omitted from API requests. However, any field
  6372. // with an empty value appearing in NullFields will be sent to the
  6373. // server as null. It is an error if a field in this list has a
  6374. // non-empty value. This may be used to include null fields in Patch
  6375. // requests.
  6376. NullFields []string `json:"-"`
  6377. }
  6378. func (s *DiskType) MarshalJSON() ([]byte, error) {
  6379. type NoMethod DiskType
  6380. raw := NoMethod(*s)
  6381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6382. }
  6383. type DiskTypeAggregatedList struct {
  6384. // Id: [Output Only] Unique identifier for the resource; defined by the
  6385. // server.
  6386. Id string `json:"id,omitempty"`
  6387. // Items: A list of DiskTypesScopedList resources.
  6388. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  6389. // Kind: [Output Only] Type of resource. Always
  6390. // compute#diskTypeAggregatedList.
  6391. Kind string `json:"kind,omitempty"`
  6392. // NextPageToken: [Output Only] This token allows you to get the next
  6393. // page of results for list requests. If the number of results is larger
  6394. // than maxResults, use the nextPageToken as a value for the query
  6395. // parameter pageToken in the next list request. Subsequent list
  6396. // requests will have their own nextPageToken to continue paging through
  6397. // the results.
  6398. NextPageToken string `json:"nextPageToken,omitempty"`
  6399. // SelfLink: [Output Only] Server-defined URL for this resource.
  6400. SelfLink string `json:"selfLink,omitempty"`
  6401. // Warning: [Output Only] Informational warning message.
  6402. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  6403. // ServerResponse contains the HTTP response code and headers from the
  6404. // server.
  6405. googleapi.ServerResponse `json:"-"`
  6406. // ForceSendFields is a list of field names (e.g. "Id") to
  6407. // unconditionally include in API requests. By default, fields with
  6408. // empty values are omitted from API requests. However, any non-pointer,
  6409. // non-interface field appearing in ForceSendFields will be sent to the
  6410. // server regardless of whether the field is empty or not. This may be
  6411. // used to include empty fields in Patch requests.
  6412. ForceSendFields []string `json:"-"`
  6413. // NullFields is a list of field names (e.g. "Id") to include in API
  6414. // requests with the JSON null value. By default, fields with empty
  6415. // values are omitted from API requests. However, any field with an
  6416. // empty value appearing in NullFields will be sent to the server as
  6417. // null. It is an error if a field in this list has a non-empty value.
  6418. // This may be used to include null fields in Patch requests.
  6419. NullFields []string `json:"-"`
  6420. }
  6421. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  6422. type NoMethod DiskTypeAggregatedList
  6423. raw := NoMethod(*s)
  6424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6425. }
  6426. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  6427. // message.
  6428. type DiskTypeAggregatedListWarning struct {
  6429. // Code: [Output Only] A warning code, if applicable. For example,
  6430. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6431. // the response.
  6432. //
  6433. // Possible values:
  6434. // "CLEANUP_FAILED"
  6435. // "DEPRECATED_RESOURCE_USED"
  6436. // "DEPRECATED_TYPE_USED"
  6437. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6438. // "EXPERIMENTAL_TYPE_USED"
  6439. // "EXTERNAL_API_WARNING"
  6440. // "FIELD_VALUE_OVERRIDEN"
  6441. // "INJECTED_KERNELS_DEPRECATED"
  6442. // "MISSING_TYPE_DEPENDENCY"
  6443. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6444. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6445. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6446. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6447. // "NEXT_HOP_NOT_RUNNING"
  6448. // "NOT_CRITICAL_ERROR"
  6449. // "NO_RESULTS_ON_PAGE"
  6450. // "REQUIRED_TOS_AGREEMENT"
  6451. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6452. // "RESOURCE_NOT_DELETED"
  6453. // "SCHEMA_VALIDATION_IGNORED"
  6454. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6455. // "UNDECLARED_PROPERTIES"
  6456. // "UNREACHABLE"
  6457. Code string `json:"code,omitempty"`
  6458. // Data: [Output Only] Metadata about this warning in key: value format.
  6459. // For example:
  6460. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6461. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  6462. // Message: [Output Only] A human-readable description of the warning
  6463. // code.
  6464. Message string `json:"message,omitempty"`
  6465. // ForceSendFields is a list of field names (e.g. "Code") to
  6466. // unconditionally include in API requests. By default, fields with
  6467. // empty values are omitted from API requests. However, any non-pointer,
  6468. // non-interface field appearing in ForceSendFields will be sent to the
  6469. // server regardless of whether the field is empty or not. This may be
  6470. // used to include empty fields in Patch requests.
  6471. ForceSendFields []string `json:"-"`
  6472. // NullFields is a list of field names (e.g. "Code") to include in API
  6473. // requests with the JSON null value. By default, fields with empty
  6474. // values are omitted from API requests. However, any field with an
  6475. // empty value appearing in NullFields will be sent to the server as
  6476. // null. It is an error if a field in this list has a non-empty value.
  6477. // This may be used to include null fields in Patch requests.
  6478. NullFields []string `json:"-"`
  6479. }
  6480. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6481. type NoMethod DiskTypeAggregatedListWarning
  6482. raw := NoMethod(*s)
  6483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6484. }
  6485. type DiskTypeAggregatedListWarningData struct {
  6486. // Key: [Output Only] A key that provides more detail on the warning
  6487. // being returned. For example, for warnings where there are no results
  6488. // in a list request for a particular zone, this key might be scope and
  6489. // the key value might be the zone name. Other examples might be a key
  6490. // indicating a deprecated resource and a suggested replacement, or a
  6491. // warning about invalid network settings (for example, if an instance
  6492. // attempts to perform IP forwarding but is not enabled for IP
  6493. // forwarding).
  6494. Key string `json:"key,omitempty"`
  6495. // Value: [Output Only] A warning data value corresponding to the key.
  6496. Value string `json:"value,omitempty"`
  6497. // ForceSendFields is a list of field names (e.g. "Key") to
  6498. // unconditionally include in API requests. By default, fields with
  6499. // empty values are omitted from API requests. However, any non-pointer,
  6500. // non-interface field appearing in ForceSendFields will be sent to the
  6501. // server regardless of whether the field is empty or not. This may be
  6502. // used to include empty fields in Patch requests.
  6503. ForceSendFields []string `json:"-"`
  6504. // NullFields is a list of field names (e.g. "Key") to include in API
  6505. // requests with the JSON null value. By default, fields with empty
  6506. // values are omitted from API requests. However, any field with an
  6507. // empty value appearing in NullFields will be sent to the server as
  6508. // null. It is an error if a field in this list has a non-empty value.
  6509. // This may be used to include null fields in Patch requests.
  6510. NullFields []string `json:"-"`
  6511. }
  6512. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6513. type NoMethod DiskTypeAggregatedListWarningData
  6514. raw := NoMethod(*s)
  6515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6516. }
  6517. // DiskTypeList: Contains a list of disk types.
  6518. type DiskTypeList struct {
  6519. // Id: [Output Only] Unique identifier for the resource; defined by the
  6520. // server.
  6521. Id string `json:"id,omitempty"`
  6522. // Items: A list of DiskType resources.
  6523. Items []*DiskType `json:"items,omitempty"`
  6524. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  6525. // disk types.
  6526. Kind string `json:"kind,omitempty"`
  6527. // NextPageToken: [Output Only] This token allows you to get the next
  6528. // page of results for list requests. If the number of results is larger
  6529. // than maxResults, use the nextPageToken as a value for the query
  6530. // parameter pageToken in the next list request. Subsequent list
  6531. // requests will have their own nextPageToken to continue paging through
  6532. // the results.
  6533. NextPageToken string `json:"nextPageToken,omitempty"`
  6534. // SelfLink: [Output Only] Server-defined URL for this resource.
  6535. SelfLink string `json:"selfLink,omitempty"`
  6536. // Warning: [Output Only] Informational warning message.
  6537. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  6538. // ServerResponse contains the HTTP response code and headers from the
  6539. // server.
  6540. googleapi.ServerResponse `json:"-"`
  6541. // ForceSendFields is a list of field names (e.g. "Id") to
  6542. // unconditionally include in API requests. By default, fields with
  6543. // empty values are omitted from API requests. However, any non-pointer,
  6544. // non-interface field appearing in ForceSendFields will be sent to the
  6545. // server regardless of whether the field is empty or not. This may be
  6546. // used to include empty fields in Patch requests.
  6547. ForceSendFields []string `json:"-"`
  6548. // NullFields is a list of field names (e.g. "Id") to include in API
  6549. // requests with the JSON null value. By default, fields with empty
  6550. // values are omitted from API requests. However, any field with an
  6551. // empty value appearing in NullFields will be sent to the server as
  6552. // null. It is an error if a field in this list has a non-empty value.
  6553. // This may be used to include null fields in Patch requests.
  6554. NullFields []string `json:"-"`
  6555. }
  6556. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  6557. type NoMethod DiskTypeList
  6558. raw := NoMethod(*s)
  6559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6560. }
  6561. // DiskTypeListWarning: [Output Only] Informational warning message.
  6562. type DiskTypeListWarning struct {
  6563. // Code: [Output Only] A warning code, if applicable. For example,
  6564. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6565. // the response.
  6566. //
  6567. // Possible values:
  6568. // "CLEANUP_FAILED"
  6569. // "DEPRECATED_RESOURCE_USED"
  6570. // "DEPRECATED_TYPE_USED"
  6571. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6572. // "EXPERIMENTAL_TYPE_USED"
  6573. // "EXTERNAL_API_WARNING"
  6574. // "FIELD_VALUE_OVERRIDEN"
  6575. // "INJECTED_KERNELS_DEPRECATED"
  6576. // "MISSING_TYPE_DEPENDENCY"
  6577. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6578. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6579. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6580. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6581. // "NEXT_HOP_NOT_RUNNING"
  6582. // "NOT_CRITICAL_ERROR"
  6583. // "NO_RESULTS_ON_PAGE"
  6584. // "REQUIRED_TOS_AGREEMENT"
  6585. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6586. // "RESOURCE_NOT_DELETED"
  6587. // "SCHEMA_VALIDATION_IGNORED"
  6588. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6589. // "UNDECLARED_PROPERTIES"
  6590. // "UNREACHABLE"
  6591. Code string `json:"code,omitempty"`
  6592. // Data: [Output Only] Metadata about this warning in key: value format.
  6593. // For example:
  6594. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6595. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  6596. // Message: [Output Only] A human-readable description of the warning
  6597. // code.
  6598. Message string `json:"message,omitempty"`
  6599. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  6615. type NoMethod DiskTypeListWarning
  6616. raw := NoMethod(*s)
  6617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6618. }
  6619. type DiskTypeListWarningData struct {
  6620. // Key: [Output Only] A key that provides more detail on the warning
  6621. // being returned. For example, for warnings where there are no results
  6622. // in a list request for a particular zone, this key might be scope and
  6623. // the key value might be the zone name. Other examples might be a key
  6624. // indicating a deprecated resource and a suggested replacement, or a
  6625. // warning about invalid network settings (for example, if an instance
  6626. // attempts to perform IP forwarding but is not enabled for IP
  6627. // forwarding).
  6628. Key string `json:"key,omitempty"`
  6629. // Value: [Output Only] A warning data value corresponding to the key.
  6630. Value string `json:"value,omitempty"`
  6631. // ForceSendFields is a list of field names (e.g. "Key") to
  6632. // unconditionally include in API requests. By default, fields with
  6633. // empty values are omitted from API requests. However, any non-pointer,
  6634. // non-interface field appearing in ForceSendFields will be sent to the
  6635. // server regardless of whether the field is empty or not. This may be
  6636. // used to include empty fields in Patch requests.
  6637. ForceSendFields []string `json:"-"`
  6638. // NullFields is a list of field names (e.g. "Key") to include in API
  6639. // requests with the JSON null value. By default, fields with empty
  6640. // values are omitted from API requests. However, any field with an
  6641. // empty value appearing in NullFields will be sent to the server as
  6642. // null. It is an error if a field in this list has a non-empty value.
  6643. // This may be used to include null fields in Patch requests.
  6644. NullFields []string `json:"-"`
  6645. }
  6646. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  6647. type NoMethod DiskTypeListWarningData
  6648. raw := NoMethod(*s)
  6649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6650. }
  6651. type DiskTypesScopedList struct {
  6652. // DiskTypes: [Output Only] A list of disk types contained in this
  6653. // scope.
  6654. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  6655. // Warning: [Output Only] Informational warning which replaces the list
  6656. // of disk types when the list is empty.
  6657. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  6658. // ForceSendFields is a list of field names (e.g. "DiskTypes") 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. "DiskTypes") to include in
  6666. // API 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 *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  6674. type NoMethod DiskTypesScopedList
  6675. raw := NoMethod(*s)
  6676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6677. }
  6678. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  6679. // replaces the list of disk types when the list is empty.
  6680. type DiskTypesScopedListWarning struct {
  6681. // Code: [Output Only] A warning code, if applicable. For example,
  6682. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6683. // the response.
  6684. //
  6685. // Possible values:
  6686. // "CLEANUP_FAILED"
  6687. // "DEPRECATED_RESOURCE_USED"
  6688. // "DEPRECATED_TYPE_USED"
  6689. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6690. // "EXPERIMENTAL_TYPE_USED"
  6691. // "EXTERNAL_API_WARNING"
  6692. // "FIELD_VALUE_OVERRIDEN"
  6693. // "INJECTED_KERNELS_DEPRECATED"
  6694. // "MISSING_TYPE_DEPENDENCY"
  6695. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6696. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6697. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6698. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6699. // "NEXT_HOP_NOT_RUNNING"
  6700. // "NOT_CRITICAL_ERROR"
  6701. // "NO_RESULTS_ON_PAGE"
  6702. // "REQUIRED_TOS_AGREEMENT"
  6703. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6704. // "RESOURCE_NOT_DELETED"
  6705. // "SCHEMA_VALIDATION_IGNORED"
  6706. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6707. // "UNDECLARED_PROPERTIES"
  6708. // "UNREACHABLE"
  6709. Code string `json:"code,omitempty"`
  6710. // Data: [Output Only] Metadata about this warning in key: value format.
  6711. // For example:
  6712. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6713. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  6714. // Message: [Output Only] A human-readable description of the warning
  6715. // code.
  6716. Message string `json:"message,omitempty"`
  6717. // ForceSendFields is a list of field names (e.g. "Code") to
  6718. // unconditionally include in API requests. By default, fields with
  6719. // empty values are omitted from API requests. However, any non-pointer,
  6720. // non-interface field appearing in ForceSendFields will be sent to the
  6721. // server regardless of whether the field is empty or not. This may be
  6722. // used to include empty fields in Patch requests.
  6723. ForceSendFields []string `json:"-"`
  6724. // NullFields is a list of field names (e.g. "Code") to include in API
  6725. // requests with the JSON null value. By default, fields with empty
  6726. // values are omitted from API requests. However, any field with an
  6727. // empty value appearing in NullFields will be sent to the server as
  6728. // null. It is an error if a field in this list has a non-empty value.
  6729. // This may be used to include null fields in Patch requests.
  6730. NullFields []string `json:"-"`
  6731. }
  6732. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6733. type NoMethod DiskTypesScopedListWarning
  6734. raw := NoMethod(*s)
  6735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6736. }
  6737. type DiskTypesScopedListWarningData struct {
  6738. // Key: [Output Only] A key that provides more detail on the warning
  6739. // being returned. For example, for warnings where there are no results
  6740. // in a list request for a particular zone, this key might be scope and
  6741. // the key value might be the zone name. Other examples might be a key
  6742. // indicating a deprecated resource and a suggested replacement, or a
  6743. // warning about invalid network settings (for example, if an instance
  6744. // attempts to perform IP forwarding but is not enabled for IP
  6745. // forwarding).
  6746. Key string `json:"key,omitempty"`
  6747. // Value: [Output Only] A warning data value corresponding to the key.
  6748. Value string `json:"value,omitempty"`
  6749. // ForceSendFields is a list of field names (e.g. "Key") to
  6750. // unconditionally include in API requests. By default, fields with
  6751. // empty values are omitted from API requests. However, any non-pointer,
  6752. // non-interface field appearing in ForceSendFields will be sent to the
  6753. // server regardless of whether the field is empty or not. This may be
  6754. // used to include empty fields in Patch requests.
  6755. ForceSendFields []string `json:"-"`
  6756. // NullFields is a list of field names (e.g. "Key") to include in API
  6757. // requests with the JSON null value. By default, fields with empty
  6758. // values are omitted from API requests. However, any field with an
  6759. // empty value appearing in NullFields will be sent to the server as
  6760. // null. It is an error if a field in this list has a non-empty value.
  6761. // This may be used to include null fields in Patch requests.
  6762. NullFields []string `json:"-"`
  6763. }
  6764. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6765. type NoMethod DiskTypesScopedListWarningData
  6766. raw := NoMethod(*s)
  6767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6768. }
  6769. type DisksAddResourcePoliciesRequest struct {
  6770. // ResourcePolicies: Resource policies to be added to this disk.
  6771. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6772. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6773. // unconditionally include in API requests. By default, fields with
  6774. // empty values are omitted from API requests. However, any non-pointer,
  6775. // non-interface field appearing in ForceSendFields will be sent to the
  6776. // server regardless of whether the field is empty or not. This may be
  6777. // used to include empty fields in Patch requests.
  6778. ForceSendFields []string `json:"-"`
  6779. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6780. // include in API requests with the JSON null value. By default, fields
  6781. // with empty values are omitted from API requests. However, any field
  6782. // with an empty value appearing in NullFields will be sent to the
  6783. // server as null. It is an error if a field in this list has a
  6784. // non-empty value. This may be used to include null fields in Patch
  6785. // requests.
  6786. NullFields []string `json:"-"`
  6787. }
  6788. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6789. type NoMethod DisksAddResourcePoliciesRequest
  6790. raw := NoMethod(*s)
  6791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6792. }
  6793. type DisksRemoveResourcePoliciesRequest struct {
  6794. // ResourcePolicies: Resource policies to be removed from this disk.
  6795. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6796. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6797. // unconditionally include in API requests. By default, fields with
  6798. // empty values are omitted from API requests. However, any non-pointer,
  6799. // non-interface field appearing in ForceSendFields will be sent to the
  6800. // server regardless of whether the field is empty or not. This may be
  6801. // used to include empty fields in Patch requests.
  6802. ForceSendFields []string `json:"-"`
  6803. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6804. // include in API requests with the JSON null value. By default, fields
  6805. // with empty values are omitted from API requests. However, any field
  6806. // with an empty value appearing in NullFields will be sent to the
  6807. // server as null. It is an error if a field in this list has a
  6808. // non-empty value. This may be used to include null fields in Patch
  6809. // requests.
  6810. NullFields []string `json:"-"`
  6811. }
  6812. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6813. type NoMethod DisksRemoveResourcePoliciesRequest
  6814. raw := NoMethod(*s)
  6815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6816. }
  6817. type DisksResizeRequest struct {
  6818. // SizeGb: The new size of the persistent disk, which is specified in
  6819. // GB.
  6820. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6821. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  6822. // unconditionally include in API requests. By default, fields with
  6823. // empty values are omitted from API requests. However, any non-pointer,
  6824. // non-interface field appearing in ForceSendFields will be sent to the
  6825. // server regardless of whether the field is empty or not. This may be
  6826. // used to include empty fields in Patch requests.
  6827. ForceSendFields []string `json:"-"`
  6828. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  6829. // requests with the JSON null value. By default, fields with empty
  6830. // values are omitted from API requests. However, any field with an
  6831. // empty value appearing in NullFields will be sent to the server as
  6832. // null. It is an error if a field in this list has a non-empty value.
  6833. // This may be used to include null fields in Patch requests.
  6834. NullFields []string `json:"-"`
  6835. }
  6836. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  6837. type NoMethod DisksResizeRequest
  6838. raw := NoMethod(*s)
  6839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6840. }
  6841. type DisksScopedList struct {
  6842. // Disks: [Output Only] A list of disks contained in this scope.
  6843. Disks []*Disk `json:"disks,omitempty"`
  6844. // Warning: [Output Only] Informational warning which replaces the list
  6845. // of disks when the list is empty.
  6846. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  6847. // ForceSendFields is a list of field names (e.g. "Disks") to
  6848. // unconditionally include in API requests. By default, fields with
  6849. // empty values are omitted from API requests. However, any non-pointer,
  6850. // non-interface field appearing in ForceSendFields will be sent to the
  6851. // server regardless of whether the field is empty or not. This may be
  6852. // used to include empty fields in Patch requests.
  6853. ForceSendFields []string `json:"-"`
  6854. // NullFields is a list of field names (e.g. "Disks") to include in API
  6855. // requests with the JSON null value. By default, fields with empty
  6856. // values are omitted from API requests. However, any field with an
  6857. // empty value appearing in NullFields will be sent to the server as
  6858. // null. It is an error if a field in this list has a non-empty value.
  6859. // This may be used to include null fields in Patch requests.
  6860. NullFields []string `json:"-"`
  6861. }
  6862. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  6863. type NoMethod DisksScopedList
  6864. raw := NoMethod(*s)
  6865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6866. }
  6867. // DisksScopedListWarning: [Output Only] Informational warning which
  6868. // replaces the list of disks when the list is empty.
  6869. type DisksScopedListWarning struct {
  6870. // Code: [Output Only] A warning code, if applicable. For example,
  6871. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6872. // the response.
  6873. //
  6874. // Possible values:
  6875. // "CLEANUP_FAILED"
  6876. // "DEPRECATED_RESOURCE_USED"
  6877. // "DEPRECATED_TYPE_USED"
  6878. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6879. // "EXPERIMENTAL_TYPE_USED"
  6880. // "EXTERNAL_API_WARNING"
  6881. // "FIELD_VALUE_OVERRIDEN"
  6882. // "INJECTED_KERNELS_DEPRECATED"
  6883. // "MISSING_TYPE_DEPENDENCY"
  6884. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6885. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6886. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6887. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6888. // "NEXT_HOP_NOT_RUNNING"
  6889. // "NOT_CRITICAL_ERROR"
  6890. // "NO_RESULTS_ON_PAGE"
  6891. // "REQUIRED_TOS_AGREEMENT"
  6892. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6893. // "RESOURCE_NOT_DELETED"
  6894. // "SCHEMA_VALIDATION_IGNORED"
  6895. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6896. // "UNDECLARED_PROPERTIES"
  6897. // "UNREACHABLE"
  6898. Code string `json:"code,omitempty"`
  6899. // Data: [Output Only] Metadata about this warning in key: value format.
  6900. // For example:
  6901. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6902. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  6903. // Message: [Output Only] A human-readable description of the warning
  6904. // code.
  6905. Message string `json:"message,omitempty"`
  6906. // ForceSendFields is a list of field names (e.g. "Code") to
  6907. // unconditionally include in API requests. By default, fields with
  6908. // empty values are omitted from API requests. However, any non-pointer,
  6909. // non-interface field appearing in ForceSendFields will be sent to the
  6910. // server regardless of whether the field is empty or not. This may be
  6911. // used to include empty fields in Patch requests.
  6912. ForceSendFields []string `json:"-"`
  6913. // NullFields is a list of field names (e.g. "Code") to include in API
  6914. // requests with the JSON null value. By default, fields with empty
  6915. // values are omitted from API requests. However, any field with an
  6916. // empty value appearing in NullFields will be sent to the server as
  6917. // null. It is an error if a field in this list has a non-empty value.
  6918. // This may be used to include null fields in Patch requests.
  6919. NullFields []string `json:"-"`
  6920. }
  6921. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  6922. type NoMethod DisksScopedListWarning
  6923. raw := NoMethod(*s)
  6924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6925. }
  6926. type DisksScopedListWarningData struct {
  6927. // Key: [Output Only] A key that provides more detail on the warning
  6928. // being returned. For example, for warnings where there are no results
  6929. // in a list request for a particular zone, this key might be scope and
  6930. // the key value might be the zone name. Other examples might be a key
  6931. // indicating a deprecated resource and a suggested replacement, or a
  6932. // warning about invalid network settings (for example, if an instance
  6933. // attempts to perform IP forwarding but is not enabled for IP
  6934. // forwarding).
  6935. Key string `json:"key,omitempty"`
  6936. // Value: [Output Only] A warning data value corresponding to the key.
  6937. Value string `json:"value,omitempty"`
  6938. // ForceSendFields is a list of field names (e.g. "Key") to
  6939. // unconditionally include in API requests. By default, fields with
  6940. // empty values are omitted from API requests. However, any non-pointer,
  6941. // non-interface field appearing in ForceSendFields will be sent to the
  6942. // server regardless of whether the field is empty or not. This may be
  6943. // used to include empty fields in Patch requests.
  6944. ForceSendFields []string `json:"-"`
  6945. // NullFields is a list of field names (e.g. "Key") to include in API
  6946. // requests with the JSON null value. By default, fields with empty
  6947. // values are omitted from API requests. However, any field with an
  6948. // empty value appearing in NullFields will be sent to the server as
  6949. // null. It is an error if a field in this list has a non-empty value.
  6950. // This may be used to include null fields in Patch requests.
  6951. NullFields []string `json:"-"`
  6952. }
  6953. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  6954. type NoMethod DisksScopedListWarningData
  6955. raw := NoMethod(*s)
  6956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6957. }
  6958. // DisplayDevice: A set of Display Device options
  6959. type DisplayDevice struct {
  6960. // EnableDisplay: Defines whether the instance has Display enabled.
  6961. EnableDisplay bool `json:"enableDisplay,omitempty"`
  6962. // ForceSendFields is a list of field names (e.g. "EnableDisplay") to
  6963. // unconditionally include in API requests. By default, fields with
  6964. // empty values are omitted from API requests. However, any non-pointer,
  6965. // non-interface field appearing in ForceSendFields will be sent to the
  6966. // server regardless of whether the field is empty or not. This may be
  6967. // used to include empty fields in Patch requests.
  6968. ForceSendFields []string `json:"-"`
  6969. // NullFields is a list of field names (e.g. "EnableDisplay") to include
  6970. // in API requests with the JSON null value. By default, fields with
  6971. // empty values are omitted from API requests. However, any field with
  6972. // an empty value appearing in NullFields will be sent to the server as
  6973. // null. It is an error if a field in this list has a non-empty value.
  6974. // This may be used to include null fields in Patch requests.
  6975. NullFields []string `json:"-"`
  6976. }
  6977. func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
  6978. type NoMethod DisplayDevice
  6979. raw := NoMethod(*s)
  6980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6981. }
  6982. type DistributionPolicy struct {
  6983. // Zones: Zones where the regional managed instance group will create
  6984. // and manage instances.
  6985. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  6986. // ForceSendFields is a list of field names (e.g. "Zones") to
  6987. // unconditionally include in API requests. By default, fields with
  6988. // empty values are omitted from API requests. However, any non-pointer,
  6989. // non-interface field appearing in ForceSendFields will be sent to the
  6990. // server regardless of whether the field is empty or not. This may be
  6991. // used to include empty fields in Patch requests.
  6992. ForceSendFields []string `json:"-"`
  6993. // NullFields is a list of field names (e.g. "Zones") to include in API
  6994. // requests with the JSON null value. By default, fields with empty
  6995. // values are omitted from API requests. However, any field with an
  6996. // empty value appearing in NullFields will be sent to the server as
  6997. // null. It is an error if a field in this list has a non-empty value.
  6998. // This may be used to include null fields in Patch requests.
  6999. NullFields []string `json:"-"`
  7000. }
  7001. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  7002. type NoMethod DistributionPolicy
  7003. raw := NoMethod(*s)
  7004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7005. }
  7006. type DistributionPolicyZoneConfiguration struct {
  7007. // Zone: The URL of the zone. The zone must exist in the region where
  7008. // the managed instance group is located.
  7009. Zone string `json:"zone,omitempty"`
  7010. // ForceSendFields is a list of field names (e.g. "Zone") to
  7011. // unconditionally include in API requests. By default, fields with
  7012. // empty values are omitted from API requests. However, any non-pointer,
  7013. // non-interface field appearing in ForceSendFields will be sent to the
  7014. // server regardless of whether the field is empty or not. This may be
  7015. // used to include empty fields in Patch requests.
  7016. ForceSendFields []string `json:"-"`
  7017. // NullFields is a list of field names (e.g. "Zone") to include in API
  7018. // requests with the JSON null value. By default, fields with empty
  7019. // values are omitted from API requests. However, any field with an
  7020. // empty value appearing in NullFields will be sent to the server as
  7021. // null. It is an error if a field in this list has a non-empty value.
  7022. // This may be used to include null fields in Patch requests.
  7023. NullFields []string `json:"-"`
  7024. }
  7025. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  7026. type NoMethod DistributionPolicyZoneConfiguration
  7027. raw := NoMethod(*s)
  7028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7029. }
  7030. type ExchangedPeeringRoute struct {
  7031. // DestRange: The destination range of the route.
  7032. DestRange string `json:"destRange,omitempty"`
  7033. // Imported: If the peering route is imported if there is no
  7034. // confliction.
  7035. Imported bool `json:"imported,omitempty"`
  7036. // NextHopRegion: The region of peering route next hop, only applies to
  7037. // dynamic routes.
  7038. NextHopRegion string `json:"nextHopRegion,omitempty"`
  7039. // Priority: The priority of the peering route.
  7040. Priority int64 `json:"priority,omitempty"`
  7041. // Type: The type of the peering route.
  7042. //
  7043. // Possible values:
  7044. // "DYNAMIC_PEERING_ROUTE"
  7045. // "STATIC_PEERING_ROUTE"
  7046. // "SUBNET_PEERING_ROUTE"
  7047. Type string `json:"type,omitempty"`
  7048. // ForceSendFields is a list of field names (e.g. "DestRange") to
  7049. // unconditionally include in API requests. By default, fields with
  7050. // empty values are omitted from API requests. However, any non-pointer,
  7051. // non-interface field appearing in ForceSendFields will be sent to the
  7052. // server regardless of whether the field is empty or not. This may be
  7053. // used to include empty fields in Patch requests.
  7054. ForceSendFields []string `json:"-"`
  7055. // NullFields is a list of field names (e.g. "DestRange") to include in
  7056. // API requests with the JSON null value. By default, fields with empty
  7057. // values are omitted from API requests. However, any field with an
  7058. // empty value appearing in NullFields will be sent to the server as
  7059. // null. It is an error if a field in this list has a non-empty value.
  7060. // This may be used to include null fields in Patch requests.
  7061. NullFields []string `json:"-"`
  7062. }
  7063. func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
  7064. type NoMethod ExchangedPeeringRoute
  7065. raw := NoMethod(*s)
  7066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7067. }
  7068. type ExchangedPeeringRoutesList struct {
  7069. // Id: [Output Only] Unique identifier for the resource; defined by the
  7070. // server.
  7071. Id string `json:"id,omitempty"`
  7072. // Items: A list of ExchangedPeeringRoute resources.
  7073. Items []*ExchangedPeeringRoute `json:"items,omitempty"`
  7074. // Kind: [Output Only] Type of resource. Always
  7075. // compute#exchangedPeeringRoutesList for exchanged peering routes
  7076. // lists.
  7077. Kind string `json:"kind,omitempty"`
  7078. // NextPageToken: [Output Only] This token allows you to get the next
  7079. // page of results for list requests. If the number of results is larger
  7080. // than maxResults, use the nextPageToken as a value for the query
  7081. // parameter pageToken in the next list request. Subsequent list
  7082. // requests will have their own nextPageToken to continue paging through
  7083. // the results.
  7084. NextPageToken string `json:"nextPageToken,omitempty"`
  7085. // SelfLink: [Output Only] Server-defined URL for this resource.
  7086. SelfLink string `json:"selfLink,omitempty"`
  7087. // Warning: [Output Only] Informational warning message.
  7088. Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
  7089. // ServerResponse contains the HTTP response code and headers from the
  7090. // server.
  7091. googleapi.ServerResponse `json:"-"`
  7092. // ForceSendFields is a list of field names (e.g. "Id") to
  7093. // unconditionally include in API requests. By default, fields with
  7094. // empty values are omitted from API requests. However, any non-pointer,
  7095. // non-interface field appearing in ForceSendFields will be sent to the
  7096. // server regardless of whether the field is empty or not. This may be
  7097. // used to include empty fields in Patch requests.
  7098. ForceSendFields []string `json:"-"`
  7099. // NullFields is a list of field names (e.g. "Id") to include in API
  7100. // requests with the JSON null value. By default, fields with empty
  7101. // values are omitted from API requests. However, any field with an
  7102. // empty value appearing in NullFields will be sent to the server as
  7103. // null. It is an error if a field in this list has a non-empty value.
  7104. // This may be used to include null fields in Patch requests.
  7105. NullFields []string `json:"-"`
  7106. }
  7107. func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
  7108. type NoMethod ExchangedPeeringRoutesList
  7109. raw := NoMethod(*s)
  7110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7111. }
  7112. // ExchangedPeeringRoutesListWarning: [Output Only] Informational
  7113. // warning message.
  7114. type ExchangedPeeringRoutesListWarning struct {
  7115. // Code: [Output Only] A warning code, if applicable. For example,
  7116. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7117. // the response.
  7118. //
  7119. // Possible values:
  7120. // "CLEANUP_FAILED"
  7121. // "DEPRECATED_RESOURCE_USED"
  7122. // "DEPRECATED_TYPE_USED"
  7123. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7124. // "EXPERIMENTAL_TYPE_USED"
  7125. // "EXTERNAL_API_WARNING"
  7126. // "FIELD_VALUE_OVERRIDEN"
  7127. // "INJECTED_KERNELS_DEPRECATED"
  7128. // "MISSING_TYPE_DEPENDENCY"
  7129. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7130. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7131. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7132. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7133. // "NEXT_HOP_NOT_RUNNING"
  7134. // "NOT_CRITICAL_ERROR"
  7135. // "NO_RESULTS_ON_PAGE"
  7136. // "REQUIRED_TOS_AGREEMENT"
  7137. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7138. // "RESOURCE_NOT_DELETED"
  7139. // "SCHEMA_VALIDATION_IGNORED"
  7140. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7141. // "UNDECLARED_PROPERTIES"
  7142. // "UNREACHABLE"
  7143. Code string `json:"code,omitempty"`
  7144. // Data: [Output Only] Metadata about this warning in key: value format.
  7145. // For example:
  7146. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7147. Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
  7148. // Message: [Output Only] A human-readable description of the warning
  7149. // code.
  7150. Message string `json:"message,omitempty"`
  7151. // ForceSendFields is a list of field names (e.g. "Code") to
  7152. // unconditionally include in API requests. By default, fields with
  7153. // empty values are omitted from API requests. However, any non-pointer,
  7154. // non-interface field appearing in ForceSendFields will be sent to the
  7155. // server regardless of whether the field is empty or not. This may be
  7156. // used to include empty fields in Patch requests.
  7157. ForceSendFields []string `json:"-"`
  7158. // NullFields is a list of field names (e.g. "Code") to include in API
  7159. // requests with the JSON null value. By default, fields with empty
  7160. // values are omitted from API requests. However, any field with an
  7161. // empty value appearing in NullFields will be sent to the server as
  7162. // null. It is an error if a field in this list has a non-empty value.
  7163. // This may be used to include null fields in Patch requests.
  7164. NullFields []string `json:"-"`
  7165. }
  7166. func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
  7167. type NoMethod ExchangedPeeringRoutesListWarning
  7168. raw := NoMethod(*s)
  7169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7170. }
  7171. type ExchangedPeeringRoutesListWarningData struct {
  7172. // Key: [Output Only] A key that provides more detail on the warning
  7173. // being returned. For example, for warnings where there are no results
  7174. // in a list request for a particular zone, this key might be scope and
  7175. // the key value might be the zone name. Other examples might be a key
  7176. // indicating a deprecated resource and a suggested replacement, or a
  7177. // warning about invalid network settings (for example, if an instance
  7178. // attempts to perform IP forwarding but is not enabled for IP
  7179. // forwarding).
  7180. Key string `json:"key,omitempty"`
  7181. // Value: [Output Only] A warning data value corresponding to the key.
  7182. Value string `json:"value,omitempty"`
  7183. // ForceSendFields is a list of field names (e.g. "Key") to
  7184. // unconditionally include in API requests. By default, fields with
  7185. // empty values are omitted from API requests. However, any non-pointer,
  7186. // non-interface field appearing in ForceSendFields will be sent to the
  7187. // server regardless of whether the field is empty or not. This may be
  7188. // used to include empty fields in Patch requests.
  7189. ForceSendFields []string `json:"-"`
  7190. // NullFields is a list of field names (e.g. "Key") to include in API
  7191. // requests with the JSON null value. By default, fields with empty
  7192. // values are omitted from API requests. However, any field with an
  7193. // empty value appearing in NullFields will be sent to the server as
  7194. // null. It is an error if a field in this list has a non-empty value.
  7195. // This may be used to include null fields in Patch requests.
  7196. NullFields []string `json:"-"`
  7197. }
  7198. func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
  7199. type NoMethod ExchangedPeeringRoutesListWarningData
  7200. raw := NoMethod(*s)
  7201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7202. }
  7203. // Expr: Represents an expression text. Example:
  7204. //
  7205. // title: "User account presence" description: "Determines whether the
  7206. // request has a user account" expression: "size(request.user) > 0"
  7207. type Expr struct {
  7208. // Description: An optional description of the expression. This is a
  7209. // longer text which describes the expression, e.g. when hovered over it
  7210. // in a UI.
  7211. Description string `json:"description,omitempty"`
  7212. // Expression: Textual representation of an expression in Common
  7213. // Expression Language syntax.
  7214. //
  7215. // The application context of the containing message determines which
  7216. // well-known feature set of CEL is supported.
  7217. Expression string `json:"expression,omitempty"`
  7218. // Location: An optional string indicating the location of the
  7219. // expression for error reporting, e.g. a file name and a position in
  7220. // the file.
  7221. Location string `json:"location,omitempty"`
  7222. // Title: An optional title for the expression, i.e. a short string
  7223. // describing its purpose. This can be used e.g. in UIs which allow to
  7224. // enter the expression.
  7225. Title string `json:"title,omitempty"`
  7226. // ForceSendFields is a list of field names (e.g. "Description") to
  7227. // unconditionally include in API requests. By default, fields with
  7228. // empty values are omitted from API requests. However, any non-pointer,
  7229. // non-interface field appearing in ForceSendFields will be sent to the
  7230. // server regardless of whether the field is empty or not. This may be
  7231. // used to include empty fields in Patch requests.
  7232. ForceSendFields []string `json:"-"`
  7233. // NullFields is a list of field names (e.g. "Description") to include
  7234. // in API requests with the JSON null value. By default, fields with
  7235. // empty values are omitted from API requests. However, any field with
  7236. // an empty value appearing in NullFields will be sent to the server as
  7237. // null. It is an error if a field in this list has a non-empty value.
  7238. // This may be used to include null fields in Patch requests.
  7239. NullFields []string `json:"-"`
  7240. }
  7241. func (s *Expr) MarshalJSON() ([]byte, error) {
  7242. type NoMethod Expr
  7243. raw := NoMethod(*s)
  7244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7245. }
  7246. // Firewall: Represents a Firewall resource.
  7247. type Firewall struct {
  7248. // Allowed: The list of ALLOW rules specified by this firewall. Each
  7249. // rule specifies a protocol and port-range tuple that describes a
  7250. // permitted connection.
  7251. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  7252. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7253. // format.
  7254. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7255. // Denied: The list of DENY rules specified by this firewall. Each rule
  7256. // specifies a protocol and port-range tuple that describes a denied
  7257. // connection.
  7258. Denied []*FirewallDenied `json:"denied,omitempty"`
  7259. // Description: An optional description of this resource. Provide this
  7260. // property when you create the resource.
  7261. Description string `json:"description,omitempty"`
  7262. // DestinationRanges: If destination ranges are specified, the firewall
  7263. // will apply only to traffic that has destination IP address in these
  7264. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  7265. // supported.
  7266. DestinationRanges []string `json:"destinationRanges,omitempty"`
  7267. // Direction: Direction of traffic to which this firewall applies;
  7268. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  7269. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  7270. // specify sourceRanges OR sourceTags.
  7271. //
  7272. // Possible values:
  7273. // "EGRESS"
  7274. // "INGRESS"
  7275. Direction string `json:"direction,omitempty"`
  7276. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  7277. // applied to the network it is associated with. When set to true, the
  7278. // firewall rule is not enforced and the network behaves as if it did
  7279. // not exist. If this is unspecified, the firewall rule will be enabled.
  7280. Disabled bool `json:"disabled,omitempty"`
  7281. // EnableLogging: Deprecated in favor of enable in LogConfig. This field
  7282. // denotes whether to enable logging for a particular firewall rule. If
  7283. // logging is enabled, logs will be exported to Stackdriver.
  7284. EnableLogging bool `json:"enableLogging,omitempty"`
  7285. // Id: [Output Only] The unique identifier for the resource. This
  7286. // identifier is defined by the server.
  7287. Id uint64 `json:"id,omitempty,string"`
  7288. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  7289. // firewall rules.
  7290. Kind string `json:"kind,omitempty"`
  7291. // LogConfig: This field denotes the logging options for a particular
  7292. // firewall rule. If logging is enabled, logs will be exported to
  7293. // Stackdriver.
  7294. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  7295. // Name: Name of the resource; provided by the client when the resource
  7296. // is created. The name must be 1-63 characters long, and comply with
  7297. // RFC1035. Specifically, the name must be 1-63 characters long and
  7298. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7299. // the first character must be a lowercase letter, and all following
  7300. // characters must be a dash, lowercase letter, or digit, except the
  7301. // last character, which cannot be a dash.
  7302. Name string `json:"name,omitempty"`
  7303. // Network: URL of the network resource for this firewall rule. If not
  7304. // specified when creating a firewall rule, the default network is
  7305. // used:
  7306. // global/networks/default
  7307. // If you choose to specify this property, you can specify the network
  7308. // as a full or partial URL. For example, the following are all valid
  7309. // URLs:
  7310. // -
  7311. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  7312. // - projects/myproject/global/networks/my-network
  7313. // - global/networks/default
  7314. Network string `json:"network,omitempty"`
  7315. // Priority: Priority for this rule. This is an integer between 0 and
  7316. // 65535, both inclusive. When not specified, the value assumed is 1000.
  7317. // Relative priorities determine precedence of conflicting rules. Lower
  7318. // value of priority implies higher precedence (eg, a rule with priority
  7319. // 0 has higher precedence than a rule with priority 1). DENY rules take
  7320. // precedence over ALLOW rules having equal priority.
  7321. Priority int64 `json:"priority,omitempty"`
  7322. // SelfLink: [Output Only] Server-defined URL for the resource.
  7323. SelfLink string `json:"selfLink,omitempty"`
  7324. // SourceRanges: If source ranges are specified, the firewall will apply
  7325. // only to traffic that has source IP address in these ranges. These
  7326. // ranges must be expressed in CIDR format. One or both of sourceRanges
  7327. // and sourceTags may be set. If both properties are set, the firewall
  7328. // will apply to traffic that has source IP address within sourceRanges
  7329. // OR the source IP that belongs to a tag listed in the sourceTags
  7330. // property. The connection does not need to match both properties for
  7331. // the firewall to apply. Only IPv4 is supported.
  7332. SourceRanges []string `json:"sourceRanges,omitempty"`
  7333. // SourceServiceAccounts: If source service accounts are specified, the
  7334. // firewall will apply only to traffic originating from an instance with
  7335. // a service account in this list. Source service accounts cannot be
  7336. // used to control traffic to an instance's external IP address because
  7337. // service accounts are associated with an instance, not an IP address.
  7338. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  7339. // both are set, the firewall will apply to traffic that has source IP
  7340. // address within sourceRanges OR the source IP belongs to an instance
  7341. // with service account listed in sourceServiceAccount. The connection
  7342. // does not need to match both properties for the firewall to apply.
  7343. // sourceServiceAccounts cannot be used at the same time as sourceTags
  7344. // or targetTags.
  7345. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  7346. // SourceTags: If source tags are specified, the firewall rule applies
  7347. // only to traffic with source IPs that match the primary network
  7348. // interfaces of VM instances that have the tag and are in the same VPC
  7349. // network. Source tags cannot be used to control traffic to an
  7350. // instance's external IP address, it only applies to traffic between
  7351. // instances in the same virtual network. Because tags are associated
  7352. // with instances, not IP addresses. One or both of sourceRanges and
  7353. // sourceTags may be set. If both properties are set, the firewall will
  7354. // apply to traffic that has source IP address within sourceRanges OR
  7355. // the source IP that belongs to a tag listed in the sourceTags
  7356. // property. The connection does not need to match both properties for
  7357. // the firewall to apply.
  7358. SourceTags []string `json:"sourceTags,omitempty"`
  7359. // TargetServiceAccounts: A list of service accounts indicating sets of
  7360. // instances located in the network that may make network connections as
  7361. // specified in allowed[]. targetServiceAccounts cannot be used at the
  7362. // same time as targetTags or sourceTags. If neither
  7363. // targetServiceAccounts nor targetTags are specified, the firewall rule
  7364. // applies to all instances on the specified network.
  7365. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  7366. // TargetTags: A list of tags that controls which instances the firewall
  7367. // rule applies to. If targetTags are specified, then the firewall rule
  7368. // applies only to instances in the VPC network that have one of those
  7369. // tags. If no targetTags are specified, the firewall rule applies to
  7370. // all instances on the specified network.
  7371. TargetTags []string `json:"targetTags,omitempty"`
  7372. // ServerResponse contains the HTTP response code and headers from the
  7373. // server.
  7374. googleapi.ServerResponse `json:"-"`
  7375. // ForceSendFields is a list of field names (e.g. "Allowed") to
  7376. // unconditionally include in API requests. By default, fields with
  7377. // empty values are omitted from API requests. However, any non-pointer,
  7378. // non-interface field appearing in ForceSendFields will be sent to the
  7379. // server regardless of whether the field is empty or not. This may be
  7380. // used to include empty fields in Patch requests.
  7381. ForceSendFields []string `json:"-"`
  7382. // NullFields is a list of field names (e.g. "Allowed") to include in
  7383. // API requests with the JSON null value. By default, fields with empty
  7384. // values are omitted from API requests. However, any field with an
  7385. // empty value appearing in NullFields will be sent to the server as
  7386. // null. It is an error if a field in this list has a non-empty value.
  7387. // This may be used to include null fields in Patch requests.
  7388. NullFields []string `json:"-"`
  7389. }
  7390. func (s *Firewall) MarshalJSON() ([]byte, error) {
  7391. type NoMethod Firewall
  7392. raw := NoMethod(*s)
  7393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7394. }
  7395. type FirewallAllowed struct {
  7396. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7397. // type is required when creating a firewall rule. This value can either
  7398. // be one of the following well known protocol strings (tcp, udp, icmp,
  7399. // esp, ah, ipip, sctp), or the IP protocol number.
  7400. IPProtocol string `json:"IPProtocol,omitempty"`
  7401. // Ports: An optional list of ports to which this rule applies. This
  7402. // field is only applicable for UDP or TCP protocol. Each entry must be
  7403. // either an integer or a range. If not specified, this rule applies to
  7404. // connections through any port.
  7405. //
  7406. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7407. Ports []string `json:"ports,omitempty"`
  7408. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  7409. // unconditionally include in API requests. By default, fields with
  7410. // empty values are omitted from API requests. However, any non-pointer,
  7411. // non-interface field appearing in ForceSendFields will be sent to the
  7412. // server regardless of whether the field is empty or not. This may be
  7413. // used to include empty fields in Patch requests.
  7414. ForceSendFields []string `json:"-"`
  7415. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  7416. // API requests with the JSON null value. By default, fields with empty
  7417. // values are omitted from API requests. However, any field with an
  7418. // empty value appearing in NullFields will be sent to the server as
  7419. // null. It is an error if a field in this list has a non-empty value.
  7420. // This may be used to include null fields in Patch requests.
  7421. NullFields []string `json:"-"`
  7422. }
  7423. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  7424. type NoMethod FirewallAllowed
  7425. raw := NoMethod(*s)
  7426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7427. }
  7428. type FirewallDenied struct {
  7429. // IPProtocol: The IP protocol to which this rule applies. The protocol
  7430. // type is required when creating a firewall rule. This value can either
  7431. // be one of the following well known protocol strings (tcp, udp, icmp,
  7432. // esp, ah, ipip, sctp), or the IP protocol number.
  7433. IPProtocol string `json:"IPProtocol,omitempty"`
  7434. // Ports: An optional list of ports to which this rule applies. This
  7435. // field is only applicable for UDP or TCP protocol. Each entry must be
  7436. // either an integer or a range. If not specified, this rule applies to
  7437. // connections through any port.
  7438. //
  7439. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  7440. Ports []string `json:"ports,omitempty"`
  7441. // ForceSendFields is a list of field names (e.g. "IPProtocol") 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. "IPProtocol") to include in
  7449. // API 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 *FirewallDenied) MarshalJSON() ([]byte, error) {
  7457. type NoMethod FirewallDenied
  7458. raw := NoMethod(*s)
  7459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7460. }
  7461. // FirewallList: Contains a list of firewalls.
  7462. type FirewallList struct {
  7463. // Id: [Output Only] Unique identifier for the resource; defined by the
  7464. // server.
  7465. Id string `json:"id,omitempty"`
  7466. // Items: A list of Firewall resources.
  7467. Items []*Firewall `json:"items,omitempty"`
  7468. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  7469. // lists of firewalls.
  7470. Kind string `json:"kind,omitempty"`
  7471. // NextPageToken: [Output Only] This token allows you to get the next
  7472. // page of results for list requests. If the number of results is larger
  7473. // than maxResults, use the nextPageToken as a value for the query
  7474. // parameter pageToken in the next list request. Subsequent list
  7475. // requests will have their own nextPageToken to continue paging through
  7476. // the results.
  7477. NextPageToken string `json:"nextPageToken,omitempty"`
  7478. // SelfLink: [Output Only] Server-defined URL for this resource.
  7479. SelfLink string `json:"selfLink,omitempty"`
  7480. // Warning: [Output Only] Informational warning message.
  7481. Warning *FirewallListWarning `json:"warning,omitempty"`
  7482. // ServerResponse contains the HTTP response code and headers from the
  7483. // server.
  7484. googleapi.ServerResponse `json:"-"`
  7485. // ForceSendFields is a list of field names (e.g. "Id") to
  7486. // unconditionally include in API requests. By default, fields with
  7487. // empty values are omitted from API requests. However, any non-pointer,
  7488. // non-interface field appearing in ForceSendFields will be sent to the
  7489. // server regardless of whether the field is empty or not. This may be
  7490. // used to include empty fields in Patch requests.
  7491. ForceSendFields []string `json:"-"`
  7492. // NullFields is a list of field names (e.g. "Id") to include in API
  7493. // requests with the JSON null value. By default, fields with empty
  7494. // values are omitted from API requests. However, any field with an
  7495. // empty value appearing in NullFields will be sent to the server as
  7496. // null. It is an error if a field in this list has a non-empty value.
  7497. // This may be used to include null fields in Patch requests.
  7498. NullFields []string `json:"-"`
  7499. }
  7500. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  7501. type NoMethod FirewallList
  7502. raw := NoMethod(*s)
  7503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7504. }
  7505. // FirewallListWarning: [Output Only] Informational warning message.
  7506. type FirewallListWarning struct {
  7507. // Code: [Output Only] A warning code, if applicable. For example,
  7508. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7509. // the response.
  7510. //
  7511. // Possible values:
  7512. // "CLEANUP_FAILED"
  7513. // "DEPRECATED_RESOURCE_USED"
  7514. // "DEPRECATED_TYPE_USED"
  7515. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7516. // "EXPERIMENTAL_TYPE_USED"
  7517. // "EXTERNAL_API_WARNING"
  7518. // "FIELD_VALUE_OVERRIDEN"
  7519. // "INJECTED_KERNELS_DEPRECATED"
  7520. // "MISSING_TYPE_DEPENDENCY"
  7521. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7522. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7523. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7524. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7525. // "NEXT_HOP_NOT_RUNNING"
  7526. // "NOT_CRITICAL_ERROR"
  7527. // "NO_RESULTS_ON_PAGE"
  7528. // "REQUIRED_TOS_AGREEMENT"
  7529. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7530. // "RESOURCE_NOT_DELETED"
  7531. // "SCHEMA_VALIDATION_IGNORED"
  7532. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7533. // "UNDECLARED_PROPERTIES"
  7534. // "UNREACHABLE"
  7535. Code string `json:"code,omitempty"`
  7536. // Data: [Output Only] Metadata about this warning in key: value format.
  7537. // For example:
  7538. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7539. Data []*FirewallListWarningData `json:"data,omitempty"`
  7540. // Message: [Output Only] A human-readable description of the warning
  7541. // code.
  7542. Message string `json:"message,omitempty"`
  7543. // ForceSendFields is a list of field names (e.g. "Code") to
  7544. // unconditionally include in API requests. By default, fields with
  7545. // empty values are omitted from API requests. However, any non-pointer,
  7546. // non-interface field appearing in ForceSendFields will be sent to the
  7547. // server regardless of whether the field is empty or not. This may be
  7548. // used to include empty fields in Patch requests.
  7549. ForceSendFields []string `json:"-"`
  7550. // NullFields is a list of field names (e.g. "Code") to include in API
  7551. // requests with the JSON null value. By default, fields with empty
  7552. // values are omitted from API requests. However, any field with an
  7553. // empty value appearing in NullFields will be sent to the server as
  7554. // null. It is an error if a field in this list has a non-empty value.
  7555. // This may be used to include null fields in Patch requests.
  7556. NullFields []string `json:"-"`
  7557. }
  7558. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  7559. type NoMethod FirewallListWarning
  7560. raw := NoMethod(*s)
  7561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7562. }
  7563. type FirewallListWarningData struct {
  7564. // Key: [Output Only] A key that provides more detail on the warning
  7565. // being returned. For example, for warnings where there are no results
  7566. // in a list request for a particular zone, this key might be scope and
  7567. // the key value might be the zone name. Other examples might be a key
  7568. // indicating a deprecated resource and a suggested replacement, or a
  7569. // warning about invalid network settings (for example, if an instance
  7570. // attempts to perform IP forwarding but is not enabled for IP
  7571. // forwarding).
  7572. Key string `json:"key,omitempty"`
  7573. // Value: [Output Only] A warning data value corresponding to the key.
  7574. Value string `json:"value,omitempty"`
  7575. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  7591. type NoMethod FirewallListWarningData
  7592. raw := NoMethod(*s)
  7593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7594. }
  7595. // FirewallLogConfig: The available logging options for a firewall rule.
  7596. type FirewallLogConfig struct {
  7597. // Enable: This field denotes whether to enable logging for a particular
  7598. // firewall rule.
  7599. Enable bool `json:"enable,omitempty"`
  7600. // ForceSendFields is a list of field names (e.g. "Enable") to
  7601. // unconditionally include in API requests. By default, fields with
  7602. // empty values are omitted from API requests. However, any non-pointer,
  7603. // non-interface field appearing in ForceSendFields will be sent to the
  7604. // server regardless of whether the field is empty or not. This may be
  7605. // used to include empty fields in Patch requests.
  7606. ForceSendFields []string `json:"-"`
  7607. // NullFields is a list of field names (e.g. "Enable") to include in API
  7608. // requests with the JSON null value. By default, fields with empty
  7609. // values are omitted from API requests. However, any field with an
  7610. // empty value appearing in NullFields will be sent to the server as
  7611. // null. It is an error if a field in this list has a non-empty value.
  7612. // This may be used to include null fields in Patch requests.
  7613. NullFields []string `json:"-"`
  7614. }
  7615. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  7616. type NoMethod FirewallLogConfig
  7617. raw := NoMethod(*s)
  7618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7619. }
  7620. // FixedOrPercent: Encapsulates numeric value that can be either
  7621. // absolute or relative.
  7622. type FixedOrPercent struct {
  7623. // Calculated: [Output Only] Absolute value of VM instances calculated
  7624. // based on the specific mode.
  7625. //
  7626. //
  7627. // - If the value is fixed, then the caculated value is equal to the
  7628. // fixed value.
  7629. // - If the value is a percent, then the calculated value is percent/100
  7630. // * targetSize. For example, the calculated value of a 80% of a managed
  7631. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  7632. // instances. If there is a remainder, the number is rounded up.
  7633. Calculated int64 `json:"calculated,omitempty"`
  7634. // Fixed: Specifies a fixed number of VM instances. This must be a
  7635. // positive integer.
  7636. Fixed int64 `json:"fixed,omitempty"`
  7637. // Percent: Specifies a percentage of instances between 0 to 100%,
  7638. // inclusive. For example, specify 80 for 80%.
  7639. Percent int64 `json:"percent,omitempty"`
  7640. // ForceSendFields is a list of field names (e.g. "Calculated") to
  7641. // unconditionally include in API requests. By default, fields with
  7642. // empty values are omitted from API requests. However, any non-pointer,
  7643. // non-interface field appearing in ForceSendFields will be sent to the
  7644. // server regardless of whether the field is empty or not. This may be
  7645. // used to include empty fields in Patch requests.
  7646. ForceSendFields []string `json:"-"`
  7647. // NullFields is a list of field names (e.g. "Calculated") to include in
  7648. // API requests with the JSON null value. By default, fields with empty
  7649. // values are omitted from API requests. However, any field with an
  7650. // empty value appearing in NullFields will be sent to the server as
  7651. // null. It is an error if a field in this list has a non-empty value.
  7652. // This may be used to include null fields in Patch requests.
  7653. NullFields []string `json:"-"`
  7654. }
  7655. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  7656. type NoMethod FixedOrPercent
  7657. raw := NoMethod(*s)
  7658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7659. }
  7660. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  7661. // specifies which pool of target virtual machines to forward a packet
  7662. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  7663. // resource_for beta.forwardingRules ==) (== resource_for
  7664. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  7665. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  7666. // beta.regionForwardingRules ==) (== resource_for
  7667. // v1.regionForwardingRules ==)
  7668. type ForwardingRule struct {
  7669. // IPAddress: The IP address that this forwarding rule is serving on
  7670. // behalf of.
  7671. //
  7672. // Addresses are restricted based on the forwarding rule's load
  7673. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  7674. // regional).
  7675. //
  7676. // When the load balancing scheme is EXTERNAL, for global forwarding
  7677. // rules, the address must be a global IP, and for regional forwarding
  7678. // rules, the address must live in the same region as the forwarding
  7679. // rule. If this field is empty, an ephemeral IPv4 address from the same
  7680. // scope (global or regional) will be assigned. A regional forwarding
  7681. // rule supports IPv4 only. A global forwarding rule supports either
  7682. // IPv4 or IPv6.
  7683. //
  7684. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  7685. // a URL reference to an existing Address resource ( internal regional
  7686. // static IP address), with a purpose of GCE_END_POINT and address_type
  7687. // of INTERNAL.
  7688. //
  7689. // When the load balancing scheme is INTERNAL, this can only be an RFC
  7690. // 1918 IP address belonging to the network/subnet configured for the
  7691. // forwarding rule. By default, if this field is empty, an ephemeral
  7692. // internal IP address will be automatically allocated from the IP range
  7693. // of the subnet or network configured for this forwarding rule.
  7694. //
  7695. // An address can be specified either by a literal IP address or a URL
  7696. // reference to an existing Address resource. The following examples are
  7697. // all valid:
  7698. // - 100.1.2.3
  7699. // -
  7700. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  7701. // - projects/project/regions/region/addresses/address
  7702. // - regions/region/addresses/address
  7703. // - global/addresses/address
  7704. // - address
  7705. IPAddress string `json:"IPAddress,omitempty"`
  7706. // IPProtocol: The IP protocol to which this rule applies. Valid options
  7707. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  7708. //
  7709. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  7710. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  7711. // TCPis valid.
  7712. //
  7713. // Possible values:
  7714. // "AH"
  7715. // "ESP"
  7716. // "ICMP"
  7717. // "SCTP"
  7718. // "TCP"
  7719. // "UDP"
  7720. IPProtocol string `json:"IPProtocol,omitempty"`
  7721. // AllPorts: This field is used along with the backend_service field for
  7722. // internal load balancing or with the target field for internal
  7723. // TargetInstance. This field cannot be used with port or portRange
  7724. // fields.
  7725. //
  7726. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  7727. // specify this field to allow packets addressed to any ports will be
  7728. // forwarded to the backends configured with this forwarding rule.
  7729. AllPorts bool `json:"allPorts,omitempty"`
  7730. // AllowGlobalAccess: This field is used along with the backend_service
  7731. // field for internal load balancing or with the target field for
  7732. // internal TargetInstance. If the field is set to TRUE, clients can
  7733. // access ILB from all regions. Otherwise only allows access from
  7734. // clients in the same region as the internal load balancer.
  7735. AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
  7736. // BackendService: This field is only used for INTERNAL load
  7737. // balancing.
  7738. //
  7739. // For internal load balancing, this field identifies the BackendService
  7740. // resource to receive the matched traffic.
  7741. BackendService string `json:"backendService,omitempty"`
  7742. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7743. // format.
  7744. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7745. // Description: An optional description of this resource. Provide this
  7746. // property when you create the resource.
  7747. Description string `json:"description,omitempty"`
  7748. // Fingerprint: Fingerprint of this resource. A hash of the contents
  7749. // stored in this object. This field is used in optimistic locking. This
  7750. // field will be ignored when inserting a ForwardingRule. Include the
  7751. // fingerprint in patch request to ensure that you do not overwrite
  7752. // changes that were applied from another concurrent request.
  7753. //
  7754. // To see the latest fingerprint, make a get() request to retrieve a
  7755. // ForwardingRule.
  7756. Fingerprint string `json:"fingerprint,omitempty"`
  7757. // Id: [Output Only] The unique identifier for the resource. This
  7758. // identifier is defined by the server.
  7759. Id uint64 `json:"id,omitempty,string"`
  7760. // IpVersion: The IP Version that will be used by this forwarding rule.
  7761. // Valid options are IPV4 or IPV6. This can only be specified for an
  7762. // external global forwarding rule.
  7763. //
  7764. // Possible values:
  7765. // "IPV4"
  7766. // "IPV6"
  7767. // "UNSPECIFIED_VERSION"
  7768. IpVersion string `json:"ipVersion,omitempty"`
  7769. // Kind: [Output Only] Type of the resource. Always
  7770. // compute#forwardingRule for Forwarding Rule resources.
  7771. Kind string `json:"kind,omitempty"`
  7772. // LabelFingerprint: A fingerprint for the labels being applied to this
  7773. // resource, which is essentially a hash of the labels set used for
  7774. // optimistic locking. The fingerprint is initially generated by Compute
  7775. // Engine and changes after every request to modify or update labels.
  7776. // You must always provide an up-to-date fingerprint hash in order to
  7777. // update or change labels, otherwise the request will fail with error
  7778. // 412 conditionNotMet.
  7779. //
  7780. // To see the latest fingerprint, make a get() request to retrieve a
  7781. // ForwardingRule.
  7782. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7783. // Labels: Labels to apply to this resource. These can be later modified
  7784. // by the setLabels method. Each label key/value pair must comply with
  7785. // RFC1035. Label values may be empty.
  7786. Labels map[string]string `json:"labels,omitempty"`
  7787. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  7788. // used for and can only take the following values: INTERNAL,
  7789. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  7790. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  7791. // value of INTERNAL_SELF_MANAGED means that this will be used for
  7792. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  7793. // will be used for External Load Balancing (HTTP(S) LB, External
  7794. // TCP/UDP LB, SSL Proxy)
  7795. //
  7796. // Possible values:
  7797. // "EXTERNAL"
  7798. // "INTERNAL"
  7799. // "INTERNAL_MANAGED"
  7800. // "INTERNAL_SELF_MANAGED"
  7801. // "INVALID"
  7802. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  7803. // Name: Name of the resource; provided by the client when the resource
  7804. // is created. The name must be 1-63 characters long, and comply with
  7805. // RFC1035. Specifically, the name must be 1-63 characters long and
  7806. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7807. // the first character must be a lowercase letter, and all following
  7808. // characters must be a dash, lowercase letter, or digit, except the
  7809. // last character, which cannot be a dash.
  7810. Name string `json:"name,omitempty"`
  7811. // Network: This field is not used for external load balancing.
  7812. //
  7813. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  7814. // identifies the network that the load balanced IP should belong to for
  7815. // this Forwarding Rule. If this field is not specified, the default
  7816. // network will be used.
  7817. Network string `json:"network,omitempty"`
  7818. // NetworkTier: This signifies the networking tier used for configuring
  7819. // this load balancer and can only take the following values: PREMIUM ,
  7820. // STANDARD.
  7821. //
  7822. // For regional ForwardingRule, the valid values are PREMIUM and
  7823. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  7824. //
  7825. // If this field is not specified, it is assumed to be PREMIUM. If
  7826. // IPAddress is specified, this value must be equal to the networkTier
  7827. // of the Address.
  7828. //
  7829. // Possible values:
  7830. // "PREMIUM"
  7831. // "SELECT"
  7832. // "STANDARD"
  7833. NetworkTier string `json:"networkTier,omitempty"`
  7834. // PortRange: This field is used along with the target field for
  7835. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  7836. // TargetVpnGateway, TargetPool, TargetInstance.
  7837. //
  7838. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  7839. // addressed to ports in the specified range will be forwarded to
  7840. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  7841. // must have disjoint port ranges.
  7842. //
  7843. // Some types of forwarding target have constraints on the acceptable
  7844. // ports:
  7845. // - TargetHttpProxy: 80, 8080
  7846. // - TargetHttpsProxy: 443
  7847. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7848. // 995, 1688, 1883, 5222
  7849. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  7850. // 995, 1688, 1883, 5222
  7851. // - TargetVpnGateway: 500, 4500
  7852. PortRange string `json:"portRange,omitempty"`
  7853. // Ports: This field is used along with the backend_service field for
  7854. // internal load balancing.
  7855. //
  7856. // When the load balancing scheme is INTERNAL, a list of ports can be
  7857. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  7858. // addressed to these ports will be forwarded to the backends configured
  7859. // with this forwarding rule.
  7860. //
  7861. // You may specify a maximum of up to 5 ports.
  7862. Ports []string `json:"ports,omitempty"`
  7863. // Region: [Output Only] URL of the region where the regional forwarding
  7864. // rule resides. This field is not applicable to global forwarding
  7865. // rules. You must specify this field as part of the HTTP request URL.
  7866. // It is not settable as a field in the request body.
  7867. Region string `json:"region,omitempty"`
  7868. // SelfLink: [Output Only] Server-defined URL for the resource.
  7869. SelfLink string `json:"selfLink,omitempty"`
  7870. // ServiceLabel: An optional prefix to the service name for this
  7871. // Forwarding Rule. If specified, will be the first label of the fully
  7872. // qualified service name.
  7873. //
  7874. // The label must be 1-63 characters long, and comply with RFC1035.
  7875. // Specifically, the label must be 1-63 characters long and match the
  7876. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  7877. // character must be a lowercase letter, and all following characters
  7878. // must be a dash, lowercase letter, or digit, except the last
  7879. // character, which cannot be a dash.
  7880. //
  7881. // This field is only used for internal load balancing.
  7882. ServiceLabel string `json:"serviceLabel,omitempty"`
  7883. // ServiceName: [Output Only] The internal fully qualified service name
  7884. // for this Forwarding Rule.
  7885. //
  7886. // This field is only used for internal load balancing.
  7887. ServiceName string `json:"serviceName,omitempty"`
  7888. // Subnetwork: This field is only used for INTERNAL load balancing.
  7889. //
  7890. // For internal load balancing, this field identifies the subnetwork
  7891. // that the load balanced IP should belong to for this Forwarding
  7892. // Rule.
  7893. //
  7894. // If the network specified is in auto subnet mode, this field is
  7895. // optional. However, if the network is in custom subnet mode, a
  7896. // subnetwork must be specified.
  7897. Subnetwork string `json:"subnetwork,omitempty"`
  7898. // Target: The URL of the target resource to receive the matched
  7899. // traffic. For regional forwarding rules, this target must live in the
  7900. // same region as the forwarding rule. For global forwarding rules, this
  7901. // target must be a global load balancing resource. The forwarded
  7902. // traffic must be of a type appropriate to the target object. For
  7903. // INTERNAL_SELF_MANAGED" load balancing, only HTTP and HTTPS targets
  7904. // are valid.
  7905. Target string `json:"target,omitempty"`
  7906. // ServerResponse contains the HTTP response code and headers from the
  7907. // server.
  7908. googleapi.ServerResponse `json:"-"`
  7909. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  7910. // unconditionally include in API requests. By default, fields with
  7911. // empty values are omitted from API requests. However, any non-pointer,
  7912. // non-interface field appearing in ForceSendFields will be sent to the
  7913. // server regardless of whether the field is empty or not. This may be
  7914. // used to include empty fields in Patch requests.
  7915. ForceSendFields []string `json:"-"`
  7916. // NullFields is a list of field names (e.g. "IPAddress") to include in
  7917. // API requests with the JSON null value. By default, fields with empty
  7918. // values are omitted from API requests. However, any field with an
  7919. // empty value appearing in NullFields will be sent to the server as
  7920. // null. It is an error if a field in this list has a non-empty value.
  7921. // This may be used to include null fields in Patch requests.
  7922. NullFields []string `json:"-"`
  7923. }
  7924. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  7925. type NoMethod ForwardingRule
  7926. raw := NoMethod(*s)
  7927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7928. }
  7929. type ForwardingRuleAggregatedList struct {
  7930. // Id: [Output Only] Unique identifier for the resource; defined by the
  7931. // server.
  7932. Id string `json:"id,omitempty"`
  7933. // Items: A list of ForwardingRulesScopedList resources.
  7934. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  7935. // Kind: [Output Only] Type of resource. Always
  7936. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  7937. Kind string `json:"kind,omitempty"`
  7938. // NextPageToken: [Output Only] This token allows you to get the next
  7939. // page of results for list requests. If the number of results is larger
  7940. // than maxResults, use the nextPageToken as a value for the query
  7941. // parameter pageToken in the next list request. Subsequent list
  7942. // requests will have their own nextPageToken to continue paging through
  7943. // the results.
  7944. NextPageToken string `json:"nextPageToken,omitempty"`
  7945. // SelfLink: [Output Only] Server-defined URL for this resource.
  7946. SelfLink string `json:"selfLink,omitempty"`
  7947. // Warning: [Output Only] Informational warning message.
  7948. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  7949. // ServerResponse contains the HTTP response code and headers from the
  7950. // server.
  7951. googleapi.ServerResponse `json:"-"`
  7952. // ForceSendFields is a list of field names (e.g. "Id") to
  7953. // unconditionally include in API requests. By default, fields with
  7954. // empty values are omitted from API requests. However, any non-pointer,
  7955. // non-interface field appearing in ForceSendFields will be sent to the
  7956. // server regardless of whether the field is empty or not. This may be
  7957. // used to include empty fields in Patch requests.
  7958. ForceSendFields []string `json:"-"`
  7959. // NullFields is a list of field names (e.g. "Id") to include in API
  7960. // requests with the JSON null value. By default, fields with empty
  7961. // values are omitted from API requests. However, any field with an
  7962. // empty value appearing in NullFields will be sent to the server as
  7963. // null. It is an error if a field in this list has a non-empty value.
  7964. // This may be used to include null fields in Patch requests.
  7965. NullFields []string `json:"-"`
  7966. }
  7967. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  7968. type NoMethod ForwardingRuleAggregatedList
  7969. raw := NoMethod(*s)
  7970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7971. }
  7972. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  7973. // warning message.
  7974. type ForwardingRuleAggregatedListWarning struct {
  7975. // Code: [Output Only] A warning code, if applicable. For example,
  7976. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7977. // the response.
  7978. //
  7979. // Possible values:
  7980. // "CLEANUP_FAILED"
  7981. // "DEPRECATED_RESOURCE_USED"
  7982. // "DEPRECATED_TYPE_USED"
  7983. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7984. // "EXPERIMENTAL_TYPE_USED"
  7985. // "EXTERNAL_API_WARNING"
  7986. // "FIELD_VALUE_OVERRIDEN"
  7987. // "INJECTED_KERNELS_DEPRECATED"
  7988. // "MISSING_TYPE_DEPENDENCY"
  7989. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7990. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7991. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7992. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7993. // "NEXT_HOP_NOT_RUNNING"
  7994. // "NOT_CRITICAL_ERROR"
  7995. // "NO_RESULTS_ON_PAGE"
  7996. // "REQUIRED_TOS_AGREEMENT"
  7997. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7998. // "RESOURCE_NOT_DELETED"
  7999. // "SCHEMA_VALIDATION_IGNORED"
  8000. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8001. // "UNDECLARED_PROPERTIES"
  8002. // "UNREACHABLE"
  8003. Code string `json:"code,omitempty"`
  8004. // Data: [Output Only] Metadata about this warning in key: value format.
  8005. // For example:
  8006. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8007. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  8008. // Message: [Output Only] A human-readable description of the warning
  8009. // code.
  8010. Message string `json:"message,omitempty"`
  8011. // ForceSendFields is a list of field names (e.g. "Code") to
  8012. // unconditionally include in API requests. By default, fields with
  8013. // empty values are omitted from API requests. However, any non-pointer,
  8014. // non-interface field appearing in ForceSendFields will be sent to the
  8015. // server regardless of whether the field is empty or not. This may be
  8016. // used to include empty fields in Patch requests.
  8017. ForceSendFields []string `json:"-"`
  8018. // NullFields is a list of field names (e.g. "Code") to include in API
  8019. // requests with the JSON null value. By default, fields with empty
  8020. // values are omitted from API requests. However, any field with an
  8021. // empty value appearing in NullFields will be sent to the server as
  8022. // null. It is an error if a field in this list has a non-empty value.
  8023. // This may be used to include null fields in Patch requests.
  8024. NullFields []string `json:"-"`
  8025. }
  8026. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8027. type NoMethod ForwardingRuleAggregatedListWarning
  8028. raw := NoMethod(*s)
  8029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8030. }
  8031. type ForwardingRuleAggregatedListWarningData struct {
  8032. // Key: [Output Only] A key that provides more detail on the warning
  8033. // being returned. For example, for warnings where there are no results
  8034. // in a list request for a particular zone, this key might be scope and
  8035. // the key value might be the zone name. Other examples might be a key
  8036. // indicating a deprecated resource and a suggested replacement, or a
  8037. // warning about invalid network settings (for example, if an instance
  8038. // attempts to perform IP forwarding but is not enabled for IP
  8039. // forwarding).
  8040. Key string `json:"key,omitempty"`
  8041. // Value: [Output Only] A warning data value corresponding to the key.
  8042. Value string `json:"value,omitempty"`
  8043. // ForceSendFields is a list of field names (e.g. "Key") to
  8044. // unconditionally include in API requests. By default, fields with
  8045. // empty values are omitted from API requests. However, any non-pointer,
  8046. // non-interface field appearing in ForceSendFields will be sent to the
  8047. // server regardless of whether the field is empty or not. This may be
  8048. // used to include empty fields in Patch requests.
  8049. ForceSendFields []string `json:"-"`
  8050. // NullFields is a list of field names (e.g. "Key") to include in API
  8051. // requests with the JSON null value. By default, fields with empty
  8052. // values are omitted from API requests. However, any field with an
  8053. // empty value appearing in NullFields will be sent to the server as
  8054. // null. It is an error if a field in this list has a non-empty value.
  8055. // This may be used to include null fields in Patch requests.
  8056. NullFields []string `json:"-"`
  8057. }
  8058. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8059. type NoMethod ForwardingRuleAggregatedListWarningData
  8060. raw := NoMethod(*s)
  8061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8062. }
  8063. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  8064. type ForwardingRuleList struct {
  8065. // Id: [Output Only] Unique identifier for the resource; defined by the
  8066. // server.
  8067. Id string `json:"id,omitempty"`
  8068. // Items: A list of ForwardingRule resources.
  8069. Items []*ForwardingRule `json:"items,omitempty"`
  8070. // Kind: Type of resource.
  8071. Kind string `json:"kind,omitempty"`
  8072. // NextPageToken: [Output Only] This token allows you to get the next
  8073. // page of results for list requests. If the number of results is larger
  8074. // than maxResults, use the nextPageToken as a value for the query
  8075. // parameter pageToken in the next list request. Subsequent list
  8076. // requests will have their own nextPageToken to continue paging through
  8077. // the results.
  8078. NextPageToken string `json:"nextPageToken,omitempty"`
  8079. // SelfLink: [Output Only] Server-defined URL for this resource.
  8080. SelfLink string `json:"selfLink,omitempty"`
  8081. // Warning: [Output Only] Informational warning message.
  8082. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  8083. // ServerResponse contains the HTTP response code and headers from the
  8084. // server.
  8085. googleapi.ServerResponse `json:"-"`
  8086. // ForceSendFields is a list of field names (e.g. "Id") to
  8087. // unconditionally include in API requests. By default, fields with
  8088. // empty values are omitted from API requests. However, any non-pointer,
  8089. // non-interface field appearing in ForceSendFields will be sent to the
  8090. // server regardless of whether the field is empty or not. This may be
  8091. // used to include empty fields in Patch requests.
  8092. ForceSendFields []string `json:"-"`
  8093. // NullFields is a list of field names (e.g. "Id") to include in API
  8094. // requests with the JSON null value. By default, fields with empty
  8095. // values are omitted from API requests. However, any field with an
  8096. // empty value appearing in NullFields will be sent to the server as
  8097. // null. It is an error if a field in this list has a non-empty value.
  8098. // This may be used to include null fields in Patch requests.
  8099. NullFields []string `json:"-"`
  8100. }
  8101. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  8102. type NoMethod ForwardingRuleList
  8103. raw := NoMethod(*s)
  8104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8105. }
  8106. // ForwardingRuleListWarning: [Output Only] Informational warning
  8107. // message.
  8108. type ForwardingRuleListWarning struct {
  8109. // Code: [Output Only] A warning code, if applicable. For example,
  8110. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8111. // the response.
  8112. //
  8113. // Possible values:
  8114. // "CLEANUP_FAILED"
  8115. // "DEPRECATED_RESOURCE_USED"
  8116. // "DEPRECATED_TYPE_USED"
  8117. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8118. // "EXPERIMENTAL_TYPE_USED"
  8119. // "EXTERNAL_API_WARNING"
  8120. // "FIELD_VALUE_OVERRIDEN"
  8121. // "INJECTED_KERNELS_DEPRECATED"
  8122. // "MISSING_TYPE_DEPENDENCY"
  8123. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8124. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8125. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8126. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8127. // "NEXT_HOP_NOT_RUNNING"
  8128. // "NOT_CRITICAL_ERROR"
  8129. // "NO_RESULTS_ON_PAGE"
  8130. // "REQUIRED_TOS_AGREEMENT"
  8131. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8132. // "RESOURCE_NOT_DELETED"
  8133. // "SCHEMA_VALIDATION_IGNORED"
  8134. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8135. // "UNDECLARED_PROPERTIES"
  8136. // "UNREACHABLE"
  8137. Code string `json:"code,omitempty"`
  8138. // Data: [Output Only] Metadata about this warning in key: value format.
  8139. // For example:
  8140. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8141. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  8142. // Message: [Output Only] A human-readable description of the warning
  8143. // code.
  8144. Message string `json:"message,omitempty"`
  8145. // ForceSendFields is a list of field names (e.g. "Code") to
  8146. // unconditionally include in API requests. By default, fields with
  8147. // empty values are omitted from API requests. However, any non-pointer,
  8148. // non-interface field appearing in ForceSendFields will be sent to the
  8149. // server regardless of whether the field is empty or not. This may be
  8150. // used to include empty fields in Patch requests.
  8151. ForceSendFields []string `json:"-"`
  8152. // NullFields is a list of field names (e.g. "Code") to include in API
  8153. // requests with the JSON null value. By default, fields with empty
  8154. // values are omitted from API requests. However, any field with an
  8155. // empty value appearing in NullFields will be sent to the server as
  8156. // null. It is an error if a field in this list has a non-empty value.
  8157. // This may be used to include null fields in Patch requests.
  8158. NullFields []string `json:"-"`
  8159. }
  8160. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  8161. type NoMethod ForwardingRuleListWarning
  8162. raw := NoMethod(*s)
  8163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8164. }
  8165. type ForwardingRuleListWarningData struct {
  8166. // Key: [Output Only] A key that provides more detail on the warning
  8167. // being returned. For example, for warnings where there are no results
  8168. // in a list request for a particular zone, this key might be scope and
  8169. // the key value might be the zone name. Other examples might be a key
  8170. // indicating a deprecated resource and a suggested replacement, or a
  8171. // warning about invalid network settings (for example, if an instance
  8172. // attempts to perform IP forwarding but is not enabled for IP
  8173. // forwarding).
  8174. Key string `json:"key,omitempty"`
  8175. // Value: [Output Only] A warning data value corresponding to the key.
  8176. Value string `json:"value,omitempty"`
  8177. // ForceSendFields is a list of field names (e.g. "Key") to
  8178. // unconditionally include in API requests. By default, fields with
  8179. // empty values are omitted from API requests. However, any non-pointer,
  8180. // non-interface field appearing in ForceSendFields will be sent to the
  8181. // server regardless of whether the field is empty or not. This may be
  8182. // used to include empty fields in Patch requests.
  8183. ForceSendFields []string `json:"-"`
  8184. // NullFields is a list of field names (e.g. "Key") to include in API
  8185. // requests with the JSON null value. By default, fields with empty
  8186. // values are omitted from API requests. However, any field with an
  8187. // empty value appearing in NullFields will be sent to the server as
  8188. // null. It is an error if a field in this list has a non-empty value.
  8189. // This may be used to include null fields in Patch requests.
  8190. NullFields []string `json:"-"`
  8191. }
  8192. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  8193. type NoMethod ForwardingRuleListWarningData
  8194. raw := NoMethod(*s)
  8195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8196. }
  8197. type ForwardingRuleReference struct {
  8198. ForwardingRule string `json:"forwardingRule,omitempty"`
  8199. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  8200. // unconditionally include in API requests. By default, fields with
  8201. // empty values are omitted from API requests. However, any non-pointer,
  8202. // non-interface field appearing in ForceSendFields will be sent to the
  8203. // server regardless of whether the field is empty or not. This may be
  8204. // used to include empty fields in Patch requests.
  8205. ForceSendFields []string `json:"-"`
  8206. // NullFields is a list of field names (e.g. "ForwardingRule") to
  8207. // include in API requests with the JSON null value. By default, fields
  8208. // with empty values are omitted from API requests. However, any field
  8209. // with an empty value appearing in NullFields will be sent to the
  8210. // server as null. It is an error if a field in this list has a
  8211. // non-empty value. This may be used to include null fields in Patch
  8212. // requests.
  8213. NullFields []string `json:"-"`
  8214. }
  8215. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  8216. type NoMethod ForwardingRuleReference
  8217. raw := NoMethod(*s)
  8218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8219. }
  8220. type ForwardingRulesScopedList struct {
  8221. // ForwardingRules: A list of forwarding rules contained in this scope.
  8222. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  8223. // Warning: Informational warning which replaces the list of forwarding
  8224. // rules when the list is empty.
  8225. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  8226. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  8227. // unconditionally include in API requests. By default, fields with
  8228. // empty values are omitted from API requests. However, any non-pointer,
  8229. // non-interface field appearing in ForceSendFields will be sent to the
  8230. // server regardless of whether the field is empty or not. This may be
  8231. // used to include empty fields in Patch requests.
  8232. ForceSendFields []string `json:"-"`
  8233. // NullFields is a list of field names (e.g. "ForwardingRules") to
  8234. // include in API requests with the JSON null value. By default, fields
  8235. // with empty values are omitted from API requests. However, any field
  8236. // with an empty value appearing in NullFields will be sent to the
  8237. // server as null. It is an error if a field in this list has a
  8238. // non-empty value. This may be used to include null fields in Patch
  8239. // requests.
  8240. NullFields []string `json:"-"`
  8241. }
  8242. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  8243. type NoMethod ForwardingRulesScopedList
  8244. raw := NoMethod(*s)
  8245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8246. }
  8247. // ForwardingRulesScopedListWarning: Informational warning which
  8248. // replaces the list of forwarding rules when the list is empty.
  8249. type ForwardingRulesScopedListWarning struct {
  8250. // Code: [Output Only] A warning code, if applicable. For example,
  8251. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8252. // the response.
  8253. //
  8254. // Possible values:
  8255. // "CLEANUP_FAILED"
  8256. // "DEPRECATED_RESOURCE_USED"
  8257. // "DEPRECATED_TYPE_USED"
  8258. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8259. // "EXPERIMENTAL_TYPE_USED"
  8260. // "EXTERNAL_API_WARNING"
  8261. // "FIELD_VALUE_OVERRIDEN"
  8262. // "INJECTED_KERNELS_DEPRECATED"
  8263. // "MISSING_TYPE_DEPENDENCY"
  8264. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8265. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8266. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8267. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8268. // "NEXT_HOP_NOT_RUNNING"
  8269. // "NOT_CRITICAL_ERROR"
  8270. // "NO_RESULTS_ON_PAGE"
  8271. // "REQUIRED_TOS_AGREEMENT"
  8272. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8273. // "RESOURCE_NOT_DELETED"
  8274. // "SCHEMA_VALIDATION_IGNORED"
  8275. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8276. // "UNDECLARED_PROPERTIES"
  8277. // "UNREACHABLE"
  8278. Code string `json:"code,omitempty"`
  8279. // Data: [Output Only] Metadata about this warning in key: value format.
  8280. // For example:
  8281. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8282. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  8283. // Message: [Output Only] A human-readable description of the warning
  8284. // code.
  8285. Message string `json:"message,omitempty"`
  8286. // ForceSendFields is a list of field names (e.g. "Code") to
  8287. // unconditionally include in API requests. By default, fields with
  8288. // empty values are omitted from API requests. However, any non-pointer,
  8289. // non-interface field appearing in ForceSendFields will be sent to the
  8290. // server regardless of whether the field is empty or not. This may be
  8291. // used to include empty fields in Patch requests.
  8292. ForceSendFields []string `json:"-"`
  8293. // NullFields is a list of field names (e.g. "Code") to include in API
  8294. // requests with the JSON null value. By default, fields with empty
  8295. // values are omitted from API requests. However, any field with an
  8296. // empty value appearing in NullFields will be sent to the server as
  8297. // null. It is an error if a field in this list has a non-empty value.
  8298. // This may be used to include null fields in Patch requests.
  8299. NullFields []string `json:"-"`
  8300. }
  8301. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  8302. type NoMethod ForwardingRulesScopedListWarning
  8303. raw := NoMethod(*s)
  8304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8305. }
  8306. type ForwardingRulesScopedListWarningData struct {
  8307. // Key: [Output Only] A key that provides more detail on the warning
  8308. // being returned. For example, for warnings where there are no results
  8309. // in a list request for a particular zone, this key might be scope and
  8310. // the key value might be the zone name. Other examples might be a key
  8311. // indicating a deprecated resource and a suggested replacement, or a
  8312. // warning about invalid network settings (for example, if an instance
  8313. // attempts to perform IP forwarding but is not enabled for IP
  8314. // forwarding).
  8315. Key string `json:"key,omitempty"`
  8316. // Value: [Output Only] A warning data value corresponding to the key.
  8317. Value string `json:"value,omitempty"`
  8318. // ForceSendFields is a list of field names (e.g. "Key") to
  8319. // unconditionally include in API requests. By default, fields with
  8320. // empty values are omitted from API requests. However, any non-pointer,
  8321. // non-interface field appearing in ForceSendFields will be sent to the
  8322. // server regardless of whether the field is empty or not. This may be
  8323. // used to include empty fields in Patch requests.
  8324. ForceSendFields []string `json:"-"`
  8325. // NullFields is a list of field names (e.g. "Key") to include in API
  8326. // requests with the JSON null value. By default, fields with empty
  8327. // values are omitted from API requests. However, any field with an
  8328. // empty value appearing in NullFields will be sent to the server as
  8329. // null. It is an error if a field in this list has a non-empty value.
  8330. // This may be used to include null fields in Patch requests.
  8331. NullFields []string `json:"-"`
  8332. }
  8333. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  8334. type NoMethod ForwardingRulesScopedListWarningData
  8335. raw := NoMethod(*s)
  8336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8337. }
  8338. type GlobalSetLabelsRequest struct {
  8339. // LabelFingerprint: The fingerprint of the previous set of labels for
  8340. // this resource, used to detect conflicts. The fingerprint is initially
  8341. // generated by Compute Engine and changes after every request to modify
  8342. // or update labels. You must always provide an up-to-date fingerprint
  8343. // hash when updating or changing labels, otherwise the request will
  8344. // fail with error 412 conditionNotMet. Make a get() request to the
  8345. // resource to get the latest fingerprint.
  8346. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8347. // Labels: A list of labels to apply for this resource. Each label key &
  8348. // value must comply with RFC1035. Specifically, the name must be 1-63
  8349. // characters long and match the regular expression
  8350. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8351. // a lowercase letter, and all following characters must be a dash,
  8352. // lowercase letter, or digit, except the last character, which cannot
  8353. // be a dash. For example, "webserver-frontend": "images". A label value
  8354. // can also be empty (e.g. "my-label": "").
  8355. Labels map[string]string `json:"labels,omitempty"`
  8356. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  8357. // unconditionally include in API requests. By default, fields with
  8358. // empty values are omitted from API requests. However, any non-pointer,
  8359. // non-interface field appearing in ForceSendFields will be sent to the
  8360. // server regardless of whether the field is empty or not. This may be
  8361. // used to include empty fields in Patch requests.
  8362. ForceSendFields []string `json:"-"`
  8363. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  8364. // include in API requests with the JSON null value. By default, fields
  8365. // with empty values are omitted from API requests. However, any field
  8366. // with an empty value appearing in NullFields will be sent to the
  8367. // server as null. It is an error if a field in this list has a
  8368. // non-empty value. This may be used to include null fields in Patch
  8369. // requests.
  8370. NullFields []string `json:"-"`
  8371. }
  8372. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  8373. type NoMethod GlobalSetLabelsRequest
  8374. raw := NoMethod(*s)
  8375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8376. }
  8377. type GlobalSetPolicyRequest struct {
  8378. // Bindings: Flatten Policy to create a backward compatible wire-format.
  8379. // Deprecated. Use 'policy' to specify bindings.
  8380. Bindings []*Binding `json:"bindings,omitempty"`
  8381. // Etag: Flatten Policy to create a backward compatible wire-format.
  8382. // Deprecated. Use 'policy' to specify the etag.
  8383. Etag string `json:"etag,omitempty"`
  8384. // Policy: REQUIRED: The complete policy to be applied to the
  8385. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  8386. // empty policy is in general a valid policy but certain services (like
  8387. // Projects) might reject them.
  8388. Policy *Policy `json:"policy,omitempty"`
  8389. // ForceSendFields is a list of field names (e.g. "Bindings") to
  8390. // unconditionally include in API requests. By default, fields with
  8391. // empty values are omitted from API requests. However, any non-pointer,
  8392. // non-interface field appearing in ForceSendFields will be sent to the
  8393. // server regardless of whether the field is empty or not. This may be
  8394. // used to include empty fields in Patch requests.
  8395. ForceSendFields []string `json:"-"`
  8396. // NullFields is a list of field names (e.g. "Bindings") to include in
  8397. // API requests with the JSON null value. By default, fields with empty
  8398. // values are omitted from API requests. However, any field with an
  8399. // empty value appearing in NullFields will be sent to the server as
  8400. // null. It is an error if a field in this list has a non-empty value.
  8401. // This may be used to include null fields in Patch requests.
  8402. NullFields []string `json:"-"`
  8403. }
  8404. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  8405. type NoMethod GlobalSetPolicyRequest
  8406. raw := NoMethod(*s)
  8407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8408. }
  8409. // GuestAttributes: A guest attributes entry.
  8410. type GuestAttributes struct {
  8411. // Kind: [Output Only] Type of the resource. Always
  8412. // compute#guestAttributes for guest attributes entry.
  8413. Kind string `json:"kind,omitempty"`
  8414. // QueryPath: The path to be queried. This can be the default namespace
  8415. // ('/') or a nested namespace ('//') or a specified key ('//')
  8416. QueryPath string `json:"queryPath,omitempty"`
  8417. // QueryValue: [Output Only] The value of the requested queried path.
  8418. QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
  8419. // SelfLink: [Output Only] Server-defined URL for this resource.
  8420. SelfLink string `json:"selfLink,omitempty"`
  8421. // VariableKey: The key to search for.
  8422. VariableKey string `json:"variableKey,omitempty"`
  8423. // VariableValue: [Output Only] The value found for the requested key.
  8424. VariableValue string `json:"variableValue,omitempty"`
  8425. // ServerResponse contains the HTTP response code and headers from the
  8426. // server.
  8427. googleapi.ServerResponse `json:"-"`
  8428. // ForceSendFields is a list of field names (e.g. "Kind") to
  8429. // unconditionally include in API requests. By default, fields with
  8430. // empty values are omitted from API requests. However, any non-pointer,
  8431. // non-interface field appearing in ForceSendFields will be sent to the
  8432. // server regardless of whether the field is empty or not. This may be
  8433. // used to include empty fields in Patch requests.
  8434. ForceSendFields []string `json:"-"`
  8435. // NullFields is a list of field names (e.g. "Kind") to include in API
  8436. // requests with the JSON null value. By default, fields with empty
  8437. // values are omitted from API requests. However, any field with an
  8438. // empty value appearing in NullFields will be sent to the server as
  8439. // null. It is an error if a field in this list has a non-empty value.
  8440. // This may be used to include null fields in Patch requests.
  8441. NullFields []string `json:"-"`
  8442. }
  8443. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  8444. type NoMethod GuestAttributes
  8445. raw := NoMethod(*s)
  8446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8447. }
  8448. // GuestAttributesEntry: A guest attributes namespace/key/value entry.
  8449. type GuestAttributesEntry struct {
  8450. // Key: Key for the guest attribute entry.
  8451. Key string `json:"key,omitempty"`
  8452. // Namespace: Namespace for the guest attribute entry.
  8453. Namespace string `json:"namespace,omitempty"`
  8454. // Value: Value for the guest attribute entry.
  8455. Value string `json:"value,omitempty"`
  8456. // ForceSendFields is a list of field names (e.g. "Key") to
  8457. // unconditionally include in API requests. By default, fields with
  8458. // empty values are omitted from API requests. However, any non-pointer,
  8459. // non-interface field appearing in ForceSendFields will be sent to the
  8460. // server regardless of whether the field is empty or not. This may be
  8461. // used to include empty fields in Patch requests.
  8462. ForceSendFields []string `json:"-"`
  8463. // NullFields is a list of field names (e.g. "Key") to include in API
  8464. // requests with the JSON null value. By default, fields with empty
  8465. // values are omitted from API requests. However, any field with an
  8466. // empty value appearing in NullFields will be sent to the server as
  8467. // null. It is an error if a field in this list has a non-empty value.
  8468. // This may be used to include null fields in Patch requests.
  8469. NullFields []string `json:"-"`
  8470. }
  8471. func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
  8472. type NoMethod GuestAttributesEntry
  8473. raw := NoMethod(*s)
  8474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8475. }
  8476. // GuestAttributesValue: Array of guest attribute namespace/key/value
  8477. // tuples.
  8478. type GuestAttributesValue struct {
  8479. Items []*GuestAttributesEntry `json:"items,omitempty"`
  8480. // ForceSendFields is a list of field names (e.g. "Items") to
  8481. // unconditionally include in API requests. By default, fields with
  8482. // empty values are omitted from API requests. However, any non-pointer,
  8483. // non-interface field appearing in ForceSendFields will be sent to the
  8484. // server regardless of whether the field is empty or not. This may be
  8485. // used to include empty fields in Patch requests.
  8486. ForceSendFields []string `json:"-"`
  8487. // NullFields is a list of field names (e.g. "Items") to include in API
  8488. // requests with the JSON null value. By default, fields with empty
  8489. // values are omitted from API requests. However, any field with an
  8490. // empty value appearing in NullFields will be sent to the server as
  8491. // null. It is an error if a field in this list has a non-empty value.
  8492. // This may be used to include null fields in Patch requests.
  8493. NullFields []string `json:"-"`
  8494. }
  8495. func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
  8496. type NoMethod GuestAttributesValue
  8497. raw := NoMethod(*s)
  8498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8499. }
  8500. // GuestOsFeature: Guest OS features.
  8501. type GuestOsFeature struct {
  8502. // Type: The ID of a supported feature. Read Enabling guest operating
  8503. // system features to see a list of available options.
  8504. //
  8505. // Possible values:
  8506. // "FEATURE_TYPE_UNSPECIFIED"
  8507. // "MULTI_IP_SUBNET"
  8508. // "SECURE_BOOT"
  8509. // "UEFI_COMPATIBLE"
  8510. // "VIRTIO_SCSI_MULTIQUEUE"
  8511. // "WINDOWS"
  8512. Type string `json:"type,omitempty"`
  8513. // ForceSendFields is a list of field names (e.g. "Type") to
  8514. // unconditionally include in API requests. By default, fields with
  8515. // empty values are omitted from API requests. However, any non-pointer,
  8516. // non-interface field appearing in ForceSendFields will be sent to the
  8517. // server regardless of whether the field is empty or not. This may be
  8518. // used to include empty fields in Patch requests.
  8519. ForceSendFields []string `json:"-"`
  8520. // NullFields is a list of field names (e.g. "Type") to include in API
  8521. // requests with the JSON null value. By default, fields with empty
  8522. // values are omitted from API requests. However, any field with an
  8523. // empty value appearing in NullFields will be sent to the server as
  8524. // null. It is an error if a field in this list has a non-empty value.
  8525. // This may be used to include null fields in Patch requests.
  8526. NullFields []string `json:"-"`
  8527. }
  8528. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  8529. type NoMethod GuestOsFeature
  8530. raw := NoMethod(*s)
  8531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8532. }
  8533. type HTTP2HealthCheck struct {
  8534. // Host: The value of the host header in the HTTP/2 health check
  8535. // request. If left empty (default value), the IP on behalf of which
  8536. // this health check is performed will be used.
  8537. Host string `json:"host,omitempty"`
  8538. // Port: The TCP port number for the health check request. The default
  8539. // value is 443. Valid values are 1 through 65535.
  8540. Port int64 `json:"port,omitempty"`
  8541. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8542. // both port and port_name are defined, port takes precedence.
  8543. PortName string `json:"portName,omitempty"`
  8544. // PortSpecification: Specifies how port is selected for health
  8545. // checking, can be one of following values:
  8546. // USE_FIXED_PORT: The port number in
  8547. // port
  8548. // is used for health checking.
  8549. // USE_NAMED_PORT: The
  8550. // portName
  8551. // is used for health checking.
  8552. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8553. // each network endpoint is used for health checking. For other
  8554. // backends, the port or named port specified in the Backend Service is
  8555. // used for health checking.
  8556. //
  8557. //
  8558. // If not specified, HTTP2 health check follows behavior specified
  8559. // in
  8560. // port
  8561. // and
  8562. // portName
  8563. // fields.
  8564. //
  8565. // Possible values:
  8566. // "USE_FIXED_PORT"
  8567. // "USE_NAMED_PORT"
  8568. // "USE_SERVING_PORT"
  8569. PortSpecification string `json:"portSpecification,omitempty"`
  8570. // ProxyHeader: Specifies the type of proxy header to append before
  8571. // sending data to the backend, either NONE or PROXY_V1. The default is
  8572. // NONE.
  8573. //
  8574. // Possible values:
  8575. // "NONE"
  8576. // "PROXY_V1"
  8577. ProxyHeader string `json:"proxyHeader,omitempty"`
  8578. // RequestPath: The request path of the HTTP/2 health check request. The
  8579. // default value is /.
  8580. RequestPath string `json:"requestPath,omitempty"`
  8581. // Response: The string to match anywhere in the first 1024 bytes of the
  8582. // response body. If left empty (the default value), the status code
  8583. // determines health. The response data can only be ASCII.
  8584. Response string `json:"response,omitempty"`
  8585. // ForceSendFields is a list of field names (e.g. "Host") to
  8586. // unconditionally include in API requests. By default, fields with
  8587. // empty values are omitted from API requests. However, any non-pointer,
  8588. // non-interface field appearing in ForceSendFields will be sent to the
  8589. // server regardless of whether the field is empty or not. This may be
  8590. // used to include empty fields in Patch requests.
  8591. ForceSendFields []string `json:"-"`
  8592. // NullFields is a list of field names (e.g. "Host") to include in API
  8593. // requests with the JSON null value. By default, fields with empty
  8594. // values are omitted from API requests. However, any field with an
  8595. // empty value appearing in NullFields will be sent to the server as
  8596. // null. It is an error if a field in this list has a non-empty value.
  8597. // This may be used to include null fields in Patch requests.
  8598. NullFields []string `json:"-"`
  8599. }
  8600. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  8601. type NoMethod HTTP2HealthCheck
  8602. raw := NoMethod(*s)
  8603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8604. }
  8605. type HTTPHealthCheck struct {
  8606. // Host: The value of the host header in the HTTP health check request.
  8607. // If left empty (default value), the IP on behalf of which this health
  8608. // check is performed will be used.
  8609. Host string `json:"host,omitempty"`
  8610. // Port: The TCP port number for the health check request. The default
  8611. // value is 80. Valid values are 1 through 65535.
  8612. Port int64 `json:"port,omitempty"`
  8613. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8614. // both port and port_name are defined, port takes precedence.
  8615. PortName string `json:"portName,omitempty"`
  8616. // PortSpecification: Specifies how port is selected for health
  8617. // checking, can be one of following values:
  8618. // USE_FIXED_PORT: The port number in
  8619. // port
  8620. // is used for health checking.
  8621. // USE_NAMED_PORT: The
  8622. // portName
  8623. // is used for health checking.
  8624. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8625. // each network endpoint is used for health checking. For other
  8626. // backends, the port or named port specified in the Backend Service is
  8627. // used for health checking.
  8628. //
  8629. //
  8630. // If not specified, HTTP health check follows behavior specified
  8631. // in
  8632. // port
  8633. // and
  8634. // portName
  8635. // fields.
  8636. //
  8637. // Possible values:
  8638. // "USE_FIXED_PORT"
  8639. // "USE_NAMED_PORT"
  8640. // "USE_SERVING_PORT"
  8641. PortSpecification string `json:"portSpecification,omitempty"`
  8642. // ProxyHeader: Specifies the type of proxy header to append before
  8643. // sending data to the backend, either NONE or PROXY_V1. The default is
  8644. // NONE.
  8645. //
  8646. // Possible values:
  8647. // "NONE"
  8648. // "PROXY_V1"
  8649. ProxyHeader string `json:"proxyHeader,omitempty"`
  8650. // RequestPath: The request path of the HTTP health check request. The
  8651. // default value is /.
  8652. RequestPath string `json:"requestPath,omitempty"`
  8653. // Response: The string to match anywhere in the first 1024 bytes of the
  8654. // response body. If left empty (the default value), the status code
  8655. // determines health. The response data can only be ASCII.
  8656. Response string `json:"response,omitempty"`
  8657. // ForceSendFields is a list of field names (e.g. "Host") to
  8658. // unconditionally include in API requests. By default, fields with
  8659. // empty values are omitted from API requests. However, any non-pointer,
  8660. // non-interface field appearing in ForceSendFields will be sent to the
  8661. // server regardless of whether the field is empty or not. This may be
  8662. // used to include empty fields in Patch requests.
  8663. ForceSendFields []string `json:"-"`
  8664. // NullFields is a list of field names (e.g. "Host") to include in API
  8665. // requests with the JSON null value. By default, fields with empty
  8666. // values are omitted from API requests. However, any field with an
  8667. // empty value appearing in NullFields will be sent to the server as
  8668. // null. It is an error if a field in this list has a non-empty value.
  8669. // This may be used to include null fields in Patch requests.
  8670. NullFields []string `json:"-"`
  8671. }
  8672. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  8673. type NoMethod HTTPHealthCheck
  8674. raw := NoMethod(*s)
  8675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8676. }
  8677. type HTTPSHealthCheck struct {
  8678. // Host: The value of the host header in the HTTPS health check request.
  8679. // If left empty (default value), the IP on behalf of which this health
  8680. // check is performed will be used.
  8681. Host string `json:"host,omitempty"`
  8682. // Port: The TCP port number for the health check request. The default
  8683. // value is 443. Valid values are 1 through 65535.
  8684. Port int64 `json:"port,omitempty"`
  8685. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  8686. // both port and port_name are defined, port takes precedence.
  8687. PortName string `json:"portName,omitempty"`
  8688. // PortSpecification: Specifies how port is selected for health
  8689. // checking, can be one of following values:
  8690. // USE_FIXED_PORT: The port number in
  8691. // port
  8692. // is used for health checking.
  8693. // USE_NAMED_PORT: The
  8694. // portName
  8695. // is used for health checking.
  8696. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  8697. // each network endpoint is used for health checking. For other
  8698. // backends, the port or named port specified in the Backend Service is
  8699. // used for health checking.
  8700. //
  8701. //
  8702. // If not specified, HTTPS health check follows behavior specified
  8703. // in
  8704. // port
  8705. // and
  8706. // portName
  8707. // fields.
  8708. //
  8709. // Possible values:
  8710. // "USE_FIXED_PORT"
  8711. // "USE_NAMED_PORT"
  8712. // "USE_SERVING_PORT"
  8713. PortSpecification string `json:"portSpecification,omitempty"`
  8714. // ProxyHeader: Specifies the type of proxy header to append before
  8715. // sending data to the backend, either NONE or PROXY_V1. The default is
  8716. // NONE.
  8717. //
  8718. // Possible values:
  8719. // "NONE"
  8720. // "PROXY_V1"
  8721. ProxyHeader string `json:"proxyHeader,omitempty"`
  8722. // RequestPath: The request path of the HTTPS health check request. The
  8723. // default value is /.
  8724. RequestPath string `json:"requestPath,omitempty"`
  8725. // Response: The string to match anywhere in the first 1024 bytes of the
  8726. // response body. If left empty (the default value), the status code
  8727. // determines health. The response data can only be ASCII.
  8728. Response string `json:"response,omitempty"`
  8729. // ForceSendFields is a list of field names (e.g. "Host") to
  8730. // unconditionally include in API requests. By default, fields with
  8731. // empty values are omitted from API requests. However, any non-pointer,
  8732. // non-interface field appearing in ForceSendFields will be sent to the
  8733. // server regardless of whether the field is empty or not. This may be
  8734. // used to include empty fields in Patch requests.
  8735. ForceSendFields []string `json:"-"`
  8736. // NullFields is a list of field names (e.g. "Host") to include in API
  8737. // requests with the JSON null value. By default, fields with empty
  8738. // values are omitted from API requests. However, any field with an
  8739. // empty value appearing in NullFields will be sent to the server as
  8740. // null. It is an error if a field in this list has a non-empty value.
  8741. // This may be used to include null fields in Patch requests.
  8742. NullFields []string `json:"-"`
  8743. }
  8744. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  8745. type NoMethod HTTPSHealthCheck
  8746. raw := NoMethod(*s)
  8747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8748. }
  8749. // HealthCheck: An HealthCheck resource. This resource defines a
  8750. // template for how individual virtual machines should be checked for
  8751. // health, via one of the supported protocols.
  8752. type HealthCheck struct {
  8753. // CheckIntervalSec: How often (in seconds) to send a health check. The
  8754. // default value is 5 seconds.
  8755. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  8756. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  8757. // format.
  8758. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8759. // Description: An optional description of this resource. Provide this
  8760. // property when you create the resource.
  8761. Description string `json:"description,omitempty"`
  8762. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  8763. // after this many consecutive successes. The default value is 2.
  8764. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  8765. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  8766. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  8767. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  8768. // Id: [Output Only] The unique identifier for the resource. This
  8769. // identifier is defined by the server.
  8770. Id uint64 `json:"id,omitempty,string"`
  8771. // Kind: Type of the resource.
  8772. Kind string `json:"kind,omitempty"`
  8773. // Name: Name of the resource. Provided by the client when the resource
  8774. // is created. The name must be 1-63 characters long, and comply with
  8775. // RFC1035. Specifically, the name must be 1-63 characters long and
  8776. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8777. // the first character must be a lowercase letter, and all following
  8778. // characters must be a dash, lowercase letter, or digit, except the
  8779. // last character, which cannot be a dash.
  8780. Name string `json:"name,omitempty"`
  8781. // Region: [Output Only] Region where the health check resides. Not
  8782. // applicable to global health checks.
  8783. Region string `json:"region,omitempty"`
  8784. // SelfLink: [Output Only] Server-defined URL for the resource.
  8785. SelfLink string `json:"selfLink,omitempty"`
  8786. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  8787. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  8788. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  8789. // The default value is 5 seconds. It is invalid for timeoutSec to have
  8790. // greater value than checkIntervalSec.
  8791. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  8792. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  8793. // HTTPS. If not specified, the default is TCP. Exactly one of the
  8794. // protocol-specific health check field must be specified, which must
  8795. // match type field.
  8796. //
  8797. // Possible values:
  8798. // "HTTP"
  8799. // "HTTP2"
  8800. // "HTTPS"
  8801. // "INVALID"
  8802. // "SSL"
  8803. // "TCP"
  8804. // "UDP"
  8805. Type string `json:"type,omitempty"`
  8806. UdpHealthCheck *UDPHealthCheck `json:"udpHealthCheck,omitempty"`
  8807. // UnhealthyThreshold: A so-far healthy instance will be marked
  8808. // unhealthy after this many consecutive failures. The default value is
  8809. // 2.
  8810. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  8811. // ServerResponse contains the HTTP response code and headers from the
  8812. // server.
  8813. googleapi.ServerResponse `json:"-"`
  8814. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  8815. // unconditionally include in API requests. By default, fields with
  8816. // empty values are omitted from API requests. However, any non-pointer,
  8817. // non-interface field appearing in ForceSendFields will be sent to the
  8818. // server regardless of whether the field is empty or not. This may be
  8819. // used to include empty fields in Patch requests.
  8820. ForceSendFields []string `json:"-"`
  8821. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  8822. // include in API requests with the JSON null value. By default, fields
  8823. // with empty values are omitted from API requests. However, any field
  8824. // with an empty value appearing in NullFields will be sent to the
  8825. // server as null. It is an error if a field in this list has a
  8826. // non-empty value. This may be used to include null fields in Patch
  8827. // requests.
  8828. NullFields []string `json:"-"`
  8829. }
  8830. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  8831. type NoMethod HealthCheck
  8832. raw := NoMethod(*s)
  8833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8834. }
  8835. // HealthCheckList: Contains a list of HealthCheck resources.
  8836. type HealthCheckList struct {
  8837. // Id: [Output Only] Unique identifier for the resource; defined by the
  8838. // server.
  8839. Id string `json:"id,omitempty"`
  8840. // Items: A list of HealthCheck resources.
  8841. Items []*HealthCheck `json:"items,omitempty"`
  8842. // Kind: Type of resource.
  8843. Kind string `json:"kind,omitempty"`
  8844. // NextPageToken: [Output Only] This token allows you to get the next
  8845. // page of results for list requests. If the number of results is larger
  8846. // than maxResults, use the nextPageToken as a value for the query
  8847. // parameter pageToken in the next list request. Subsequent list
  8848. // requests will have their own nextPageToken to continue paging through
  8849. // the results.
  8850. NextPageToken string `json:"nextPageToken,omitempty"`
  8851. // SelfLink: [Output Only] Server-defined URL for this resource.
  8852. SelfLink string `json:"selfLink,omitempty"`
  8853. // Warning: [Output Only] Informational warning message.
  8854. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  8855. // ServerResponse contains the HTTP response code and headers from the
  8856. // server.
  8857. googleapi.ServerResponse `json:"-"`
  8858. // ForceSendFields is a list of field names (e.g. "Id") to
  8859. // unconditionally include in API requests. By default, fields with
  8860. // empty values are omitted from API requests. However, any non-pointer,
  8861. // non-interface field appearing in ForceSendFields will be sent to the
  8862. // server regardless of whether the field is empty or not. This may be
  8863. // used to include empty fields in Patch requests.
  8864. ForceSendFields []string `json:"-"`
  8865. // NullFields is a list of field names (e.g. "Id") to include in API
  8866. // requests with the JSON null value. By default, fields with empty
  8867. // values are omitted from API requests. However, any field with an
  8868. // empty value appearing in NullFields will be sent to the server as
  8869. // null. It is an error if a field in this list has a non-empty value.
  8870. // This may be used to include null fields in Patch requests.
  8871. NullFields []string `json:"-"`
  8872. }
  8873. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  8874. type NoMethod HealthCheckList
  8875. raw := NoMethod(*s)
  8876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8877. }
  8878. // HealthCheckListWarning: [Output Only] Informational warning message.
  8879. type HealthCheckListWarning struct {
  8880. // Code: [Output Only] A warning code, if applicable. For example,
  8881. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8882. // the response.
  8883. //
  8884. // Possible values:
  8885. // "CLEANUP_FAILED"
  8886. // "DEPRECATED_RESOURCE_USED"
  8887. // "DEPRECATED_TYPE_USED"
  8888. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8889. // "EXPERIMENTAL_TYPE_USED"
  8890. // "EXTERNAL_API_WARNING"
  8891. // "FIELD_VALUE_OVERRIDEN"
  8892. // "INJECTED_KERNELS_DEPRECATED"
  8893. // "MISSING_TYPE_DEPENDENCY"
  8894. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8895. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8896. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8897. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8898. // "NEXT_HOP_NOT_RUNNING"
  8899. // "NOT_CRITICAL_ERROR"
  8900. // "NO_RESULTS_ON_PAGE"
  8901. // "REQUIRED_TOS_AGREEMENT"
  8902. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8903. // "RESOURCE_NOT_DELETED"
  8904. // "SCHEMA_VALIDATION_IGNORED"
  8905. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8906. // "UNDECLARED_PROPERTIES"
  8907. // "UNREACHABLE"
  8908. Code string `json:"code,omitempty"`
  8909. // Data: [Output Only] Metadata about this warning in key: value format.
  8910. // For example:
  8911. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8912. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  8913. // Message: [Output Only] A human-readable description of the warning
  8914. // code.
  8915. Message string `json:"message,omitempty"`
  8916. // ForceSendFields is a list of field names (e.g. "Code") to
  8917. // unconditionally include in API requests. By default, fields with
  8918. // empty values are omitted from API requests. However, any non-pointer,
  8919. // non-interface field appearing in ForceSendFields will be sent to the
  8920. // server regardless of whether the field is empty or not. This may be
  8921. // used to include empty fields in Patch requests.
  8922. ForceSendFields []string `json:"-"`
  8923. // NullFields is a list of field names (e.g. "Code") to include in API
  8924. // requests with the JSON null value. By default, fields with empty
  8925. // values are omitted from API requests. However, any field with an
  8926. // empty value appearing in NullFields will be sent to the server as
  8927. // null. It is an error if a field in this list has a non-empty value.
  8928. // This may be used to include null fields in Patch requests.
  8929. NullFields []string `json:"-"`
  8930. }
  8931. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8932. type NoMethod HealthCheckListWarning
  8933. raw := NoMethod(*s)
  8934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8935. }
  8936. type HealthCheckListWarningData struct {
  8937. // Key: [Output Only] A key that provides more detail on the warning
  8938. // being returned. For example, for warnings where there are no results
  8939. // in a list request for a particular zone, this key might be scope and
  8940. // the key value might be the zone name. Other examples might be a key
  8941. // indicating a deprecated resource and a suggested replacement, or a
  8942. // warning about invalid network settings (for example, if an instance
  8943. // attempts to perform IP forwarding but is not enabled for IP
  8944. // forwarding).
  8945. Key string `json:"key,omitempty"`
  8946. // Value: [Output Only] A warning data value corresponding to the key.
  8947. Value string `json:"value,omitempty"`
  8948. // ForceSendFields is a list of field names (e.g. "Key") to
  8949. // unconditionally include in API requests. By default, fields with
  8950. // empty values are omitted from API requests. However, any non-pointer,
  8951. // non-interface field appearing in ForceSendFields will be sent to the
  8952. // server regardless of whether the field is empty or not. This may be
  8953. // used to include empty fields in Patch requests.
  8954. ForceSendFields []string `json:"-"`
  8955. // NullFields is a list of field names (e.g. "Key") to include in API
  8956. // requests with the JSON null value. By default, fields with empty
  8957. // values are omitted from API requests. However, any field with an
  8958. // empty value appearing in NullFields will be sent to the server as
  8959. // null. It is an error if a field in this list has a non-empty value.
  8960. // This may be used to include null fields in Patch requests.
  8961. NullFields []string `json:"-"`
  8962. }
  8963. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8964. type NoMethod HealthCheckListWarningData
  8965. raw := NoMethod(*s)
  8966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8967. }
  8968. // HealthCheckReference: A full or valid partial URL to a health check.
  8969. // For example, the following are valid URLs:
  8970. // -
  8971. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  8972. // - projects/project-id/global/httpHealthChecks/health-check
  8973. // - global/httpHealthChecks/health-check
  8974. type HealthCheckReference struct {
  8975. HealthCheck string `json:"healthCheck,omitempty"`
  8976. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  8977. // unconditionally include in API requests. By default, fields with
  8978. // empty values are omitted from API requests. However, any non-pointer,
  8979. // non-interface field appearing in ForceSendFields will be sent to the
  8980. // server regardless of whether the field is empty or not. This may be
  8981. // used to include empty fields in Patch requests.
  8982. ForceSendFields []string `json:"-"`
  8983. // NullFields is a list of field names (e.g. "HealthCheck") to include
  8984. // in API requests with the JSON null value. By default, fields with
  8985. // empty values are omitted from API requests. However, any field with
  8986. // an empty value appearing in NullFields will be sent to the server as
  8987. // null. It is an error if a field in this list has a non-empty value.
  8988. // This may be used to include null fields in Patch requests.
  8989. NullFields []string `json:"-"`
  8990. }
  8991. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  8992. type NoMethod HealthCheckReference
  8993. raw := NoMethod(*s)
  8994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8995. }
  8996. type HealthChecksAggregatedList struct {
  8997. // Id: [Output Only] Unique identifier for the resource; defined by the
  8998. // server.
  8999. Id string `json:"id,omitempty"`
  9000. // Items: A list of HealthChecksScopedList resources.
  9001. Items map[string]HealthChecksScopedList `json:"items,omitempty"`
  9002. // Kind: Type of resource.
  9003. Kind string `json:"kind,omitempty"`
  9004. // NextPageToken: [Output Only] This token allows you to get the next
  9005. // page of results for list requests. If the number of results is larger
  9006. // than maxResults, use the nextPageToken as a value for the query
  9007. // parameter pageToken in the next list request. Subsequent list
  9008. // requests will have their own nextPageToken to continue paging through
  9009. // the results.
  9010. NextPageToken string `json:"nextPageToken,omitempty"`
  9011. // SelfLink: [Output Only] Server-defined URL for this resource.
  9012. SelfLink string `json:"selfLink,omitempty"`
  9013. // Warning: [Output Only] Informational warning message.
  9014. Warning *HealthChecksAggregatedListWarning `json:"warning,omitempty"`
  9015. // ServerResponse contains the HTTP response code and headers from the
  9016. // server.
  9017. googleapi.ServerResponse `json:"-"`
  9018. // ForceSendFields is a list of field names (e.g. "Id") to
  9019. // unconditionally include in API requests. By default, fields with
  9020. // empty values are omitted from API requests. However, any non-pointer,
  9021. // non-interface field appearing in ForceSendFields will be sent to the
  9022. // server regardless of whether the field is empty or not. This may be
  9023. // used to include empty fields in Patch requests.
  9024. ForceSendFields []string `json:"-"`
  9025. // NullFields is a list of field names (e.g. "Id") to include in API
  9026. // requests with the JSON null value. By default, fields with empty
  9027. // values are omitted from API requests. However, any field with an
  9028. // empty value appearing in NullFields will be sent to the server as
  9029. // null. It is an error if a field in this list has a non-empty value.
  9030. // This may be used to include null fields in Patch requests.
  9031. NullFields []string `json:"-"`
  9032. }
  9033. func (s *HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
  9034. type NoMethod HealthChecksAggregatedList
  9035. raw := NoMethod(*s)
  9036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9037. }
  9038. // HealthChecksAggregatedListWarning: [Output Only] Informational
  9039. // warning message.
  9040. type HealthChecksAggregatedListWarning struct {
  9041. // Code: [Output Only] A warning code, if applicable. For example,
  9042. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9043. // the response.
  9044. //
  9045. // Possible values:
  9046. // "CLEANUP_FAILED"
  9047. // "DEPRECATED_RESOURCE_USED"
  9048. // "DEPRECATED_TYPE_USED"
  9049. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9050. // "EXPERIMENTAL_TYPE_USED"
  9051. // "EXTERNAL_API_WARNING"
  9052. // "FIELD_VALUE_OVERRIDEN"
  9053. // "INJECTED_KERNELS_DEPRECATED"
  9054. // "MISSING_TYPE_DEPENDENCY"
  9055. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9056. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9057. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9058. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9059. // "NEXT_HOP_NOT_RUNNING"
  9060. // "NOT_CRITICAL_ERROR"
  9061. // "NO_RESULTS_ON_PAGE"
  9062. // "REQUIRED_TOS_AGREEMENT"
  9063. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9064. // "RESOURCE_NOT_DELETED"
  9065. // "SCHEMA_VALIDATION_IGNORED"
  9066. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9067. // "UNDECLARED_PROPERTIES"
  9068. // "UNREACHABLE"
  9069. Code string `json:"code,omitempty"`
  9070. // Data: [Output Only] Metadata about this warning in key: value format.
  9071. // For example:
  9072. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9073. Data []*HealthChecksAggregatedListWarningData `json:"data,omitempty"`
  9074. // Message: [Output Only] A human-readable description of the warning
  9075. // code.
  9076. Message string `json:"message,omitempty"`
  9077. // ForceSendFields is a list of field names (e.g. "Code") to
  9078. // unconditionally include in API requests. By default, fields with
  9079. // empty values are omitted from API requests. However, any non-pointer,
  9080. // non-interface field appearing in ForceSendFields will be sent to the
  9081. // server regardless of whether the field is empty or not. This may be
  9082. // used to include empty fields in Patch requests.
  9083. ForceSendFields []string `json:"-"`
  9084. // NullFields is a list of field names (e.g. "Code") to include in API
  9085. // requests with the JSON null value. By default, fields with empty
  9086. // values are omitted from API requests. However, any field with an
  9087. // empty value appearing in NullFields will be sent to the server as
  9088. // null. It is an error if a field in this list has a non-empty value.
  9089. // This may be used to include null fields in Patch requests.
  9090. NullFields []string `json:"-"`
  9091. }
  9092. func (s *HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9093. type NoMethod HealthChecksAggregatedListWarning
  9094. raw := NoMethod(*s)
  9095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9096. }
  9097. type HealthChecksAggregatedListWarningData struct {
  9098. // Key: [Output Only] A key that provides more detail on the warning
  9099. // being returned. For example, for warnings where there are no results
  9100. // in a list request for a particular zone, this key might be scope and
  9101. // the key value might be the zone name. Other examples might be a key
  9102. // indicating a deprecated resource and a suggested replacement, or a
  9103. // warning about invalid network settings (for example, if an instance
  9104. // attempts to perform IP forwarding but is not enabled for IP
  9105. // forwarding).
  9106. Key string `json:"key,omitempty"`
  9107. // Value: [Output Only] A warning data value corresponding to the key.
  9108. Value string `json:"value,omitempty"`
  9109. // ForceSendFields is a list of field names (e.g. "Key") to
  9110. // unconditionally include in API requests. By default, fields with
  9111. // empty values are omitted from API requests. However, any non-pointer,
  9112. // non-interface field appearing in ForceSendFields will be sent to the
  9113. // server regardless of whether the field is empty or not. This may be
  9114. // used to include empty fields in Patch requests.
  9115. ForceSendFields []string `json:"-"`
  9116. // NullFields is a list of field names (e.g. "Key") to include in API
  9117. // requests with the JSON null value. By default, fields with empty
  9118. // values are omitted from API requests. However, any field with an
  9119. // empty value appearing in NullFields will be sent to the server as
  9120. // null. It is an error if a field in this list has a non-empty value.
  9121. // This may be used to include null fields in Patch requests.
  9122. NullFields []string `json:"-"`
  9123. }
  9124. func (s *HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9125. type NoMethod HealthChecksAggregatedListWarningData
  9126. raw := NoMethod(*s)
  9127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9128. }
  9129. type HealthChecksScopedList struct {
  9130. // HealthChecks: A list of HealthChecks contained in this scope.
  9131. HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
  9132. // Warning: Informational warning which replaces the list of backend
  9133. // services when the list is empty.
  9134. Warning *HealthChecksScopedListWarning `json:"warning,omitempty"`
  9135. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  9136. // unconditionally include in API requests. By default, fields with
  9137. // empty values are omitted from API requests. However, any non-pointer,
  9138. // non-interface field appearing in ForceSendFields will be sent to the
  9139. // server regardless of whether the field is empty or not. This may be
  9140. // used to include empty fields in Patch requests.
  9141. ForceSendFields []string `json:"-"`
  9142. // NullFields is a list of field names (e.g. "HealthChecks") to include
  9143. // in API requests with the JSON null value. By default, fields with
  9144. // empty values are omitted from API requests. However, any field with
  9145. // an empty value appearing in NullFields will be sent to the server as
  9146. // null. It is an error if a field in this list has a non-empty value.
  9147. // This may be used to include null fields in Patch requests.
  9148. NullFields []string `json:"-"`
  9149. }
  9150. func (s *HealthChecksScopedList) MarshalJSON() ([]byte, error) {
  9151. type NoMethod HealthChecksScopedList
  9152. raw := NoMethod(*s)
  9153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9154. }
  9155. // HealthChecksScopedListWarning: Informational warning which replaces
  9156. // the list of backend services when the list is empty.
  9157. type HealthChecksScopedListWarning struct {
  9158. // Code: [Output Only] A warning code, if applicable. For example,
  9159. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9160. // the response.
  9161. //
  9162. // Possible values:
  9163. // "CLEANUP_FAILED"
  9164. // "DEPRECATED_RESOURCE_USED"
  9165. // "DEPRECATED_TYPE_USED"
  9166. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9167. // "EXPERIMENTAL_TYPE_USED"
  9168. // "EXTERNAL_API_WARNING"
  9169. // "FIELD_VALUE_OVERRIDEN"
  9170. // "INJECTED_KERNELS_DEPRECATED"
  9171. // "MISSING_TYPE_DEPENDENCY"
  9172. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9173. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9174. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9175. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9176. // "NEXT_HOP_NOT_RUNNING"
  9177. // "NOT_CRITICAL_ERROR"
  9178. // "NO_RESULTS_ON_PAGE"
  9179. // "REQUIRED_TOS_AGREEMENT"
  9180. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9181. // "RESOURCE_NOT_DELETED"
  9182. // "SCHEMA_VALIDATION_IGNORED"
  9183. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9184. // "UNDECLARED_PROPERTIES"
  9185. // "UNREACHABLE"
  9186. Code string `json:"code,omitempty"`
  9187. // Data: [Output Only] Metadata about this warning in key: value format.
  9188. // For example:
  9189. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9190. Data []*HealthChecksScopedListWarningData `json:"data,omitempty"`
  9191. // Message: [Output Only] A human-readable description of the warning
  9192. // code.
  9193. Message string `json:"message,omitempty"`
  9194. // ForceSendFields is a list of field names (e.g. "Code") to
  9195. // unconditionally include in API requests. By default, fields with
  9196. // empty values are omitted from API requests. However, any non-pointer,
  9197. // non-interface field appearing in ForceSendFields will be sent to the
  9198. // server regardless of whether the field is empty or not. This may be
  9199. // used to include empty fields in Patch requests.
  9200. ForceSendFields []string `json:"-"`
  9201. // NullFields is a list of field names (e.g. "Code") to include in API
  9202. // requests with the JSON null value. By default, fields with empty
  9203. // values are omitted from API requests. However, any field with an
  9204. // empty value appearing in NullFields will be sent to the server as
  9205. // null. It is an error if a field in this list has a non-empty value.
  9206. // This may be used to include null fields in Patch requests.
  9207. NullFields []string `json:"-"`
  9208. }
  9209. func (s *HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
  9210. type NoMethod HealthChecksScopedListWarning
  9211. raw := NoMethod(*s)
  9212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9213. }
  9214. type HealthChecksScopedListWarningData struct {
  9215. // Key: [Output Only] A key that provides more detail on the warning
  9216. // being returned. For example, for warnings where there are no results
  9217. // in a list request for a particular zone, this key might be scope and
  9218. // the key value might be the zone name. Other examples might be a key
  9219. // indicating a deprecated resource and a suggested replacement, or a
  9220. // warning about invalid network settings (for example, if an instance
  9221. // attempts to perform IP forwarding but is not enabled for IP
  9222. // forwarding).
  9223. Key string `json:"key,omitempty"`
  9224. // Value: [Output Only] A warning data value corresponding to the key.
  9225. Value string `json:"value,omitempty"`
  9226. // ForceSendFields is a list of field names (e.g. "Key") to
  9227. // unconditionally include in API requests. By default, fields with
  9228. // empty values are omitted from API requests. However, any non-pointer,
  9229. // non-interface field appearing in ForceSendFields will be sent to the
  9230. // server regardless of whether the field is empty or not. This may be
  9231. // used to include empty fields in Patch requests.
  9232. ForceSendFields []string `json:"-"`
  9233. // NullFields is a list of field names (e.g. "Key") to include in API
  9234. // requests with the JSON null value. By default, fields with empty
  9235. // values are omitted from API requests. However, any field with an
  9236. // empty value appearing in NullFields will be sent to the server as
  9237. // null. It is an error if a field in this list has a non-empty value.
  9238. // This may be used to include null fields in Patch requests.
  9239. NullFields []string `json:"-"`
  9240. }
  9241. func (s *HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
  9242. type NoMethod HealthChecksScopedListWarningData
  9243. raw := NoMethod(*s)
  9244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9245. }
  9246. type HealthStatus struct {
  9247. // Annotations: Metadata defined as annotations for network endpoint.
  9248. Annotations map[string]string `json:"annotations,omitempty"`
  9249. // HealthState: Health state of the instance.
  9250. //
  9251. // Possible values:
  9252. // "HEALTHY"
  9253. // "UNHEALTHY"
  9254. HealthState string `json:"healthState,omitempty"`
  9255. // Instance: URL of the instance resource.
  9256. Instance string `json:"instance,omitempty"`
  9257. // IpAddress: The IP address represented by this resource.
  9258. IpAddress string `json:"ipAddress,omitempty"`
  9259. // Port: The port on the instance.
  9260. Port int64 `json:"port,omitempty"`
  9261. // ForceSendFields is a list of field names (e.g. "Annotations") to
  9262. // unconditionally include in API requests. By default, fields with
  9263. // empty values are omitted from API requests. However, any non-pointer,
  9264. // non-interface field appearing in ForceSendFields will be sent to the
  9265. // server regardless of whether the field is empty or not. This may be
  9266. // used to include empty fields in Patch requests.
  9267. ForceSendFields []string `json:"-"`
  9268. // NullFields is a list of field names (e.g. "Annotations") to include
  9269. // in API requests with the JSON null value. By default, fields with
  9270. // empty values are omitted from API requests. However, any field with
  9271. // an empty value appearing in NullFields will be sent to the server as
  9272. // null. It is an error if a field in this list has a non-empty value.
  9273. // This may be used to include null fields in Patch requests.
  9274. NullFields []string `json:"-"`
  9275. }
  9276. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  9277. type NoMethod HealthStatus
  9278. raw := NoMethod(*s)
  9279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9280. }
  9281. type HealthStatusForNetworkEndpoint struct {
  9282. // BackendService: URL of the backend service associated with the health
  9283. // state of the network endpoint.
  9284. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  9285. // ForwardingRule: URL of the forwarding rule associated with the health
  9286. // state of the network endpoint.
  9287. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  9288. // HealthCheck: URL of the health check associated with the health state
  9289. // of the network endpoint.
  9290. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  9291. // HealthState: Health state of the network endpoint determined based on
  9292. // the health checks configured.
  9293. //
  9294. // Possible values:
  9295. // "DRAINING"
  9296. // "HEALTHY"
  9297. // "UNHEALTHY"
  9298. // "UNKNOWN"
  9299. HealthState string `json:"healthState,omitempty"`
  9300. // ForceSendFields is a list of field names (e.g. "BackendService") to
  9301. // unconditionally include in API requests. By default, fields with
  9302. // empty values are omitted from API requests. However, any non-pointer,
  9303. // non-interface field appearing in ForceSendFields will be sent to the
  9304. // server regardless of whether the field is empty or not. This may be
  9305. // used to include empty fields in Patch requests.
  9306. ForceSendFields []string `json:"-"`
  9307. // NullFields is a list of field names (e.g. "BackendService") to
  9308. // include in API requests with the JSON null value. By default, fields
  9309. // with empty values are omitted from API requests. However, any field
  9310. // with an empty value appearing in NullFields will be sent to the
  9311. // server as null. It is an error if a field in this list has a
  9312. // non-empty value. This may be used to include null fields in Patch
  9313. // requests.
  9314. NullFields []string `json:"-"`
  9315. }
  9316. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  9317. type NoMethod HealthStatusForNetworkEndpoint
  9318. raw := NoMethod(*s)
  9319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9320. }
  9321. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  9322. // use the named PathMatcher to select the BackendService.
  9323. type HostRule struct {
  9324. // Description: An optional description of this resource. Provide this
  9325. // property when you create the resource.
  9326. Description string `json:"description,omitempty"`
  9327. // Hosts: The list of host patterns to match. They must be valid
  9328. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  9329. // case, * must be the first character and must be followed in the
  9330. // pattern by either - or ..
  9331. Hosts []string `json:"hosts,omitempty"`
  9332. // PathMatcher: The name of the PathMatcher to use to match the path
  9333. // portion of the URL if the hostRule matches the URL's host portion.
  9334. PathMatcher string `json:"pathMatcher,omitempty"`
  9335. // ForceSendFields is a list of field names (e.g. "Description") to
  9336. // unconditionally include in API requests. By default, fields with
  9337. // empty values are omitted from API requests. However, any non-pointer,
  9338. // non-interface field appearing in ForceSendFields will be sent to the
  9339. // server regardless of whether the field is empty or not. This may be
  9340. // used to include empty fields in Patch requests.
  9341. ForceSendFields []string `json:"-"`
  9342. // NullFields is a list of field names (e.g. "Description") to include
  9343. // in API requests with the JSON null value. By default, fields with
  9344. // empty values are omitted from API requests. However, any field with
  9345. // an empty value appearing in NullFields will be sent to the server as
  9346. // null. It is an error if a field in this list has a non-empty value.
  9347. // This may be used to include null fields in Patch requests.
  9348. NullFields []string `json:"-"`
  9349. }
  9350. func (s *HostRule) MarshalJSON() ([]byte, error) {
  9351. type NoMethod HostRule
  9352. raw := NoMethod(*s)
  9353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9354. }
  9355. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  9356. // template for how individual instances should be checked for health,
  9357. // via HTTP.
  9358. type HttpHealthCheck struct {
  9359. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9360. // default value is 5 seconds.
  9361. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9362. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9363. // format.
  9364. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9365. // Description: An optional description of this resource. Provide this
  9366. // property when you create the resource.
  9367. Description string `json:"description,omitempty"`
  9368. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9369. // after this many consecutive successes. The default value is 2.
  9370. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9371. // Host: The value of the host header in the HTTP health check request.
  9372. // If left empty (default value), the public IP on behalf of which this
  9373. // health check is performed will be used.
  9374. Host string `json:"host,omitempty"`
  9375. // Id: [Output Only] The unique identifier for the resource. This
  9376. // identifier is defined by the server.
  9377. Id uint64 `json:"id,omitempty,string"`
  9378. // Kind: [Output Only] Type of the resource. Always
  9379. // compute#httpHealthCheck for HTTP health checks.
  9380. Kind string `json:"kind,omitempty"`
  9381. // Name: Name of the resource. Provided by the client when the resource
  9382. // is created. The name must be 1-63 characters long, and comply with
  9383. // RFC1035. Specifically, the name must be 1-63 characters long and
  9384. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9385. // the first character must be a lowercase letter, and all following
  9386. // characters must be a dash, lowercase letter, or digit, except the
  9387. // last character, which cannot be a dash.
  9388. Name string `json:"name,omitempty"`
  9389. // Port: The TCP port number for the HTTP health check request. The
  9390. // default value is 80.
  9391. Port int64 `json:"port,omitempty"`
  9392. // RequestPath: The request path of the HTTP health check request. The
  9393. // default value is /.
  9394. RequestPath string `json:"requestPath,omitempty"`
  9395. // SelfLink: [Output Only] Server-defined URL for the resource.
  9396. SelfLink string `json:"selfLink,omitempty"`
  9397. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9398. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9399. // greater value than checkIntervalSec.
  9400. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9401. // UnhealthyThreshold: A so-far healthy instance will be marked
  9402. // unhealthy after this many consecutive failures. The default value is
  9403. // 2.
  9404. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9405. // ServerResponse contains the HTTP response code and headers from the
  9406. // server.
  9407. googleapi.ServerResponse `json:"-"`
  9408. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9409. // unconditionally include in API requests. By default, fields with
  9410. // empty values are omitted from API requests. However, any non-pointer,
  9411. // non-interface field appearing in ForceSendFields will be sent to the
  9412. // server regardless of whether the field is empty or not. This may be
  9413. // used to include empty fields in Patch requests.
  9414. ForceSendFields []string `json:"-"`
  9415. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9416. // include in API requests with the JSON null value. By default, fields
  9417. // with empty values are omitted from API requests. However, any field
  9418. // with an empty value appearing in NullFields will be sent to the
  9419. // server as null. It is an error if a field in this list has a
  9420. // non-empty value. This may be used to include null fields in Patch
  9421. // requests.
  9422. NullFields []string `json:"-"`
  9423. }
  9424. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  9425. type NoMethod HttpHealthCheck
  9426. raw := NoMethod(*s)
  9427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9428. }
  9429. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  9430. type HttpHealthCheckList struct {
  9431. // Id: [Output Only] Unique identifier for the resource; defined by the
  9432. // server.
  9433. Id string `json:"id,omitempty"`
  9434. // Items: A list of HttpHealthCheck resources.
  9435. Items []*HttpHealthCheck `json:"items,omitempty"`
  9436. // Kind: Type of resource.
  9437. Kind string `json:"kind,omitempty"`
  9438. // NextPageToken: [Output Only] This token allows you to get the next
  9439. // page of results for list requests. If the number of results is larger
  9440. // than maxResults, use the nextPageToken as a value for the query
  9441. // parameter pageToken in the next list request. Subsequent list
  9442. // requests will have their own nextPageToken to continue paging through
  9443. // the results.
  9444. NextPageToken string `json:"nextPageToken,omitempty"`
  9445. // SelfLink: [Output Only] Server-defined URL for this resource.
  9446. SelfLink string `json:"selfLink,omitempty"`
  9447. // Warning: [Output Only] Informational warning message.
  9448. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  9449. // ServerResponse contains the HTTP response code and headers from the
  9450. // server.
  9451. googleapi.ServerResponse `json:"-"`
  9452. // ForceSendFields is a list of field names (e.g. "Id") to
  9453. // unconditionally include in API requests. By default, fields with
  9454. // empty values are omitted from API requests. However, any non-pointer,
  9455. // non-interface field appearing in ForceSendFields will be sent to the
  9456. // server regardless of whether the field is empty or not. This may be
  9457. // used to include empty fields in Patch requests.
  9458. ForceSendFields []string `json:"-"`
  9459. // NullFields is a list of field names (e.g. "Id") to include in API
  9460. // requests with the JSON null value. By default, fields with empty
  9461. // values are omitted from API requests. However, any field with an
  9462. // empty value appearing in NullFields will be sent to the server as
  9463. // null. It is an error if a field in this list has a non-empty value.
  9464. // This may be used to include null fields in Patch requests.
  9465. NullFields []string `json:"-"`
  9466. }
  9467. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  9468. type NoMethod HttpHealthCheckList
  9469. raw := NoMethod(*s)
  9470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9471. }
  9472. // HttpHealthCheckListWarning: [Output Only] Informational warning
  9473. // message.
  9474. type HttpHealthCheckListWarning struct {
  9475. // Code: [Output Only] A warning code, if applicable. For example,
  9476. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9477. // the response.
  9478. //
  9479. // Possible values:
  9480. // "CLEANUP_FAILED"
  9481. // "DEPRECATED_RESOURCE_USED"
  9482. // "DEPRECATED_TYPE_USED"
  9483. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9484. // "EXPERIMENTAL_TYPE_USED"
  9485. // "EXTERNAL_API_WARNING"
  9486. // "FIELD_VALUE_OVERRIDEN"
  9487. // "INJECTED_KERNELS_DEPRECATED"
  9488. // "MISSING_TYPE_DEPENDENCY"
  9489. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9490. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9491. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9492. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9493. // "NEXT_HOP_NOT_RUNNING"
  9494. // "NOT_CRITICAL_ERROR"
  9495. // "NO_RESULTS_ON_PAGE"
  9496. // "REQUIRED_TOS_AGREEMENT"
  9497. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9498. // "RESOURCE_NOT_DELETED"
  9499. // "SCHEMA_VALIDATION_IGNORED"
  9500. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9501. // "UNDECLARED_PROPERTIES"
  9502. // "UNREACHABLE"
  9503. Code string `json:"code,omitempty"`
  9504. // Data: [Output Only] Metadata about this warning in key: value format.
  9505. // For example:
  9506. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9507. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  9508. // Message: [Output Only] A human-readable description of the warning
  9509. // code.
  9510. Message string `json:"message,omitempty"`
  9511. // ForceSendFields is a list of field names (e.g. "Code") to
  9512. // unconditionally include in API requests. By default, fields with
  9513. // empty values are omitted from API requests. However, any non-pointer,
  9514. // non-interface field appearing in ForceSendFields will be sent to the
  9515. // server regardless of whether the field is empty or not. This may be
  9516. // used to include empty fields in Patch requests.
  9517. ForceSendFields []string `json:"-"`
  9518. // NullFields is a list of field names (e.g. "Code") to include in API
  9519. // requests with the JSON null value. By default, fields with empty
  9520. // values are omitted from API requests. However, any field with an
  9521. // empty value appearing in NullFields will be sent to the server as
  9522. // null. It is an error if a field in this list has a non-empty value.
  9523. // This may be used to include null fields in Patch requests.
  9524. NullFields []string `json:"-"`
  9525. }
  9526. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9527. type NoMethod HttpHealthCheckListWarning
  9528. raw := NoMethod(*s)
  9529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9530. }
  9531. type HttpHealthCheckListWarningData struct {
  9532. // Key: [Output Only] A key that provides more detail on the warning
  9533. // being returned. For example, for warnings where there are no results
  9534. // in a list request for a particular zone, this key might be scope and
  9535. // the key value might be the zone name. Other examples might be a key
  9536. // indicating a deprecated resource and a suggested replacement, or a
  9537. // warning about invalid network settings (for example, if an instance
  9538. // attempts to perform IP forwarding but is not enabled for IP
  9539. // forwarding).
  9540. Key string `json:"key,omitempty"`
  9541. // Value: [Output Only] A warning data value corresponding to the key.
  9542. Value string `json:"value,omitempty"`
  9543. // ForceSendFields is a list of field names (e.g. "Key") to
  9544. // unconditionally include in API requests. By default, fields with
  9545. // empty values are omitted from API requests. However, any non-pointer,
  9546. // non-interface field appearing in ForceSendFields will be sent to the
  9547. // server regardless of whether the field is empty or not. This may be
  9548. // used to include empty fields in Patch requests.
  9549. ForceSendFields []string `json:"-"`
  9550. // NullFields is a list of field names (e.g. "Key") to include in API
  9551. // requests with the JSON null value. By default, fields with empty
  9552. // values are omitted from API requests. However, any field with an
  9553. // empty value appearing in NullFields will be sent to the server as
  9554. // null. It is an error if a field in this list has a non-empty value.
  9555. // This may be used to include null fields in Patch requests.
  9556. NullFields []string `json:"-"`
  9557. }
  9558. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9559. type NoMethod HttpHealthCheckListWarningData
  9560. raw := NoMethod(*s)
  9561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9562. }
  9563. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  9564. // a template for how individual instances should be checked for health,
  9565. // via HTTPS.
  9566. type HttpsHealthCheck struct {
  9567. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9568. // default value is 5 seconds.
  9569. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9570. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9571. // format.
  9572. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9573. // Description: An optional description of this resource. Provide this
  9574. // property when you create the resource.
  9575. Description string `json:"description,omitempty"`
  9576. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9577. // after this many consecutive successes. The default value is 2.
  9578. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9579. // Host: The value of the host header in the HTTPS health check request.
  9580. // If left empty (default value), the public IP on behalf of which this
  9581. // health check is performed will be used.
  9582. Host string `json:"host,omitempty"`
  9583. // Id: [Output Only] The unique identifier for the resource. This
  9584. // identifier is defined by the server.
  9585. Id uint64 `json:"id,omitempty,string"`
  9586. // Kind: Type of the resource.
  9587. Kind string `json:"kind,omitempty"`
  9588. // Name: Name of the resource. Provided by the client when the resource
  9589. // is created. The name must be 1-63 characters long, and comply with
  9590. // RFC1035. Specifically, the name must be 1-63 characters long and
  9591. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9592. // the first character must be a lowercase letter, and all following
  9593. // characters must be a dash, lowercase letter, or digit, except the
  9594. // last character, which cannot be a dash.
  9595. Name string `json:"name,omitempty"`
  9596. // Port: The TCP port number for the HTTPS health check request. The
  9597. // default value is 443.
  9598. Port int64 `json:"port,omitempty"`
  9599. // RequestPath: The request path of the HTTPS health check request. The
  9600. // default value is "/".
  9601. RequestPath string `json:"requestPath,omitempty"`
  9602. // SelfLink: [Output Only] Server-defined URL for the resource.
  9603. SelfLink string `json:"selfLink,omitempty"`
  9604. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9605. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9606. // a greater value than checkIntervalSec.
  9607. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9608. // UnhealthyThreshold: A so-far healthy instance will be marked
  9609. // unhealthy after this many consecutive failures. The default value is
  9610. // 2.
  9611. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9612. // ServerResponse contains the HTTP response code and headers from the
  9613. // server.
  9614. googleapi.ServerResponse `json:"-"`
  9615. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9616. // unconditionally include in API requests. By default, fields with
  9617. // empty values are omitted from API requests. However, any non-pointer,
  9618. // non-interface field appearing in ForceSendFields will be sent to the
  9619. // server regardless of whether the field is empty or not. This may be
  9620. // used to include empty fields in Patch requests.
  9621. ForceSendFields []string `json:"-"`
  9622. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9623. // include in API requests with the JSON null value. By default, fields
  9624. // with empty values are omitted from API requests. However, any field
  9625. // with an empty value appearing in NullFields will be sent to the
  9626. // server as null. It is an error if a field in this list has a
  9627. // non-empty value. This may be used to include null fields in Patch
  9628. // requests.
  9629. NullFields []string `json:"-"`
  9630. }
  9631. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  9632. type NoMethod HttpsHealthCheck
  9633. raw := NoMethod(*s)
  9634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9635. }
  9636. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  9637. type HttpsHealthCheckList struct {
  9638. // Id: [Output Only] Unique identifier for the resource; defined by the
  9639. // server.
  9640. Id string `json:"id,omitempty"`
  9641. // Items: A list of HttpsHealthCheck resources.
  9642. Items []*HttpsHealthCheck `json:"items,omitempty"`
  9643. // Kind: Type of resource.
  9644. Kind string `json:"kind,omitempty"`
  9645. // NextPageToken: [Output Only] This token allows you to get the next
  9646. // page of results for list requests. If the number of results is larger
  9647. // than maxResults, use the nextPageToken as a value for the query
  9648. // parameter pageToken in the next list request. Subsequent list
  9649. // requests will have their own nextPageToken to continue paging through
  9650. // the results.
  9651. NextPageToken string `json:"nextPageToken,omitempty"`
  9652. // SelfLink: [Output Only] Server-defined URL for this resource.
  9653. SelfLink string `json:"selfLink,omitempty"`
  9654. // Warning: [Output Only] Informational warning message.
  9655. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  9656. // ServerResponse contains the HTTP response code and headers from the
  9657. // server.
  9658. googleapi.ServerResponse `json:"-"`
  9659. // ForceSendFields is a list of field names (e.g. "Id") to
  9660. // unconditionally include in API requests. By default, fields with
  9661. // empty values are omitted from API requests. However, any non-pointer,
  9662. // non-interface field appearing in ForceSendFields will be sent to the
  9663. // server regardless of whether the field is empty or not. This may be
  9664. // used to include empty fields in Patch requests.
  9665. ForceSendFields []string `json:"-"`
  9666. // NullFields is a list of field names (e.g. "Id") to include in API
  9667. // requests with the JSON null value. By default, fields with empty
  9668. // values are omitted from API requests. However, any field with an
  9669. // empty value appearing in NullFields will be sent to the server as
  9670. // null. It is an error if a field in this list has a non-empty value.
  9671. // This may be used to include null fields in Patch requests.
  9672. NullFields []string `json:"-"`
  9673. }
  9674. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  9675. type NoMethod HttpsHealthCheckList
  9676. raw := NoMethod(*s)
  9677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9678. }
  9679. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  9680. // message.
  9681. type HttpsHealthCheckListWarning struct {
  9682. // Code: [Output Only] A warning code, if applicable. For example,
  9683. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9684. // the response.
  9685. //
  9686. // Possible values:
  9687. // "CLEANUP_FAILED"
  9688. // "DEPRECATED_RESOURCE_USED"
  9689. // "DEPRECATED_TYPE_USED"
  9690. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9691. // "EXPERIMENTAL_TYPE_USED"
  9692. // "EXTERNAL_API_WARNING"
  9693. // "FIELD_VALUE_OVERRIDEN"
  9694. // "INJECTED_KERNELS_DEPRECATED"
  9695. // "MISSING_TYPE_DEPENDENCY"
  9696. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9697. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9698. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9699. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9700. // "NEXT_HOP_NOT_RUNNING"
  9701. // "NOT_CRITICAL_ERROR"
  9702. // "NO_RESULTS_ON_PAGE"
  9703. // "REQUIRED_TOS_AGREEMENT"
  9704. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9705. // "RESOURCE_NOT_DELETED"
  9706. // "SCHEMA_VALIDATION_IGNORED"
  9707. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9708. // "UNDECLARED_PROPERTIES"
  9709. // "UNREACHABLE"
  9710. Code string `json:"code,omitempty"`
  9711. // Data: [Output Only] Metadata about this warning in key: value format.
  9712. // For example:
  9713. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9714. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  9715. // Message: [Output Only] A human-readable description of the warning
  9716. // code.
  9717. Message string `json:"message,omitempty"`
  9718. // ForceSendFields is a list of field names (e.g. "Code") to
  9719. // unconditionally include in API requests. By default, fields with
  9720. // empty values are omitted from API requests. However, any non-pointer,
  9721. // non-interface field appearing in ForceSendFields will be sent to the
  9722. // server regardless of whether the field is empty or not. This may be
  9723. // used to include empty fields in Patch requests.
  9724. ForceSendFields []string `json:"-"`
  9725. // NullFields is a list of field names (e.g. "Code") to include in API
  9726. // requests with the JSON null value. By default, fields with empty
  9727. // values are omitted from API requests. However, any field with an
  9728. // empty value appearing in NullFields will be sent to the server as
  9729. // null. It is an error if a field in this list has a non-empty value.
  9730. // This may be used to include null fields in Patch requests.
  9731. NullFields []string `json:"-"`
  9732. }
  9733. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9734. type NoMethod HttpsHealthCheckListWarning
  9735. raw := NoMethod(*s)
  9736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9737. }
  9738. type HttpsHealthCheckListWarningData struct {
  9739. // Key: [Output Only] A key that provides more detail on the warning
  9740. // being returned. For example, for warnings where there are no results
  9741. // in a list request for a particular zone, this key might be scope and
  9742. // the key value might be the zone name. Other examples might be a key
  9743. // indicating a deprecated resource and a suggested replacement, or a
  9744. // warning about invalid network settings (for example, if an instance
  9745. // attempts to perform IP forwarding but is not enabled for IP
  9746. // forwarding).
  9747. Key string `json:"key,omitempty"`
  9748. // Value: [Output Only] A warning data value corresponding to the key.
  9749. Value string `json:"value,omitempty"`
  9750. // ForceSendFields is a list of field names (e.g. "Key") to
  9751. // unconditionally include in API requests. By default, fields with
  9752. // empty values are omitted from API requests. However, any non-pointer,
  9753. // non-interface field appearing in ForceSendFields will be sent to the
  9754. // server regardless of whether the field is empty or not. This may be
  9755. // used to include empty fields in Patch requests.
  9756. ForceSendFields []string `json:"-"`
  9757. // NullFields is a list of field names (e.g. "Key") to include in API
  9758. // requests with the JSON null value. By default, fields with empty
  9759. // values are omitted from API requests. However, any field with an
  9760. // empty value appearing in NullFields will be sent to the server as
  9761. // null. It is an error if a field in this list has a non-empty value.
  9762. // This may be used to include null fields in Patch requests.
  9763. NullFields []string `json:"-"`
  9764. }
  9765. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9766. type NoMethod HttpsHealthCheckListWarningData
  9767. raw := NoMethod(*s)
  9768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9769. }
  9770. // Image: An Image resource. (== resource_for beta.images ==) (==
  9771. // resource_for v1.images ==)
  9772. type Image struct {
  9773. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  9774. // Cloud Storage (in bytes).
  9775. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  9776. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9777. // format.
  9778. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9779. // Deprecated: The deprecation status associated with this image.
  9780. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  9781. // Description: An optional description of this resource. Provide this
  9782. // property when you create the resource.
  9783. Description string `json:"description,omitempty"`
  9784. // DiskSizeGb: Size of the image when restored onto a persistent disk
  9785. // (in GB).
  9786. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  9787. // Family: The name of the image family to which this image belongs. You
  9788. // can create disks by specifying an image family instead of a specific
  9789. // image name. The image family always returns its latest image that is
  9790. // not deprecated. The name of the image family must comply with
  9791. // RFC1035.
  9792. Family string `json:"family,omitempty"`
  9793. // GuestOsFeatures: A list of features to enable on the guest operating
  9794. // system. Applicable only for bootable images. Read Enabling guest
  9795. // operating system features to see a list of available options.
  9796. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  9797. // Id: [Output Only] The unique identifier for the resource. This
  9798. // identifier is defined by the server.
  9799. Id uint64 `json:"id,omitempty,string"`
  9800. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  9801. // encryption key.
  9802. //
  9803. // After you encrypt an image with a customer-supplied key, you must
  9804. // provide the same key if you use the image later (e.g. to create a
  9805. // disk from the image).
  9806. //
  9807. // Customer-supplied encryption keys do not protect access to metadata
  9808. // of the disk.
  9809. //
  9810. // If you do not provide an encryption key when creating the image, then
  9811. // the disk will be encrypted using an automatically generated key and
  9812. // you do not need to provide a key to use the image later.
  9813. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  9814. // Kind: [Output Only] Type of the resource. Always compute#image for
  9815. // images.
  9816. Kind string `json:"kind,omitempty"`
  9817. // LabelFingerprint: A fingerprint for the labels being applied to this
  9818. // image, which is essentially a hash of the labels used for optimistic
  9819. // locking. The fingerprint is initially generated by Compute Engine and
  9820. // changes after every request to modify or update labels. You must
  9821. // always provide an up-to-date fingerprint hash in order to update or
  9822. // change labels, otherwise the request will fail with error 412
  9823. // conditionNotMet.
  9824. //
  9825. // To see the latest fingerprint, make a get() request to retrieve an
  9826. // image.
  9827. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9828. // Labels: Labels to apply to this image. These can be later modified by
  9829. // the setLabels method.
  9830. Labels map[string]string `json:"labels,omitempty"`
  9831. // LicenseCodes: Integer license codes indicating which licenses are
  9832. // attached to this image.
  9833. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  9834. // Licenses: Any applicable license URI.
  9835. Licenses []string `json:"licenses,omitempty"`
  9836. // Name: Name of the resource; provided by the client when the resource
  9837. // is created. The name must be 1-63 characters long, and comply with
  9838. // RFC1035. Specifically, the name must be 1-63 characters long and
  9839. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9840. // the first character must be a lowercase letter, and all following
  9841. // characters must be a dash, lowercase letter, or digit, except the
  9842. // last character, which cannot be a dash.
  9843. Name string `json:"name,omitempty"`
  9844. // RawDisk: The parameters of the raw disk image.
  9845. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  9846. // SelfLink: [Output Only] Server-defined URL for the resource.
  9847. SelfLink string `json:"selfLink,omitempty"`
  9848. // SourceDisk: URL of the source disk used to create this image. This
  9849. // can be a full or valid partial URL. You must provide either this
  9850. // property or the rawDisk.source property but not both to create an
  9851. // image. For example, the following are valid values:
  9852. // -
  9853. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  9854. // - projects/project/zones/zone/disks/disk
  9855. // - zones/zone/disks/disk
  9856. SourceDisk string `json:"sourceDisk,omitempty"`
  9857. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  9858. // source disk. Required if the source disk is protected by a
  9859. // customer-supplied encryption key.
  9860. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  9861. // SourceDiskId: [Output Only] The ID value of the disk used to create
  9862. // this image. This value may be used to determine whether the image was
  9863. // taken from the current or a previous instance of a given disk name.
  9864. SourceDiskId string `json:"sourceDiskId,omitempty"`
  9865. // SourceImage: URL of the source image used to create this image. This
  9866. // can be a full or valid partial URL. You must provide exactly one of:
  9867. //
  9868. // - this property, or
  9869. // - the rawDisk.source property, or
  9870. // - the sourceDisk property in order to create an image.
  9871. SourceImage string `json:"sourceImage,omitempty"`
  9872. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  9873. // source image. Required if the source image is protected by a
  9874. // customer-supplied encryption key.
  9875. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  9876. // SourceImageId: [Output Only] The ID value of the image used to create
  9877. // this image. This value may be used to determine whether the image was
  9878. // taken from the current or a previous instance of a given image name.
  9879. SourceImageId string `json:"sourceImageId,omitempty"`
  9880. // SourceSnapshot: URL of the source snapshot used to create this image.
  9881. // This can be a full or valid partial URL. You must provide exactly one
  9882. // of:
  9883. // - this property, or
  9884. // - the sourceImage property, or
  9885. // - the rawDisk.source property, or
  9886. // - the sourceDisk property in order to create an image.
  9887. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  9888. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  9889. // the source snapshot. Required if the source snapshot is protected by
  9890. // a customer-supplied encryption key.
  9891. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  9892. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  9893. // create this image. This value may be used to determine whether the
  9894. // snapshot was taken from the current or a previous instance of a given
  9895. // snapshot name.
  9896. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  9897. // SourceType: The type of the image used to create this disk. The
  9898. // default and only value is RAW
  9899. //
  9900. // Possible values:
  9901. // "RAW" (default)
  9902. SourceType string `json:"sourceType,omitempty"`
  9903. // Status: [Output Only] The status of the image. An image can be used
  9904. // to create other resources, such as instances, only after the image
  9905. // has been successfully created and the status is set to READY.
  9906. // Possible values are FAILED, PENDING, or READY.
  9907. //
  9908. // Possible values:
  9909. // "FAILED"
  9910. // "PENDING"
  9911. // "READY"
  9912. Status string `json:"status,omitempty"`
  9913. // ServerResponse contains the HTTP response code and headers from the
  9914. // server.
  9915. googleapi.ServerResponse `json:"-"`
  9916. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9917. // unconditionally include in API requests. By default, fields with
  9918. // empty values are omitted from API requests. However, any non-pointer,
  9919. // non-interface field appearing in ForceSendFields will be sent to the
  9920. // server regardless of whether the field is empty or not. This may be
  9921. // used to include empty fields in Patch requests.
  9922. ForceSendFields []string `json:"-"`
  9923. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9924. // include in API requests with the JSON null value. By default, fields
  9925. // with empty values are omitted from API requests. However, any field
  9926. // with an empty value appearing in NullFields will be sent to the
  9927. // server as null. It is an error if a field in this list has a
  9928. // non-empty value. This may be used to include null fields in Patch
  9929. // requests.
  9930. NullFields []string `json:"-"`
  9931. }
  9932. func (s *Image) MarshalJSON() ([]byte, error) {
  9933. type NoMethod Image
  9934. raw := NoMethod(*s)
  9935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9936. }
  9937. // ImageRawDisk: The parameters of the raw disk image.
  9938. type ImageRawDisk struct {
  9939. // ContainerType: The format used to encode and transmit the block
  9940. // device, which should be TAR. This is just a container and
  9941. // transmission format and not a runtime format. Provided by the client
  9942. // when the disk image is created.
  9943. //
  9944. // Possible values:
  9945. // "TAR"
  9946. ContainerType string `json:"containerType,omitempty"`
  9947. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  9948. // unpackaging; provided by the client when the disk image is created.
  9949. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  9950. // Source: The full Google Cloud Storage URL where the disk image is
  9951. // stored. You must provide either this property or the sourceDisk
  9952. // property but not both.
  9953. Source string `json:"source,omitempty"`
  9954. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  9955. // unconditionally include in API requests. By default, fields with
  9956. // empty values are omitted from API requests. However, any non-pointer,
  9957. // non-interface field appearing in ForceSendFields will be sent to the
  9958. // server regardless of whether the field is empty or not. This may be
  9959. // used to include empty fields in Patch requests.
  9960. ForceSendFields []string `json:"-"`
  9961. // NullFields is a list of field names (e.g. "ContainerType") to include
  9962. // in API requests with the JSON null value. By default, fields with
  9963. // empty values are omitted from API requests. However, any field with
  9964. // an empty value appearing in NullFields will be sent to the server as
  9965. // null. It is an error if a field in this list has a non-empty value.
  9966. // This may be used to include null fields in Patch requests.
  9967. NullFields []string `json:"-"`
  9968. }
  9969. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  9970. type NoMethod ImageRawDisk
  9971. raw := NoMethod(*s)
  9972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9973. }
  9974. // ImageList: Contains a list of images.
  9975. type ImageList struct {
  9976. // Id: [Output Only] Unique identifier for the resource; defined by the
  9977. // server.
  9978. Id string `json:"id,omitempty"`
  9979. // Items: A list of Image resources.
  9980. Items []*Image `json:"items,omitempty"`
  9981. // Kind: Type of resource.
  9982. Kind string `json:"kind,omitempty"`
  9983. // NextPageToken: [Output Only] This token allows you to get the next
  9984. // page of results for list requests. If the number of results is larger
  9985. // than maxResults, use the nextPageToken as a value for the query
  9986. // parameter pageToken in the next list request. Subsequent list
  9987. // requests will have their own nextPageToken to continue paging through
  9988. // the results.
  9989. NextPageToken string `json:"nextPageToken,omitempty"`
  9990. // SelfLink: [Output Only] Server-defined URL for this resource.
  9991. SelfLink string `json:"selfLink,omitempty"`
  9992. // Warning: [Output Only] Informational warning message.
  9993. Warning *ImageListWarning `json:"warning,omitempty"`
  9994. // ServerResponse contains the HTTP response code and headers from the
  9995. // server.
  9996. googleapi.ServerResponse `json:"-"`
  9997. // ForceSendFields is a list of field names (e.g. "Id") to
  9998. // unconditionally include in API requests. By default, fields with
  9999. // empty values are omitted from API requests. However, any non-pointer,
  10000. // non-interface field appearing in ForceSendFields will be sent to the
  10001. // server regardless of whether the field is empty or not. This may be
  10002. // used to include empty fields in Patch requests.
  10003. ForceSendFields []string `json:"-"`
  10004. // NullFields is a list of field names (e.g. "Id") to include in API
  10005. // requests with the JSON null value. By default, fields with empty
  10006. // values are omitted from API requests. However, any field with an
  10007. // empty value appearing in NullFields will be sent to the server as
  10008. // null. It is an error if a field in this list has a non-empty value.
  10009. // This may be used to include null fields in Patch requests.
  10010. NullFields []string `json:"-"`
  10011. }
  10012. func (s *ImageList) MarshalJSON() ([]byte, error) {
  10013. type NoMethod ImageList
  10014. raw := NoMethod(*s)
  10015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10016. }
  10017. // ImageListWarning: [Output Only] Informational warning message.
  10018. type ImageListWarning struct {
  10019. // Code: [Output Only] A warning code, if applicable. For example,
  10020. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10021. // the response.
  10022. //
  10023. // Possible values:
  10024. // "CLEANUP_FAILED"
  10025. // "DEPRECATED_RESOURCE_USED"
  10026. // "DEPRECATED_TYPE_USED"
  10027. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10028. // "EXPERIMENTAL_TYPE_USED"
  10029. // "EXTERNAL_API_WARNING"
  10030. // "FIELD_VALUE_OVERRIDEN"
  10031. // "INJECTED_KERNELS_DEPRECATED"
  10032. // "MISSING_TYPE_DEPENDENCY"
  10033. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10034. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10035. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10036. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10037. // "NEXT_HOP_NOT_RUNNING"
  10038. // "NOT_CRITICAL_ERROR"
  10039. // "NO_RESULTS_ON_PAGE"
  10040. // "REQUIRED_TOS_AGREEMENT"
  10041. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10042. // "RESOURCE_NOT_DELETED"
  10043. // "SCHEMA_VALIDATION_IGNORED"
  10044. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10045. // "UNDECLARED_PROPERTIES"
  10046. // "UNREACHABLE"
  10047. Code string `json:"code,omitempty"`
  10048. // Data: [Output Only] Metadata about this warning in key: value format.
  10049. // For example:
  10050. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10051. Data []*ImageListWarningData `json:"data,omitempty"`
  10052. // Message: [Output Only] A human-readable description of the warning
  10053. // code.
  10054. Message string `json:"message,omitempty"`
  10055. // ForceSendFields is a list of field names (e.g. "Code") to
  10056. // unconditionally include in API requests. By default, fields with
  10057. // empty values are omitted from API requests. However, any non-pointer,
  10058. // non-interface field appearing in ForceSendFields will be sent to the
  10059. // server regardless of whether the field is empty or not. This may be
  10060. // used to include empty fields in Patch requests.
  10061. ForceSendFields []string `json:"-"`
  10062. // NullFields is a list of field names (e.g. "Code") to include in API
  10063. // requests with the JSON null value. By default, fields with empty
  10064. // values are omitted from API requests. However, any field with an
  10065. // empty value appearing in NullFields will be sent to the server as
  10066. // null. It is an error if a field in this list has a non-empty value.
  10067. // This may be used to include null fields in Patch requests.
  10068. NullFields []string `json:"-"`
  10069. }
  10070. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  10071. type NoMethod ImageListWarning
  10072. raw := NoMethod(*s)
  10073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10074. }
  10075. type ImageListWarningData struct {
  10076. // Key: [Output Only] A key that provides more detail on the warning
  10077. // being returned. For example, for warnings where there are no results
  10078. // in a list request for a particular zone, this key might be scope and
  10079. // the key value might be the zone name. Other examples might be a key
  10080. // indicating a deprecated resource and a suggested replacement, or a
  10081. // warning about invalid network settings (for example, if an instance
  10082. // attempts to perform IP forwarding but is not enabled for IP
  10083. // forwarding).
  10084. Key string `json:"key,omitempty"`
  10085. // Value: [Output Only] A warning data value corresponding to the key.
  10086. Value string `json:"value,omitempty"`
  10087. // ForceSendFields is a list of field names (e.g. "Key") to
  10088. // 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. "Key") to include in API
  10095. // requests with the JSON null value. By default, fields with empty
  10096. // values are omitted from API requests. However, any field with an
  10097. // empty value appearing in NullFields will be sent to the server as
  10098. // null. It is an error if a field in this list has a non-empty value.
  10099. // This may be used to include null fields in Patch requests.
  10100. NullFields []string `json:"-"`
  10101. }
  10102. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  10103. type NoMethod ImageListWarningData
  10104. raw := NoMethod(*s)
  10105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10106. }
  10107. // Instance: An Instance resource. (== resource_for beta.instances ==)
  10108. // (== resource_for v1.instances ==)
  10109. type Instance struct {
  10110. // AllocationAffinity: The configuration of desired allocations which
  10111. // this Instance could consume capacity from.
  10112. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  10113. // CanIpForward: Allows this instance to send and receive packets with
  10114. // non-matching destination or source IPs. This is required if you plan
  10115. // to use this instance to forward routes. For more information, see
  10116. // Enabling IP Forwarding.
  10117. CanIpForward bool `json:"canIpForward,omitempty"`
  10118. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  10119. CpuPlatform string `json:"cpuPlatform,omitempty"`
  10120. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10121. // format.
  10122. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10123. // DeletionProtection: Whether the resource should be protected against
  10124. // deletion.
  10125. DeletionProtection bool `json:"deletionProtection,omitempty"`
  10126. // Description: An optional description of this resource. Provide this
  10127. // property when you create the resource.
  10128. Description string `json:"description,omitempty"`
  10129. // Disks: Array of disks associated with this instance. Persistent disks
  10130. // must be created before you can assign them.
  10131. Disks []*AttachedDisk `json:"disks,omitempty"`
  10132. // DisplayDevice: Enables display device for the instance.
  10133. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  10134. // GuestAccelerators: A list of the type and count of accelerator cards
  10135. // attached to the instance.
  10136. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10137. Hostname string `json:"hostname,omitempty"`
  10138. // Id: [Output Only] The unique identifier for the resource. This
  10139. // identifier is defined by the server.
  10140. Id uint64 `json:"id,omitempty,string"`
  10141. // InstanceEncryptionKey: Encrypts or decrypts data for an instance with
  10142. // a customer-supplied encryption key.
  10143. //
  10144. // If you are creating a new instance, this field encrypts the local SSD
  10145. // and in-memory contents of the instance using a key that you
  10146. // provide.
  10147. //
  10148. // If you are restarting an instance protected with a customer-supplied
  10149. // encryption key, you must provide the correct key in order to
  10150. // successfully restart the instance.
  10151. //
  10152. // If you do not provide an encryption key when creating the instance,
  10153. // then the local SSD and in-memory contents will be encrypted using an
  10154. // automatically generated key and you do not need to provide a key to
  10155. // start the instance later.
  10156. //
  10157. // Instance templates do not store customer-supplied encryption keys, so
  10158. // you cannot use your own keys to encrypt local SSDs and in-memory
  10159. // content in a managed instance group.
  10160. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  10161. // Kind: [Output Only] Type of the resource. Always compute#instance for
  10162. // instances.
  10163. Kind string `json:"kind,omitempty"`
  10164. // LabelFingerprint: A fingerprint for this request, which is
  10165. // essentially a hash of the label's contents and used for optimistic
  10166. // locking. The fingerprint is initially generated by Compute Engine and
  10167. // changes after every request to modify or update labels. You must
  10168. // always provide an up-to-date fingerprint hash in order to update or
  10169. // change labels.
  10170. //
  10171. // To see the latest fingerprint, make get() request to the instance.
  10172. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  10173. // Labels: Labels to apply to this instance. These can be later modified
  10174. // by the setLabels method.
  10175. Labels map[string]string `json:"labels,omitempty"`
  10176. // MachineType: Full or partial URL of the machine type resource to use
  10177. // for this instance, in the format:
  10178. // zones/zone/machineTypes/machine-type. This is provided by the client
  10179. // when the instance is created. For example, the following is a valid
  10180. // partial url to a predefined machine
  10181. // type:
  10182. // zones/us-central1-f/machineTypes/n1-standard-1
  10183. //
  10184. //
  10185. // To create a custom machine type, provide a URL to a machine type in
  10186. // the following format, where CPUS is 1 or an even number up to 32 (2,
  10187. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  10188. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  10189. // 5 GB of memory is 5120
  10190. // MB):
  10191. // zones/zone/machineTypes/custom-CPUS-MEMORY
  10192. //
  10193. //
  10194. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  10195. //
  10196. // For a full list of restrictions, read the Specifications for custom
  10197. // machine types.
  10198. MachineType string `json:"machineType,omitempty"`
  10199. // Metadata: The metadata key/value pairs assigned to this instance.
  10200. // This includes custom metadata and predefined keys.
  10201. Metadata *Metadata `json:"metadata,omitempty"`
  10202. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  10203. // Applicable values are the friendly names of CPU platforms, such as
  10204. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10205. // Bridge".
  10206. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10207. // Name: The name of the resource, provided by the client when initially
  10208. // creating the resource. The resource name must be 1-63 characters
  10209. // long, and comply with RFC1035. Specifically, the name must be 1-63
  10210. // characters long and match the regular expression
  10211. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  10212. // a lowercase letter, and all following characters must be a dash,
  10213. // lowercase letter, or digit, except the last character, which cannot
  10214. // be a dash.
  10215. Name string `json:"name,omitempty"`
  10216. // NetworkInterfaces: An array of network configurations for this
  10217. // instance. These specify how interfaces are configured to interact
  10218. // with other network services, such as connecting to the internet.
  10219. // Multiple interfaces are supported per instance.
  10220. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10221. // PreservedStateSizeGb: Total amount of preserved state for SUSPENDED
  10222. // instances. Read-only in the api.
  10223. PreservedStateSizeGb int64 `json:"preservedStateSizeGb,omitempty,string"`
  10224. // ResourcePolicies: Resource policies applied to this instance.
  10225. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  10226. // Scheduling: Sets the scheduling options for this instance.
  10227. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10228. // SelfLink: [Output Only] Server-defined URL for this resource.
  10229. SelfLink string `json:"selfLink,omitempty"`
  10230. // ServiceAccounts: A list of service accounts, with their specified
  10231. // scopes, authorized for this instance. Only one service account per VM
  10232. // instance is supported.
  10233. //
  10234. // Service accounts generate access tokens that can be accessed through
  10235. // the metadata server and used to authenticate applications on the
  10236. // instance. See Service Accounts for more information.
  10237. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10238. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  10239. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  10240. // SourceMachineImage: Source machine image
  10241. SourceMachineImage string `json:"sourceMachineImage,omitempty"`
  10242. // StartRestricted: [Output Only] Whether a VM has been restricted for
  10243. // start because Compute Engine has detected suspicious activity.
  10244. StartRestricted bool `json:"startRestricted,omitempty"`
  10245. // Status: [Output Only] The status of the instance. One of the
  10246. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  10247. // SUSPENDING, SUSPENDED, and TERMINATED.
  10248. //
  10249. // Possible values:
  10250. // "PROVISIONING"
  10251. // "RUNNING"
  10252. // "STAGING"
  10253. // "STOPPED"
  10254. // "STOPPING"
  10255. // "SUSPENDED"
  10256. // "SUSPENDING"
  10257. // "TERMINATED"
  10258. Status string `json:"status,omitempty"`
  10259. // StatusMessage: [Output Only] An optional, human-readable explanation
  10260. // of the status.
  10261. StatusMessage string `json:"statusMessage,omitempty"`
  10262. // Tags: Tags to apply to this instance. Tags are used to identify valid
  10263. // sources or targets for network firewalls and are specified by the
  10264. // client during instance creation. The tags can be later modified by
  10265. // the setTags method. Each tag within the list must comply with
  10266. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  10267. Tags *Tags `json:"tags,omitempty"`
  10268. // Zone: [Output Only] URL of the zone where the instance resides. You
  10269. // must specify this field as part of the HTTP request URL. It is not
  10270. // settable as a field in the request body.
  10271. Zone string `json:"zone,omitempty"`
  10272. // ServerResponse contains the HTTP response code and headers from the
  10273. // server.
  10274. googleapi.ServerResponse `json:"-"`
  10275. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  10276. // to unconditionally include in API requests. By default, fields with
  10277. // empty values are omitted from API requests. However, any non-pointer,
  10278. // non-interface field appearing in ForceSendFields will be sent to the
  10279. // server regardless of whether the field is empty or not. This may be
  10280. // used to include empty fields in Patch requests.
  10281. ForceSendFields []string `json:"-"`
  10282. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  10283. // include in API requests with the JSON null value. By default, fields
  10284. // with empty values are omitted from API requests. However, any field
  10285. // with an empty value appearing in NullFields will be sent to the
  10286. // server as null. It is an error if a field in this list has a
  10287. // non-empty value. This may be used to include null fields in Patch
  10288. // requests.
  10289. NullFields []string `json:"-"`
  10290. }
  10291. func (s *Instance) MarshalJSON() ([]byte, error) {
  10292. type NoMethod Instance
  10293. raw := NoMethod(*s)
  10294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10295. }
  10296. type InstanceAggregatedList struct {
  10297. // Id: [Output Only] Unique identifier for the resource; defined by the
  10298. // server.
  10299. Id string `json:"id,omitempty"`
  10300. // Items: A list of InstancesScopedList resources.
  10301. Items map[string]InstancesScopedList `json:"items,omitempty"`
  10302. // Kind: [Output Only] Type of resource. Always
  10303. // compute#instanceAggregatedList for aggregated lists of Instance
  10304. // resources.
  10305. Kind string `json:"kind,omitempty"`
  10306. // NextPageToken: [Output Only] This token allows you to get the next
  10307. // page of results for list requests. If the number of results is larger
  10308. // than maxResults, use the nextPageToken as a value for the query
  10309. // parameter pageToken in the next list request. Subsequent list
  10310. // requests will have their own nextPageToken to continue paging through
  10311. // the results.
  10312. NextPageToken string `json:"nextPageToken,omitempty"`
  10313. // SelfLink: [Output Only] Server-defined URL for this resource.
  10314. SelfLink string `json:"selfLink,omitempty"`
  10315. // Warning: [Output Only] Informational warning message.
  10316. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  10317. // ServerResponse contains the HTTP response code and headers from the
  10318. // server.
  10319. googleapi.ServerResponse `json:"-"`
  10320. // ForceSendFields is a list of field names (e.g. "Id") to
  10321. // unconditionally include in API requests. By default, fields with
  10322. // empty values are omitted from API requests. However, any non-pointer,
  10323. // non-interface field appearing in ForceSendFields will be sent to the
  10324. // server regardless of whether the field is empty or not. This may be
  10325. // used to include empty fields in Patch requests.
  10326. ForceSendFields []string `json:"-"`
  10327. // NullFields is a list of field names (e.g. "Id") to include in API
  10328. // requests with the JSON null value. By default, fields with empty
  10329. // values are omitted from API requests. However, any field with an
  10330. // empty value appearing in NullFields will be sent to the server as
  10331. // null. It is an error if a field in this list has a non-empty value.
  10332. // This may be used to include null fields in Patch requests.
  10333. NullFields []string `json:"-"`
  10334. }
  10335. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  10336. type NoMethod InstanceAggregatedList
  10337. raw := NoMethod(*s)
  10338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10339. }
  10340. // InstanceAggregatedListWarning: [Output Only] Informational warning
  10341. // message.
  10342. type InstanceAggregatedListWarning struct {
  10343. // Code: [Output Only] A warning code, if applicable. For example,
  10344. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10345. // the response.
  10346. //
  10347. // Possible values:
  10348. // "CLEANUP_FAILED"
  10349. // "DEPRECATED_RESOURCE_USED"
  10350. // "DEPRECATED_TYPE_USED"
  10351. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10352. // "EXPERIMENTAL_TYPE_USED"
  10353. // "EXTERNAL_API_WARNING"
  10354. // "FIELD_VALUE_OVERRIDEN"
  10355. // "INJECTED_KERNELS_DEPRECATED"
  10356. // "MISSING_TYPE_DEPENDENCY"
  10357. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10358. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10359. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10360. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10361. // "NEXT_HOP_NOT_RUNNING"
  10362. // "NOT_CRITICAL_ERROR"
  10363. // "NO_RESULTS_ON_PAGE"
  10364. // "REQUIRED_TOS_AGREEMENT"
  10365. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10366. // "RESOURCE_NOT_DELETED"
  10367. // "SCHEMA_VALIDATION_IGNORED"
  10368. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10369. // "UNDECLARED_PROPERTIES"
  10370. // "UNREACHABLE"
  10371. Code string `json:"code,omitempty"`
  10372. // Data: [Output Only] Metadata about this warning in key: value format.
  10373. // For example:
  10374. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10375. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  10376. // Message: [Output Only] A human-readable description of the warning
  10377. // code.
  10378. Message string `json:"message,omitempty"`
  10379. // ForceSendFields is a list of field names (e.g. "Code") to
  10380. // unconditionally include in API requests. By default, fields with
  10381. // empty values are omitted from API requests. However, any non-pointer,
  10382. // non-interface field appearing in ForceSendFields will be sent to the
  10383. // server regardless of whether the field is empty or not. This may be
  10384. // used to include empty fields in Patch requests.
  10385. ForceSendFields []string `json:"-"`
  10386. // NullFields is a list of field names (e.g. "Code") to include in API
  10387. // requests with the JSON null value. By default, fields with empty
  10388. // values are omitted from API requests. However, any field with an
  10389. // empty value appearing in NullFields will be sent to the server as
  10390. // null. It is an error if a field in this list has a non-empty value.
  10391. // This may be used to include null fields in Patch requests.
  10392. NullFields []string `json:"-"`
  10393. }
  10394. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10395. type NoMethod InstanceAggregatedListWarning
  10396. raw := NoMethod(*s)
  10397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10398. }
  10399. type InstanceAggregatedListWarningData struct {
  10400. // Key: [Output Only] A key that provides more detail on the warning
  10401. // being returned. For example, for warnings where there are no results
  10402. // in a list request for a particular zone, this key might be scope and
  10403. // the key value might be the zone name. Other examples might be a key
  10404. // indicating a deprecated resource and a suggested replacement, or a
  10405. // warning about invalid network settings (for example, if an instance
  10406. // attempts to perform IP forwarding but is not enabled for IP
  10407. // forwarding).
  10408. Key string `json:"key,omitempty"`
  10409. // Value: [Output Only] A warning data value corresponding to the key.
  10410. Value string `json:"value,omitempty"`
  10411. // ForceSendFields is a list of field names (e.g. "Key") to
  10412. // unconditionally include in API requests. By default, fields with
  10413. // empty values are omitted from API requests. However, any non-pointer,
  10414. // non-interface field appearing in ForceSendFields will be sent to the
  10415. // server regardless of whether the field is empty or not. This may be
  10416. // used to include empty fields in Patch requests.
  10417. ForceSendFields []string `json:"-"`
  10418. // NullFields is a list of field names (e.g. "Key") to include in API
  10419. // requests with the JSON null value. By default, fields with empty
  10420. // values are omitted from API requests. However, any field with an
  10421. // empty value appearing in NullFields will be sent to the server as
  10422. // null. It is an error if a field in this list has a non-empty value.
  10423. // This may be used to include null fields in Patch requests.
  10424. NullFields []string `json:"-"`
  10425. }
  10426. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10427. type NoMethod InstanceAggregatedListWarningData
  10428. raw := NoMethod(*s)
  10429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10430. }
  10431. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  10432. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  10433. // beta.regionInstanceGroups ==) (== resource_for
  10434. // v1.regionInstanceGroups ==)
  10435. type InstanceGroup struct {
  10436. // CreationTimestamp: [Output Only] The creation timestamp for this
  10437. // instance group in RFC3339 text format.
  10438. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10439. // Description: An optional description of this resource. Provide this
  10440. // property when you create the resource.
  10441. Description string `json:"description,omitempty"`
  10442. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  10443. // system uses this fingerprint to detect conflicts when multiple users
  10444. // change the named ports concurrently.
  10445. Fingerprint string `json:"fingerprint,omitempty"`
  10446. // Id: [Output Only] A unique identifier for this instance group,
  10447. // generated by the server.
  10448. Id uint64 `json:"id,omitempty,string"`
  10449. // Kind: [Output Only] The resource type, which is always
  10450. // compute#instanceGroup for instance groups.
  10451. Kind string `json:"kind,omitempty"`
  10452. // Name: The name of the instance group. The name must be 1-63
  10453. // characters long, and comply with RFC1035.
  10454. Name string `json:"name,omitempty"`
  10455. // NamedPorts: Assigns a name to a port number. For example: {name:
  10456. // "http", port: 80}
  10457. //
  10458. // This allows the system to reference ports by the assigned name
  10459. // instead of a port number. Named ports can also contain multiple
  10460. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  10461. // 8080}]
  10462. //
  10463. // Named ports apply to all instances in this instance group.
  10464. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10465. // Network: The URL of the network to which all instances in the
  10466. // instance group belong.
  10467. Network string `json:"network,omitempty"`
  10468. // Region: [Output Only] The URL of the region where the instance group
  10469. // is located (for regional resources).
  10470. Region string `json:"region,omitempty"`
  10471. // SelfLink: [Output Only] The URL for this instance group. The server
  10472. // generates this URL.
  10473. SelfLink string `json:"selfLink,omitempty"`
  10474. // Size: [Output Only] The total number of instances in the instance
  10475. // group.
  10476. Size int64 `json:"size,omitempty"`
  10477. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  10478. // instances in the instance group belong.
  10479. Subnetwork string `json:"subnetwork,omitempty"`
  10480. // Zone: [Output Only] The URL of the zone where the instance group is
  10481. // located (for zonal resources).
  10482. Zone string `json:"zone,omitempty"`
  10483. // ServerResponse contains the HTTP response code and headers from the
  10484. // server.
  10485. googleapi.ServerResponse `json:"-"`
  10486. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10487. // to unconditionally include in API requests. By default, fields with
  10488. // empty values are omitted from API requests. However, any non-pointer,
  10489. // non-interface field appearing in ForceSendFields will be sent to the
  10490. // server regardless of whether the field is empty or not. This may be
  10491. // used to include empty fields in Patch requests.
  10492. ForceSendFields []string `json:"-"`
  10493. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10494. // include in API requests with the JSON null value. By default, fields
  10495. // with empty values are omitted from API requests. However, any field
  10496. // with an empty value appearing in NullFields will be sent to the
  10497. // server as null. It is an error if a field in this list has a
  10498. // non-empty value. This may be used to include null fields in Patch
  10499. // requests.
  10500. NullFields []string `json:"-"`
  10501. }
  10502. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  10503. type NoMethod InstanceGroup
  10504. raw := NoMethod(*s)
  10505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10506. }
  10507. type InstanceGroupAggregatedList struct {
  10508. // Id: [Output Only] Unique identifier for the resource; defined by the
  10509. // server.
  10510. Id string `json:"id,omitempty"`
  10511. // Items: A list of InstanceGroupsScopedList resources.
  10512. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  10513. // Kind: [Output Only] The resource type, which is always
  10514. // compute#instanceGroupAggregatedList for aggregated lists of instance
  10515. // groups.
  10516. Kind string `json:"kind,omitempty"`
  10517. // NextPageToken: [Output Only] This token allows you to get the next
  10518. // page of results for list requests. If the number of results is larger
  10519. // than maxResults, use the nextPageToken as a value for the query
  10520. // parameter pageToken in the next list request. Subsequent list
  10521. // requests will have their own nextPageToken to continue paging through
  10522. // the results.
  10523. NextPageToken string `json:"nextPageToken,omitempty"`
  10524. // SelfLink: [Output Only] Server-defined URL for this resource.
  10525. SelfLink string `json:"selfLink,omitempty"`
  10526. // Warning: [Output Only] Informational warning message.
  10527. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  10528. // ServerResponse contains the HTTP response code and headers from the
  10529. // server.
  10530. googleapi.ServerResponse `json:"-"`
  10531. // ForceSendFields is a list of field names (e.g. "Id") to
  10532. // unconditionally include in API requests. By default, fields with
  10533. // empty values are omitted from API requests. However, any non-pointer,
  10534. // non-interface field appearing in ForceSendFields will be sent to the
  10535. // server regardless of whether the field is empty or not. This may be
  10536. // used to include empty fields in Patch requests.
  10537. ForceSendFields []string `json:"-"`
  10538. // NullFields is a list of field names (e.g. "Id") to include in API
  10539. // requests with the JSON null value. By default, fields with empty
  10540. // values are omitted from API requests. However, any field with an
  10541. // empty value appearing in NullFields will be sent to the server as
  10542. // null. It is an error if a field in this list has a non-empty value.
  10543. // This may be used to include null fields in Patch requests.
  10544. NullFields []string `json:"-"`
  10545. }
  10546. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  10547. type NoMethod InstanceGroupAggregatedList
  10548. raw := NoMethod(*s)
  10549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10550. }
  10551. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  10552. // warning message.
  10553. type InstanceGroupAggregatedListWarning struct {
  10554. // Code: [Output Only] A warning code, if applicable. For example,
  10555. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10556. // the response.
  10557. //
  10558. // Possible values:
  10559. // "CLEANUP_FAILED"
  10560. // "DEPRECATED_RESOURCE_USED"
  10561. // "DEPRECATED_TYPE_USED"
  10562. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10563. // "EXPERIMENTAL_TYPE_USED"
  10564. // "EXTERNAL_API_WARNING"
  10565. // "FIELD_VALUE_OVERRIDEN"
  10566. // "INJECTED_KERNELS_DEPRECATED"
  10567. // "MISSING_TYPE_DEPENDENCY"
  10568. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10569. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10570. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10571. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10572. // "NEXT_HOP_NOT_RUNNING"
  10573. // "NOT_CRITICAL_ERROR"
  10574. // "NO_RESULTS_ON_PAGE"
  10575. // "REQUIRED_TOS_AGREEMENT"
  10576. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10577. // "RESOURCE_NOT_DELETED"
  10578. // "SCHEMA_VALIDATION_IGNORED"
  10579. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10580. // "UNDECLARED_PROPERTIES"
  10581. // "UNREACHABLE"
  10582. Code string `json:"code,omitempty"`
  10583. // Data: [Output Only] Metadata about this warning in key: value format.
  10584. // For example:
  10585. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10586. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  10587. // Message: [Output Only] A human-readable description of the warning
  10588. // code.
  10589. Message string `json:"message,omitempty"`
  10590. // ForceSendFields is a list of field names (e.g. "Code") to
  10591. // unconditionally include in API requests. By default, fields with
  10592. // empty values are omitted from API requests. However, any non-pointer,
  10593. // non-interface field appearing in ForceSendFields will be sent to the
  10594. // server regardless of whether the field is empty or not. This may be
  10595. // used to include empty fields in Patch requests.
  10596. ForceSendFields []string `json:"-"`
  10597. // NullFields is a list of field names (e.g. "Code") to include in API
  10598. // requests with the JSON null value. By default, fields with empty
  10599. // values are omitted from API requests. However, any field with an
  10600. // empty value appearing in NullFields will be sent to the server as
  10601. // null. It is an error if a field in this list has a non-empty value.
  10602. // This may be used to include null fields in Patch requests.
  10603. NullFields []string `json:"-"`
  10604. }
  10605. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10606. type NoMethod InstanceGroupAggregatedListWarning
  10607. raw := NoMethod(*s)
  10608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10609. }
  10610. type InstanceGroupAggregatedListWarningData struct {
  10611. // Key: [Output Only] A key that provides more detail on the warning
  10612. // being returned. For example, for warnings where there are no results
  10613. // in a list request for a particular zone, this key might be scope and
  10614. // the key value might be the zone name. Other examples might be a key
  10615. // indicating a deprecated resource and a suggested replacement, or a
  10616. // warning about invalid network settings (for example, if an instance
  10617. // attempts to perform IP forwarding but is not enabled for IP
  10618. // forwarding).
  10619. Key string `json:"key,omitempty"`
  10620. // Value: [Output Only] A warning data value corresponding to the key.
  10621. Value string `json:"value,omitempty"`
  10622. // ForceSendFields is a list of field names (e.g. "Key") to
  10623. // unconditionally include in API requests. By default, fields with
  10624. // empty values are omitted from API requests. However, any non-pointer,
  10625. // non-interface field appearing in ForceSendFields will be sent to the
  10626. // server regardless of whether the field is empty or not. This may be
  10627. // used to include empty fields in Patch requests.
  10628. ForceSendFields []string `json:"-"`
  10629. // NullFields is a list of field names (e.g. "Key") to include in API
  10630. // requests with the JSON null value. By default, fields with empty
  10631. // values are omitted from API requests. However, any field with an
  10632. // empty value appearing in NullFields will be sent to the server as
  10633. // null. It is an error if a field in this list has a non-empty value.
  10634. // This may be used to include null fields in Patch requests.
  10635. NullFields []string `json:"-"`
  10636. }
  10637. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10638. type NoMethod InstanceGroupAggregatedListWarningData
  10639. raw := NoMethod(*s)
  10640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10641. }
  10642. // InstanceGroupList: A list of InstanceGroup resources.
  10643. type InstanceGroupList struct {
  10644. // Id: [Output Only] Unique identifier for the resource; defined by the
  10645. // server.
  10646. Id string `json:"id,omitempty"`
  10647. // Items: A list of InstanceGroup resources.
  10648. Items []*InstanceGroup `json:"items,omitempty"`
  10649. // Kind: [Output Only] The resource type, which is always
  10650. // compute#instanceGroupList for instance group lists.
  10651. Kind string `json:"kind,omitempty"`
  10652. // NextPageToken: [Output Only] This token allows you to get the next
  10653. // page of results for list requests. If the number of results is larger
  10654. // than maxResults, use the nextPageToken as a value for the query
  10655. // parameter pageToken in the next list request. Subsequent list
  10656. // requests will have their own nextPageToken to continue paging through
  10657. // the results.
  10658. NextPageToken string `json:"nextPageToken,omitempty"`
  10659. // SelfLink: [Output Only] Server-defined URL for this resource.
  10660. SelfLink string `json:"selfLink,omitempty"`
  10661. // Warning: [Output Only] Informational warning message.
  10662. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  10663. // ServerResponse contains the HTTP response code and headers from the
  10664. // server.
  10665. googleapi.ServerResponse `json:"-"`
  10666. // ForceSendFields is a list of field names (e.g. "Id") to
  10667. // unconditionally include in API requests. By default, fields with
  10668. // empty values are omitted from API requests. However, any non-pointer,
  10669. // non-interface field appearing in ForceSendFields will be sent to the
  10670. // server regardless of whether the field is empty or not. This may be
  10671. // used to include empty fields in Patch requests.
  10672. ForceSendFields []string `json:"-"`
  10673. // NullFields is a list of field names (e.g. "Id") to include in API
  10674. // requests with the JSON null value. By default, fields with empty
  10675. // values are omitted from API requests. However, any field with an
  10676. // empty value appearing in NullFields will be sent to the server as
  10677. // null. It is an error if a field in this list has a non-empty value.
  10678. // This may be used to include null fields in Patch requests.
  10679. NullFields []string `json:"-"`
  10680. }
  10681. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  10682. type NoMethod InstanceGroupList
  10683. raw := NoMethod(*s)
  10684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10685. }
  10686. // InstanceGroupListWarning: [Output Only] Informational warning
  10687. // message.
  10688. type InstanceGroupListWarning struct {
  10689. // Code: [Output Only] A warning code, if applicable. For example,
  10690. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10691. // the response.
  10692. //
  10693. // Possible values:
  10694. // "CLEANUP_FAILED"
  10695. // "DEPRECATED_RESOURCE_USED"
  10696. // "DEPRECATED_TYPE_USED"
  10697. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10698. // "EXPERIMENTAL_TYPE_USED"
  10699. // "EXTERNAL_API_WARNING"
  10700. // "FIELD_VALUE_OVERRIDEN"
  10701. // "INJECTED_KERNELS_DEPRECATED"
  10702. // "MISSING_TYPE_DEPENDENCY"
  10703. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10704. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10705. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10706. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10707. // "NEXT_HOP_NOT_RUNNING"
  10708. // "NOT_CRITICAL_ERROR"
  10709. // "NO_RESULTS_ON_PAGE"
  10710. // "REQUIRED_TOS_AGREEMENT"
  10711. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10712. // "RESOURCE_NOT_DELETED"
  10713. // "SCHEMA_VALIDATION_IGNORED"
  10714. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10715. // "UNDECLARED_PROPERTIES"
  10716. // "UNREACHABLE"
  10717. Code string `json:"code,omitempty"`
  10718. // Data: [Output Only] Metadata about this warning in key: value format.
  10719. // For example:
  10720. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10721. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  10722. // Message: [Output Only] A human-readable description of the warning
  10723. // code.
  10724. Message string `json:"message,omitempty"`
  10725. // ForceSendFields is a list of field names (e.g. "Code") to
  10726. // unconditionally include in API requests. By default, fields with
  10727. // empty values are omitted from API requests. However, any non-pointer,
  10728. // non-interface field appearing in ForceSendFields will be sent to the
  10729. // server regardless of whether the field is empty or not. This may be
  10730. // used to include empty fields in Patch requests.
  10731. ForceSendFields []string `json:"-"`
  10732. // NullFields is a list of field names (e.g. "Code") to include in API
  10733. // requests with the JSON null value. By default, fields with empty
  10734. // values are omitted from API requests. However, any field with an
  10735. // empty value appearing in NullFields will be sent to the server as
  10736. // null. It is an error if a field in this list has a non-empty value.
  10737. // This may be used to include null fields in Patch requests.
  10738. NullFields []string `json:"-"`
  10739. }
  10740. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  10741. type NoMethod InstanceGroupListWarning
  10742. raw := NoMethod(*s)
  10743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10744. }
  10745. type InstanceGroupListWarningData struct {
  10746. // Key: [Output Only] A key that provides more detail on the warning
  10747. // being returned. For example, for warnings where there are no results
  10748. // in a list request for a particular zone, this key might be scope and
  10749. // the key value might be the zone name. Other examples might be a key
  10750. // indicating a deprecated resource and a suggested replacement, or a
  10751. // warning about invalid network settings (for example, if an instance
  10752. // attempts to perform IP forwarding but is not enabled for IP
  10753. // forwarding).
  10754. Key string `json:"key,omitempty"`
  10755. // Value: [Output Only] A warning data value corresponding to the key.
  10756. Value string `json:"value,omitempty"`
  10757. // ForceSendFields is a list of field names (e.g. "Key") to
  10758. // unconditionally include in API requests. By default, fields with
  10759. // empty values are omitted from API requests. However, any non-pointer,
  10760. // non-interface field appearing in ForceSendFields will be sent to the
  10761. // server regardless of whether the field is empty or not. This may be
  10762. // used to include empty fields in Patch requests.
  10763. ForceSendFields []string `json:"-"`
  10764. // NullFields is a list of field names (e.g. "Key") to include in API
  10765. // requests with the JSON null value. By default, fields with empty
  10766. // values are omitted from API requests. However, any field with an
  10767. // empty value appearing in NullFields will be sent to the server as
  10768. // null. It is an error if a field in this list has a non-empty value.
  10769. // This may be used to include null fields in Patch requests.
  10770. NullFields []string `json:"-"`
  10771. }
  10772. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  10773. type NoMethod InstanceGroupListWarningData
  10774. raw := NoMethod(*s)
  10775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10776. }
  10777. // InstanceGroupManager: An Instance Group Manager resource. (==
  10778. // resource_for beta.instanceGroupManagers ==) (== resource_for
  10779. // v1.instanceGroupManagers ==) (== resource_for
  10780. // beta.regionInstanceGroupManagers ==) (== resource_for
  10781. // v1.regionInstanceGroupManagers ==)
  10782. type InstanceGroupManager struct {
  10783. // AutoHealingPolicies: The autohealing policy for this managed instance
  10784. // group. You can specify only one value.
  10785. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  10786. // BaseInstanceName: The base instance name to use for instances in this
  10787. // group. The value must be 1-58 characters long. Instances are named by
  10788. // appending a hyphen and a random four-character string to the base
  10789. // instance name. The base instance name must comply with RFC1035.
  10790. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  10791. // CreationTimestamp: [Output Only] The creation timestamp for this
  10792. // managed instance group in RFC3339 text format.
  10793. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10794. // CurrentActions: [Output Only] The list of instance actions and the
  10795. // number of instances in this managed instance group that are scheduled
  10796. // for each of those actions.
  10797. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  10798. // Description: An optional description of this resource. Provide this
  10799. // property when you create the resource.
  10800. Description string `json:"description,omitempty"`
  10801. // DistributionPolicy: Policy specifying intended distribution of
  10802. // instances in regional managed instance group.
  10803. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  10804. // FailoverAction: The action to perform in case of zone failure. Only
  10805. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  10806. //
  10807. // Possible values:
  10808. // "NO_FAILOVER"
  10809. // "UNKNOWN"
  10810. FailoverAction string `json:"failoverAction,omitempty"`
  10811. // Fingerprint: Fingerprint of this resource. This field may be used in
  10812. // optimistic locking. It will be ignored when inserting an
  10813. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  10814. // order to update the InstanceGroupManager, otherwise the request will
  10815. // fail with error 412 conditionNotMet.
  10816. //
  10817. // To see the latest fingerprint, make a get() request to retrieve an
  10818. // InstanceGroupManager.
  10819. Fingerprint string `json:"fingerprint,omitempty"`
  10820. // Id: [Output Only] A unique identifier for this resource type. The
  10821. // server generates this identifier.
  10822. Id uint64 `json:"id,omitempty,string"`
  10823. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  10824. InstanceGroup string `json:"instanceGroup,omitempty"`
  10825. // InstanceTemplate: The URL of the instance template that is specified
  10826. // for this managed instance group. The group uses this template to
  10827. // create all new instances in the managed instance group.
  10828. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10829. // Kind: [Output Only] The resource type, which is always
  10830. // compute#instanceGroupManager for managed instance groups.
  10831. Kind string `json:"kind,omitempty"`
  10832. // Name: The name of the managed instance group. The name must be 1-63
  10833. // characters long, and comply with RFC1035.
  10834. Name string `json:"name,omitempty"`
  10835. // NamedPorts: Named ports configured for the Instance Groups
  10836. // complementary to this Instance Group Manager.
  10837. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10838. // PendingActions: [Output Only] The list of instance actions and the
  10839. // number of instances in this managed instance group that are pending
  10840. // for each of those actions.
  10841. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  10842. // Region: [Output Only] The URL of the region where the managed
  10843. // instance group resides (for regional resources).
  10844. Region string `json:"region,omitempty"`
  10845. // SelfLink: [Output Only] The URL for this managed instance group. The
  10846. // server defines this URL.
  10847. SelfLink string `json:"selfLink,omitempty"`
  10848. // ServiceAccount: The service account to be used as credentials for all
  10849. // operations performed by the managed instance group on instances. The
  10850. // service accounts needs all permissions required to create and delete
  10851. // instances. By default, the service account
  10852. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  10853. ServiceAccount string `json:"serviceAccount,omitempty"`
  10854. // StatefulPolicy: Stateful configuration for this Instanced Group
  10855. // Manager
  10856. StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"`
  10857. // Status: [Output Only] The status of this managed instance group.
  10858. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  10859. // TargetPools: The URLs for all TargetPool resources to which instances
  10860. // in the instanceGroup field are added. The target pools automatically
  10861. // apply to all of the instances in the managed instance group.
  10862. TargetPools []string `json:"targetPools,omitempty"`
  10863. // TargetSize: The target number of running instances for this managed
  10864. // instance group. Deleting or abandoning instances reduces this number.
  10865. // Resizing the group changes this number.
  10866. TargetSize int64 `json:"targetSize,omitempty"`
  10867. // UpdatePolicy: The update policy for this managed instance group.
  10868. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  10869. // Versions: Specifies the instance templates used by this managed
  10870. // instance group to create instances.
  10871. //
  10872. // Each version is defined by an instanceTemplate. Every template can
  10873. // appear at most once per instance group. This field overrides the
  10874. // top-level instanceTemplate field. Read more about the relationships
  10875. // between these fields. Exactly one version must leave the targetSize
  10876. // field unset. That version will be applied to all remaining instances.
  10877. // For more information, read about canary updates.
  10878. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  10879. // Zone: [Output Only] The URL of the zone where the managed instance
  10880. // group is located (for zonal resources).
  10881. Zone string `json:"zone,omitempty"`
  10882. // ServerResponse contains the HTTP response code and headers from the
  10883. // server.
  10884. googleapi.ServerResponse `json:"-"`
  10885. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  10886. // to unconditionally include in API requests. By default, fields with
  10887. // empty values are omitted from API requests. However, any non-pointer,
  10888. // non-interface field appearing in ForceSendFields will be sent to the
  10889. // server regardless of whether the field is empty or not. This may be
  10890. // used to include empty fields in Patch requests.
  10891. ForceSendFields []string `json:"-"`
  10892. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  10893. // include in API requests with the JSON null value. By default, fields
  10894. // with empty values are omitted from API requests. However, any field
  10895. // with an empty value appearing in NullFields will be sent to the
  10896. // server as null. It is an error if a field in this list has a
  10897. // non-empty value. This may be used to include null fields in Patch
  10898. // requests.
  10899. NullFields []string `json:"-"`
  10900. }
  10901. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  10902. type NoMethod InstanceGroupManager
  10903. raw := NoMethod(*s)
  10904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10905. }
  10906. type InstanceGroupManagerActionsSummary struct {
  10907. // Abandoning: [Output Only] The total number of instances in the
  10908. // managed instance group that are scheduled to be abandoned. Abandoning
  10909. // an instance removes it from the managed instance group without
  10910. // deleting it.
  10911. Abandoning int64 `json:"abandoning,omitempty"`
  10912. // Creating: [Output Only] The number of instances in the managed
  10913. // instance group that are scheduled to be created or are currently
  10914. // being created. If the group fails to create any of these instances,
  10915. // it tries again until it creates the instance successfully.
  10916. //
  10917. // If you have disabled creation retries, this field will not be
  10918. // populated; instead, the creatingWithoutRetries field will be
  10919. // populated.
  10920. Creating int64 `json:"creating,omitempty"`
  10921. // CreatingWithoutRetries: [Output Only] The number of instances that
  10922. // the managed instance group will attempt to create. The group attempts
  10923. // to create each instance only once. If the group fails to create any
  10924. // of these instances, it decreases the group's targetSize value
  10925. // accordingly.
  10926. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  10927. // Deleting: [Output Only] The number of instances in the managed
  10928. // instance group that are scheduled to be deleted or are currently
  10929. // being deleted.
  10930. Deleting int64 `json:"deleting,omitempty"`
  10931. // None: [Output Only] The number of instances in the managed instance
  10932. // group that are running and have no scheduled actions.
  10933. None int64 `json:"none,omitempty"`
  10934. // Recreating: [Output Only] The number of instances in the managed
  10935. // instance group that are scheduled to be recreated or are currently
  10936. // being being recreated. Recreating an instance deletes the existing
  10937. // root persistent disk and creates a new disk from the image that is
  10938. // defined in the instance template.
  10939. Recreating int64 `json:"recreating,omitempty"`
  10940. // Refreshing: [Output Only] The number of instances in the managed
  10941. // instance group that are being reconfigured with properties that do
  10942. // not require a restart or a recreate action. For example, setting or
  10943. // removing target pools for the instance.
  10944. Refreshing int64 `json:"refreshing,omitempty"`
  10945. // Restarting: [Output Only] The number of instances in the managed
  10946. // instance group that are scheduled to be restarted or are currently
  10947. // being restarted.
  10948. Restarting int64 `json:"restarting,omitempty"`
  10949. // Verifying: [Output Only] The number of instances in the managed
  10950. // instance group that are being verified. See the
  10951. // managedInstances[].currentAction property in the listManagedInstances
  10952. // method documentation.
  10953. Verifying int64 `json:"verifying,omitempty"`
  10954. // ForceSendFields is a list of field names (e.g. "Abandoning") 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. "Abandoning") to include in
  10962. // API requests with the JSON null value. By default, fields with empty
  10963. // values are omitted from API requests. However, any field with an
  10964. // empty value appearing in NullFields will be sent to the server as
  10965. // null. It is an error if a field in this list has a non-empty value.
  10966. // This may be used to include null fields in Patch requests.
  10967. NullFields []string `json:"-"`
  10968. }
  10969. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  10970. type NoMethod InstanceGroupManagerActionsSummary
  10971. raw := NoMethod(*s)
  10972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10973. }
  10974. type InstanceGroupManagerAggregatedList struct {
  10975. // Id: [Output Only] Unique identifier for the resource; defined by the
  10976. // server.
  10977. Id string `json:"id,omitempty"`
  10978. // Items: A list of InstanceGroupManagersScopedList resources.
  10979. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  10980. // Kind: [Output Only] The resource type, which is always
  10981. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  10982. // managed instance groups.
  10983. Kind string `json:"kind,omitempty"`
  10984. // NextPageToken: [Output Only] This token allows you to get the next
  10985. // page of results for list requests. If the number of results is larger
  10986. // than maxResults, use the nextPageToken as a value for the query
  10987. // parameter pageToken in the next list request. Subsequent list
  10988. // requests will have their own nextPageToken to continue paging through
  10989. // the results.
  10990. NextPageToken string `json:"nextPageToken,omitempty"`
  10991. // SelfLink: [Output Only] Server-defined URL for this resource.
  10992. SelfLink string `json:"selfLink,omitempty"`
  10993. // Warning: [Output Only] Informational warning message.
  10994. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  10995. // ServerResponse contains the HTTP response code and headers from the
  10996. // server.
  10997. googleapi.ServerResponse `json:"-"`
  10998. // ForceSendFields is a list of field names (e.g. "Id") to
  10999. // unconditionally include in API requests. By default, fields with
  11000. // empty values are omitted from API requests. However, any non-pointer,
  11001. // non-interface field appearing in ForceSendFields will be sent to the
  11002. // server regardless of whether the field is empty or not. This may be
  11003. // used to include empty fields in Patch requests.
  11004. ForceSendFields []string `json:"-"`
  11005. // NullFields is a list of field names (e.g. "Id") to include in API
  11006. // requests with the JSON null value. By default, fields with empty
  11007. // values are omitted from API requests. However, any field with an
  11008. // empty value appearing in NullFields will be sent to the server as
  11009. // null. It is an error if a field in this list has a non-empty value.
  11010. // This may be used to include null fields in Patch requests.
  11011. NullFields []string `json:"-"`
  11012. }
  11013. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  11014. type NoMethod InstanceGroupManagerAggregatedList
  11015. raw := NoMethod(*s)
  11016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11017. }
  11018. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  11019. // Informational warning message.
  11020. type InstanceGroupManagerAggregatedListWarning struct {
  11021. // Code: [Output Only] A warning code, if applicable. For example,
  11022. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11023. // the response.
  11024. //
  11025. // Possible values:
  11026. // "CLEANUP_FAILED"
  11027. // "DEPRECATED_RESOURCE_USED"
  11028. // "DEPRECATED_TYPE_USED"
  11029. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11030. // "EXPERIMENTAL_TYPE_USED"
  11031. // "EXTERNAL_API_WARNING"
  11032. // "FIELD_VALUE_OVERRIDEN"
  11033. // "INJECTED_KERNELS_DEPRECATED"
  11034. // "MISSING_TYPE_DEPENDENCY"
  11035. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11036. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11037. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11038. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11039. // "NEXT_HOP_NOT_RUNNING"
  11040. // "NOT_CRITICAL_ERROR"
  11041. // "NO_RESULTS_ON_PAGE"
  11042. // "REQUIRED_TOS_AGREEMENT"
  11043. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11044. // "RESOURCE_NOT_DELETED"
  11045. // "SCHEMA_VALIDATION_IGNORED"
  11046. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11047. // "UNDECLARED_PROPERTIES"
  11048. // "UNREACHABLE"
  11049. Code string `json:"code,omitempty"`
  11050. // Data: [Output Only] Metadata about this warning in key: value format.
  11051. // For example:
  11052. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11053. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  11054. // Message: [Output Only] A human-readable description of the warning
  11055. // code.
  11056. Message string `json:"message,omitempty"`
  11057. // ForceSendFields is a list of field names (e.g. "Code") to
  11058. // unconditionally include in API requests. By default, fields with
  11059. // empty values are omitted from API requests. However, any non-pointer,
  11060. // non-interface field appearing in ForceSendFields will be sent to the
  11061. // server regardless of whether the field is empty or not. This may be
  11062. // used to include empty fields in Patch requests.
  11063. ForceSendFields []string `json:"-"`
  11064. // NullFields is a list of field names (e.g. "Code") to include in API
  11065. // requests with the JSON null value. By default, fields with empty
  11066. // values are omitted from API requests. However, any field with an
  11067. // empty value appearing in NullFields will be sent to the server as
  11068. // null. It is an error if a field in this list has a non-empty value.
  11069. // This may be used to include null fields in Patch requests.
  11070. NullFields []string `json:"-"`
  11071. }
  11072. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11073. type NoMethod InstanceGroupManagerAggregatedListWarning
  11074. raw := NoMethod(*s)
  11075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11076. }
  11077. type InstanceGroupManagerAggregatedListWarningData struct {
  11078. // Key: [Output Only] A key that provides more detail on the warning
  11079. // being returned. For example, for warnings where there are no results
  11080. // in a list request for a particular zone, this key might be scope and
  11081. // the key value might be the zone name. Other examples might be a key
  11082. // indicating a deprecated resource and a suggested replacement, or a
  11083. // warning about invalid network settings (for example, if an instance
  11084. // attempts to perform IP forwarding but is not enabled for IP
  11085. // forwarding).
  11086. Key string `json:"key,omitempty"`
  11087. // Value: [Output Only] A warning data value corresponding to the key.
  11088. Value string `json:"value,omitempty"`
  11089. // ForceSendFields is a list of field names (e.g. "Key") to
  11090. // unconditionally include in API requests. By default, fields with
  11091. // empty values are omitted from API requests. However, any non-pointer,
  11092. // non-interface field appearing in ForceSendFields will be sent to the
  11093. // server regardless of whether the field is empty or not. This may be
  11094. // used to include empty fields in Patch requests.
  11095. ForceSendFields []string `json:"-"`
  11096. // NullFields is a list of field names (e.g. "Key") to include in API
  11097. // requests with the JSON null value. By default, fields with empty
  11098. // values are omitted from API requests. However, any field with an
  11099. // empty value appearing in NullFields will be sent to the server as
  11100. // null. It is an error if a field in this list has a non-empty value.
  11101. // This may be used to include null fields in Patch requests.
  11102. NullFields []string `json:"-"`
  11103. }
  11104. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11105. type NoMethod InstanceGroupManagerAggregatedListWarningData
  11106. raw := NoMethod(*s)
  11107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11108. }
  11109. type InstanceGroupManagerAutoHealingPolicy struct {
  11110. // HealthCheck: The URL for the health check that signals autohealing.
  11111. HealthCheck string `json:"healthCheck,omitempty"`
  11112. // InitialDelaySec: The number of seconds that the managed instance
  11113. // group waits before it applies autohealing policies to new instances
  11114. // or recently recreated instances. This initial delay allows instances
  11115. // to initialize and run their startup scripts before the instance group
  11116. // determines that they are UNHEALTHY. This prevents the managed
  11117. // instance group from recreating its instances prematurely. This value
  11118. // must be from range [0, 3600].
  11119. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  11120. // MaxUnavailable: Maximum number of instances that can be unavailable
  11121. // when autohealing. The instance is considered available if all of the
  11122. // following conditions are satisfied: 1. Instance's status is RUNNING.
  11123. // 2. Instance's liveness health check result was observed to be HEALTHY
  11124. // at least once. By default, a percent value of 100% is used.
  11125. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  11126. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  11127. // unconditionally include in API requests. By default, fields with
  11128. // empty values are omitted from API requests. However, any non-pointer,
  11129. // non-interface field appearing in ForceSendFields will be sent to the
  11130. // server regardless of whether the field is empty or not. This may be
  11131. // used to include empty fields in Patch requests.
  11132. ForceSendFields []string `json:"-"`
  11133. // NullFields is a list of field names (e.g. "HealthCheck") to include
  11134. // in API requests with the JSON null value. By default, fields with
  11135. // empty values are omitted from API requests. However, any field with
  11136. // an empty value appearing in NullFields will be sent to the server as
  11137. // null. It is an error if a field in this list has a non-empty value.
  11138. // This may be used to include null fields in Patch requests.
  11139. NullFields []string `json:"-"`
  11140. }
  11141. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  11142. type NoMethod InstanceGroupManagerAutoHealingPolicy
  11143. raw := NoMethod(*s)
  11144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11145. }
  11146. // InstanceGroupManagerList: [Output Only] A list of managed instance
  11147. // groups.
  11148. type InstanceGroupManagerList struct {
  11149. // Id: [Output Only] Unique identifier for the resource; defined by the
  11150. // server.
  11151. Id string `json:"id,omitempty"`
  11152. // Items: A list of InstanceGroupManager resources.
  11153. Items []*InstanceGroupManager `json:"items,omitempty"`
  11154. // Kind: [Output Only] The resource type, which is always
  11155. // compute#instanceGroupManagerList for a list of managed instance
  11156. // groups.
  11157. Kind string `json:"kind,omitempty"`
  11158. // NextPageToken: [Output Only] This token allows you to get the next
  11159. // page of results for list requests. If the number of results is larger
  11160. // than maxResults, use the nextPageToken as a value for the query
  11161. // parameter pageToken in the next list request. Subsequent list
  11162. // requests will have their own nextPageToken to continue paging through
  11163. // the results.
  11164. NextPageToken string `json:"nextPageToken,omitempty"`
  11165. // SelfLink: [Output Only] Server-defined URL for this resource.
  11166. SelfLink string `json:"selfLink,omitempty"`
  11167. // Warning: [Output Only] Informational warning message.
  11168. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  11169. // ServerResponse contains the HTTP response code and headers from the
  11170. // server.
  11171. googleapi.ServerResponse `json:"-"`
  11172. // ForceSendFields is a list of field names (e.g. "Id") to
  11173. // unconditionally include in API requests. By default, fields with
  11174. // empty values are omitted from API requests. However, any non-pointer,
  11175. // non-interface field appearing in ForceSendFields will be sent to the
  11176. // server regardless of whether the field is empty or not. This may be
  11177. // used to include empty fields in Patch requests.
  11178. ForceSendFields []string `json:"-"`
  11179. // NullFields is a list of field names (e.g. "Id") to include in API
  11180. // requests with the JSON null value. By default, fields with empty
  11181. // values are omitted from API requests. However, any field with an
  11182. // empty value appearing in NullFields will be sent to the server as
  11183. // null. It is an error if a field in this list has a non-empty value.
  11184. // This may be used to include null fields in Patch requests.
  11185. NullFields []string `json:"-"`
  11186. }
  11187. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  11188. type NoMethod InstanceGroupManagerList
  11189. raw := NoMethod(*s)
  11190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11191. }
  11192. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  11193. // message.
  11194. type InstanceGroupManagerListWarning struct {
  11195. // Code: [Output Only] A warning code, if applicable. For example,
  11196. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11197. // the response.
  11198. //
  11199. // Possible values:
  11200. // "CLEANUP_FAILED"
  11201. // "DEPRECATED_RESOURCE_USED"
  11202. // "DEPRECATED_TYPE_USED"
  11203. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11204. // "EXPERIMENTAL_TYPE_USED"
  11205. // "EXTERNAL_API_WARNING"
  11206. // "FIELD_VALUE_OVERRIDEN"
  11207. // "INJECTED_KERNELS_DEPRECATED"
  11208. // "MISSING_TYPE_DEPENDENCY"
  11209. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11210. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11211. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11212. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11213. // "NEXT_HOP_NOT_RUNNING"
  11214. // "NOT_CRITICAL_ERROR"
  11215. // "NO_RESULTS_ON_PAGE"
  11216. // "REQUIRED_TOS_AGREEMENT"
  11217. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11218. // "RESOURCE_NOT_DELETED"
  11219. // "SCHEMA_VALIDATION_IGNORED"
  11220. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11221. // "UNDECLARED_PROPERTIES"
  11222. // "UNREACHABLE"
  11223. Code string `json:"code,omitempty"`
  11224. // Data: [Output Only] Metadata about this warning in key: value format.
  11225. // For example:
  11226. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11227. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  11228. // Message: [Output Only] A human-readable description of the warning
  11229. // code.
  11230. Message string `json:"message,omitempty"`
  11231. // ForceSendFields is a list of field names (e.g. "Code") to
  11232. // unconditionally include in API requests. By default, fields with
  11233. // empty values are omitted from API requests. However, any non-pointer,
  11234. // non-interface field appearing in ForceSendFields will be sent to the
  11235. // server regardless of whether the field is empty or not. This may be
  11236. // used to include empty fields in Patch requests.
  11237. ForceSendFields []string `json:"-"`
  11238. // NullFields is a list of field names (e.g. "Code") to include in API
  11239. // requests with the JSON null value. By default, fields with empty
  11240. // values are omitted from API requests. However, any field with an
  11241. // empty value appearing in NullFields will be sent to the server as
  11242. // null. It is an error if a field in this list has a non-empty value.
  11243. // This may be used to include null fields in Patch requests.
  11244. NullFields []string `json:"-"`
  11245. }
  11246. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  11247. type NoMethod InstanceGroupManagerListWarning
  11248. raw := NoMethod(*s)
  11249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11250. }
  11251. type InstanceGroupManagerListWarningData struct {
  11252. // Key: [Output Only] A key that provides more detail on the warning
  11253. // being returned. For example, for warnings where there are no results
  11254. // in a list request for a particular zone, this key might be scope and
  11255. // the key value might be the zone name. Other examples might be a key
  11256. // indicating a deprecated resource and a suggested replacement, or a
  11257. // warning about invalid network settings (for example, if an instance
  11258. // attempts to perform IP forwarding but is not enabled for IP
  11259. // forwarding).
  11260. Key string `json:"key,omitempty"`
  11261. // Value: [Output Only] A warning data value corresponding to the key.
  11262. Value string `json:"value,omitempty"`
  11263. // ForceSendFields is a list of field names (e.g. "Key") to
  11264. // unconditionally include in API requests. By default, fields with
  11265. // empty values are omitted from API requests. However, any non-pointer,
  11266. // non-interface field appearing in ForceSendFields will be sent to the
  11267. // server regardless of whether the field is empty or not. This may be
  11268. // used to include empty fields in Patch requests.
  11269. ForceSendFields []string `json:"-"`
  11270. // NullFields is a list of field names (e.g. "Key") to include in API
  11271. // requests with the JSON null value. By default, fields with empty
  11272. // values are omitted from API requests. However, any field with an
  11273. // empty value appearing in NullFields will be sent to the server as
  11274. // null. It is an error if a field in this list has a non-empty value.
  11275. // This may be used to include null fields in Patch requests.
  11276. NullFields []string `json:"-"`
  11277. }
  11278. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  11279. type NoMethod InstanceGroupManagerListWarningData
  11280. raw := NoMethod(*s)
  11281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11282. }
  11283. type InstanceGroupManagerPendingActionsSummary struct {
  11284. // Creating: [Output Only] The number of instances in the managed
  11285. // instance group that are pending to be created.
  11286. Creating int64 `json:"creating,omitempty"`
  11287. // Deleting: [Output Only] The number of instances in the managed
  11288. // instance group that are pending to be deleted.
  11289. Deleting int64 `json:"deleting,omitempty"`
  11290. // Recreating: [Output Only] The number of instances in the managed
  11291. // instance group that are pending to be recreated.
  11292. Recreating int64 `json:"recreating,omitempty"`
  11293. // Restarting: [Output Only] The number of instances in the managed
  11294. // instance group that are pending to be restarted.
  11295. Restarting int64 `json:"restarting,omitempty"`
  11296. // ForceSendFields is a list of field names (e.g. "Creating") to
  11297. // unconditionally include in API requests. By default, fields with
  11298. // empty values are omitted from API requests. However, any non-pointer,
  11299. // non-interface field appearing in ForceSendFields will be sent to the
  11300. // server regardless of whether the field is empty or not. This may be
  11301. // used to include empty fields in Patch requests.
  11302. ForceSendFields []string `json:"-"`
  11303. // NullFields is a list of field names (e.g. "Creating") to include in
  11304. // API requests with the JSON null value. By default, fields with empty
  11305. // values are omitted from API requests. However, any field with an
  11306. // empty value appearing in NullFields will be sent to the server as
  11307. // null. It is an error if a field in this list has a non-empty value.
  11308. // This may be used to include null fields in Patch requests.
  11309. NullFields []string `json:"-"`
  11310. }
  11311. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  11312. type NoMethod InstanceGroupManagerPendingActionsSummary
  11313. raw := NoMethod(*s)
  11314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11315. }
  11316. type InstanceGroupManagerStatus struct {
  11317. // IsStable: [Output Only] A bit indicating whether the managed instance
  11318. // group is in a stable state. A stable state means that: none of the
  11319. // instances in the managed instance group is currently undergoing any
  11320. // type of change (for example, creation, restart, or deletion); no
  11321. // future changes are scheduled for instances in the managed instance
  11322. // group; and the managed instance group itself is not being modified.
  11323. IsStable bool `json:"isStable,omitempty"`
  11324. // VersionTarget: [Output Only] A status of consistency of Instances'
  11325. // versions with their target version specified by version field on
  11326. // Instance Group Manager.
  11327. VersionTarget *InstanceGroupManagerStatusVersionTarget `json:"versionTarget,omitempty"`
  11328. // ForceSendFields is a list of field names (e.g. "IsStable") to
  11329. // unconditionally include in API requests. By default, fields with
  11330. // empty values are omitted from API requests. However, any non-pointer,
  11331. // non-interface field appearing in ForceSendFields will be sent to the
  11332. // server regardless of whether the field is empty or not. This may be
  11333. // used to include empty fields in Patch requests.
  11334. ForceSendFields []string `json:"-"`
  11335. // NullFields is a list of field names (e.g. "IsStable") to include in
  11336. // API requests with the JSON null value. By default, fields with empty
  11337. // values are omitted from API requests. However, any field with an
  11338. // empty value appearing in NullFields will be sent to the server as
  11339. // null. It is an error if a field in this list has a non-empty value.
  11340. // This may be used to include null fields in Patch requests.
  11341. NullFields []string `json:"-"`
  11342. }
  11343. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  11344. type NoMethod InstanceGroupManagerStatus
  11345. raw := NoMethod(*s)
  11346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11347. }
  11348. type InstanceGroupManagerStatusVersionTarget struct {
  11349. // IsReached: [Output Only] A bit indicating whether version target has
  11350. // been reached in this managed instance group, i.e. all instances are
  11351. // in their target version. Instances' target version are specified by
  11352. // version field on Instance Group Manager.
  11353. IsReached bool `json:"isReached,omitempty"`
  11354. // ForceSendFields is a list of field names (e.g. "IsReached") to
  11355. // unconditionally include in API requests. By default, fields with
  11356. // empty values are omitted from API requests. However, any non-pointer,
  11357. // non-interface field appearing in ForceSendFields will be sent to the
  11358. // server regardless of whether the field is empty or not. This may be
  11359. // used to include empty fields in Patch requests.
  11360. ForceSendFields []string `json:"-"`
  11361. // NullFields is a list of field names (e.g. "IsReached") to include in
  11362. // API requests with the JSON null value. By default, fields with empty
  11363. // values are omitted from API requests. However, any field with an
  11364. // empty value appearing in NullFields will be sent to the server as
  11365. // null. It is an error if a field in this list has a non-empty value.
  11366. // This may be used to include null fields in Patch requests.
  11367. NullFields []string `json:"-"`
  11368. }
  11369. func (s *InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
  11370. type NoMethod InstanceGroupManagerStatusVersionTarget
  11371. raw := NoMethod(*s)
  11372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11373. }
  11374. type InstanceGroupManagerUpdatePolicy struct {
  11375. // Possible values:
  11376. // "NONE"
  11377. // "PROACTIVE"
  11378. InstanceRedistributionType string `json:"instanceRedistributionType,omitempty"`
  11379. // MaxSurge: The maximum number of instances that can be created above
  11380. // the specified targetSize during the update process. By default, a
  11381. // fixed value of 1 is used. This value can be either a fixed number or
  11382. // a percentage if the instance group has 10 or more instances. If you
  11383. // set a percentage, the number of instances will be rounded up if
  11384. // necessary.
  11385. //
  11386. // At least one of either maxSurge or maxUnavailable must be greater
  11387. // than 0. Learn more about maxSurge.
  11388. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  11389. // MaxUnavailable: The maximum number of instances that can be
  11390. // unavailable during the update process. An instance is considered
  11391. // available if all of the following conditions are satisfied:
  11392. //
  11393. //
  11394. // - The instance's status is RUNNING.
  11395. // - If there is a health check on the instance group, the instance's
  11396. // liveness health check result must be HEALTHY at least once. If there
  11397. // is no health check on the group, then the instance only needs to have
  11398. // a status of RUNNING to be considered available. By default, a fixed
  11399. // value of 1 is used. This value can be either a fixed number or a
  11400. // percentage if the instance group has 10 or more instances. If you set
  11401. // a percentage, the number of instances will be rounded up if
  11402. // necessary.
  11403. //
  11404. // At least one of either maxSurge or maxUnavailable must be greater
  11405. // than 0. Learn more about maxUnavailable.
  11406. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  11407. // MinReadySec: Minimum number of seconds to wait for after a newly
  11408. // created instance becomes available. This value must be from range [0,
  11409. // 3600].
  11410. MinReadySec int64 `json:"minReadySec,omitempty"`
  11411. // MinimalAction: Minimal action to be taken on an instance. You can
  11412. // specify either RESTART to restart existing instances or REPLACE to
  11413. // delete and create new instances from the target template. If you
  11414. // specify a RESTART, the Updater will attempt to perform that action
  11415. // only. However, if the Updater determines that the minimal action you
  11416. // specify is not enough to perform the update, it might perform a more
  11417. // disruptive action.
  11418. //
  11419. // Possible values:
  11420. // "NONE"
  11421. // "REFRESH"
  11422. // "REPLACE"
  11423. // "RESTART"
  11424. MinimalAction string `json:"minimalAction,omitempty"`
  11425. // Possible values:
  11426. // "OPPORTUNISTIC"
  11427. // "PROACTIVE"
  11428. Type string `json:"type,omitempty"`
  11429. // ForceSendFields is a list of field names (e.g.
  11430. // "InstanceRedistributionType") to unconditionally include in API
  11431. // requests. By default, fields with empty values are omitted from API
  11432. // requests. However, any non-pointer, non-interface field appearing in
  11433. // ForceSendFields will be sent to the server regardless of whether the
  11434. // field is empty or not. This may be used to include empty fields in
  11435. // Patch requests.
  11436. ForceSendFields []string `json:"-"`
  11437. // NullFields is a list of field names (e.g.
  11438. // "InstanceRedistributionType") to include in API requests with the
  11439. // JSON null value. By default, fields with empty values are omitted
  11440. // from API requests. However, any field with an empty value appearing
  11441. // in NullFields will be sent to the server as null. It is an error if a
  11442. // field in this list has a non-empty value. This may be used to include
  11443. // null fields in Patch requests.
  11444. NullFields []string `json:"-"`
  11445. }
  11446. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  11447. type NoMethod InstanceGroupManagerUpdatePolicy
  11448. raw := NoMethod(*s)
  11449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11450. }
  11451. type InstanceGroupManagerVersion struct {
  11452. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  11453. // Name: Name of the version. Unique among all versions in the scope of
  11454. // this managed instance group.
  11455. Name string `json:"name,omitempty"`
  11456. // Tag: Tag describing the version. Used to trigger rollout of a target
  11457. // version even if instance_template remains unchanged. Deprecated in
  11458. // favor of 'name'.
  11459. Tag string `json:"tag,omitempty"`
  11460. // TargetSize: Specifies the intended number of instances to be created
  11461. // from the instanceTemplate. The final number of instances created from
  11462. // the template will be equal to:
  11463. // - If expressed as a fixed number, the minimum of either
  11464. // targetSize.fixed or instanceGroupManager.targetSize is used.
  11465. // - if expressed as a percent, the targetSize would be
  11466. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  11467. // is a remainder, the number is rounded up. If unset, this version
  11468. // will update any remaining instances not updated by another version.
  11469. // Read Starting a canary update for more information.
  11470. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  11471. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  11472. // unconditionally include in API requests. By default, fields with
  11473. // empty values are omitted from API requests. However, any non-pointer,
  11474. // non-interface field appearing in ForceSendFields will be sent to the
  11475. // server regardless of whether the field is empty or not. This may be
  11476. // used to include empty fields in Patch requests.
  11477. ForceSendFields []string `json:"-"`
  11478. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  11479. // include in API requests with the JSON null value. By default, fields
  11480. // with empty values are omitted from API requests. However, any field
  11481. // with an empty value appearing in NullFields will be sent to the
  11482. // server as null. It is an error if a field in this list has a
  11483. // non-empty value. This may be used to include null fields in Patch
  11484. // requests.
  11485. NullFields []string `json:"-"`
  11486. }
  11487. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  11488. type NoMethod InstanceGroupManagerVersion
  11489. raw := NoMethod(*s)
  11490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11491. }
  11492. type InstanceGroupManagersAbandonInstancesRequest struct {
  11493. // Instances: The URLs of one or more instances to abandon. This can be
  11494. // a full URL or a partial URL, such as
  11495. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11496. Instances []string `json:"instances,omitempty"`
  11497. // ForceSendFields is a list of field names (e.g. "Instances") to
  11498. // unconditionally include in API requests. By default, fields with
  11499. // empty values are omitted from API requests. However, any non-pointer,
  11500. // non-interface field appearing in ForceSendFields will be sent to the
  11501. // server regardless of whether the field is empty or not. This may be
  11502. // used to include empty fields in Patch requests.
  11503. ForceSendFields []string `json:"-"`
  11504. // NullFields is a list of field names (e.g. "Instances") to include in
  11505. // API requests with the JSON null value. By default, fields with empty
  11506. // values are omitted from API requests. However, any field with an
  11507. // empty value appearing in NullFields will be sent to the server as
  11508. // null. It is an error if a field in this list has a non-empty value.
  11509. // This may be used to include null fields in Patch requests.
  11510. NullFields []string `json:"-"`
  11511. }
  11512. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  11513. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  11514. raw := NoMethod(*s)
  11515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11516. }
  11517. // InstanceGroupManagersApplyUpdatesRequest:
  11518. // InstanceGroupManagers.applyUpdatesToInstances
  11519. type InstanceGroupManagersApplyUpdatesRequest struct {
  11520. // Instances: The list of URLs of one or more instances for which we
  11521. // want to apply updates on this managed instance group. This can be a
  11522. // full URL or a partial URL, such as
  11523. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11524. Instances []string `json:"instances,omitempty"`
  11525. // MaximalAction: The maximal action that should be perfomed on the
  11526. // instances. By default REPLACE.
  11527. //
  11528. // Possible values:
  11529. // "NONE"
  11530. // "REFRESH"
  11531. // "REPLACE"
  11532. // "RESTART"
  11533. MaximalAction string `json:"maximalAction,omitempty"`
  11534. // MinimalAction: The minimal action that should be perfomed on the
  11535. // instances. By default NONE.
  11536. //
  11537. // Possible values:
  11538. // "NONE"
  11539. // "REFRESH"
  11540. // "REPLACE"
  11541. // "RESTART"
  11542. MinimalAction string `json:"minimalAction,omitempty"`
  11543. // ForceSendFields is a list of field names (e.g. "Instances") to
  11544. // unconditionally include in API requests. By default, fields with
  11545. // empty values are omitted from API requests. However, any non-pointer,
  11546. // non-interface field appearing in ForceSendFields will be sent to the
  11547. // server regardless of whether the field is empty or not. This may be
  11548. // used to include empty fields in Patch requests.
  11549. ForceSendFields []string `json:"-"`
  11550. // NullFields is a list of field names (e.g. "Instances") to include in
  11551. // API requests with the JSON null value. By default, fields with empty
  11552. // values are omitted from API requests. However, any field with an
  11553. // empty value appearing in NullFields will be sent to the server as
  11554. // null. It is an error if a field in this list has a non-empty value.
  11555. // This may be used to include null fields in Patch requests.
  11556. NullFields []string `json:"-"`
  11557. }
  11558. func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  11559. type NoMethod InstanceGroupManagersApplyUpdatesRequest
  11560. raw := NoMethod(*s)
  11561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11562. }
  11563. // InstanceGroupManagersCreateInstancesRequest:
  11564. // InstanceGroupManagers.createInstances
  11565. type InstanceGroupManagersCreateInstancesRequest struct {
  11566. // Instances: [Required] List of specifications of per-instance configs.
  11567. Instances []*PerInstanceConfig `json:"instances,omitempty"`
  11568. // ForceSendFields is a list of field names (e.g. "Instances") to
  11569. // unconditionally include in API requests. By default, fields with
  11570. // empty values are omitted from API requests. However, any non-pointer,
  11571. // non-interface field appearing in ForceSendFields will be sent to the
  11572. // server regardless of whether the field is empty or not. This may be
  11573. // used to include empty fields in Patch requests.
  11574. ForceSendFields []string `json:"-"`
  11575. // NullFields is a list of field names (e.g. "Instances") to include in
  11576. // API requests with the JSON null value. By default, fields with empty
  11577. // values are omitted from API requests. However, any field with an
  11578. // empty value appearing in NullFields will be sent to the server as
  11579. // null. It is an error if a field in this list has a non-empty value.
  11580. // This may be used to include null fields in Patch requests.
  11581. NullFields []string `json:"-"`
  11582. }
  11583. func (s *InstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
  11584. type NoMethod InstanceGroupManagersCreateInstancesRequest
  11585. raw := NoMethod(*s)
  11586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11587. }
  11588. type InstanceGroupManagersDeleteInstancesRequest struct {
  11589. // Instances: The URLs of one or more instances to delete. This can be a
  11590. // full URL or a partial URL, such as
  11591. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11592. Instances []string `json:"instances,omitempty"`
  11593. // ForceSendFields is a list of field names (e.g. "Instances") to
  11594. // unconditionally include in API requests. By default, fields with
  11595. // empty values are omitted from API requests. However, any non-pointer,
  11596. // non-interface field appearing in ForceSendFields will be sent to the
  11597. // server regardless of whether the field is empty or not. This may be
  11598. // used to include empty fields in Patch requests.
  11599. ForceSendFields []string `json:"-"`
  11600. // NullFields is a list of field names (e.g. "Instances") to include in
  11601. // API requests with the JSON null value. By default, fields with empty
  11602. // values are omitted from API requests. However, any field with an
  11603. // empty value appearing in NullFields will be sent to the server as
  11604. // null. It is an error if a field in this list has a non-empty value.
  11605. // This may be used to include null fields in Patch requests.
  11606. NullFields []string `json:"-"`
  11607. }
  11608. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  11609. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  11610. raw := NoMethod(*s)
  11611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11612. }
  11613. // InstanceGroupManagersDeletePerInstanceConfigsReq:
  11614. // InstanceGroupManagers.deletePerInstanceConfigs
  11615. type InstanceGroupManagersDeletePerInstanceConfigsReq struct {
  11616. // Instances: The list of instances for which we want to delete
  11617. // per-instance configs on this managed instance group.
  11618. Instances []string `json:"instances,omitempty"`
  11619. // Names: The list of instance names for which we want to delete
  11620. // per-instance configs on this managed instance group.
  11621. Names []string `json:"names,omitempty"`
  11622. // ForceSendFields is a list of field names (e.g. "Instances") to
  11623. // unconditionally include in API requests. By default, fields with
  11624. // empty values are omitted from API requests. However, any non-pointer,
  11625. // non-interface field appearing in ForceSendFields will be sent to the
  11626. // server regardless of whether the field is empty or not. This may be
  11627. // used to include empty fields in Patch requests.
  11628. ForceSendFields []string `json:"-"`
  11629. // NullFields is a list of field names (e.g. "Instances") to include in
  11630. // API requests with the JSON null value. By default, fields with empty
  11631. // values are omitted from API requests. However, any field with an
  11632. // empty value appearing in NullFields will be sent to the server as
  11633. // null. It is an error if a field in this list has a non-empty value.
  11634. // This may be used to include null fields in Patch requests.
  11635. NullFields []string `json:"-"`
  11636. }
  11637. func (s *InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  11638. type NoMethod InstanceGroupManagersDeletePerInstanceConfigsReq
  11639. raw := NoMethod(*s)
  11640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11641. }
  11642. type InstanceGroupManagersListManagedInstancesResponse struct {
  11643. // ManagedInstances: [Output Only] The list of instances in the managed
  11644. // instance group.
  11645. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  11646. // NextPageToken: [Output Only] This token allows you to get the next
  11647. // page of results for list requests. If the number of results is larger
  11648. // than maxResults, use the nextPageToken as a value for the query
  11649. // parameter pageToken in the next list request. Subsequent list
  11650. // requests will have their own nextPageToken to continue paging through
  11651. // the results.
  11652. NextPageToken string `json:"nextPageToken,omitempty"`
  11653. // ServerResponse contains the HTTP response code and headers from the
  11654. // server.
  11655. googleapi.ServerResponse `json:"-"`
  11656. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  11657. // unconditionally include in API requests. By default, fields with
  11658. // empty values are omitted from API requests. However, any non-pointer,
  11659. // non-interface field appearing in ForceSendFields will be sent to the
  11660. // server regardless of whether the field is empty or not. This may be
  11661. // used to include empty fields in Patch requests.
  11662. ForceSendFields []string `json:"-"`
  11663. // NullFields is a list of field names (e.g. "ManagedInstances") to
  11664. // include in API requests with the JSON null value. By default, fields
  11665. // with empty values are omitted from API requests. However, any field
  11666. // with an empty value appearing in NullFields will be sent to the
  11667. // server as null. It is an error if a field in this list has a
  11668. // non-empty value. This may be used to include null fields in Patch
  11669. // requests.
  11670. NullFields []string `json:"-"`
  11671. }
  11672. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  11673. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  11674. raw := NoMethod(*s)
  11675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11676. }
  11677. type InstanceGroupManagersListPerInstanceConfigsResp struct {
  11678. // Items: [Output Only] The list of PerInstanceConfig.
  11679. Items []*PerInstanceConfig `json:"items,omitempty"`
  11680. // NextPageToken: [Output Only] This token allows you to get the next
  11681. // page of results for list requests. If the number of results is larger
  11682. // than maxResults, use the nextPageToken as a value for the query
  11683. // parameter pageToken in the next list request. Subsequent list
  11684. // requests will have their own nextPageToken to continue paging through
  11685. // the results.
  11686. NextPageToken string `json:"nextPageToken,omitempty"`
  11687. // Warning: [Output Only] Informational warning message.
  11688. Warning *InstanceGroupManagersListPerInstanceConfigsRespWarning `json:"warning,omitempty"`
  11689. // ServerResponse contains the HTTP response code and headers from the
  11690. // server.
  11691. googleapi.ServerResponse `json:"-"`
  11692. // ForceSendFields is a list of field names (e.g. "Items") to
  11693. // unconditionally include in API requests. By default, fields with
  11694. // empty values are omitted from API requests. However, any non-pointer,
  11695. // non-interface field appearing in ForceSendFields will be sent to the
  11696. // server regardless of whether the field is empty or not. This may be
  11697. // used to include empty fields in Patch requests.
  11698. ForceSendFields []string `json:"-"`
  11699. // NullFields is a list of field names (e.g. "Items") to include in API
  11700. // requests with the JSON null value. By default, fields with empty
  11701. // values are omitted from API requests. However, any field with an
  11702. // empty value appearing in NullFields will be sent to the server as
  11703. // null. It is an error if a field in this list has a non-empty value.
  11704. // This may be used to include null fields in Patch requests.
  11705. NullFields []string `json:"-"`
  11706. }
  11707. func (s *InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  11708. type NoMethod InstanceGroupManagersListPerInstanceConfigsResp
  11709. raw := NoMethod(*s)
  11710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11711. }
  11712. // InstanceGroupManagersListPerInstanceConfigsRespWarning: [Output Only]
  11713. // Informational warning message.
  11714. type InstanceGroupManagersListPerInstanceConfigsRespWarning struct {
  11715. // Code: [Output Only] A warning code, if applicable. For example,
  11716. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11717. // the response.
  11718. //
  11719. // Possible values:
  11720. // "CLEANUP_FAILED"
  11721. // "DEPRECATED_RESOURCE_USED"
  11722. // "DEPRECATED_TYPE_USED"
  11723. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11724. // "EXPERIMENTAL_TYPE_USED"
  11725. // "EXTERNAL_API_WARNING"
  11726. // "FIELD_VALUE_OVERRIDEN"
  11727. // "INJECTED_KERNELS_DEPRECATED"
  11728. // "MISSING_TYPE_DEPENDENCY"
  11729. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11730. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11731. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11732. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11733. // "NEXT_HOP_NOT_RUNNING"
  11734. // "NOT_CRITICAL_ERROR"
  11735. // "NO_RESULTS_ON_PAGE"
  11736. // "REQUIRED_TOS_AGREEMENT"
  11737. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11738. // "RESOURCE_NOT_DELETED"
  11739. // "SCHEMA_VALIDATION_IGNORED"
  11740. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11741. // "UNDECLARED_PROPERTIES"
  11742. // "UNREACHABLE"
  11743. Code string `json:"code,omitempty"`
  11744. // Data: [Output Only] Metadata about this warning in key: value format.
  11745. // For example:
  11746. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11747. Data []*InstanceGroupManagersListPerInstanceConfigsRespWarningData `json:"data,omitempty"`
  11748. // Message: [Output Only] A human-readable description of the warning
  11749. // code.
  11750. Message string `json:"message,omitempty"`
  11751. // ForceSendFields is a list of field names (e.g. "Code") to
  11752. // unconditionally include in API requests. By default, fields with
  11753. // empty values are omitted from API requests. However, any non-pointer,
  11754. // non-interface field appearing in ForceSendFields will be sent to the
  11755. // server regardless of whether the field is empty or not. This may be
  11756. // used to include empty fields in Patch requests.
  11757. ForceSendFields []string `json:"-"`
  11758. // NullFields is a list of field names (e.g. "Code") to include in API
  11759. // requests with the JSON null value. By default, fields with empty
  11760. // values are omitted from API requests. However, any field with an
  11761. // empty value appearing in NullFields will be sent to the server as
  11762. // null. It is an error if a field in this list has a non-empty value.
  11763. // This may be used to include null fields in Patch requests.
  11764. NullFields []string `json:"-"`
  11765. }
  11766. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  11767. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarning
  11768. raw := NoMethod(*s)
  11769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11770. }
  11771. type InstanceGroupManagersListPerInstanceConfigsRespWarningData struct {
  11772. // Key: [Output Only] A key that provides more detail on the warning
  11773. // being returned. For example, for warnings where there are no results
  11774. // in a list request for a particular zone, this key might be scope and
  11775. // the key value might be the zone name. Other examples might be a key
  11776. // indicating a deprecated resource and a suggested replacement, or a
  11777. // warning about invalid network settings (for example, if an instance
  11778. // attempts to perform IP forwarding but is not enabled for IP
  11779. // forwarding).
  11780. Key string `json:"key,omitempty"`
  11781. // Value: [Output Only] A warning data value corresponding to the key.
  11782. Value string `json:"value,omitempty"`
  11783. // ForceSendFields is a list of field names (e.g. "Key") to
  11784. // unconditionally include in API requests. By default, fields with
  11785. // empty values are omitted from API requests. However, any non-pointer,
  11786. // non-interface field appearing in ForceSendFields will be sent to the
  11787. // server regardless of whether the field is empty or not. This may be
  11788. // used to include empty fields in Patch requests.
  11789. ForceSendFields []string `json:"-"`
  11790. // NullFields is a list of field names (e.g. "Key") to include in API
  11791. // requests with the JSON null value. By default, fields with empty
  11792. // values are omitted from API requests. However, any field with an
  11793. // empty value appearing in NullFields will be sent to the server as
  11794. // null. It is an error if a field in this list has a non-empty value.
  11795. // This may be used to include null fields in Patch requests.
  11796. NullFields []string `json:"-"`
  11797. }
  11798. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  11799. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarningData
  11800. raw := NoMethod(*s)
  11801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11802. }
  11803. type InstanceGroupManagersRecreateInstancesRequest struct {
  11804. // Instances: The URLs of one or more instances to recreate. This can be
  11805. // a full URL or a partial URL, such as
  11806. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11807. Instances []string `json:"instances,omitempty"`
  11808. // ForceSendFields is a list of field names (e.g. "Instances") to
  11809. // unconditionally include in API requests. By default, fields with
  11810. // empty values are omitted from API requests. However, any non-pointer,
  11811. // non-interface field appearing in ForceSendFields will be sent to the
  11812. // server regardless of whether the field is empty or not. This may be
  11813. // used to include empty fields in Patch requests.
  11814. ForceSendFields []string `json:"-"`
  11815. // NullFields is a list of field names (e.g. "Instances") to include in
  11816. // API requests with the JSON null value. By default, fields with empty
  11817. // values are omitted from API requests. However, any field with an
  11818. // empty value appearing in NullFields will be sent to the server as
  11819. // null. It is an error if a field in this list has a non-empty value.
  11820. // This may be used to include null fields in Patch requests.
  11821. NullFields []string `json:"-"`
  11822. }
  11823. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  11824. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  11825. raw := NoMethod(*s)
  11826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11827. }
  11828. type InstanceGroupManagersResizeAdvancedRequest struct {
  11829. // NoCreationRetries: If this flag is true, the managed instance group
  11830. // attempts to create all instances initiated by this resize request
  11831. // only once. If there is an error during creation, the managed instance
  11832. // group does not retry create this instance, and we will decrease the
  11833. // targetSize of the request instead. If the flag is false, the group
  11834. // attempts to recreate each instance continuously until it
  11835. // succeeds.
  11836. //
  11837. // This flag matters only in the first attempt of creation of an
  11838. // instance. After an instance is successfully created while this flag
  11839. // is enabled, the instance behaves the same way as all the other
  11840. // instances created with a regular resize request. In particular, if a
  11841. // running instance dies unexpectedly at a later time and needs to be
  11842. // recreated, this mode does not affect the recreation behavior in that
  11843. // scenario.
  11844. //
  11845. // This flag is applicable only to the current resize request. It does
  11846. // not influence other resize requests in any way.
  11847. //
  11848. // You can see which instances is being creating in which mode by
  11849. // calling the get or listManagedInstances API.
  11850. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  11851. // TargetSize: The number of running instances that the managed instance
  11852. // group should maintain at any given time. The group automatically adds
  11853. // or removes instances to maintain the number of instances specified by
  11854. // this parameter.
  11855. TargetSize int64 `json:"targetSize,omitempty"`
  11856. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  11857. // to unconditionally include in API requests. By default, fields with
  11858. // empty values are omitted from API requests. However, any non-pointer,
  11859. // non-interface field appearing in ForceSendFields will be sent to the
  11860. // server regardless of whether the field is empty or not. This may be
  11861. // used to include empty fields in Patch requests.
  11862. ForceSendFields []string `json:"-"`
  11863. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  11864. // include in API requests with the JSON null value. By default, fields
  11865. // with empty values are omitted from API requests. However, any field
  11866. // with an empty value appearing in NullFields will be sent to the
  11867. // server as null. It is an error if a field in this list has a
  11868. // non-empty value. This may be used to include null fields in Patch
  11869. // requests.
  11870. NullFields []string `json:"-"`
  11871. }
  11872. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  11873. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  11874. raw := NoMethod(*s)
  11875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11876. }
  11877. type InstanceGroupManagersScopedList struct {
  11878. // InstanceGroupManagers: [Output Only] The list of managed instance
  11879. // groups that are contained in the specified project and zone.
  11880. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  11881. // Warning: [Output Only] The warning that replaces the list of managed
  11882. // instance groups when the list is empty.
  11883. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  11884. // ForceSendFields is a list of field names (e.g.
  11885. // "InstanceGroupManagers") to unconditionally include in API requests.
  11886. // By default, fields with empty values are omitted from API requests.
  11887. // However, any non-pointer, non-interface field appearing in
  11888. // ForceSendFields will be sent to the server regardless of whether the
  11889. // field is empty or not. This may be used to include empty fields in
  11890. // Patch requests.
  11891. ForceSendFields []string `json:"-"`
  11892. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  11893. // include in API requests with the JSON null value. By default, fields
  11894. // with empty values are omitted from API requests. However, any field
  11895. // with an empty value appearing in NullFields will be sent to the
  11896. // server as null. It is an error if a field in this list has a
  11897. // non-empty value. This may be used to include null fields in Patch
  11898. // requests.
  11899. NullFields []string `json:"-"`
  11900. }
  11901. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  11902. type NoMethod InstanceGroupManagersScopedList
  11903. raw := NoMethod(*s)
  11904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11905. }
  11906. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  11907. // that replaces the list of managed instance groups when the list is
  11908. // empty.
  11909. type InstanceGroupManagersScopedListWarning struct {
  11910. // Code: [Output Only] A warning code, if applicable. For example,
  11911. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11912. // the response.
  11913. //
  11914. // Possible values:
  11915. // "CLEANUP_FAILED"
  11916. // "DEPRECATED_RESOURCE_USED"
  11917. // "DEPRECATED_TYPE_USED"
  11918. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11919. // "EXPERIMENTAL_TYPE_USED"
  11920. // "EXTERNAL_API_WARNING"
  11921. // "FIELD_VALUE_OVERRIDEN"
  11922. // "INJECTED_KERNELS_DEPRECATED"
  11923. // "MISSING_TYPE_DEPENDENCY"
  11924. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11925. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11926. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11927. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11928. // "NEXT_HOP_NOT_RUNNING"
  11929. // "NOT_CRITICAL_ERROR"
  11930. // "NO_RESULTS_ON_PAGE"
  11931. // "REQUIRED_TOS_AGREEMENT"
  11932. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11933. // "RESOURCE_NOT_DELETED"
  11934. // "SCHEMA_VALIDATION_IGNORED"
  11935. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11936. // "UNDECLARED_PROPERTIES"
  11937. // "UNREACHABLE"
  11938. Code string `json:"code,omitempty"`
  11939. // Data: [Output Only] Metadata about this warning in key: value format.
  11940. // For example:
  11941. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11942. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  11943. // Message: [Output Only] A human-readable description of the warning
  11944. // code.
  11945. Message string `json:"message,omitempty"`
  11946. // ForceSendFields is a list of field names (e.g. "Code") to
  11947. // unconditionally include in API requests. By default, fields with
  11948. // empty values are omitted from API requests. However, any non-pointer,
  11949. // non-interface field appearing in ForceSendFields will be sent to the
  11950. // server regardless of whether the field is empty or not. This may be
  11951. // used to include empty fields in Patch requests.
  11952. ForceSendFields []string `json:"-"`
  11953. // NullFields is a list of field names (e.g. "Code") to include in API
  11954. // requests with the JSON null value. By default, fields with empty
  11955. // values are omitted from API requests. However, any field with an
  11956. // empty value appearing in NullFields will be sent to the server as
  11957. // null. It is an error if a field in this list has a non-empty value.
  11958. // This may be used to include null fields in Patch requests.
  11959. NullFields []string `json:"-"`
  11960. }
  11961. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  11962. type NoMethod InstanceGroupManagersScopedListWarning
  11963. raw := NoMethod(*s)
  11964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11965. }
  11966. type InstanceGroupManagersScopedListWarningData struct {
  11967. // Key: [Output Only] A key that provides more detail on the warning
  11968. // being returned. For example, for warnings where there are no results
  11969. // in a list request for a particular zone, this key might be scope and
  11970. // the key value might be the zone name. Other examples might be a key
  11971. // indicating a deprecated resource and a suggested replacement, or a
  11972. // warning about invalid network settings (for example, if an instance
  11973. // attempts to perform IP forwarding but is not enabled for IP
  11974. // forwarding).
  11975. Key string `json:"key,omitempty"`
  11976. // Value: [Output Only] A warning data value corresponding to the key.
  11977. Value string `json:"value,omitempty"`
  11978. // ForceSendFields is a list of field names (e.g. "Key") to
  11979. // unconditionally include in API requests. By default, fields with
  11980. // empty values are omitted from API requests. However, any non-pointer,
  11981. // non-interface field appearing in ForceSendFields will be sent to the
  11982. // server regardless of whether the field is empty or not. This may be
  11983. // used to include empty fields in Patch requests.
  11984. ForceSendFields []string `json:"-"`
  11985. // NullFields is a list of field names (e.g. "Key") to include in API
  11986. // requests with the JSON null value. By default, fields with empty
  11987. // values are omitted from API requests. However, any field with an
  11988. // empty value appearing in NullFields will be sent to the server as
  11989. // null. It is an error if a field in this list has a non-empty value.
  11990. // This may be used to include null fields in Patch requests.
  11991. NullFields []string `json:"-"`
  11992. }
  11993. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  11994. type NoMethod InstanceGroupManagersScopedListWarningData
  11995. raw := NoMethod(*s)
  11996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11997. }
  11998. type InstanceGroupManagersSetAutoHealingRequest struct {
  11999. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  12000. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  12001. // to unconditionally include in API requests. By default, fields with
  12002. // empty values are omitted from API requests. However, any non-pointer,
  12003. // non-interface field appearing in ForceSendFields will be sent to the
  12004. // server regardless of whether the field is empty or not. This may be
  12005. // used to include empty fields in Patch requests.
  12006. ForceSendFields []string `json:"-"`
  12007. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  12008. // include in API requests with the JSON null value. By default, fields
  12009. // with empty values are omitted from API requests. However, any field
  12010. // with an empty value appearing in NullFields will be sent to the
  12011. // server as null. It is an error if a field in this list has a
  12012. // non-empty value. This may be used to include null fields in Patch
  12013. // requests.
  12014. NullFields []string `json:"-"`
  12015. }
  12016. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  12017. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  12018. raw := NoMethod(*s)
  12019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12020. }
  12021. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  12022. // InstanceTemplate: The URL of the instance template that is specified
  12023. // for this managed instance group. The group uses this template to
  12024. // create all new instances in the managed instance group.
  12025. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  12026. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  12027. // unconditionally include in API requests. By default, fields with
  12028. // empty values are omitted from API requests. However, any non-pointer,
  12029. // non-interface field appearing in ForceSendFields will be sent to the
  12030. // server regardless of whether the field is empty or not. This may be
  12031. // used to include empty fields in Patch requests.
  12032. ForceSendFields []string `json:"-"`
  12033. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  12034. // include in API requests with the JSON null value. By default, fields
  12035. // with empty values are omitted from API requests. However, any field
  12036. // with an empty value appearing in NullFields will be sent to the
  12037. // server as null. It is an error if a field in this list has a
  12038. // non-empty value. This may be used to include null fields in Patch
  12039. // requests.
  12040. NullFields []string `json:"-"`
  12041. }
  12042. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  12043. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  12044. raw := NoMethod(*s)
  12045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12046. }
  12047. type InstanceGroupManagersSetTargetPoolsRequest struct {
  12048. // Fingerprint: The fingerprint of the target pools information. Use
  12049. // this optional property to prevent conflicts when multiple users
  12050. // change the target pools settings concurrently. Obtain the fingerprint
  12051. // with the instanceGroupManagers.get method. Then, include the
  12052. // fingerprint in your request to ensure that you do not overwrite
  12053. // changes that were applied from another concurrent request.
  12054. Fingerprint string `json:"fingerprint,omitempty"`
  12055. // TargetPools: The list of target pool URLs that instances in this
  12056. // managed instance group belong to. The managed instance group applies
  12057. // these target pools to all of the instances in the group. Existing
  12058. // instances and new instances in the group all receive these target
  12059. // pool settings.
  12060. TargetPools []string `json:"targetPools,omitempty"`
  12061. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  12062. // unconditionally include in API requests. By default, fields with
  12063. // empty values are omitted from API requests. However, any non-pointer,
  12064. // non-interface field appearing in ForceSendFields will be sent to the
  12065. // server regardless of whether the field is empty or not. This may be
  12066. // used to include empty fields in Patch requests.
  12067. ForceSendFields []string `json:"-"`
  12068. // NullFields is a list of field names (e.g. "Fingerprint") to include
  12069. // in API requests with the JSON null value. By default, fields with
  12070. // empty values are omitted from API requests. However, any field with
  12071. // an empty value appearing in NullFields will be sent to the server as
  12072. // null. It is an error if a field in this list has a non-empty value.
  12073. // This may be used to include null fields in Patch requests.
  12074. NullFields []string `json:"-"`
  12075. }
  12076. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  12077. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  12078. raw := NoMethod(*s)
  12079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12080. }
  12081. // InstanceGroupManagersUpdatePerInstanceConfigsReq:
  12082. // InstanceGroupManagers.updatePerInstanceConfigs
  12083. type InstanceGroupManagersUpdatePerInstanceConfigsReq struct {
  12084. // PerInstanceConfigs: The list of per-instance configs to insert or
  12085. // patch on this managed instance group.
  12086. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  12087. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  12088. // to unconditionally include in API requests. By default, fields with
  12089. // empty values are omitted from API requests. However, any non-pointer,
  12090. // non-interface field appearing in ForceSendFields will be sent to the
  12091. // server regardless of whether the field is empty or not. This may be
  12092. // used to include empty fields in Patch requests.
  12093. ForceSendFields []string `json:"-"`
  12094. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  12095. // include in API requests with the JSON null value. By default, fields
  12096. // with empty values are omitted from API requests. However, any field
  12097. // with an empty value appearing in NullFields will be sent to the
  12098. // server as null. It is an error if a field in this list has a
  12099. // non-empty value. This may be used to include null fields in Patch
  12100. // requests.
  12101. NullFields []string `json:"-"`
  12102. }
  12103. func (s *InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  12104. type NoMethod InstanceGroupManagersUpdatePerInstanceConfigsReq
  12105. raw := NoMethod(*s)
  12106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12107. }
  12108. type InstanceGroupsAddInstancesRequest struct {
  12109. // Instances: The list of instances to add to the instance group.
  12110. Instances []*InstanceReference `json:"instances,omitempty"`
  12111. // ForceSendFields is a list of field names (e.g. "Instances") to
  12112. // unconditionally include in API requests. By default, fields with
  12113. // empty values are omitted from API requests. However, any non-pointer,
  12114. // non-interface field appearing in ForceSendFields will be sent to the
  12115. // server regardless of whether the field is empty or not. This may be
  12116. // used to include empty fields in Patch requests.
  12117. ForceSendFields []string `json:"-"`
  12118. // NullFields is a list of field names (e.g. "Instances") to include in
  12119. // API requests with the JSON null value. By default, fields with empty
  12120. // values are omitted from API requests. However, any field with an
  12121. // empty value appearing in NullFields will be sent to the server as
  12122. // null. It is an error if a field in this list has a non-empty value.
  12123. // This may be used to include null fields in Patch requests.
  12124. NullFields []string `json:"-"`
  12125. }
  12126. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  12127. type NoMethod InstanceGroupsAddInstancesRequest
  12128. raw := NoMethod(*s)
  12129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12130. }
  12131. type InstanceGroupsListInstances struct {
  12132. // Id: [Output Only] Unique identifier for the resource; defined by the
  12133. // server.
  12134. Id string `json:"id,omitempty"`
  12135. // Items: A list of InstanceWithNamedPorts resources.
  12136. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  12137. // Kind: [Output Only] The resource type, which is always
  12138. // compute#instanceGroupsListInstances for the list of instances in the
  12139. // specified instance group.
  12140. Kind string `json:"kind,omitempty"`
  12141. // NextPageToken: [Output Only] This token allows you to get the next
  12142. // page of results for list requests. If the number of results is larger
  12143. // than maxResults, use the nextPageToken as a value for the query
  12144. // parameter pageToken in the next list request. Subsequent list
  12145. // requests will have their own nextPageToken to continue paging through
  12146. // the results.
  12147. NextPageToken string `json:"nextPageToken,omitempty"`
  12148. // SelfLink: [Output Only] Server-defined URL for this resource.
  12149. SelfLink string `json:"selfLink,omitempty"`
  12150. // Warning: [Output Only] Informational warning message.
  12151. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  12152. // ServerResponse contains the HTTP response code and headers from the
  12153. // server.
  12154. googleapi.ServerResponse `json:"-"`
  12155. // ForceSendFields is a list of field names (e.g. "Id") to
  12156. // unconditionally include in API requests. By default, fields with
  12157. // empty values are omitted from API requests. However, any non-pointer,
  12158. // non-interface field appearing in ForceSendFields will be sent to the
  12159. // server regardless of whether the field is empty or not. This may be
  12160. // used to include empty fields in Patch requests.
  12161. ForceSendFields []string `json:"-"`
  12162. // NullFields is a list of field names (e.g. "Id") to include in API
  12163. // requests with the JSON null value. By default, fields with empty
  12164. // values are omitted from API requests. However, any field with an
  12165. // empty value appearing in NullFields will be sent to the server as
  12166. // null. It is an error if a field in this list has a non-empty value.
  12167. // This may be used to include null fields in Patch requests.
  12168. NullFields []string `json:"-"`
  12169. }
  12170. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  12171. type NoMethod InstanceGroupsListInstances
  12172. raw := NoMethod(*s)
  12173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12174. }
  12175. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  12176. // warning message.
  12177. type InstanceGroupsListInstancesWarning struct {
  12178. // Code: [Output Only] A warning code, if applicable. For example,
  12179. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12180. // the response.
  12181. //
  12182. // Possible values:
  12183. // "CLEANUP_FAILED"
  12184. // "DEPRECATED_RESOURCE_USED"
  12185. // "DEPRECATED_TYPE_USED"
  12186. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12187. // "EXPERIMENTAL_TYPE_USED"
  12188. // "EXTERNAL_API_WARNING"
  12189. // "FIELD_VALUE_OVERRIDEN"
  12190. // "INJECTED_KERNELS_DEPRECATED"
  12191. // "MISSING_TYPE_DEPENDENCY"
  12192. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12193. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12194. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12195. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12196. // "NEXT_HOP_NOT_RUNNING"
  12197. // "NOT_CRITICAL_ERROR"
  12198. // "NO_RESULTS_ON_PAGE"
  12199. // "REQUIRED_TOS_AGREEMENT"
  12200. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12201. // "RESOURCE_NOT_DELETED"
  12202. // "SCHEMA_VALIDATION_IGNORED"
  12203. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12204. // "UNDECLARED_PROPERTIES"
  12205. // "UNREACHABLE"
  12206. Code string `json:"code,omitempty"`
  12207. // Data: [Output Only] Metadata about this warning in key: value format.
  12208. // For example:
  12209. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12210. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  12211. // Message: [Output Only] A human-readable description of the warning
  12212. // code.
  12213. Message string `json:"message,omitempty"`
  12214. // ForceSendFields is a list of field names (e.g. "Code") to
  12215. // unconditionally include in API requests. By default, fields with
  12216. // empty values are omitted from API requests. However, any non-pointer,
  12217. // non-interface field appearing in ForceSendFields will be sent to the
  12218. // server regardless of whether the field is empty or not. This may be
  12219. // used to include empty fields in Patch requests.
  12220. ForceSendFields []string `json:"-"`
  12221. // NullFields is a list of field names (e.g. "Code") to include in API
  12222. // requests with the JSON null value. By default, fields with empty
  12223. // values are omitted from API requests. However, any field with an
  12224. // empty value appearing in NullFields will be sent to the server as
  12225. // null. It is an error if a field in this list has a non-empty value.
  12226. // This may be used to include null fields in Patch requests.
  12227. NullFields []string `json:"-"`
  12228. }
  12229. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  12230. type NoMethod InstanceGroupsListInstancesWarning
  12231. raw := NoMethod(*s)
  12232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12233. }
  12234. type InstanceGroupsListInstancesWarningData struct {
  12235. // Key: [Output Only] A key that provides more detail on the warning
  12236. // being returned. For example, for warnings where there are no results
  12237. // in a list request for a particular zone, this key might be scope and
  12238. // the key value might be the zone name. Other examples might be a key
  12239. // indicating a deprecated resource and a suggested replacement, or a
  12240. // warning about invalid network settings (for example, if an instance
  12241. // attempts to perform IP forwarding but is not enabled for IP
  12242. // forwarding).
  12243. Key string `json:"key,omitempty"`
  12244. // Value: [Output Only] A warning data value corresponding to the key.
  12245. Value string `json:"value,omitempty"`
  12246. // ForceSendFields is a list of field names (e.g. "Key") to
  12247. // unconditionally include in API requests. By default, fields with
  12248. // empty values are omitted from API requests. However, any non-pointer,
  12249. // non-interface field appearing in ForceSendFields will be sent to the
  12250. // server regardless of whether the field is empty or not. This may be
  12251. // used to include empty fields in Patch requests.
  12252. ForceSendFields []string `json:"-"`
  12253. // NullFields is a list of field names (e.g. "Key") to include in API
  12254. // requests with the JSON null value. By default, fields with empty
  12255. // values are omitted from API requests. However, any field with an
  12256. // empty value appearing in NullFields will be sent to the server as
  12257. // null. It is an error if a field in this list has a non-empty value.
  12258. // This may be used to include null fields in Patch requests.
  12259. NullFields []string `json:"-"`
  12260. }
  12261. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  12262. type NoMethod InstanceGroupsListInstancesWarningData
  12263. raw := NoMethod(*s)
  12264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12265. }
  12266. type InstanceGroupsListInstancesRequest struct {
  12267. // InstanceState: A filter for the state of the instances in the
  12268. // instance group. Valid options are ALL or RUNNING. If you do not
  12269. // specify this parameter the list includes all instances regardless of
  12270. // their state.
  12271. //
  12272. // Possible values:
  12273. // "ALL"
  12274. // "RUNNING"
  12275. InstanceState string `json:"instanceState,omitempty"`
  12276. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  12277. // unconditionally include in API requests. By default, fields with
  12278. // empty values are omitted from API requests. However, any non-pointer,
  12279. // non-interface field appearing in ForceSendFields will be sent to the
  12280. // server regardless of whether the field is empty or not. This may be
  12281. // used to include empty fields in Patch requests.
  12282. ForceSendFields []string `json:"-"`
  12283. // NullFields is a list of field names (e.g. "InstanceState") to include
  12284. // in API requests with the JSON null value. By default, fields with
  12285. // empty values are omitted from API requests. However, any field with
  12286. // an empty value appearing in NullFields will be sent to the server as
  12287. // null. It is an error if a field in this list has a non-empty value.
  12288. // This may be used to include null fields in Patch requests.
  12289. NullFields []string `json:"-"`
  12290. }
  12291. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  12292. type NoMethod InstanceGroupsListInstancesRequest
  12293. raw := NoMethod(*s)
  12294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12295. }
  12296. type InstanceGroupsRemoveInstancesRequest struct {
  12297. // Instances: The list of instances to remove from the instance group.
  12298. Instances []*InstanceReference `json:"instances,omitempty"`
  12299. // ForceSendFields is a list of field names (e.g. "Instances") to
  12300. // unconditionally include in API requests. By default, fields with
  12301. // empty values are omitted from API requests. However, any non-pointer,
  12302. // non-interface field appearing in ForceSendFields will be sent to the
  12303. // server regardless of whether the field is empty or not. This may be
  12304. // used to include empty fields in Patch requests.
  12305. ForceSendFields []string `json:"-"`
  12306. // NullFields is a list of field names (e.g. "Instances") to include in
  12307. // API requests with the JSON null value. By default, fields with empty
  12308. // values are omitted from API requests. However, any field with an
  12309. // empty value appearing in NullFields will be sent to the server as
  12310. // null. It is an error if a field in this list has a non-empty value.
  12311. // This may be used to include null fields in Patch requests.
  12312. NullFields []string `json:"-"`
  12313. }
  12314. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  12315. type NoMethod InstanceGroupsRemoveInstancesRequest
  12316. raw := NoMethod(*s)
  12317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12318. }
  12319. type InstanceGroupsScopedList struct {
  12320. // InstanceGroups: [Output Only] The list of instance groups that are
  12321. // contained in this scope.
  12322. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  12323. // Warning: [Output Only] An informational warning that replaces the
  12324. // list of instance groups when the list is empty.
  12325. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  12326. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  12327. // unconditionally include in API requests. By default, fields with
  12328. // empty values are omitted from API requests. However, any non-pointer,
  12329. // non-interface field appearing in ForceSendFields will be sent to the
  12330. // server regardless of whether the field is empty or not. This may be
  12331. // used to include empty fields in Patch requests.
  12332. ForceSendFields []string `json:"-"`
  12333. // NullFields is a list of field names (e.g. "InstanceGroups") to
  12334. // include in API requests with the JSON null value. By default, fields
  12335. // with empty values are omitted from API requests. However, any field
  12336. // with an empty value appearing in NullFields will be sent to the
  12337. // server as null. It is an error if a field in this list has a
  12338. // non-empty value. This may be used to include null fields in Patch
  12339. // requests.
  12340. NullFields []string `json:"-"`
  12341. }
  12342. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  12343. type NoMethod InstanceGroupsScopedList
  12344. raw := NoMethod(*s)
  12345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12346. }
  12347. // InstanceGroupsScopedListWarning: [Output Only] An informational
  12348. // warning that replaces the list of instance groups when the list is
  12349. // empty.
  12350. type InstanceGroupsScopedListWarning struct {
  12351. // Code: [Output Only] A warning code, if applicable. For example,
  12352. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12353. // the response.
  12354. //
  12355. // Possible values:
  12356. // "CLEANUP_FAILED"
  12357. // "DEPRECATED_RESOURCE_USED"
  12358. // "DEPRECATED_TYPE_USED"
  12359. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12360. // "EXPERIMENTAL_TYPE_USED"
  12361. // "EXTERNAL_API_WARNING"
  12362. // "FIELD_VALUE_OVERRIDEN"
  12363. // "INJECTED_KERNELS_DEPRECATED"
  12364. // "MISSING_TYPE_DEPENDENCY"
  12365. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12366. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12367. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12368. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12369. // "NEXT_HOP_NOT_RUNNING"
  12370. // "NOT_CRITICAL_ERROR"
  12371. // "NO_RESULTS_ON_PAGE"
  12372. // "REQUIRED_TOS_AGREEMENT"
  12373. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12374. // "RESOURCE_NOT_DELETED"
  12375. // "SCHEMA_VALIDATION_IGNORED"
  12376. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12377. // "UNDECLARED_PROPERTIES"
  12378. // "UNREACHABLE"
  12379. Code string `json:"code,omitempty"`
  12380. // Data: [Output Only] Metadata about this warning in key: value format.
  12381. // For example:
  12382. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12383. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  12384. // Message: [Output Only] A human-readable description of the warning
  12385. // code.
  12386. Message string `json:"message,omitempty"`
  12387. // ForceSendFields is a list of field names (e.g. "Code") to
  12388. // unconditionally include in API requests. By default, fields with
  12389. // empty values are omitted from API requests. However, any non-pointer,
  12390. // non-interface field appearing in ForceSendFields will be sent to the
  12391. // server regardless of whether the field is empty or not. This may be
  12392. // used to include empty fields in Patch requests.
  12393. ForceSendFields []string `json:"-"`
  12394. // NullFields is a list of field names (e.g. "Code") to include in API
  12395. // requests with the JSON null value. By default, fields with empty
  12396. // values are omitted from API requests. However, any field with an
  12397. // empty value appearing in NullFields will be sent to the server as
  12398. // null. It is an error if a field in this list has a non-empty value.
  12399. // This may be used to include null fields in Patch requests.
  12400. NullFields []string `json:"-"`
  12401. }
  12402. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  12403. type NoMethod InstanceGroupsScopedListWarning
  12404. raw := NoMethod(*s)
  12405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12406. }
  12407. type InstanceGroupsScopedListWarningData struct {
  12408. // Key: [Output Only] A key that provides more detail on the warning
  12409. // being returned. For example, for warnings where there are no results
  12410. // in a list request for a particular zone, this key might be scope and
  12411. // the key value might be the zone name. Other examples might be a key
  12412. // indicating a deprecated resource and a suggested replacement, or a
  12413. // warning about invalid network settings (for example, if an instance
  12414. // attempts to perform IP forwarding but is not enabled for IP
  12415. // forwarding).
  12416. Key string `json:"key,omitempty"`
  12417. // Value: [Output Only] A warning data value corresponding to the key.
  12418. Value string `json:"value,omitempty"`
  12419. // ForceSendFields is a list of field names (e.g. "Key") to
  12420. // unconditionally include in API requests. By default, fields with
  12421. // empty values are omitted from API requests. However, any non-pointer,
  12422. // non-interface field appearing in ForceSendFields will be sent to the
  12423. // server regardless of whether the field is empty or not. This may be
  12424. // used to include empty fields in Patch requests.
  12425. ForceSendFields []string `json:"-"`
  12426. // NullFields is a list of field names (e.g. "Key") to include in API
  12427. // requests with the JSON null value. By default, fields with empty
  12428. // values are omitted from API requests. However, any field with an
  12429. // empty value appearing in NullFields will be sent to the server as
  12430. // null. It is an error if a field in this list has a non-empty value.
  12431. // This may be used to include null fields in Patch requests.
  12432. NullFields []string `json:"-"`
  12433. }
  12434. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  12435. type NoMethod InstanceGroupsScopedListWarningData
  12436. raw := NoMethod(*s)
  12437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12438. }
  12439. type InstanceGroupsSetNamedPortsRequest struct {
  12440. // Fingerprint: The fingerprint of the named ports information for this
  12441. // instance group. Use this optional property to prevent conflicts when
  12442. // multiple users change the named ports settings concurrently. Obtain
  12443. // the fingerprint with the instanceGroups.get method. Then, include the
  12444. // fingerprint in your request to ensure that you do not overwrite
  12445. // changes that were applied from another concurrent request. A request
  12446. // with an incorrect fingerprint will fail with error 412
  12447. // conditionNotMet.
  12448. Fingerprint string `json:"fingerprint,omitempty"`
  12449. // NamedPorts: The list of named ports to set for this instance group.
  12450. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12451. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  12452. // unconditionally include in API requests. By default, fields with
  12453. // empty values are omitted from API requests. However, any non-pointer,
  12454. // non-interface field appearing in ForceSendFields will be sent to the
  12455. // server regardless of whether the field is empty or not. This may be
  12456. // used to include empty fields in Patch requests.
  12457. ForceSendFields []string `json:"-"`
  12458. // NullFields is a list of field names (e.g. "Fingerprint") to include
  12459. // in API requests with the JSON null value. By default, fields with
  12460. // empty values are omitted from API requests. However, any field with
  12461. // an empty value appearing in NullFields will be sent to the server as
  12462. // null. It is an error if a field in this list has a non-empty value.
  12463. // This may be used to include null fields in Patch requests.
  12464. NullFields []string `json:"-"`
  12465. }
  12466. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  12467. type NoMethod InstanceGroupsSetNamedPortsRequest
  12468. raw := NoMethod(*s)
  12469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12470. }
  12471. // InstanceList: Contains a list of instances.
  12472. type InstanceList struct {
  12473. // Id: [Output Only] Unique identifier for the resource; defined by the
  12474. // server.
  12475. Id string `json:"id,omitempty"`
  12476. // Items: A list of Instance resources.
  12477. Items []*Instance `json:"items,omitempty"`
  12478. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  12479. // lists of Instance resources.
  12480. Kind string `json:"kind,omitempty"`
  12481. // NextPageToken: [Output Only] This token allows you to get the next
  12482. // page of results for list requests. If the number of results is larger
  12483. // than maxResults, use the nextPageToken as a value for the query
  12484. // parameter pageToken in the next list request. Subsequent list
  12485. // requests will have their own nextPageToken to continue paging through
  12486. // the results.
  12487. NextPageToken string `json:"nextPageToken,omitempty"`
  12488. // SelfLink: [Output Only] Server-defined URL for this resource.
  12489. SelfLink string `json:"selfLink,omitempty"`
  12490. // Warning: [Output Only] Informational warning message.
  12491. Warning *InstanceListWarning `json:"warning,omitempty"`
  12492. // ServerResponse contains the HTTP response code and headers from the
  12493. // server.
  12494. googleapi.ServerResponse `json:"-"`
  12495. // ForceSendFields is a list of field names (e.g. "Id") to
  12496. // unconditionally include in API requests. By default, fields with
  12497. // empty values are omitted from API requests. However, any non-pointer,
  12498. // non-interface field appearing in ForceSendFields will be sent to the
  12499. // server regardless of whether the field is empty or not. This may be
  12500. // used to include empty fields in Patch requests.
  12501. ForceSendFields []string `json:"-"`
  12502. // NullFields is a list of field names (e.g. "Id") to include in API
  12503. // requests with the JSON null value. By default, fields with empty
  12504. // values are omitted from API requests. However, any field with an
  12505. // empty value appearing in NullFields will be sent to the server as
  12506. // null. It is an error if a field in this list has a non-empty value.
  12507. // This may be used to include null fields in Patch requests.
  12508. NullFields []string `json:"-"`
  12509. }
  12510. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  12511. type NoMethod InstanceList
  12512. raw := NoMethod(*s)
  12513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12514. }
  12515. // InstanceListWarning: [Output Only] Informational warning message.
  12516. type InstanceListWarning struct {
  12517. // Code: [Output Only] A warning code, if applicable. For example,
  12518. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12519. // the response.
  12520. //
  12521. // Possible values:
  12522. // "CLEANUP_FAILED"
  12523. // "DEPRECATED_RESOURCE_USED"
  12524. // "DEPRECATED_TYPE_USED"
  12525. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12526. // "EXPERIMENTAL_TYPE_USED"
  12527. // "EXTERNAL_API_WARNING"
  12528. // "FIELD_VALUE_OVERRIDEN"
  12529. // "INJECTED_KERNELS_DEPRECATED"
  12530. // "MISSING_TYPE_DEPENDENCY"
  12531. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12532. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12533. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12534. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12535. // "NEXT_HOP_NOT_RUNNING"
  12536. // "NOT_CRITICAL_ERROR"
  12537. // "NO_RESULTS_ON_PAGE"
  12538. // "REQUIRED_TOS_AGREEMENT"
  12539. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12540. // "RESOURCE_NOT_DELETED"
  12541. // "SCHEMA_VALIDATION_IGNORED"
  12542. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12543. // "UNDECLARED_PROPERTIES"
  12544. // "UNREACHABLE"
  12545. Code string `json:"code,omitempty"`
  12546. // Data: [Output Only] Metadata about this warning in key: value format.
  12547. // For example:
  12548. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12549. Data []*InstanceListWarningData `json:"data,omitempty"`
  12550. // Message: [Output Only] A human-readable description of the warning
  12551. // code.
  12552. Message string `json:"message,omitempty"`
  12553. // ForceSendFields is a list of field names (e.g. "Code") to
  12554. // unconditionally include in API requests. By default, fields with
  12555. // empty values are omitted from API requests. However, any non-pointer,
  12556. // non-interface field appearing in ForceSendFields will be sent to the
  12557. // server regardless of whether the field is empty or not. This may be
  12558. // used to include empty fields in Patch requests.
  12559. ForceSendFields []string `json:"-"`
  12560. // NullFields is a list of field names (e.g. "Code") to include in API
  12561. // requests with the JSON null value. By default, fields with empty
  12562. // values are omitted from API requests. However, any field with an
  12563. // empty value appearing in NullFields will be sent to the server as
  12564. // null. It is an error if a field in this list has a non-empty value.
  12565. // This may be used to include null fields in Patch requests.
  12566. NullFields []string `json:"-"`
  12567. }
  12568. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  12569. type NoMethod InstanceListWarning
  12570. raw := NoMethod(*s)
  12571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12572. }
  12573. type InstanceListWarningData struct {
  12574. // Key: [Output Only] A key that provides more detail on the warning
  12575. // being returned. For example, for warnings where there are no results
  12576. // in a list request for a particular zone, this key might be scope and
  12577. // the key value might be the zone name. Other examples might be a key
  12578. // indicating a deprecated resource and a suggested replacement, or a
  12579. // warning about invalid network settings (for example, if an instance
  12580. // attempts to perform IP forwarding but is not enabled for IP
  12581. // forwarding).
  12582. Key string `json:"key,omitempty"`
  12583. // Value: [Output Only] A warning data value corresponding to the key.
  12584. Value string `json:"value,omitempty"`
  12585. // ForceSendFields is a list of field names (e.g. "Key") to
  12586. // unconditionally include in API requests. By default, fields with
  12587. // empty values are omitted from API requests. However, any non-pointer,
  12588. // non-interface field appearing in ForceSendFields will be sent to the
  12589. // server regardless of whether the field is empty or not. This may be
  12590. // used to include empty fields in Patch requests.
  12591. ForceSendFields []string `json:"-"`
  12592. // NullFields is a list of field names (e.g. "Key") to include in API
  12593. // requests with the JSON null value. By default, fields with empty
  12594. // values are omitted from API requests. However, any field with an
  12595. // empty value appearing in NullFields will be sent to the server as
  12596. // null. It is an error if a field in this list has a non-empty value.
  12597. // This may be used to include null fields in Patch requests.
  12598. NullFields []string `json:"-"`
  12599. }
  12600. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  12601. type NoMethod InstanceListWarningData
  12602. raw := NoMethod(*s)
  12603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12604. }
  12605. // InstanceListReferrers: Contains a list of instance referrers.
  12606. type InstanceListReferrers struct {
  12607. // Id: [Output Only] Unique identifier for the resource; defined by the
  12608. // server.
  12609. Id string `json:"id,omitempty"`
  12610. // Items: A list of Reference resources.
  12611. Items []*Reference `json:"items,omitempty"`
  12612. // Kind: [Output Only] Type of resource. Always
  12613. // compute#instanceListReferrers for lists of Instance referrers.
  12614. Kind string `json:"kind,omitempty"`
  12615. // NextPageToken: [Output Only] This token allows you to get the next
  12616. // page of results for list requests. If the number of results is larger
  12617. // than maxResults, use the nextPageToken as a value for the query
  12618. // parameter pageToken in the next list request. Subsequent list
  12619. // requests will have their own nextPageToken to continue paging through
  12620. // the results.
  12621. NextPageToken string `json:"nextPageToken,omitempty"`
  12622. // SelfLink: [Output Only] Server-defined URL for this resource.
  12623. SelfLink string `json:"selfLink,omitempty"`
  12624. // Warning: [Output Only] Informational warning message.
  12625. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  12626. // ServerResponse contains the HTTP response code and headers from the
  12627. // server.
  12628. googleapi.ServerResponse `json:"-"`
  12629. // ForceSendFields is a list of field names (e.g. "Id") to
  12630. // unconditionally include in API requests. By default, fields with
  12631. // empty values are omitted from API requests. However, any non-pointer,
  12632. // non-interface field appearing in ForceSendFields will be sent to the
  12633. // server regardless of whether the field is empty or not. This may be
  12634. // used to include empty fields in Patch requests.
  12635. ForceSendFields []string `json:"-"`
  12636. // NullFields is a list of field names (e.g. "Id") to include in API
  12637. // requests with the JSON null value. By default, fields with empty
  12638. // values are omitted from API requests. However, any field with an
  12639. // empty value appearing in NullFields will be sent to the server as
  12640. // null. It is an error if a field in this list has a non-empty value.
  12641. // This may be used to include null fields in Patch requests.
  12642. NullFields []string `json:"-"`
  12643. }
  12644. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  12645. type NoMethod InstanceListReferrers
  12646. raw := NoMethod(*s)
  12647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12648. }
  12649. // InstanceListReferrersWarning: [Output Only] Informational warning
  12650. // message.
  12651. type InstanceListReferrersWarning struct {
  12652. // Code: [Output Only] A warning code, if applicable. For example,
  12653. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12654. // the response.
  12655. //
  12656. // Possible values:
  12657. // "CLEANUP_FAILED"
  12658. // "DEPRECATED_RESOURCE_USED"
  12659. // "DEPRECATED_TYPE_USED"
  12660. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12661. // "EXPERIMENTAL_TYPE_USED"
  12662. // "EXTERNAL_API_WARNING"
  12663. // "FIELD_VALUE_OVERRIDEN"
  12664. // "INJECTED_KERNELS_DEPRECATED"
  12665. // "MISSING_TYPE_DEPENDENCY"
  12666. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12667. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12668. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12669. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12670. // "NEXT_HOP_NOT_RUNNING"
  12671. // "NOT_CRITICAL_ERROR"
  12672. // "NO_RESULTS_ON_PAGE"
  12673. // "REQUIRED_TOS_AGREEMENT"
  12674. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12675. // "RESOURCE_NOT_DELETED"
  12676. // "SCHEMA_VALIDATION_IGNORED"
  12677. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12678. // "UNDECLARED_PROPERTIES"
  12679. // "UNREACHABLE"
  12680. Code string `json:"code,omitempty"`
  12681. // Data: [Output Only] Metadata about this warning in key: value format.
  12682. // For example:
  12683. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12684. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  12685. // Message: [Output Only] A human-readable description of the warning
  12686. // code.
  12687. Message string `json:"message,omitempty"`
  12688. // ForceSendFields is a list of field names (e.g. "Code") to
  12689. // unconditionally include in API requests. By default, fields with
  12690. // empty values are omitted from API requests. However, any non-pointer,
  12691. // non-interface field appearing in ForceSendFields will be sent to the
  12692. // server regardless of whether the field is empty or not. This may be
  12693. // used to include empty fields in Patch requests.
  12694. ForceSendFields []string `json:"-"`
  12695. // NullFields is a list of field names (e.g. "Code") to include in API
  12696. // requests with the JSON null value. By default, fields with empty
  12697. // values are omitted from API requests. However, any field with an
  12698. // empty value appearing in NullFields will be sent to the server as
  12699. // null. It is an error if a field in this list has a non-empty value.
  12700. // This may be used to include null fields in Patch requests.
  12701. NullFields []string `json:"-"`
  12702. }
  12703. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  12704. type NoMethod InstanceListReferrersWarning
  12705. raw := NoMethod(*s)
  12706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12707. }
  12708. type InstanceListReferrersWarningData struct {
  12709. // Key: [Output Only] A key that provides more detail on the warning
  12710. // being returned. For example, for warnings where there are no results
  12711. // in a list request for a particular zone, this key might be scope and
  12712. // the key value might be the zone name. Other examples might be a key
  12713. // indicating a deprecated resource and a suggested replacement, or a
  12714. // warning about invalid network settings (for example, if an instance
  12715. // attempts to perform IP forwarding but is not enabled for IP
  12716. // forwarding).
  12717. Key string `json:"key,omitempty"`
  12718. // Value: [Output Only] A warning data value corresponding to the key.
  12719. Value string `json:"value,omitempty"`
  12720. // ForceSendFields is a list of field names (e.g. "Key") to
  12721. // unconditionally include in API requests. By default, fields with
  12722. // empty values are omitted from API requests. However, any non-pointer,
  12723. // non-interface field appearing in ForceSendFields will be sent to the
  12724. // server regardless of whether the field is empty or not. This may be
  12725. // used to include empty fields in Patch requests.
  12726. ForceSendFields []string `json:"-"`
  12727. // NullFields is a list of field names (e.g. "Key") to include in API
  12728. // requests with the JSON null value. By default, fields with empty
  12729. // values are omitted from API requests. However, any field with an
  12730. // empty value appearing in NullFields will be sent to the server as
  12731. // null. It is an error if a field in this list has a non-empty value.
  12732. // This may be used to include null fields in Patch requests.
  12733. NullFields []string `json:"-"`
  12734. }
  12735. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  12736. type NoMethod InstanceListReferrersWarningData
  12737. raw := NoMethod(*s)
  12738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12739. }
  12740. type InstanceMoveRequest struct {
  12741. // DestinationZone: The URL of the destination zone to move the
  12742. // instance. This can be a full or partial URL. For example, the
  12743. // following are all valid URLs to a zone:
  12744. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  12745. //
  12746. // - projects/project/zones/zone
  12747. // - zones/zone
  12748. DestinationZone string `json:"destinationZone,omitempty"`
  12749. // TargetInstance: The URL of the target instance to move. This can be a
  12750. // full or partial URL. For example, the following are all valid URLs to
  12751. // an instance:
  12752. // -
  12753. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12754. // - projects/project/zones/zone/instances/instance
  12755. // - zones/zone/instances/instance
  12756. TargetInstance string `json:"targetInstance,omitempty"`
  12757. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  12758. // unconditionally include in API requests. By default, fields with
  12759. // empty values are omitted from API requests. However, any non-pointer,
  12760. // non-interface field appearing in ForceSendFields will be sent to the
  12761. // server regardless of whether the field is empty or not. This may be
  12762. // used to include empty fields in Patch requests.
  12763. ForceSendFields []string `json:"-"`
  12764. // NullFields is a list of field names (e.g. "DestinationZone") to
  12765. // include in API requests with the JSON null value. By default, fields
  12766. // with empty values are omitted from API requests. However, any field
  12767. // with an empty value appearing in NullFields will be sent to the
  12768. // server as null. It is an error if a field in this list has a
  12769. // non-empty value. This may be used to include null fields in Patch
  12770. // requests.
  12771. NullFields []string `json:"-"`
  12772. }
  12773. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  12774. type NoMethod InstanceMoveRequest
  12775. raw := NoMethod(*s)
  12776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12777. }
  12778. type InstanceProperties struct {
  12779. // AllocationAffinity: The configuration of desired allocations which
  12780. // this Instance could consume capacity from.
  12781. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  12782. // CanIpForward: Enables instances created based on this template to
  12783. // send packets with source IP addresses other than their own and
  12784. // receive packets with destination IP addresses other than their own.
  12785. // If these instances will be used as an IP gateway or it will be set as
  12786. // the next-hop in a Route resource, specify true. If unsure, leave this
  12787. // set to false. See the Enable IP forwarding documentation for more
  12788. // information.
  12789. CanIpForward bool `json:"canIpForward,omitempty"`
  12790. // Description: An optional text description for the instances that are
  12791. // created from this instance template.
  12792. Description string `json:"description,omitempty"`
  12793. // Disks: An array of disks that are associated with the instances that
  12794. // are created from this template.
  12795. Disks []*AttachedDisk `json:"disks,omitempty"`
  12796. // GuestAccelerators: A list of guest accelerator cards' type and count
  12797. // to use for instances created from the instance template.
  12798. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  12799. // Labels: Labels to apply to instances that are created from this
  12800. // template.
  12801. Labels map[string]string `json:"labels,omitempty"`
  12802. // MachineType: The machine type to use for instances that are created
  12803. // from this template.
  12804. MachineType string `json:"machineType,omitempty"`
  12805. // Metadata: The metadata key/value pairs to assign to instances that
  12806. // are created from this template. These pairs can consist of custom
  12807. // metadata or predefined keys. See Project and instance metadata for
  12808. // more information.
  12809. Metadata *Metadata `json:"metadata,omitempty"`
  12810. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  12811. // instance may be scheduled on the specified or newer cpu/platform.
  12812. // Applicable values are the friendly names of CPU platforms, such as
  12813. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  12814. // Bridge". For more information, read Specifying a Minimum CPU
  12815. // Platform.
  12816. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  12817. // NetworkInterfaces: An array of network access configurations for this
  12818. // interface.
  12819. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  12820. // Scheduling: Specifies the scheduling options for the instances that
  12821. // are created from this template.
  12822. Scheduling *Scheduling `json:"scheduling,omitempty"`
  12823. // ServiceAccounts: A list of service accounts with specified scopes.
  12824. // Access tokens for these service accounts are available to the
  12825. // instances that are created from this template. Use metadata queries
  12826. // to obtain the access tokens for these instances.
  12827. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  12828. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  12829. // that are created from this template.
  12830. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  12831. // Tags: A list of tags to apply to the instances that are created from
  12832. // this template. The tags identify valid sources or targets for network
  12833. // firewalls. The setTags method can modify this list of tags. Each tag
  12834. // within the list must comply with RFC1035.
  12835. Tags *Tags `json:"tags,omitempty"`
  12836. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  12837. // to unconditionally include in API requests. By default, fields with
  12838. // empty values are omitted from API requests. However, any non-pointer,
  12839. // non-interface field appearing in ForceSendFields will be sent to the
  12840. // server regardless of whether the field is empty or not. This may be
  12841. // used to include empty fields in Patch requests.
  12842. ForceSendFields []string `json:"-"`
  12843. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  12844. // include in API requests with the JSON null value. By default, fields
  12845. // with empty values are omitted from API requests. However, any field
  12846. // with an empty value appearing in NullFields will be sent to the
  12847. // server as null. It is an error if a field in this list has a
  12848. // non-empty value. This may be used to include null fields in Patch
  12849. // requests.
  12850. NullFields []string `json:"-"`
  12851. }
  12852. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  12853. type NoMethod InstanceProperties
  12854. raw := NoMethod(*s)
  12855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12856. }
  12857. type InstanceReference struct {
  12858. // Instance: The URL for a specific instance.
  12859. Instance string `json:"instance,omitempty"`
  12860. // ForceSendFields is a list of field names (e.g. "Instance") to
  12861. // unconditionally include in API requests. By default, fields with
  12862. // empty values are omitted from API requests. However, any non-pointer,
  12863. // non-interface field appearing in ForceSendFields will be sent to the
  12864. // server regardless of whether the field is empty or not. This may be
  12865. // used to include empty fields in Patch requests.
  12866. ForceSendFields []string `json:"-"`
  12867. // NullFields is a list of field names (e.g. "Instance") to include in
  12868. // API requests with the JSON null value. By default, fields with empty
  12869. // values are omitted from API requests. However, any field with an
  12870. // empty value appearing in NullFields will be sent to the server as
  12871. // null. It is an error if a field in this list has a non-empty value.
  12872. // This may be used to include null fields in Patch requests.
  12873. NullFields []string `json:"-"`
  12874. }
  12875. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  12876. type NoMethod InstanceReference
  12877. raw := NoMethod(*s)
  12878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12879. }
  12880. // InstanceTemplate: An Instance Template resource. (== resource_for
  12881. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  12882. type InstanceTemplate struct {
  12883. // CreationTimestamp: [Output Only] The creation timestamp for this
  12884. // instance template in RFC3339 text format.
  12885. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12886. // Description: An optional description of this resource. Provide this
  12887. // property when you create the resource.
  12888. Description string `json:"description,omitempty"`
  12889. // Id: [Output Only] A unique identifier for this instance template. The
  12890. // server defines this identifier.
  12891. Id uint64 `json:"id,omitempty,string"`
  12892. // Kind: [Output Only] The resource type, which is always
  12893. // compute#instanceTemplate for instance templates.
  12894. Kind string `json:"kind,omitempty"`
  12895. // Name: Name of the resource; provided by the client when the resource
  12896. // is created. The name must be 1-63 characters long, and comply with
  12897. // RFC1035. Specifically, the name must be 1-63 characters long and
  12898. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12899. // the first character must be a lowercase letter, and all following
  12900. // characters must be a dash, lowercase letter, or digit, except the
  12901. // last character, which cannot be a dash.
  12902. Name string `json:"name,omitempty"`
  12903. // Properties: The instance properties for this instance template.
  12904. Properties *InstanceProperties `json:"properties,omitempty"`
  12905. // SelfLink: [Output Only] The URL for this instance template. The
  12906. // server defines this URL.
  12907. SelfLink string `json:"selfLink,omitempty"`
  12908. // SourceInstance: The source instance used to create the template. You
  12909. // can provide this as a partial or full URL to the resource. For
  12910. // example, the following are valid values:
  12911. // -
  12912. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12913. // - projects/project/zones/zone/instances/instance
  12914. SourceInstance string `json:"sourceInstance,omitempty"`
  12915. // SourceInstanceParams: The source instance params to use to create
  12916. // this instance template.
  12917. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  12918. // ServerResponse contains the HTTP response code and headers from the
  12919. // server.
  12920. googleapi.ServerResponse `json:"-"`
  12921. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12922. // to unconditionally include in API requests. By default, fields with
  12923. // empty values are omitted from API requests. However, any non-pointer,
  12924. // non-interface field appearing in ForceSendFields will be sent to the
  12925. // server regardless of whether the field is empty or not. This may be
  12926. // used to include empty fields in Patch requests.
  12927. ForceSendFields []string `json:"-"`
  12928. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12929. // include in API requests with the JSON null value. By default, fields
  12930. // with empty values are omitted from API requests. However, any field
  12931. // with an empty value appearing in NullFields will be sent to the
  12932. // server as null. It is an error if a field in this list has a
  12933. // non-empty value. This may be used to include null fields in Patch
  12934. // requests.
  12935. NullFields []string `json:"-"`
  12936. }
  12937. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  12938. type NoMethod InstanceTemplate
  12939. raw := NoMethod(*s)
  12940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12941. }
  12942. // InstanceTemplateList: A list of instance templates.
  12943. type InstanceTemplateList struct {
  12944. // Id: [Output Only] Unique identifier for the resource; defined by the
  12945. // server.
  12946. Id string `json:"id,omitempty"`
  12947. // Items: A list of InstanceTemplate resources.
  12948. Items []*InstanceTemplate `json:"items,omitempty"`
  12949. // Kind: [Output Only] The resource type, which is always
  12950. // compute#instanceTemplatesListResponse for instance template lists.
  12951. Kind string `json:"kind,omitempty"`
  12952. // NextPageToken: [Output Only] This token allows you to get the next
  12953. // page of results for list requests. If the number of results is larger
  12954. // than maxResults, use the nextPageToken as a value for the query
  12955. // parameter pageToken in the next list request. Subsequent list
  12956. // requests will have their own nextPageToken to continue paging through
  12957. // the results.
  12958. NextPageToken string `json:"nextPageToken,omitempty"`
  12959. // SelfLink: [Output Only] Server-defined URL for this resource.
  12960. SelfLink string `json:"selfLink,omitempty"`
  12961. // Warning: [Output Only] Informational warning message.
  12962. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  12963. // ServerResponse contains the HTTP response code and headers from the
  12964. // server.
  12965. googleapi.ServerResponse `json:"-"`
  12966. // ForceSendFields is a list of field names (e.g. "Id") to
  12967. // unconditionally include in API requests. By default, fields with
  12968. // empty values are omitted from API requests. However, any non-pointer,
  12969. // non-interface field appearing in ForceSendFields will be sent to the
  12970. // server regardless of whether the field is empty or not. This may be
  12971. // used to include empty fields in Patch requests.
  12972. ForceSendFields []string `json:"-"`
  12973. // NullFields is a list of field names (e.g. "Id") to include in API
  12974. // requests with the JSON null value. By default, fields with empty
  12975. // values are omitted from API requests. However, any field with an
  12976. // empty value appearing in NullFields will be sent to the server as
  12977. // null. It is an error if a field in this list has a non-empty value.
  12978. // This may be used to include null fields in Patch requests.
  12979. NullFields []string `json:"-"`
  12980. }
  12981. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  12982. type NoMethod InstanceTemplateList
  12983. raw := NoMethod(*s)
  12984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12985. }
  12986. // InstanceTemplateListWarning: [Output Only] Informational warning
  12987. // message.
  12988. type InstanceTemplateListWarning struct {
  12989. // Code: [Output Only] A warning code, if applicable. For example,
  12990. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12991. // the response.
  12992. //
  12993. // Possible values:
  12994. // "CLEANUP_FAILED"
  12995. // "DEPRECATED_RESOURCE_USED"
  12996. // "DEPRECATED_TYPE_USED"
  12997. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12998. // "EXPERIMENTAL_TYPE_USED"
  12999. // "EXTERNAL_API_WARNING"
  13000. // "FIELD_VALUE_OVERRIDEN"
  13001. // "INJECTED_KERNELS_DEPRECATED"
  13002. // "MISSING_TYPE_DEPENDENCY"
  13003. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13004. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13005. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13006. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13007. // "NEXT_HOP_NOT_RUNNING"
  13008. // "NOT_CRITICAL_ERROR"
  13009. // "NO_RESULTS_ON_PAGE"
  13010. // "REQUIRED_TOS_AGREEMENT"
  13011. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13012. // "RESOURCE_NOT_DELETED"
  13013. // "SCHEMA_VALIDATION_IGNORED"
  13014. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13015. // "UNDECLARED_PROPERTIES"
  13016. // "UNREACHABLE"
  13017. Code string `json:"code,omitempty"`
  13018. // Data: [Output Only] Metadata about this warning in key: value format.
  13019. // For example:
  13020. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13021. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  13022. // Message: [Output Only] A human-readable description of the warning
  13023. // code.
  13024. Message string `json:"message,omitempty"`
  13025. // ForceSendFields is a list of field names (e.g. "Code") to
  13026. // unconditionally include in API requests. By default, fields with
  13027. // empty values are omitted from API requests. However, any non-pointer,
  13028. // non-interface field appearing in ForceSendFields will be sent to the
  13029. // server regardless of whether the field is empty or not. This may be
  13030. // used to include empty fields in Patch requests.
  13031. ForceSendFields []string `json:"-"`
  13032. // NullFields is a list of field names (e.g. "Code") to include in API
  13033. // requests with the JSON null value. By default, fields with empty
  13034. // values are omitted from API requests. However, any field with an
  13035. // empty value appearing in NullFields will be sent to the server as
  13036. // null. It is an error if a field in this list has a non-empty value.
  13037. // This may be used to include null fields in Patch requests.
  13038. NullFields []string `json:"-"`
  13039. }
  13040. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  13041. type NoMethod InstanceTemplateListWarning
  13042. raw := NoMethod(*s)
  13043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13044. }
  13045. type InstanceTemplateListWarningData struct {
  13046. // Key: [Output Only] A key that provides more detail on the warning
  13047. // being returned. For example, for warnings where there are no results
  13048. // in a list request for a particular zone, this key might be scope and
  13049. // the key value might be the zone name. Other examples might be a key
  13050. // indicating a deprecated resource and a suggested replacement, or a
  13051. // warning about invalid network settings (for example, if an instance
  13052. // attempts to perform IP forwarding but is not enabled for IP
  13053. // forwarding).
  13054. Key string `json:"key,omitempty"`
  13055. // Value: [Output Only] A warning data value corresponding to the key.
  13056. Value string `json:"value,omitempty"`
  13057. // ForceSendFields is a list of field names (e.g. "Key") to
  13058. // unconditionally include in API requests. By default, fields with
  13059. // empty values are omitted from API requests. However, any non-pointer,
  13060. // non-interface field appearing in ForceSendFields will be sent to the
  13061. // server regardless of whether the field is empty or not. This may be
  13062. // used to include empty fields in Patch requests.
  13063. ForceSendFields []string `json:"-"`
  13064. // NullFields is a list of field names (e.g. "Key") to include in API
  13065. // requests with the JSON null value. By default, fields with empty
  13066. // values are omitted from API requests. However, any field with an
  13067. // empty value appearing in NullFields will be sent to the server as
  13068. // null. It is an error if a field in this list has a non-empty value.
  13069. // This may be used to include null fields in Patch requests.
  13070. NullFields []string `json:"-"`
  13071. }
  13072. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  13073. type NoMethod InstanceTemplateListWarningData
  13074. raw := NoMethod(*s)
  13075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13076. }
  13077. type InstanceWithNamedPorts struct {
  13078. // Instance: [Output Only] The URL of the instance.
  13079. Instance string `json:"instance,omitempty"`
  13080. // NamedPorts: [Output Only] The named ports that belong to this
  13081. // instance group.
  13082. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  13083. // Status: [Output Only] The status of the instance.
  13084. //
  13085. // Possible values:
  13086. // "PROVISIONING"
  13087. // "RUNNING"
  13088. // "STAGING"
  13089. // "STOPPED"
  13090. // "STOPPING"
  13091. // "SUSPENDED"
  13092. // "SUSPENDING"
  13093. // "TERMINATED"
  13094. Status string `json:"status,omitempty"`
  13095. // ForceSendFields is a list of field names (e.g. "Instance") to
  13096. // unconditionally include in API requests. By default, fields with
  13097. // empty values are omitted from API requests. However, any non-pointer,
  13098. // non-interface field appearing in ForceSendFields will be sent to the
  13099. // server regardless of whether the field is empty or not. This may be
  13100. // used to include empty fields in Patch requests.
  13101. ForceSendFields []string `json:"-"`
  13102. // NullFields is a list of field names (e.g. "Instance") to include in
  13103. // API requests with the JSON null value. By default, fields with empty
  13104. // values are omitted from API requests. However, any field with an
  13105. // empty value appearing in NullFields will be sent to the server as
  13106. // null. It is an error if a field in this list has a non-empty value.
  13107. // This may be used to include null fields in Patch requests.
  13108. NullFields []string `json:"-"`
  13109. }
  13110. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  13111. type NoMethod InstanceWithNamedPorts
  13112. raw := NoMethod(*s)
  13113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13114. }
  13115. type InstancesAddResourcePoliciesRequest struct {
  13116. // ResourcePolicies: Resource policies to be added to this instance.
  13117. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  13118. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  13119. // unconditionally include in API requests. By default, fields with
  13120. // empty values are omitted from API requests. However, any non-pointer,
  13121. // non-interface field appearing in ForceSendFields will be sent to the
  13122. // server regardless of whether the field is empty or not. This may be
  13123. // used to include empty fields in Patch requests.
  13124. ForceSendFields []string `json:"-"`
  13125. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  13126. // include in API requests with the JSON null value. By default, fields
  13127. // with empty values are omitted from API requests. However, any field
  13128. // with an empty value appearing in NullFields will be sent to the
  13129. // server as null. It is an error if a field in this list has a
  13130. // non-empty value. This may be used to include null fields in Patch
  13131. // requests.
  13132. NullFields []string `json:"-"`
  13133. }
  13134. func (s *InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  13135. type NoMethod InstancesAddResourcePoliciesRequest
  13136. raw := NoMethod(*s)
  13137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13138. }
  13139. type InstancesRemoveResourcePoliciesRequest struct {
  13140. // ResourcePolicies: Resource policies to be removed from this instance.
  13141. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  13142. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  13143. // unconditionally include in API requests. By default, fields with
  13144. // empty values are omitted from API requests. However, any non-pointer,
  13145. // non-interface field appearing in ForceSendFields will be sent to the
  13146. // server regardless of whether the field is empty or not. This may be
  13147. // used to include empty fields in Patch requests.
  13148. ForceSendFields []string `json:"-"`
  13149. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  13150. // include in API requests with the JSON null value. By default, fields
  13151. // with empty values are omitted from API requests. However, any field
  13152. // with an empty value appearing in NullFields will be sent to the
  13153. // server as null. It is an error if a field in this list has a
  13154. // non-empty value. This may be used to include null fields in Patch
  13155. // requests.
  13156. NullFields []string `json:"-"`
  13157. }
  13158. func (s *InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  13159. type NoMethod InstancesRemoveResourcePoliciesRequest
  13160. raw := NoMethod(*s)
  13161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13162. }
  13163. type InstancesResumeRequest struct {
  13164. // Disks: Array of disks associated with this instance that are
  13165. // protected with a customer-supplied encryption key.
  13166. //
  13167. // In order to resume the instance, the disk url and its corresponding
  13168. // key must be provided.
  13169. //
  13170. // If the disk is not protected with a customer-supplied encryption key
  13171. // it should not be specified.
  13172. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  13173. // InstanceEncryptionKey: Decrypts data associated with an instance that
  13174. // is protected with a customer-supplied encryption key.
  13175. //
  13176. // If the instance you are starting is protected with a
  13177. // customer-supplied encryption key, the correct key must be provided
  13178. // otherwise the instance resume will not succeed.
  13179. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  13180. // ForceSendFields is a list of field names (e.g. "Disks") to
  13181. // unconditionally include in API requests. By default, fields with
  13182. // empty values are omitted from API requests. However, any non-pointer,
  13183. // non-interface field appearing in ForceSendFields will be sent to the
  13184. // server regardless of whether the field is empty or not. This may be
  13185. // used to include empty fields in Patch requests.
  13186. ForceSendFields []string `json:"-"`
  13187. // NullFields is a list of field names (e.g. "Disks") to include in API
  13188. // requests with the JSON null value. By default, fields with empty
  13189. // values are omitted from API requests. However, any field with an
  13190. // empty value appearing in NullFields will be sent to the server as
  13191. // null. It is an error if a field in this list has a non-empty value.
  13192. // This may be used to include null fields in Patch requests.
  13193. NullFields []string `json:"-"`
  13194. }
  13195. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  13196. type NoMethod InstancesResumeRequest
  13197. raw := NoMethod(*s)
  13198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13199. }
  13200. type InstancesScopedList struct {
  13201. // Instances: [Output Only] A list of instances contained in this scope.
  13202. Instances []*Instance `json:"instances,omitempty"`
  13203. // Warning: [Output Only] Informational warning which replaces the list
  13204. // of instances when the list is empty.
  13205. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  13206. // ForceSendFields is a list of field names (e.g. "Instances") to
  13207. // unconditionally include in API requests. By default, fields with
  13208. // empty values are omitted from API requests. However, any non-pointer,
  13209. // non-interface field appearing in ForceSendFields will be sent to the
  13210. // server regardless of whether the field is empty or not. This may be
  13211. // used to include empty fields in Patch requests.
  13212. ForceSendFields []string `json:"-"`
  13213. // NullFields is a list of field names (e.g. "Instances") to include in
  13214. // API requests with the JSON null value. By default, fields with empty
  13215. // values are omitted from API requests. However, any field with an
  13216. // empty value appearing in NullFields will be sent to the server as
  13217. // null. It is an error if a field in this list has a non-empty value.
  13218. // This may be used to include null fields in Patch requests.
  13219. NullFields []string `json:"-"`
  13220. }
  13221. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  13222. type NoMethod InstancesScopedList
  13223. raw := NoMethod(*s)
  13224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13225. }
  13226. // InstancesScopedListWarning: [Output Only] Informational warning which
  13227. // replaces the list of instances when the list is empty.
  13228. type InstancesScopedListWarning struct {
  13229. // Code: [Output Only] A warning code, if applicable. For example,
  13230. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13231. // the response.
  13232. //
  13233. // Possible values:
  13234. // "CLEANUP_FAILED"
  13235. // "DEPRECATED_RESOURCE_USED"
  13236. // "DEPRECATED_TYPE_USED"
  13237. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13238. // "EXPERIMENTAL_TYPE_USED"
  13239. // "EXTERNAL_API_WARNING"
  13240. // "FIELD_VALUE_OVERRIDEN"
  13241. // "INJECTED_KERNELS_DEPRECATED"
  13242. // "MISSING_TYPE_DEPENDENCY"
  13243. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13244. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13245. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13246. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13247. // "NEXT_HOP_NOT_RUNNING"
  13248. // "NOT_CRITICAL_ERROR"
  13249. // "NO_RESULTS_ON_PAGE"
  13250. // "REQUIRED_TOS_AGREEMENT"
  13251. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13252. // "RESOURCE_NOT_DELETED"
  13253. // "SCHEMA_VALIDATION_IGNORED"
  13254. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13255. // "UNDECLARED_PROPERTIES"
  13256. // "UNREACHABLE"
  13257. Code string `json:"code,omitempty"`
  13258. // Data: [Output Only] Metadata about this warning in key: value format.
  13259. // For example:
  13260. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13261. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  13262. // Message: [Output Only] A human-readable description of the warning
  13263. // code.
  13264. Message string `json:"message,omitempty"`
  13265. // ForceSendFields is a list of field names (e.g. "Code") to
  13266. // unconditionally include in API requests. By default, fields with
  13267. // empty values are omitted from API requests. However, any non-pointer,
  13268. // non-interface field appearing in ForceSendFields will be sent to the
  13269. // server regardless of whether the field is empty or not. This may be
  13270. // used to include empty fields in Patch requests.
  13271. ForceSendFields []string `json:"-"`
  13272. // NullFields is a list of field names (e.g. "Code") to include in API
  13273. // requests with the JSON null value. By default, fields with empty
  13274. // values are omitted from API requests. However, any field with an
  13275. // empty value appearing in NullFields will be sent to the server as
  13276. // null. It is an error if a field in this list has a non-empty value.
  13277. // This may be used to include null fields in Patch requests.
  13278. NullFields []string `json:"-"`
  13279. }
  13280. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  13281. type NoMethod InstancesScopedListWarning
  13282. raw := NoMethod(*s)
  13283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13284. }
  13285. type InstancesScopedListWarningData struct {
  13286. // Key: [Output Only] A key that provides more detail on the warning
  13287. // being returned. For example, for warnings where there are no results
  13288. // in a list request for a particular zone, this key might be scope and
  13289. // the key value might be the zone name. Other examples might be a key
  13290. // indicating a deprecated resource and a suggested replacement, or a
  13291. // warning about invalid network settings (for example, if an instance
  13292. // attempts to perform IP forwarding but is not enabled for IP
  13293. // forwarding).
  13294. Key string `json:"key,omitempty"`
  13295. // Value: [Output Only] A warning data value corresponding to the key.
  13296. Value string `json:"value,omitempty"`
  13297. // ForceSendFields is a list of field names (e.g. "Key") to
  13298. // unconditionally include in API requests. By default, fields with
  13299. // empty values are omitted from API requests. However, any non-pointer,
  13300. // non-interface field appearing in ForceSendFields will be sent to the
  13301. // server regardless of whether the field is empty or not. This may be
  13302. // used to include empty fields in Patch requests.
  13303. ForceSendFields []string `json:"-"`
  13304. // NullFields is a list of field names (e.g. "Key") to include in API
  13305. // requests with the JSON null value. By default, fields with empty
  13306. // values are omitted from API requests. However, any field with an
  13307. // empty value appearing in NullFields will be sent to the server as
  13308. // null. It is an error if a field in this list has a non-empty value.
  13309. // This may be used to include null fields in Patch requests.
  13310. NullFields []string `json:"-"`
  13311. }
  13312. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  13313. type NoMethod InstancesScopedListWarningData
  13314. raw := NoMethod(*s)
  13315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13316. }
  13317. type InstancesSetLabelsRequest struct {
  13318. // LabelFingerprint: Fingerprint of the previous set of labels for this
  13319. // resource, used to prevent conflicts. Provide the latest fingerprint
  13320. // value when making a request to add or change labels.
  13321. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13322. Labels map[string]string `json:"labels,omitempty"`
  13323. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  13324. // unconditionally include in API requests. By default, fields with
  13325. // empty values are omitted from API requests. However, any non-pointer,
  13326. // non-interface field appearing in ForceSendFields will be sent to the
  13327. // server regardless of whether the field is empty or not. This may be
  13328. // used to include empty fields in Patch requests.
  13329. ForceSendFields []string `json:"-"`
  13330. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  13331. // include in API requests with the JSON null value. By default, fields
  13332. // with empty values are omitted from API requests. However, any field
  13333. // with an empty value appearing in NullFields will be sent to the
  13334. // server as null. It is an error if a field in this list has a
  13335. // non-empty value. This may be used to include null fields in Patch
  13336. // requests.
  13337. NullFields []string `json:"-"`
  13338. }
  13339. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  13340. type NoMethod InstancesSetLabelsRequest
  13341. raw := NoMethod(*s)
  13342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13343. }
  13344. type InstancesSetMachineResourcesRequest struct {
  13345. // GuestAccelerators: A list of the type and count of accelerator cards
  13346. // attached to the instance.
  13347. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  13348. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  13349. // to unconditionally include in API requests. By default, fields with
  13350. // empty values are omitted from API requests. However, any non-pointer,
  13351. // non-interface field appearing in ForceSendFields will be sent to the
  13352. // server regardless of whether the field is empty or not. This may be
  13353. // used to include empty fields in Patch requests.
  13354. ForceSendFields []string `json:"-"`
  13355. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  13356. // include in API requests with the JSON null value. By default, fields
  13357. // with empty values are omitted from API requests. However, any field
  13358. // with an empty value appearing in NullFields will be sent to the
  13359. // server as null. It is an error if a field in this list has a
  13360. // non-empty value. This may be used to include null fields in Patch
  13361. // requests.
  13362. NullFields []string `json:"-"`
  13363. }
  13364. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  13365. type NoMethod InstancesSetMachineResourcesRequest
  13366. raw := NoMethod(*s)
  13367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13368. }
  13369. type InstancesSetMachineTypeRequest struct {
  13370. // MachineType: Full or partial URL of the machine type resource. See
  13371. // Machine Types for a full list of machine types. For example:
  13372. // zones/us-central1-f/machineTypes/n1-standard-1
  13373. MachineType string `json:"machineType,omitempty"`
  13374. // ForceSendFields is a list of field names (e.g. "MachineType") to
  13375. // unconditionally include in API requests. By default, fields with
  13376. // empty values are omitted from API requests. However, any non-pointer,
  13377. // non-interface field appearing in ForceSendFields will be sent to the
  13378. // server regardless of whether the field is empty or not. This may be
  13379. // used to include empty fields in Patch requests.
  13380. ForceSendFields []string `json:"-"`
  13381. // NullFields is a list of field names (e.g. "MachineType") to include
  13382. // in API requests with the JSON null value. By default, fields with
  13383. // empty values are omitted from API requests. However, any field with
  13384. // an empty value appearing in NullFields will be sent to the server as
  13385. // null. It is an error if a field in this list has a non-empty value.
  13386. // This may be used to include null fields in Patch requests.
  13387. NullFields []string `json:"-"`
  13388. }
  13389. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  13390. type NoMethod InstancesSetMachineTypeRequest
  13391. raw := NoMethod(*s)
  13392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13393. }
  13394. type InstancesSetMinCpuPlatformRequest struct {
  13395. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  13396. // at.
  13397. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  13398. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  13399. // unconditionally include in API requests. By default, fields with
  13400. // empty values are omitted from API requests. However, any non-pointer,
  13401. // non-interface field appearing in ForceSendFields will be sent to the
  13402. // server regardless of whether the field is empty or not. This may be
  13403. // used to include empty fields in Patch requests.
  13404. ForceSendFields []string `json:"-"`
  13405. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  13406. // include in API requests with the JSON null value. By default, fields
  13407. // with empty values are omitted from API requests. However, any field
  13408. // with an empty value appearing in NullFields will be sent to the
  13409. // server as null. It is an error if a field in this list has a
  13410. // non-empty value. This may be used to include null fields in Patch
  13411. // requests.
  13412. NullFields []string `json:"-"`
  13413. }
  13414. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  13415. type NoMethod InstancesSetMinCpuPlatformRequest
  13416. raw := NoMethod(*s)
  13417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13418. }
  13419. type InstancesSetServiceAccountRequest struct {
  13420. // Email: Email address of the service account.
  13421. Email string `json:"email,omitempty"`
  13422. // Scopes: The list of scopes to be made available for this service
  13423. // account.
  13424. Scopes []string `json:"scopes,omitempty"`
  13425. // ForceSendFields is a list of field names (e.g. "Email") to
  13426. // unconditionally include in API requests. By default, fields with
  13427. // empty values are omitted from API requests. However, any non-pointer,
  13428. // non-interface field appearing in ForceSendFields will be sent to the
  13429. // server regardless of whether the field is empty or not. This may be
  13430. // used to include empty fields in Patch requests.
  13431. ForceSendFields []string `json:"-"`
  13432. // NullFields is a list of field names (e.g. "Email") to include in API
  13433. // requests with the JSON null value. By default, fields with empty
  13434. // values are omitted from API requests. However, any field with an
  13435. // empty value appearing in NullFields will be sent to the server as
  13436. // null. It is an error if a field in this list has a non-empty value.
  13437. // This may be used to include null fields in Patch requests.
  13438. NullFields []string `json:"-"`
  13439. }
  13440. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  13441. type NoMethod InstancesSetServiceAccountRequest
  13442. raw := NoMethod(*s)
  13443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13444. }
  13445. type InstancesStartWithEncryptionKeyRequest struct {
  13446. // Disks: Array of disks associated with this instance that are
  13447. // protected with a customer-supplied encryption key.
  13448. //
  13449. // In order to start the instance, the disk url and its corresponding
  13450. // key must be provided.
  13451. //
  13452. // If the disk is not protected with a customer-supplied encryption key
  13453. // it should not be specified.
  13454. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  13455. // InstanceEncryptionKey: Decrypts data associated with an instance that
  13456. // is protected with a customer-supplied encryption key.
  13457. //
  13458. // If the instance you are starting is protected with a
  13459. // customer-supplied encryption key, the correct key must be provided
  13460. // otherwise the instance start will not succeed.
  13461. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  13462. // ForceSendFields is a list of field names (e.g. "Disks") to
  13463. // unconditionally include in API requests. By default, fields with
  13464. // empty values are omitted from API requests. However, any non-pointer,
  13465. // non-interface field appearing in ForceSendFields will be sent to the
  13466. // server regardless of whether the field is empty or not. This may be
  13467. // used to include empty fields in Patch requests.
  13468. ForceSendFields []string `json:"-"`
  13469. // NullFields is a list of field names (e.g. "Disks") to include in API
  13470. // requests with the JSON null value. By default, fields with empty
  13471. // values are omitted from API requests. However, any field with an
  13472. // empty value appearing in NullFields will be sent to the server as
  13473. // null. It is an error if a field in this list has a non-empty value.
  13474. // This may be used to include null fields in Patch requests.
  13475. NullFields []string `json:"-"`
  13476. }
  13477. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  13478. type NoMethod InstancesStartWithEncryptionKeyRequest
  13479. raw := NoMethod(*s)
  13480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13481. }
  13482. // Interconnect: Represents an Interconnects resource. The Interconnects
  13483. // resource is a dedicated connection between Google's network and your
  13484. // on-premises network. For more information, see the Dedicated
  13485. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  13486. // beta.interconnects ==)
  13487. type Interconnect struct {
  13488. // AdminEnabled: Administrative status of the interconnect. When this is
  13489. // set to true, the Interconnect is functional and can carry traffic.
  13490. // When set to false, no packets can be carried over the interconnect
  13491. // and no BGP routes are exchanged over it. By default, the status is
  13492. // set to true.
  13493. AdminEnabled bool `json:"adminEnabled,omitempty"`
  13494. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  13495. // describe the individual circuits in this LAG.
  13496. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  13497. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13498. // format.
  13499. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13500. // CustomerName: Customer name, to put in the Letter of Authorization as
  13501. // the party authorized to request a crossconnect.
  13502. CustomerName string `json:"customerName,omitempty"`
  13503. // Description: An optional description of this resource. Provide this
  13504. // property when you create the resource.
  13505. Description string `json:"description,omitempty"`
  13506. // ExpectedOutages: [Output Only] A list of outages expected for this
  13507. // Interconnect.
  13508. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  13509. // GoogleIpAddress: [Output Only] IP address configured on the Google
  13510. // side of the Interconnect link. This can be used only for ping tests.
  13511. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  13512. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  13513. // raising support tickets with Google or otherwise to debug backend
  13514. // connectivity issues.
  13515. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  13516. // Id: [Output Only] The unique identifier for the resource. This
  13517. // identifier is defined by the server.
  13518. Id uint64 `json:"id,omitempty,string"`
  13519. // InterconnectAttachments: [Output Only] A list of the URLs of all
  13520. // InterconnectAttachments configured to use this Interconnect.
  13521. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  13522. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  13523. // been deprecated in favor of "DEDICATED"
  13524. //
  13525. // Possible values:
  13526. // "DEDICATED"
  13527. // "IT_PRIVATE"
  13528. // "PARTNER"
  13529. InterconnectType string `json:"interconnectType,omitempty"`
  13530. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  13531. // for interconnects.
  13532. Kind string `json:"kind,omitempty"`
  13533. // LabelFingerprint: A fingerprint for the labels being applied to this
  13534. // Interconnect, which is essentially a hash of the labels set used for
  13535. // optimistic locking. The fingerprint is initially generated by Compute
  13536. // Engine and changes after every request to modify or update labels.
  13537. // You must always provide an up-to-date fingerprint hash in order to
  13538. // update or change labels, otherwise the request will fail with error
  13539. // 412 conditionNotMet.
  13540. //
  13541. // To see the latest fingerprint, make a get() request to retrieve an
  13542. // Interconnect.
  13543. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13544. // Labels: Labels to apply to this Interconnect resource. These can be
  13545. // later modified by the setLabels method. Each label key/value must
  13546. // comply with RFC1035. Label values may be empty.
  13547. Labels map[string]string `json:"labels,omitempty"`
  13548. // LinkType: Type of link requested. This field indicates speed of each
  13549. // of the links in the bundle, not the entire bundle. Only 10G per link
  13550. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  13551. //
  13552. // Possible values:
  13553. // "LINK_TYPE_ETHERNET_10G_LR"
  13554. LinkType string `json:"linkType,omitempty"`
  13555. // Location: URL of the InterconnectLocation object that represents
  13556. // where this connection is to be provisioned.
  13557. Location string `json:"location,omitempty"`
  13558. // Name: Name of the resource. Provided by the client when the resource
  13559. // is created. The name must be 1-63 characters long, and comply with
  13560. // RFC1035. Specifically, the name must be 1-63 characters long and
  13561. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13562. // the first character must be a lowercase letter, and all following
  13563. // characters must be a dash, lowercase letter, or digit, except the
  13564. // last character, which cannot be a dash.
  13565. Name string `json:"name,omitempty"`
  13566. // NocContactEmail: Email address to contact the customer NOC for
  13567. // operations and maintenance notifications regarding this Interconnect.
  13568. // If specified, this will be used for notifications in addition to all
  13569. // other forms described, such as Stackdriver logs alerting and Cloud
  13570. // Notifications.
  13571. NocContactEmail string `json:"nocContactEmail,omitempty"`
  13572. // OperationalStatus: [Output Only] The current status of whether or not
  13573. // this Interconnect is functional.
  13574. //
  13575. // Possible values:
  13576. // "OS_ACTIVE"
  13577. // "OS_UNPROVISIONED"
  13578. OperationalStatus string `json:"operationalStatus,omitempty"`
  13579. // PeerIpAddress: [Output Only] IP address configured on the customer
  13580. // side of the Interconnect link. The customer should configure this IP
  13581. // address during turnup when prompted by Google NOC. This can be used
  13582. // only for ping tests.
  13583. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  13584. // ProvisionedLinkCount: [Output Only] Number of links actually
  13585. // provisioned in this interconnect.
  13586. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  13587. // RequestedLinkCount: Target number of physical links in the link
  13588. // bundle, as requested by the customer.
  13589. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  13590. // SelfLink: [Output Only] Server-defined URL for the resource.
  13591. SelfLink string `json:"selfLink,omitempty"`
  13592. // State: [Output Only] The current state of whether or not this
  13593. // Interconnect is functional.
  13594. //
  13595. // Possible values:
  13596. // "ACTIVE"
  13597. // "UNPROVISIONED"
  13598. State string `json:"state,omitempty"`
  13599. // ServerResponse contains the HTTP response code and headers from the
  13600. // server.
  13601. googleapi.ServerResponse `json:"-"`
  13602. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  13603. // unconditionally include in API requests. By default, fields with
  13604. // empty values are omitted from API requests. However, any non-pointer,
  13605. // non-interface field appearing in ForceSendFields will be sent to the
  13606. // server regardless of whether the field is empty or not. This may be
  13607. // used to include empty fields in Patch requests.
  13608. ForceSendFields []string `json:"-"`
  13609. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  13610. // in API requests with the JSON null value. By default, fields with
  13611. // empty values are omitted from API requests. However, any field with
  13612. // an empty value appearing in NullFields will be sent to the server as
  13613. // null. It is an error if a field in this list has a non-empty value.
  13614. // This may be used to include null fields in Patch requests.
  13615. NullFields []string `json:"-"`
  13616. }
  13617. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  13618. type NoMethod Interconnect
  13619. raw := NoMethod(*s)
  13620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13621. }
  13622. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  13623. // attachment) resource. For more information, see Creating VLAN
  13624. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  13625. // resource_for v1.interconnectAttachments ==)
  13626. type InterconnectAttachment struct {
  13627. // AdminEnabled: Determines whether this Attachment will carry packets.
  13628. // Not present for PARTNER_PROVIDER.
  13629. AdminEnabled bool `json:"adminEnabled,omitempty"`
  13630. // Bandwidth: Provisioned bandwidth capacity for the
  13631. // interconnectAttachment. Can be set by the partner to update the
  13632. // customer's provisioned bandwidth. Output only for PARTNER type,
  13633. // mutable for PARTNER_PROVIDER and DEDICATED.
  13634. //
  13635. // Possible values:
  13636. // "BPS_100M"
  13637. // "BPS_10G"
  13638. // "BPS_1G"
  13639. // "BPS_200M"
  13640. // "BPS_2G"
  13641. // "BPS_300M"
  13642. // "BPS_400M"
  13643. // "BPS_500M"
  13644. // "BPS_50M"
  13645. // "BPS_5G"
  13646. Bandwidth string `json:"bandwidth,omitempty"`
  13647. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  13648. // restrict the allocation of cloudRouterIpAddress and
  13649. // customerRouterIpAddress for this attachment. All prefixes must be
  13650. // within link-local address space (169.254.0.0/16) and must be /29 or
  13651. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  13652. // from the supplied candidate prefix(es). The request will fail if all
  13653. // possible /29s are in use on Google?s edge. If not supplied, Google
  13654. // will randomly select an unused /29 from all of link-local space.
  13655. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  13656. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  13657. // be configured on Cloud Router Interface for this interconnect
  13658. // attachment.
  13659. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  13660. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13661. // format.
  13662. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13663. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  13664. // to be configured on the customer router subinterface for this
  13665. // interconnect attachment.
  13666. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  13667. // Description: An optional description of this resource.
  13668. Description string `json:"description,omitempty"`
  13669. // EdgeAvailabilityDomain: Desired availability domain for the
  13670. // attachment. Only available for type PARTNER, at creation time. For
  13671. // improved reliability, customers should configure a pair of
  13672. // attachments with one per availability domain. The selected
  13673. // availability domain will be provided to the Partner via the pairing
  13674. // key so that the provisioned circuit will lie in the specified domain.
  13675. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  13676. //
  13677. // Possible values:
  13678. // "AVAILABILITY_DOMAIN_1"
  13679. // "AVAILABILITY_DOMAIN_2"
  13680. // "AVAILABILITY_DOMAIN_ANY"
  13681. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  13682. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  13683. // raising support tickets with Google or otherwise to debug backend
  13684. // connectivity issues.
  13685. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  13686. // Id: [Output Only] The unique identifier for the resource. This
  13687. // identifier is defined by the server.
  13688. Id uint64 `json:"id,omitempty,string"`
  13689. // Interconnect: URL of the underlying Interconnect object that this
  13690. // attachment's traffic will traverse through.
  13691. Interconnect string `json:"interconnect,omitempty"`
  13692. // Kind: [Output Only] Type of the resource. Always
  13693. // compute#interconnectAttachment for interconnect attachments.
  13694. Kind string `json:"kind,omitempty"`
  13695. // LabelFingerprint: A fingerprint for the labels being applied to this
  13696. // InterconnectAttachment, which is essentially a hash of the labels set
  13697. // used for optimistic locking. The fingerprint is initially generated
  13698. // by Compute Engine and changes after every request to modify or update
  13699. // labels. You must always provide an up-to-date fingerprint hash in
  13700. // order to update or change labels, otherwise the request will fail
  13701. // with error 412 conditionNotMet.
  13702. //
  13703. // To see the latest fingerprint, make a get() request to retrieve an
  13704. // InterconnectAttachment.
  13705. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13706. // Labels: Labels to apply to this InterconnectAttachment resource.
  13707. // These can be later modified by the setLabels method. Each label
  13708. // key/value must comply with RFC1035. Label values may be empty.
  13709. Labels map[string]string `json:"labels,omitempty"`
  13710. // Name: Name of the resource. Provided by the client when the resource
  13711. // is created. The name must be 1-63 characters long, and comply with
  13712. // RFC1035. Specifically, the name must be 1-63 characters long and
  13713. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13714. // the first character must be a lowercase letter, and all following
  13715. // characters must be a dash, lowercase letter, or digit, except the
  13716. // last character, which cannot be a dash.
  13717. Name string `json:"name,omitempty"`
  13718. // OperationalStatus: [Output Only] The current status of whether or not
  13719. // this interconnect attachment is functional.
  13720. //
  13721. // Possible values:
  13722. // "OS_ACTIVE"
  13723. // "OS_UNPROVISIONED"
  13724. OperationalStatus string `json:"operationalStatus,omitempty"`
  13725. // PairingKey: [Output only for type PARTNER. Input only for
  13726. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  13727. // of an PARTNER attachment used to initiate provisioning with a
  13728. // selected partner. Of the form "XXXXX/region/domain"
  13729. PairingKey string `json:"pairingKey,omitempty"`
  13730. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  13731. // by a layer 3 Partner if they configured BGP on behalf of the
  13732. // customer. Output only for PARTNER type, input only for
  13733. // PARTNER_PROVIDER, not available for DEDICATED.
  13734. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  13735. // PartnerMetadata: Informational metadata about Partner attachments
  13736. // from Partners to display to customers. Output only for for PARTNER
  13737. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  13738. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  13739. // PrivateInterconnectInfo: [Output Only] Information specific to an
  13740. // InterconnectAttachment. This property is populated if the
  13741. // interconnect that this is attached to is of type DEDICATED.
  13742. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  13743. // Region: [Output Only] URL of the region where the regional
  13744. // interconnect attachment resides. You must specify this field as part
  13745. // of the HTTP request URL. It is not settable as a field in the request
  13746. // body.
  13747. Region string `json:"region,omitempty"`
  13748. // Router: URL of the Cloud Router to be used for dynamic routing. This
  13749. // router must be in the same region as this InterconnectAttachment. The
  13750. // InterconnectAttachment will automatically connect the Interconnect to
  13751. // the network & region within which the Cloud Router is configured.
  13752. Router string `json:"router,omitempty"`
  13753. // SelfLink: [Output Only] Server-defined URL for the resource.
  13754. SelfLink string `json:"selfLink,omitempty"`
  13755. // State: [Output Only] The current state of this attachment's
  13756. // functionality.
  13757. //
  13758. // Possible values:
  13759. // "ACTIVE"
  13760. // "DEFUNCT"
  13761. // "PARTNER_REQUEST_RECEIVED"
  13762. // "PENDING_CUSTOMER"
  13763. // "PENDING_PARTNER"
  13764. // "STATE_UNSPECIFIED"
  13765. // "UNPROVISIONED"
  13766. State string `json:"state,omitempty"`
  13767. // Possible values:
  13768. // "DEDICATED"
  13769. // "PARTNER"
  13770. // "PARTNER_PROVIDER"
  13771. Type string `json:"type,omitempty"`
  13772. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  13773. // range 2-4094. Only specified at creation time.
  13774. VlanTag8021q int64 `json:"vlanTag8021q,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. "AdminEnabled") 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. "AdminEnabled") to include
  13786. // in API requests with the JSON null value. By default, fields with
  13787. // empty values are omitted from API requests. However, any field with
  13788. // an 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 *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  13794. type NoMethod InterconnectAttachment
  13795. raw := NoMethod(*s)
  13796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13797. }
  13798. type InterconnectAttachmentAggregatedList struct {
  13799. // Id: [Output Only] Unique identifier for the resource; defined by the
  13800. // server.
  13801. Id string `json:"id,omitempty"`
  13802. // Items: A list of InterconnectAttachmentsScopedList resources.
  13803. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  13804. // Kind: [Output Only] Type of resource. Always
  13805. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  13806. // interconnect attachments.
  13807. Kind string `json:"kind,omitempty"`
  13808. // NextPageToken: [Output Only] This token allows you to get the next
  13809. // page of results for list requests. If the number of results is larger
  13810. // than maxResults, use the nextPageToken as a value for the query
  13811. // parameter pageToken in the next list request. Subsequent list
  13812. // requests will have their own nextPageToken to continue paging through
  13813. // the results.
  13814. NextPageToken string `json:"nextPageToken,omitempty"`
  13815. // SelfLink: [Output Only] Server-defined URL for this resource.
  13816. SelfLink string `json:"selfLink,omitempty"`
  13817. // Warning: [Output Only] Informational warning message.
  13818. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  13819. // ServerResponse contains the HTTP response code and headers from the
  13820. // server.
  13821. googleapi.ServerResponse `json:"-"`
  13822. // ForceSendFields is a list of field names (e.g. "Id") to
  13823. // unconditionally include in API requests. By default, fields with
  13824. // empty values are omitted from API requests. However, any non-pointer,
  13825. // non-interface field appearing in ForceSendFields will be sent to the
  13826. // server regardless of whether the field is empty or not. This may be
  13827. // used to include empty fields in Patch requests.
  13828. ForceSendFields []string `json:"-"`
  13829. // NullFields is a list of field names (e.g. "Id") to include in API
  13830. // requests with the JSON null value. By default, fields with empty
  13831. // values are omitted from API requests. However, any field with an
  13832. // empty value appearing in NullFields will be sent to the server as
  13833. // null. It is an error if a field in this list has a non-empty value.
  13834. // This may be used to include null fields in Patch requests.
  13835. NullFields []string `json:"-"`
  13836. }
  13837. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  13838. type NoMethod InterconnectAttachmentAggregatedList
  13839. raw := NoMethod(*s)
  13840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13841. }
  13842. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  13843. // Informational warning message.
  13844. type InterconnectAttachmentAggregatedListWarning struct {
  13845. // Code: [Output Only] A warning code, if applicable. For example,
  13846. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13847. // the response.
  13848. //
  13849. // Possible values:
  13850. // "CLEANUP_FAILED"
  13851. // "DEPRECATED_RESOURCE_USED"
  13852. // "DEPRECATED_TYPE_USED"
  13853. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13854. // "EXPERIMENTAL_TYPE_USED"
  13855. // "EXTERNAL_API_WARNING"
  13856. // "FIELD_VALUE_OVERRIDEN"
  13857. // "INJECTED_KERNELS_DEPRECATED"
  13858. // "MISSING_TYPE_DEPENDENCY"
  13859. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13860. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13861. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13862. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13863. // "NEXT_HOP_NOT_RUNNING"
  13864. // "NOT_CRITICAL_ERROR"
  13865. // "NO_RESULTS_ON_PAGE"
  13866. // "REQUIRED_TOS_AGREEMENT"
  13867. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13868. // "RESOURCE_NOT_DELETED"
  13869. // "SCHEMA_VALIDATION_IGNORED"
  13870. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13871. // "UNDECLARED_PROPERTIES"
  13872. // "UNREACHABLE"
  13873. Code string `json:"code,omitempty"`
  13874. // Data: [Output Only] Metadata about this warning in key: value format.
  13875. // For example:
  13876. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13877. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  13878. // Message: [Output Only] A human-readable description of the warning
  13879. // code.
  13880. Message string `json:"message,omitempty"`
  13881. // ForceSendFields is a list of field names (e.g. "Code") to
  13882. // unconditionally include in API requests. By default, fields with
  13883. // empty values are omitted from API requests. However, any non-pointer,
  13884. // non-interface field appearing in ForceSendFields will be sent to the
  13885. // server regardless of whether the field is empty or not. This may be
  13886. // used to include empty fields in Patch requests.
  13887. ForceSendFields []string `json:"-"`
  13888. // NullFields is a list of field names (e.g. "Code") to include in API
  13889. // requests with the JSON null value. By default, fields with empty
  13890. // values are omitted from API requests. However, any field with an
  13891. // empty value appearing in NullFields will be sent to the server as
  13892. // null. It is an error if a field in this list has a non-empty value.
  13893. // This may be used to include null fields in Patch requests.
  13894. NullFields []string `json:"-"`
  13895. }
  13896. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13897. type NoMethod InterconnectAttachmentAggregatedListWarning
  13898. raw := NoMethod(*s)
  13899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13900. }
  13901. type InterconnectAttachmentAggregatedListWarningData struct {
  13902. // Key: [Output Only] A key that provides more detail on the warning
  13903. // being returned. For example, for warnings where there are no results
  13904. // in a list request for a particular zone, this key might be scope and
  13905. // the key value might be the zone name. Other examples might be a key
  13906. // indicating a deprecated resource and a suggested replacement, or a
  13907. // warning about invalid network settings (for example, if an instance
  13908. // attempts to perform IP forwarding but is not enabled for IP
  13909. // forwarding).
  13910. Key string `json:"key,omitempty"`
  13911. // Value: [Output Only] A warning data value corresponding to the key.
  13912. Value string `json:"value,omitempty"`
  13913. // ForceSendFields is a list of field names (e.g. "Key") to
  13914. // unconditionally include in API requests. By default, fields with
  13915. // empty values are omitted from API requests. However, any non-pointer,
  13916. // non-interface field appearing in ForceSendFields will be sent to the
  13917. // server regardless of whether the field is empty or not. This may be
  13918. // used to include empty fields in Patch requests.
  13919. ForceSendFields []string `json:"-"`
  13920. // NullFields is a list of field names (e.g. "Key") to include in API
  13921. // requests with the JSON null value. By default, fields with empty
  13922. // values are omitted from API requests. However, any field with an
  13923. // empty value appearing in NullFields will be sent to the server as
  13924. // null. It is an error if a field in this list has a non-empty value.
  13925. // This may be used to include null fields in Patch requests.
  13926. NullFields []string `json:"-"`
  13927. }
  13928. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13929. type NoMethod InterconnectAttachmentAggregatedListWarningData
  13930. raw := NoMethod(*s)
  13931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13932. }
  13933. // InterconnectAttachmentList: Response to the list request, and
  13934. // contains a list of interconnect attachments.
  13935. type InterconnectAttachmentList struct {
  13936. // Id: [Output Only] Unique identifier for the resource; defined by the
  13937. // server.
  13938. Id string `json:"id,omitempty"`
  13939. // Items: A list of InterconnectAttachment resources.
  13940. Items []*InterconnectAttachment `json:"items,omitempty"`
  13941. // Kind: [Output Only] Type of resource. Always
  13942. // compute#interconnectAttachmentList for lists of interconnect
  13943. // attachments.
  13944. Kind string `json:"kind,omitempty"`
  13945. // NextPageToken: [Output Only] This token allows you to get the next
  13946. // page of results for list requests. If the number of results is larger
  13947. // than maxResults, use the nextPageToken as a value for the query
  13948. // parameter pageToken in the next list request. Subsequent list
  13949. // requests will have their own nextPageToken to continue paging through
  13950. // the results.
  13951. NextPageToken string `json:"nextPageToken,omitempty"`
  13952. // SelfLink: [Output Only] Server-defined URL for this resource.
  13953. SelfLink string `json:"selfLink,omitempty"`
  13954. // Warning: [Output Only] Informational warning message.
  13955. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  13956. // ServerResponse contains the HTTP response code and headers from the
  13957. // server.
  13958. googleapi.ServerResponse `json:"-"`
  13959. // ForceSendFields is a list of field names (e.g. "Id") to
  13960. // unconditionally include in API requests. By default, fields with
  13961. // empty values are omitted from API requests. However, any non-pointer,
  13962. // non-interface field appearing in ForceSendFields will be sent to the
  13963. // server regardless of whether the field is empty or not. This may be
  13964. // used to include empty fields in Patch requests.
  13965. ForceSendFields []string `json:"-"`
  13966. // NullFields is a list of field names (e.g. "Id") to include in API
  13967. // requests with the JSON null value. By default, fields with empty
  13968. // values are omitted from API requests. However, any field with an
  13969. // empty value appearing in NullFields will be sent to the server as
  13970. // null. It is an error if a field in this list has a non-empty value.
  13971. // This may be used to include null fields in Patch requests.
  13972. NullFields []string `json:"-"`
  13973. }
  13974. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  13975. type NoMethod InterconnectAttachmentList
  13976. raw := NoMethod(*s)
  13977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13978. }
  13979. // InterconnectAttachmentListWarning: [Output Only] Informational
  13980. // warning message.
  13981. type InterconnectAttachmentListWarning struct {
  13982. // Code: [Output Only] A warning code, if applicable. For example,
  13983. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13984. // the response.
  13985. //
  13986. // Possible values:
  13987. // "CLEANUP_FAILED"
  13988. // "DEPRECATED_RESOURCE_USED"
  13989. // "DEPRECATED_TYPE_USED"
  13990. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13991. // "EXPERIMENTAL_TYPE_USED"
  13992. // "EXTERNAL_API_WARNING"
  13993. // "FIELD_VALUE_OVERRIDEN"
  13994. // "INJECTED_KERNELS_DEPRECATED"
  13995. // "MISSING_TYPE_DEPENDENCY"
  13996. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13997. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13998. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13999. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14000. // "NEXT_HOP_NOT_RUNNING"
  14001. // "NOT_CRITICAL_ERROR"
  14002. // "NO_RESULTS_ON_PAGE"
  14003. // "REQUIRED_TOS_AGREEMENT"
  14004. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14005. // "RESOURCE_NOT_DELETED"
  14006. // "SCHEMA_VALIDATION_IGNORED"
  14007. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14008. // "UNDECLARED_PROPERTIES"
  14009. // "UNREACHABLE"
  14010. Code string `json:"code,omitempty"`
  14011. // Data: [Output Only] Metadata about this warning in key: value format.
  14012. // For example:
  14013. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14014. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  14015. // Message: [Output Only] A human-readable description of the warning
  14016. // code.
  14017. Message string `json:"message,omitempty"`
  14018. // ForceSendFields is a list of field names (e.g. "Code") to
  14019. // unconditionally include in API requests. By default, fields with
  14020. // empty values are omitted from API requests. However, any non-pointer,
  14021. // non-interface field appearing in ForceSendFields will be sent to the
  14022. // server regardless of whether the field is empty or not. This may be
  14023. // used to include empty fields in Patch requests.
  14024. ForceSendFields []string `json:"-"`
  14025. // NullFields is a list of field names (e.g. "Code") to include in API
  14026. // requests with the JSON null value. By default, fields with empty
  14027. // values are omitted from API requests. However, any field with an
  14028. // empty value appearing in NullFields will be sent to the server as
  14029. // null. It is an error if a field in this list has a non-empty value.
  14030. // This may be used to include null fields in Patch requests.
  14031. NullFields []string `json:"-"`
  14032. }
  14033. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  14034. type NoMethod InterconnectAttachmentListWarning
  14035. raw := NoMethod(*s)
  14036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14037. }
  14038. type InterconnectAttachmentListWarningData struct {
  14039. // Key: [Output Only] A key that provides more detail on the warning
  14040. // being returned. For example, for warnings where there are no results
  14041. // in a list request for a particular zone, this key might be scope and
  14042. // the key value might be the zone name. Other examples might be a key
  14043. // indicating a deprecated resource and a suggested replacement, or a
  14044. // warning about invalid network settings (for example, if an instance
  14045. // attempts to perform IP forwarding but is not enabled for IP
  14046. // forwarding).
  14047. Key string `json:"key,omitempty"`
  14048. // Value: [Output Only] A warning data value corresponding to the key.
  14049. Value string `json:"value,omitempty"`
  14050. // ForceSendFields is a list of field names (e.g. "Key") to
  14051. // unconditionally include in API requests. By default, fields with
  14052. // empty values are omitted from API requests. However, any non-pointer,
  14053. // non-interface field appearing in ForceSendFields will be sent to the
  14054. // server regardless of whether the field is empty or not. This may be
  14055. // used to include empty fields in Patch requests.
  14056. ForceSendFields []string `json:"-"`
  14057. // NullFields is a list of field names (e.g. "Key") to include in API
  14058. // requests with the JSON null value. By default, fields with empty
  14059. // values are omitted from API requests. However, any field with an
  14060. // empty value appearing in NullFields will be sent to the server as
  14061. // null. It is an error if a field in this list has a non-empty value.
  14062. // This may be used to include null fields in Patch requests.
  14063. NullFields []string `json:"-"`
  14064. }
  14065. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  14066. type NoMethod InterconnectAttachmentListWarningData
  14067. raw := NoMethod(*s)
  14068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14069. }
  14070. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  14071. // Partner attachments from Partners to display to customers. These
  14072. // fields are propagated from PARTNER_PROVIDER attachments to their
  14073. // corresponding PARTNER attachments.
  14074. type InterconnectAttachmentPartnerMetadata struct {
  14075. // InterconnectName: Plain text name of the Interconnect this attachment
  14076. // is connected to, as displayed in the Partner?s portal. For instance
  14077. // "Chicago 1". This value may be validated to match approved Partner
  14078. // values.
  14079. InterconnectName string `json:"interconnectName,omitempty"`
  14080. // PartnerName: Plain text name of the Partner providing this
  14081. // attachment. This value may be validated to match approved Partner
  14082. // values.
  14083. PartnerName string `json:"partnerName,omitempty"`
  14084. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  14085. // may customise this to be a deep-link to the specific resource on the
  14086. // Partner portal. This value may be validated to match approved Partner
  14087. // values.
  14088. PortalUrl string `json:"portalUrl,omitempty"`
  14089. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  14090. // unconditionally include in API requests. By default, fields with
  14091. // empty values are omitted from API requests. However, any non-pointer,
  14092. // non-interface field appearing in ForceSendFields will be sent to the
  14093. // server regardless of whether the field is empty or not. This may be
  14094. // used to include empty fields in Patch requests.
  14095. ForceSendFields []string `json:"-"`
  14096. // NullFields is a list of field names (e.g. "InterconnectName") to
  14097. // include in API requests with the JSON null value. By default, fields
  14098. // with empty values are omitted from API requests. However, any field
  14099. // with an empty value appearing in NullFields will be sent to the
  14100. // server as null. It is an error if a field in this list has a
  14101. // non-empty value. This may be used to include null fields in Patch
  14102. // requests.
  14103. NullFields []string `json:"-"`
  14104. }
  14105. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  14106. type NoMethod InterconnectAttachmentPartnerMetadata
  14107. raw := NoMethod(*s)
  14108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14109. }
  14110. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  14111. // attachment when this belongs to an interconnect of type DEDICATED.
  14112. type InterconnectAttachmentPrivateInfo struct {
  14113. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  14114. // traffic between Google and the customer, going to and from this
  14115. // network and region.
  14116. Tag8021q int64 `json:"tag8021q,omitempty"`
  14117. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  14118. // unconditionally include in API requests. By default, fields with
  14119. // empty values are omitted from API requests. However, any non-pointer,
  14120. // non-interface field appearing in ForceSendFields will be sent to the
  14121. // server regardless of whether the field is empty or not. This may be
  14122. // used to include empty fields in Patch requests.
  14123. ForceSendFields []string `json:"-"`
  14124. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  14125. // API requests with the JSON null value. By default, fields with empty
  14126. // values are omitted from API requests. However, any field with an
  14127. // empty value appearing in NullFields will be sent to the server as
  14128. // null. It is an error if a field in this list has a non-empty value.
  14129. // This may be used to include null fields in Patch requests.
  14130. NullFields []string `json:"-"`
  14131. }
  14132. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  14133. type NoMethod InterconnectAttachmentPrivateInfo
  14134. raw := NoMethod(*s)
  14135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14136. }
  14137. type InterconnectAttachmentsScopedList struct {
  14138. // InterconnectAttachments: A list of interconnect attachments contained
  14139. // in this scope.
  14140. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  14141. // Warning: Informational warning which replaces the list of addresses
  14142. // when the list is empty.
  14143. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  14144. // ForceSendFields is a list of field names (e.g.
  14145. // "InterconnectAttachments") to unconditionally include in API
  14146. // requests. By default, fields with empty values are omitted from API
  14147. // requests. However, any non-pointer, non-interface field appearing in
  14148. // ForceSendFields will be sent to the server regardless of whether the
  14149. // field is empty or not. This may be used to include empty fields in
  14150. // Patch requests.
  14151. ForceSendFields []string `json:"-"`
  14152. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  14153. // to include in API requests with the JSON null value. By default,
  14154. // fields with empty values are omitted from API requests. However, any
  14155. // field with an empty value appearing in NullFields will be sent to the
  14156. // server as null. It is an error if a field in this list has a
  14157. // non-empty value. This may be used to include null fields in Patch
  14158. // requests.
  14159. NullFields []string `json:"-"`
  14160. }
  14161. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  14162. type NoMethod InterconnectAttachmentsScopedList
  14163. raw := NoMethod(*s)
  14164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14165. }
  14166. // InterconnectAttachmentsScopedListWarning: Informational warning which
  14167. // replaces the list of addresses when the list is empty.
  14168. type InterconnectAttachmentsScopedListWarning struct {
  14169. // Code: [Output Only] A warning code, if applicable. For example,
  14170. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14171. // the response.
  14172. //
  14173. // Possible values:
  14174. // "CLEANUP_FAILED"
  14175. // "DEPRECATED_RESOURCE_USED"
  14176. // "DEPRECATED_TYPE_USED"
  14177. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14178. // "EXPERIMENTAL_TYPE_USED"
  14179. // "EXTERNAL_API_WARNING"
  14180. // "FIELD_VALUE_OVERRIDEN"
  14181. // "INJECTED_KERNELS_DEPRECATED"
  14182. // "MISSING_TYPE_DEPENDENCY"
  14183. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14184. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14185. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14186. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14187. // "NEXT_HOP_NOT_RUNNING"
  14188. // "NOT_CRITICAL_ERROR"
  14189. // "NO_RESULTS_ON_PAGE"
  14190. // "REQUIRED_TOS_AGREEMENT"
  14191. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14192. // "RESOURCE_NOT_DELETED"
  14193. // "SCHEMA_VALIDATION_IGNORED"
  14194. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14195. // "UNDECLARED_PROPERTIES"
  14196. // "UNREACHABLE"
  14197. Code string `json:"code,omitempty"`
  14198. // Data: [Output Only] Metadata about this warning in key: value format.
  14199. // For example:
  14200. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14201. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  14202. // Message: [Output Only] A human-readable description of the warning
  14203. // code.
  14204. Message string `json:"message,omitempty"`
  14205. // ForceSendFields is a list of field names (e.g. "Code") to
  14206. // unconditionally include in API requests. By default, fields with
  14207. // empty values are omitted from API requests. However, any non-pointer,
  14208. // non-interface field appearing in ForceSendFields will be sent to the
  14209. // server regardless of whether the field is empty or not. This may be
  14210. // used to include empty fields in Patch requests.
  14211. ForceSendFields []string `json:"-"`
  14212. // NullFields is a list of field names (e.g. "Code") to include in API
  14213. // requests with the JSON null value. By default, fields with empty
  14214. // values are omitted from API requests. However, any field with an
  14215. // empty value appearing in NullFields will be sent to the server as
  14216. // null. It is an error if a field in this list has a non-empty value.
  14217. // This may be used to include null fields in Patch requests.
  14218. NullFields []string `json:"-"`
  14219. }
  14220. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  14221. type NoMethod InterconnectAttachmentsScopedListWarning
  14222. raw := NoMethod(*s)
  14223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14224. }
  14225. type InterconnectAttachmentsScopedListWarningData struct {
  14226. // Key: [Output Only] A key that provides more detail on the warning
  14227. // being returned. For example, for warnings where there are no results
  14228. // in a list request for a particular zone, this key might be scope and
  14229. // the key value might be the zone name. Other examples might be a key
  14230. // indicating a deprecated resource and a suggested replacement, or a
  14231. // warning about invalid network settings (for example, if an instance
  14232. // attempts to perform IP forwarding but is not enabled for IP
  14233. // forwarding).
  14234. Key string `json:"key,omitempty"`
  14235. // Value: [Output Only] A warning data value corresponding to the key.
  14236. Value string `json:"value,omitempty"`
  14237. // ForceSendFields is a list of field names (e.g. "Key") to
  14238. // unconditionally include in API requests. By default, fields with
  14239. // empty values are omitted from API requests. However, any non-pointer,
  14240. // non-interface field appearing in ForceSendFields will be sent to the
  14241. // server regardless of whether the field is empty or not. This may be
  14242. // used to include empty fields in Patch requests.
  14243. ForceSendFields []string `json:"-"`
  14244. // NullFields is a list of field names (e.g. "Key") to include in API
  14245. // requests with the JSON null value. By default, fields with empty
  14246. // values are omitted from API requests. However, any field with an
  14247. // empty value appearing in NullFields will be sent to the server as
  14248. // null. It is an error if a field in this list has a non-empty value.
  14249. // This may be used to include null fields in Patch requests.
  14250. NullFields []string `json:"-"`
  14251. }
  14252. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14253. type NoMethod InterconnectAttachmentsScopedListWarningData
  14254. raw := NoMethod(*s)
  14255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14256. }
  14257. // InterconnectCircuitInfo: Describes a single physical circuit between
  14258. // the Customer and Google. CircuitInfo objects are created by Google,
  14259. // so all fields are output only. Next id: 4
  14260. type InterconnectCircuitInfo struct {
  14261. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  14262. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  14263. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  14264. // at circuit turn-up.
  14265. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  14266. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  14267. // circuit turn-up and provided by Google to the customer in the LOA.
  14268. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  14269. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  14270. // unconditionally include in API requests. By default, fields with
  14271. // empty values are omitted from API requests. However, any non-pointer,
  14272. // non-interface field appearing in ForceSendFields will be sent to the
  14273. // server regardless of whether the field is empty or not. This may be
  14274. // used to include empty fields in Patch requests.
  14275. ForceSendFields []string `json:"-"`
  14276. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  14277. // include in API requests with the JSON null value. By default, fields
  14278. // with empty values are omitted from API requests. However, any field
  14279. // with an empty value appearing in NullFields will be sent to the
  14280. // server as null. It is an error if a field in this list has a
  14281. // non-empty value. This may be used to include null fields in Patch
  14282. // requests.
  14283. NullFields []string `json:"-"`
  14284. }
  14285. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  14286. type NoMethod InterconnectCircuitInfo
  14287. raw := NoMethod(*s)
  14288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14289. }
  14290. // InterconnectDiagnostics: Diagnostics information about interconnect,
  14291. // contains detailed and current technical information about Google?s
  14292. // side of the connection.
  14293. type InterconnectDiagnostics struct {
  14294. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  14295. // describing individual neighbors currently seen by the Google router
  14296. // in the ARP cache for the Interconnect. This will be empty when the
  14297. // Interconnect is not bundled.
  14298. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  14299. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  14300. // describing the status for each link on the Interconnect.
  14301. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  14302. // MacAddress: The MAC address of the Interconnect's bundle interface.
  14303. MacAddress string `json:"macAddress,omitempty"`
  14304. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  14305. // unconditionally include in API requests. By default, fields with
  14306. // empty values are omitted from API requests. However, any non-pointer,
  14307. // non-interface field appearing in ForceSendFields will be sent to the
  14308. // server regardless of whether the field is empty or not. This may be
  14309. // used to include empty fields in Patch requests.
  14310. ForceSendFields []string `json:"-"`
  14311. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  14312. // API requests with the JSON null value. By default, fields with empty
  14313. // values are omitted from API requests. However, any field with an
  14314. // empty value appearing in NullFields will be sent to the server as
  14315. // null. It is an error if a field in this list has a non-empty value.
  14316. // This may be used to include null fields in Patch requests.
  14317. NullFields []string `json:"-"`
  14318. }
  14319. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  14320. type NoMethod InterconnectDiagnostics
  14321. raw := NoMethod(*s)
  14322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14323. }
  14324. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  14325. // seen on this link
  14326. type InterconnectDiagnosticsARPEntry struct {
  14327. // IpAddress: The IP address of this ARP neighbor.
  14328. IpAddress string `json:"ipAddress,omitempty"`
  14329. // MacAddress: The MAC address of this ARP neighbor.
  14330. MacAddress string `json:"macAddress,omitempty"`
  14331. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  14332. // unconditionally include in API requests. By default, fields with
  14333. // empty values are omitted from API requests. However, any non-pointer,
  14334. // non-interface field appearing in ForceSendFields will be sent to the
  14335. // server regardless of whether the field is empty or not. This may be
  14336. // used to include empty fields in Patch requests.
  14337. ForceSendFields []string `json:"-"`
  14338. // NullFields is a list of field names (e.g. "IpAddress") to include in
  14339. // API requests with the JSON null value. By default, fields with empty
  14340. // values are omitted from API requests. However, any field with an
  14341. // empty value appearing in NullFields will be sent to the server as
  14342. // null. It is an error if a field in this list has a non-empty value.
  14343. // This may be used to include null fields in Patch requests.
  14344. NullFields []string `json:"-"`
  14345. }
  14346. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  14347. type NoMethod InterconnectDiagnosticsARPEntry
  14348. raw := NoMethod(*s)
  14349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14350. }
  14351. type InterconnectDiagnosticsLinkLACPStatus struct {
  14352. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  14353. // exchange.
  14354. GoogleSystemId string `json:"googleSystemId,omitempty"`
  14355. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  14356. // LACP exchange.
  14357. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  14358. // Possible values:
  14359. // "ACTIVE"
  14360. // "DETACHED"
  14361. State string `json:"state,omitempty"`
  14362. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  14363. // unconditionally include in API requests. By default, fields with
  14364. // empty values are omitted from API requests. However, any non-pointer,
  14365. // non-interface field appearing in ForceSendFields will be sent to the
  14366. // server regardless of whether the field is empty or not. This may be
  14367. // used to include empty fields in Patch requests.
  14368. ForceSendFields []string `json:"-"`
  14369. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  14370. // include in API requests with the JSON null value. By default, fields
  14371. // with empty values are omitted from API requests. However, any field
  14372. // with an empty value appearing in NullFields will be sent to the
  14373. // server as null. It is an error if a field in this list has a
  14374. // non-empty value. This may be used to include null fields in Patch
  14375. // requests.
  14376. NullFields []string `json:"-"`
  14377. }
  14378. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  14379. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  14380. raw := NoMethod(*s)
  14381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14382. }
  14383. type InterconnectDiagnosticsLinkOpticalPower struct {
  14384. // Possible values:
  14385. // "HIGH_ALARM"
  14386. // "HIGH_WARNING"
  14387. // "LOW_ALARM"
  14388. // "LOW_WARNING"
  14389. // "OK"
  14390. State string `json:"state,omitempty"`
  14391. // Value: Value of the current optical power, read in dBm. Take a known
  14392. // good optical value, give it a 10% margin and trigger warnings
  14393. // relative to that value. In general, a -7dBm warning and a -11dBm
  14394. // alarm are good optical value estimates for most links.
  14395. Value float64 `json:"value,omitempty"`
  14396. // ForceSendFields is a list of field names (e.g. "State") to
  14397. // unconditionally include in API requests. By default, fields with
  14398. // empty values are omitted from API requests. However, any non-pointer,
  14399. // non-interface field appearing in ForceSendFields will be sent to the
  14400. // server regardless of whether the field is empty or not. This may be
  14401. // used to include empty fields in Patch requests.
  14402. ForceSendFields []string `json:"-"`
  14403. // NullFields is a list of field names (e.g. "State") to include in API
  14404. // requests with the JSON null value. By default, fields with empty
  14405. // values are omitted from API requests. However, any field with an
  14406. // empty value appearing in NullFields will be sent to the server as
  14407. // null. It is an error if a field in this list has a non-empty value.
  14408. // This may be used to include null fields in Patch requests.
  14409. NullFields []string `json:"-"`
  14410. }
  14411. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  14412. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  14413. raw := NoMethod(*s)
  14414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14415. }
  14416. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  14417. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  14418. var s1 struct {
  14419. Value gensupport.JSONFloat64 `json:"value"`
  14420. *NoMethod
  14421. }
  14422. s1.NoMethod = (*NoMethod)(s)
  14423. if err := json.Unmarshal(data, &s1); err != nil {
  14424. return err
  14425. }
  14426. s.Value = float64(s1.Value)
  14427. return nil
  14428. }
  14429. type InterconnectDiagnosticsLinkStatus struct {
  14430. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  14431. // describing the ARP neighbor entries seen on this link. This will be
  14432. // empty if the link is bundled
  14433. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  14434. // CircuitId: The unique ID for this link assigned during turn up by
  14435. // Google.
  14436. CircuitId string `json:"circuitId,omitempty"`
  14437. // GoogleDemarc: The Demarc address assigned by Google and provided in
  14438. // the LoA.
  14439. GoogleDemarc string `json:"googleDemarc,omitempty"`
  14440. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  14441. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  14442. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  14443. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  14444. // unconditionally include in API requests. By default, fields with
  14445. // empty values are omitted from API requests. However, any non-pointer,
  14446. // non-interface field appearing in ForceSendFields will be sent to the
  14447. // server regardless of whether the field is empty or not. This may be
  14448. // used to include empty fields in Patch requests.
  14449. ForceSendFields []string `json:"-"`
  14450. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  14451. // API requests with the JSON null value. By default, fields with empty
  14452. // values are omitted from API requests. However, any field with an
  14453. // empty value appearing in NullFields will be sent to the server as
  14454. // null. It is an error if a field in this list has a non-empty value.
  14455. // This may be used to include null fields in Patch requests.
  14456. NullFields []string `json:"-"`
  14457. }
  14458. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  14459. type NoMethod InterconnectDiagnosticsLinkStatus
  14460. raw := NoMethod(*s)
  14461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14462. }
  14463. // InterconnectList: Response to the list request, and contains a list
  14464. // of interconnects.
  14465. type InterconnectList struct {
  14466. // Id: [Output Only] Unique identifier for the resource; defined by the
  14467. // server.
  14468. Id string `json:"id,omitempty"`
  14469. // Items: A list of Interconnect resources.
  14470. Items []*Interconnect `json:"items,omitempty"`
  14471. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  14472. // for lists of interconnects.
  14473. Kind string `json:"kind,omitempty"`
  14474. // NextPageToken: [Output Only] This token allows you to get the next
  14475. // page of results for list requests. If the number of results is larger
  14476. // than maxResults, use the nextPageToken as a value for the query
  14477. // parameter pageToken in the next list request. Subsequent list
  14478. // requests will have their own nextPageToken to continue paging through
  14479. // the results.
  14480. NextPageToken string `json:"nextPageToken,omitempty"`
  14481. // SelfLink: [Output Only] Server-defined URL for this resource.
  14482. SelfLink string `json:"selfLink,omitempty"`
  14483. // Warning: [Output Only] Informational warning message.
  14484. Warning *InterconnectListWarning `json:"warning,omitempty"`
  14485. // ServerResponse contains the HTTP response code and headers from the
  14486. // server.
  14487. googleapi.ServerResponse `json:"-"`
  14488. // ForceSendFields is a list of field names (e.g. "Id") to
  14489. // unconditionally include in API requests. By default, fields with
  14490. // empty values are omitted from API requests. However, any non-pointer,
  14491. // non-interface field appearing in ForceSendFields will be sent to the
  14492. // server regardless of whether the field is empty or not. This may be
  14493. // used to include empty fields in Patch requests.
  14494. ForceSendFields []string `json:"-"`
  14495. // NullFields is a list of field names (e.g. "Id") to include in API
  14496. // requests with the JSON null value. By default, fields with empty
  14497. // values are omitted from API requests. However, any field with an
  14498. // empty value appearing in NullFields will be sent to the server as
  14499. // null. It is an error if a field in this list has a non-empty value.
  14500. // This may be used to include null fields in Patch requests.
  14501. NullFields []string `json:"-"`
  14502. }
  14503. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  14504. type NoMethod InterconnectList
  14505. raw := NoMethod(*s)
  14506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14507. }
  14508. // InterconnectListWarning: [Output Only] Informational warning message.
  14509. type InterconnectListWarning struct {
  14510. // Code: [Output Only] A warning code, if applicable. For example,
  14511. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14512. // the response.
  14513. //
  14514. // Possible values:
  14515. // "CLEANUP_FAILED"
  14516. // "DEPRECATED_RESOURCE_USED"
  14517. // "DEPRECATED_TYPE_USED"
  14518. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14519. // "EXPERIMENTAL_TYPE_USED"
  14520. // "EXTERNAL_API_WARNING"
  14521. // "FIELD_VALUE_OVERRIDEN"
  14522. // "INJECTED_KERNELS_DEPRECATED"
  14523. // "MISSING_TYPE_DEPENDENCY"
  14524. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14525. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14526. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14527. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14528. // "NEXT_HOP_NOT_RUNNING"
  14529. // "NOT_CRITICAL_ERROR"
  14530. // "NO_RESULTS_ON_PAGE"
  14531. // "REQUIRED_TOS_AGREEMENT"
  14532. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14533. // "RESOURCE_NOT_DELETED"
  14534. // "SCHEMA_VALIDATION_IGNORED"
  14535. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14536. // "UNDECLARED_PROPERTIES"
  14537. // "UNREACHABLE"
  14538. Code string `json:"code,omitempty"`
  14539. // Data: [Output Only] Metadata about this warning in key: value format.
  14540. // For example:
  14541. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14542. Data []*InterconnectListWarningData `json:"data,omitempty"`
  14543. // Message: [Output Only] A human-readable description of the warning
  14544. // code.
  14545. Message string `json:"message,omitempty"`
  14546. // ForceSendFields is a list of field names (e.g. "Code") to
  14547. // unconditionally include in API requests. By default, fields with
  14548. // empty values are omitted from API requests. However, any non-pointer,
  14549. // non-interface field appearing in ForceSendFields will be sent to the
  14550. // server regardless of whether the field is empty or not. This may be
  14551. // used to include empty fields in Patch requests.
  14552. ForceSendFields []string `json:"-"`
  14553. // NullFields is a list of field names (e.g. "Code") to include in API
  14554. // requests with the JSON null value. By default, fields with empty
  14555. // values are omitted from API requests. However, any field with an
  14556. // empty value appearing in NullFields will be sent to the server as
  14557. // null. It is an error if a field in this list has a non-empty value.
  14558. // This may be used to include null fields in Patch requests.
  14559. NullFields []string `json:"-"`
  14560. }
  14561. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  14562. type NoMethod InterconnectListWarning
  14563. raw := NoMethod(*s)
  14564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14565. }
  14566. type InterconnectListWarningData struct {
  14567. // Key: [Output Only] A key that provides more detail on the warning
  14568. // being returned. For example, for warnings where there are no results
  14569. // in a list request for a particular zone, this key might be scope and
  14570. // the key value might be the zone name. Other examples might be a key
  14571. // indicating a deprecated resource and a suggested replacement, or a
  14572. // warning about invalid network settings (for example, if an instance
  14573. // attempts to perform IP forwarding but is not enabled for IP
  14574. // forwarding).
  14575. Key string `json:"key,omitempty"`
  14576. // Value: [Output Only] A warning data value corresponding to the key.
  14577. Value string `json:"value,omitempty"`
  14578. // ForceSendFields is a list of field names (e.g. "Key") to
  14579. // unconditionally include in API requests. By default, fields with
  14580. // empty values are omitted from API requests. However, any non-pointer,
  14581. // non-interface field appearing in ForceSendFields will be sent to the
  14582. // server regardless of whether the field is empty or not. This may be
  14583. // used to include empty fields in Patch requests.
  14584. ForceSendFields []string `json:"-"`
  14585. // NullFields is a list of field names (e.g. "Key") to include in API
  14586. // requests with the JSON null value. By default, fields with empty
  14587. // values are omitted from API requests. However, any field with an
  14588. // empty value appearing in NullFields will be sent to the server as
  14589. // null. It is an error if a field in this list has a non-empty value.
  14590. // This may be used to include null fields in Patch requests.
  14591. NullFields []string `json:"-"`
  14592. }
  14593. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  14594. type NoMethod InterconnectListWarningData
  14595. raw := NoMethod(*s)
  14596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14597. }
  14598. // InterconnectLocation: Represents an InterconnectLocations resource.
  14599. // The InterconnectLocations resource describes the locations where you
  14600. // can connect to Google's networks. For more information, see
  14601. // Colocation Facilities.
  14602. type InterconnectLocation struct {
  14603. // Address: [Output Only] The postal address of the Point of Presence,
  14604. // each line in the address is separated by a newline character.
  14605. Address string `json:"address,omitempty"`
  14606. // AvailabilityZone: [Output Only] Availability zone for this
  14607. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  14608. // will not be simultaneously scheduled in more than one availability
  14609. // zone. Example: "zone1" or "zone2".
  14610. AvailabilityZone string `json:"availabilityZone,omitempty"`
  14611. // City: [Output Only] Metropolitan area designator that indicates which
  14612. // city an interconnect is located. For example: "Chicago, IL",
  14613. // "Amsterdam, Netherlands".
  14614. City string `json:"city,omitempty"`
  14615. // Continent: [Output Only] Continent for this location.
  14616. //
  14617. // Possible values:
  14618. // "AFRICA"
  14619. // "ASIA_PAC"
  14620. // "C_AFRICA"
  14621. // "C_ASIA_PAC"
  14622. // "C_EUROPE"
  14623. // "C_NORTH_AMERICA"
  14624. // "C_SOUTH_AMERICA"
  14625. // "EUROPE"
  14626. // "NORTH_AMERICA"
  14627. // "SOUTH_AMERICA"
  14628. Continent string `json:"continent,omitempty"`
  14629. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14630. // format.
  14631. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14632. // Description: [Output Only] An optional description of the resource.
  14633. Description string `json:"description,omitempty"`
  14634. // FacilityProvider: [Output Only] The name of the provider for this
  14635. // facility (e.g., EQUINIX).
  14636. FacilityProvider string `json:"facilityProvider,omitempty"`
  14637. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  14638. // Identifier for this facility (e.g., Ashburn-DC1).
  14639. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  14640. // Id: [Output Only] The unique identifier for the resource. This
  14641. // identifier is defined by the server.
  14642. Id uint64 `json:"id,omitempty,string"`
  14643. // Kind: [Output Only] Type of the resource. Always
  14644. // compute#interconnectLocation for interconnect locations.
  14645. Kind string `json:"kind,omitempty"`
  14646. // Name: [Output Only] Name of the resource.
  14647. Name string `json:"name,omitempty"`
  14648. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  14649. // facility (corresponding with a netfac type in peeringdb).
  14650. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  14651. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  14652. // objects, that describe parameters pertaining to the relation between
  14653. // this InterconnectLocation and various Google Cloud regions.
  14654. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  14655. // SelfLink: [Output Only] Server-defined URL for the resource.
  14656. SelfLink string `json:"selfLink,omitempty"`
  14657. // Status: [Output Only] The status of this InterconnectLocation. If the
  14658. // status is AVAILABLE, new Interconnects may be provisioned in this
  14659. // InterconnectLocation. Otherwise, no new Interconnects may be
  14660. // provisioned.
  14661. //
  14662. // Possible values:
  14663. // "AVAILABLE"
  14664. // "CLOSED"
  14665. Status string `json:"status,omitempty"`
  14666. // ServerResponse contains the HTTP response code and headers from the
  14667. // server.
  14668. googleapi.ServerResponse `json:"-"`
  14669. // ForceSendFields is a list of field names (e.g. "Address") to
  14670. // unconditionally include in API requests. By default, fields with
  14671. // empty values are omitted from API requests. However, any non-pointer,
  14672. // non-interface field appearing in ForceSendFields will be sent to the
  14673. // server regardless of whether the field is empty or not. This may be
  14674. // used to include empty fields in Patch requests.
  14675. ForceSendFields []string `json:"-"`
  14676. // NullFields is a list of field names (e.g. "Address") to include in
  14677. // API requests with the JSON null value. By default, fields with empty
  14678. // values are omitted from API requests. However, any field with an
  14679. // empty value appearing in NullFields will be sent to the server as
  14680. // null. It is an error if a field in this list has a non-empty value.
  14681. // This may be used to include null fields in Patch requests.
  14682. NullFields []string `json:"-"`
  14683. }
  14684. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  14685. type NoMethod InterconnectLocation
  14686. raw := NoMethod(*s)
  14687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14688. }
  14689. // InterconnectLocationList: Response to the list request, and contains
  14690. // a list of interconnect locations.
  14691. type InterconnectLocationList struct {
  14692. // Id: [Output Only] Unique identifier for the resource; defined by the
  14693. // server.
  14694. Id string `json:"id,omitempty"`
  14695. // Items: A list of InterconnectLocation resources.
  14696. Items []*InterconnectLocation `json:"items,omitempty"`
  14697. // Kind: [Output Only] Type of resource. Always
  14698. // compute#interconnectLocationList for lists of interconnect locations.
  14699. Kind string `json:"kind,omitempty"`
  14700. // NextPageToken: [Output Only] This token allows you to get the next
  14701. // page of results for list requests. If the number of results is larger
  14702. // than maxResults, use the nextPageToken as a value for the query
  14703. // parameter pageToken in the next list request. Subsequent list
  14704. // requests will have their own nextPageToken to continue paging through
  14705. // the results.
  14706. NextPageToken string `json:"nextPageToken,omitempty"`
  14707. // SelfLink: [Output Only] Server-defined URL for this resource.
  14708. SelfLink string `json:"selfLink,omitempty"`
  14709. // Warning: [Output Only] Informational warning message.
  14710. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  14711. // ServerResponse contains the HTTP response code and headers from the
  14712. // server.
  14713. googleapi.ServerResponse `json:"-"`
  14714. // ForceSendFields is a list of field names (e.g. "Id") to
  14715. // unconditionally include in API requests. By default, fields with
  14716. // empty values are omitted from API requests. However, any non-pointer,
  14717. // non-interface field appearing in ForceSendFields will be sent to the
  14718. // server regardless of whether the field is empty or not. This may be
  14719. // used to include empty fields in Patch requests.
  14720. ForceSendFields []string `json:"-"`
  14721. // NullFields is a list of field names (e.g. "Id") to include in API
  14722. // requests with the JSON null value. By default, fields with empty
  14723. // values are omitted from API requests. However, any field with an
  14724. // empty value appearing in NullFields will be sent to the server as
  14725. // null. It is an error if a field in this list has a non-empty value.
  14726. // This may be used to include null fields in Patch requests.
  14727. NullFields []string `json:"-"`
  14728. }
  14729. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  14730. type NoMethod InterconnectLocationList
  14731. raw := NoMethod(*s)
  14732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14733. }
  14734. // InterconnectLocationListWarning: [Output Only] Informational warning
  14735. // message.
  14736. type InterconnectLocationListWarning struct {
  14737. // Code: [Output Only] A warning code, if applicable. For example,
  14738. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14739. // the response.
  14740. //
  14741. // Possible values:
  14742. // "CLEANUP_FAILED"
  14743. // "DEPRECATED_RESOURCE_USED"
  14744. // "DEPRECATED_TYPE_USED"
  14745. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14746. // "EXPERIMENTAL_TYPE_USED"
  14747. // "EXTERNAL_API_WARNING"
  14748. // "FIELD_VALUE_OVERRIDEN"
  14749. // "INJECTED_KERNELS_DEPRECATED"
  14750. // "MISSING_TYPE_DEPENDENCY"
  14751. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14752. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14753. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14754. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14755. // "NEXT_HOP_NOT_RUNNING"
  14756. // "NOT_CRITICAL_ERROR"
  14757. // "NO_RESULTS_ON_PAGE"
  14758. // "REQUIRED_TOS_AGREEMENT"
  14759. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14760. // "RESOURCE_NOT_DELETED"
  14761. // "SCHEMA_VALIDATION_IGNORED"
  14762. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14763. // "UNDECLARED_PROPERTIES"
  14764. // "UNREACHABLE"
  14765. Code string `json:"code,omitempty"`
  14766. // Data: [Output Only] Metadata about this warning in key: value format.
  14767. // For example:
  14768. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14769. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  14770. // Message: [Output Only] A human-readable description of the warning
  14771. // code.
  14772. Message string `json:"message,omitempty"`
  14773. // ForceSendFields is a list of field names (e.g. "Code") to
  14774. // unconditionally include in API requests. By default, fields with
  14775. // empty values are omitted from API requests. However, any non-pointer,
  14776. // non-interface field appearing in ForceSendFields will be sent to the
  14777. // server regardless of whether the field is empty or not. This may be
  14778. // used to include empty fields in Patch requests.
  14779. ForceSendFields []string `json:"-"`
  14780. // NullFields is a list of field names (e.g. "Code") to include in API
  14781. // requests with the JSON null value. By default, fields with empty
  14782. // values are omitted from API requests. However, any field with an
  14783. // empty value appearing in NullFields will be sent to the server as
  14784. // null. It is an error if a field in this list has a non-empty value.
  14785. // This may be used to include null fields in Patch requests.
  14786. NullFields []string `json:"-"`
  14787. }
  14788. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  14789. type NoMethod InterconnectLocationListWarning
  14790. raw := NoMethod(*s)
  14791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14792. }
  14793. type InterconnectLocationListWarningData struct {
  14794. // Key: [Output Only] A key that provides more detail on the warning
  14795. // being returned. For example, for warnings where there are no results
  14796. // in a list request for a particular zone, this key might be scope and
  14797. // the key value might be the zone name. Other examples might be a key
  14798. // indicating a deprecated resource and a suggested replacement, or a
  14799. // warning about invalid network settings (for example, if an instance
  14800. // attempts to perform IP forwarding but is not enabled for IP
  14801. // forwarding).
  14802. Key string `json:"key,omitempty"`
  14803. // Value: [Output Only] A warning data value corresponding to the key.
  14804. Value string `json:"value,omitempty"`
  14805. // ForceSendFields is a list of field names (e.g. "Key") to
  14806. // unconditionally include in API requests. By default, fields with
  14807. // empty values are omitted from API requests. However, any non-pointer,
  14808. // non-interface field appearing in ForceSendFields will be sent to the
  14809. // server regardless of whether the field is empty or not. This may be
  14810. // used to include empty fields in Patch requests.
  14811. ForceSendFields []string `json:"-"`
  14812. // NullFields is a list of field names (e.g. "Key") to include in API
  14813. // requests with the JSON null value. By default, fields with empty
  14814. // values are omitted from API requests. However, any field with an
  14815. // empty value appearing in NullFields will be sent to the server as
  14816. // null. It is an error if a field in this list has a non-empty value.
  14817. // This may be used to include null fields in Patch requests.
  14818. NullFields []string `json:"-"`
  14819. }
  14820. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  14821. type NoMethod InterconnectLocationListWarningData
  14822. raw := NoMethod(*s)
  14823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14824. }
  14825. // InterconnectLocationRegionInfo: Information about any potential
  14826. // InterconnectAttachments between an Interconnect at a specific
  14827. // InterconnectLocation, and a specific Cloud Region.
  14828. type InterconnectLocationRegionInfo struct {
  14829. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  14830. // InterconnectLocation to a VM in this region.
  14831. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  14832. // LocationPresence: Identifies the network presence of this location.
  14833. //
  14834. // Possible values:
  14835. // "GLOBAL"
  14836. // "LOCAL_REGION"
  14837. // "LP_GLOBAL"
  14838. // "LP_LOCAL_REGION"
  14839. LocationPresence string `json:"locationPresence,omitempty"`
  14840. // Region: URL for the region of this location.
  14841. Region string `json:"region,omitempty"`
  14842. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  14843. // unconditionally include in API requests. By default, fields with
  14844. // empty values are omitted from API requests. However, any non-pointer,
  14845. // non-interface field appearing in ForceSendFields will be sent to the
  14846. // server regardless of whether the field is empty or not. This may be
  14847. // used to include empty fields in Patch requests.
  14848. ForceSendFields []string `json:"-"`
  14849. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  14850. // in API requests with the JSON null value. By default, fields with
  14851. // empty values are omitted from API requests. However, any field with
  14852. // an empty value appearing in NullFields will be sent to the server as
  14853. // null. It is an error if a field in this list has a non-empty value.
  14854. // This may be used to include null fields in Patch requests.
  14855. NullFields []string `json:"-"`
  14856. }
  14857. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  14858. type NoMethod InterconnectLocationRegionInfo
  14859. raw := NoMethod(*s)
  14860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14861. }
  14862. // InterconnectOutageNotification: Description of a planned outage on
  14863. // this Interconnect. Next id: 9
  14864. type InterconnectOutageNotification struct {
  14865. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  14866. // Google-side circuit IDs that will be affected.
  14867. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  14868. // Description: A description about the purpose of the outage.
  14869. Description string `json:"description,omitempty"`
  14870. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  14871. // epoch).
  14872. EndTime int64 `json:"endTime,omitempty,string"`
  14873. // IssueType: Form this outage is expected to take. Note that the "IT_"
  14874. // versions of this enum have been deprecated in favor of the unprefixed
  14875. // values.
  14876. //
  14877. // Possible values:
  14878. // "IT_OUTAGE"
  14879. // "IT_PARTIAL_OUTAGE"
  14880. // "OUTAGE"
  14881. // "PARTIAL_OUTAGE"
  14882. IssueType string `json:"issueType,omitempty"`
  14883. // Name: Unique identifier for this outage notification.
  14884. Name string `json:"name,omitempty"`
  14885. // Source: The party that generated this notification. Note that
  14886. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  14887. //
  14888. // Possible values:
  14889. // "GOOGLE"
  14890. // "NSRC_GOOGLE"
  14891. Source string `json:"source,omitempty"`
  14892. // StartTime: Scheduled start time for the outage (milliseconds since
  14893. // Unix epoch).
  14894. StartTime int64 `json:"startTime,omitempty,string"`
  14895. // State: State of this notification. Note that the "NS_" versions of
  14896. // this enum have been deprecated in favor of the unprefixed values.
  14897. //
  14898. // Possible values:
  14899. // "ACTIVE"
  14900. // "CANCELLED"
  14901. // "NS_ACTIVE"
  14902. // "NS_CANCELED"
  14903. State string `json:"state,omitempty"`
  14904. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  14905. // unconditionally include in API requests. By default, fields with
  14906. // empty values are omitted from API requests. However, any non-pointer,
  14907. // non-interface field appearing in ForceSendFields will be sent to the
  14908. // server regardless of whether the field is empty or not. This may be
  14909. // used to include empty fields in Patch requests.
  14910. ForceSendFields []string `json:"-"`
  14911. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  14912. // include in API requests with the JSON null value. By default, fields
  14913. // with empty values are omitted from API requests. However, any field
  14914. // with an empty value appearing in NullFields will be sent to the
  14915. // server as null. It is an error if a field in this list has a
  14916. // non-empty value. This may be used to include null fields in Patch
  14917. // requests.
  14918. NullFields []string `json:"-"`
  14919. }
  14920. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  14921. type NoMethod InterconnectOutageNotification
  14922. raw := NoMethod(*s)
  14923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14924. }
  14925. // InterconnectsGetDiagnosticsResponse: Response for the
  14926. // InterconnectsGetDiagnosticsRequest.
  14927. type InterconnectsGetDiagnosticsResponse struct {
  14928. Result *InterconnectDiagnostics `json:"result,omitempty"`
  14929. // ServerResponse contains the HTTP response code and headers from the
  14930. // server.
  14931. googleapi.ServerResponse `json:"-"`
  14932. // ForceSendFields is a list of field names (e.g. "Result") to
  14933. // unconditionally include in API requests. By default, fields with
  14934. // empty values are omitted from API requests. However, any non-pointer,
  14935. // non-interface field appearing in ForceSendFields will be sent to the
  14936. // server regardless of whether the field is empty or not. This may be
  14937. // used to include empty fields in Patch requests.
  14938. ForceSendFields []string `json:"-"`
  14939. // NullFields is a list of field names (e.g. "Result") to include in API
  14940. // requests with the JSON null value. By default, fields with empty
  14941. // values are omitted from API requests. However, any field with an
  14942. // empty value appearing in NullFields will be sent to the server as
  14943. // null. It is an error if a field in this list has a non-empty value.
  14944. // This may be used to include null fields in Patch requests.
  14945. NullFields []string `json:"-"`
  14946. }
  14947. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  14948. type NoMethod InterconnectsGetDiagnosticsResponse
  14949. raw := NoMethod(*s)
  14950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14951. }
  14952. type InternalIpAddress struct {
  14953. // Cidr: IP CIDR address or range.
  14954. Cidr string `json:"cidr,omitempty"`
  14955. // Owner: The owner of the internal IP address.
  14956. Owner string `json:"owner,omitempty"`
  14957. // Purpose: The purpose of the internal IP address if applicable.
  14958. Purpose string `json:"purpose,omitempty"`
  14959. // Region: The region of the internal IP address if applicable.
  14960. Region string `json:"region,omitempty"`
  14961. // Type: The type of the internal IP address.
  14962. //
  14963. // Possible values:
  14964. // "PEER_RESERVED"
  14965. // "PEER_USED"
  14966. // "REMOTE_RESERVED"
  14967. // "REMOTE_USED"
  14968. // "RESERVED"
  14969. // "SUBNETWORK"
  14970. // "TYPE_UNSPECIFIED"
  14971. Type string `json:"type,omitempty"`
  14972. // ForceSendFields is a list of field names (e.g. "Cidr") to
  14973. // unconditionally include in API requests. By default, fields with
  14974. // empty values are omitted from API requests. However, any non-pointer,
  14975. // non-interface field appearing in ForceSendFields will be sent to the
  14976. // server regardless of whether the field is empty or not. This may be
  14977. // used to include empty fields in Patch requests.
  14978. ForceSendFields []string `json:"-"`
  14979. // NullFields is a list of field names (e.g. "Cidr") to include in API
  14980. // requests with the JSON null value. By default, fields with empty
  14981. // values are omitted from API requests. However, any field with an
  14982. // empty value appearing in NullFields will be sent to the server as
  14983. // null. It is an error if a field in this list has a non-empty value.
  14984. // This may be used to include null fields in Patch requests.
  14985. NullFields []string `json:"-"`
  14986. }
  14987. func (s *InternalIpAddress) MarshalJSON() ([]byte, error) {
  14988. type NoMethod InternalIpAddress
  14989. raw := NoMethod(*s)
  14990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14991. }
  14992. type InternalIpOwner struct {
  14993. // IpCidrRange: IP CIDR range being owned.
  14994. IpCidrRange string `json:"ipCidrRange,omitempty"`
  14995. // Owners: URLs of the IP owners of the IP CIDR range.
  14996. Owners []string `json:"owners,omitempty"`
  14997. // SystemOwned: Whether this IP CIDR range is reserved for system use.
  14998. SystemOwned bool `json:"systemOwned,omitempty"`
  14999. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  15000. // unconditionally include in API requests. By default, fields with
  15001. // empty values are omitted from API requests. However, any non-pointer,
  15002. // non-interface field appearing in ForceSendFields will be sent to the
  15003. // server regardless of whether the field is empty or not. This may be
  15004. // used to include empty fields in Patch requests.
  15005. ForceSendFields []string `json:"-"`
  15006. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  15007. // in API requests with the JSON null value. By default, fields with
  15008. // empty values are omitted from API requests. However, any field with
  15009. // an empty value appearing in NullFields will be sent to the server as
  15010. // null. It is an error if a field in this list has a non-empty value.
  15011. // This may be used to include null fields in Patch requests.
  15012. NullFields []string `json:"-"`
  15013. }
  15014. func (s *InternalIpOwner) MarshalJSON() ([]byte, error) {
  15015. type NoMethod InternalIpOwner
  15016. raw := NoMethod(*s)
  15017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15018. }
  15019. type IpAddressesList struct {
  15020. // Id: [Output Only] Unique identifier for the resource; defined by the
  15021. // server.
  15022. Id string `json:"id,omitempty"`
  15023. // Items: A list of InternalIpAddress resources.
  15024. Items []*InternalIpAddress `json:"items,omitempty"`
  15025. // Kind: [Output Only] Type of resource. Always compute#ipAddressesList
  15026. // for IP addresses lists.
  15027. Kind string `json:"kind,omitempty"`
  15028. // NextPageToken: [Output Only] This token allows you to get the next
  15029. // page of results for list requests. If the number of results is larger
  15030. // than maxResults, use the nextPageToken as a value for the query
  15031. // parameter pageToken in the next list request. Subsequent list
  15032. // requests will have their own nextPageToken to continue paging through
  15033. // the results.
  15034. NextPageToken string `json:"nextPageToken,omitempty"`
  15035. // SelfLink: [Output Only] Server-defined URL for this resource.
  15036. SelfLink string `json:"selfLink,omitempty"`
  15037. // Warning: [Output Only] Informational warning message.
  15038. Warning *IpAddressesListWarning `json:"warning,omitempty"`
  15039. // ServerResponse contains the HTTP response code and headers from the
  15040. // server.
  15041. googleapi.ServerResponse `json:"-"`
  15042. // ForceSendFields is a list of field names (e.g. "Id") to
  15043. // unconditionally include in API requests. By default, fields with
  15044. // empty values are omitted from API requests. However, any non-pointer,
  15045. // non-interface field appearing in ForceSendFields will be sent to the
  15046. // server regardless of whether the field is empty or not. This may be
  15047. // used to include empty fields in Patch requests.
  15048. ForceSendFields []string `json:"-"`
  15049. // NullFields is a list of field names (e.g. "Id") to include in API
  15050. // requests with the JSON null value. By default, fields with empty
  15051. // values are omitted from API requests. However, any field with an
  15052. // empty value appearing in NullFields will be sent to the server as
  15053. // null. It is an error if a field in this list has a non-empty value.
  15054. // This may be used to include null fields in Patch requests.
  15055. NullFields []string `json:"-"`
  15056. }
  15057. func (s *IpAddressesList) MarshalJSON() ([]byte, error) {
  15058. type NoMethod IpAddressesList
  15059. raw := NoMethod(*s)
  15060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15061. }
  15062. // IpAddressesListWarning: [Output Only] Informational warning message.
  15063. type IpAddressesListWarning struct {
  15064. // Code: [Output Only] A warning code, if applicable. For example,
  15065. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15066. // the response.
  15067. //
  15068. // Possible values:
  15069. // "CLEANUP_FAILED"
  15070. // "DEPRECATED_RESOURCE_USED"
  15071. // "DEPRECATED_TYPE_USED"
  15072. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15073. // "EXPERIMENTAL_TYPE_USED"
  15074. // "EXTERNAL_API_WARNING"
  15075. // "FIELD_VALUE_OVERRIDEN"
  15076. // "INJECTED_KERNELS_DEPRECATED"
  15077. // "MISSING_TYPE_DEPENDENCY"
  15078. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15079. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15080. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15081. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15082. // "NEXT_HOP_NOT_RUNNING"
  15083. // "NOT_CRITICAL_ERROR"
  15084. // "NO_RESULTS_ON_PAGE"
  15085. // "REQUIRED_TOS_AGREEMENT"
  15086. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15087. // "RESOURCE_NOT_DELETED"
  15088. // "SCHEMA_VALIDATION_IGNORED"
  15089. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15090. // "UNDECLARED_PROPERTIES"
  15091. // "UNREACHABLE"
  15092. Code string `json:"code,omitempty"`
  15093. // Data: [Output Only] Metadata about this warning in key: value format.
  15094. // For example:
  15095. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15096. Data []*IpAddressesListWarningData `json:"data,omitempty"`
  15097. // Message: [Output Only] A human-readable description of the warning
  15098. // code.
  15099. Message string `json:"message,omitempty"`
  15100. // ForceSendFields is a list of field names (e.g. "Code") to
  15101. // unconditionally include in API requests. By default, fields with
  15102. // empty values are omitted from API requests. However, any non-pointer,
  15103. // non-interface field appearing in ForceSendFields will be sent to the
  15104. // server regardless of whether the field is empty or not. This may be
  15105. // used to include empty fields in Patch requests.
  15106. ForceSendFields []string `json:"-"`
  15107. // NullFields is a list of field names (e.g. "Code") to include in API
  15108. // requests with the JSON null value. By default, fields with empty
  15109. // values are omitted from API requests. However, any field with an
  15110. // empty value appearing in NullFields will be sent to the server as
  15111. // null. It is an error if a field in this list has a non-empty value.
  15112. // This may be used to include null fields in Patch requests.
  15113. NullFields []string `json:"-"`
  15114. }
  15115. func (s *IpAddressesListWarning) MarshalJSON() ([]byte, error) {
  15116. type NoMethod IpAddressesListWarning
  15117. raw := NoMethod(*s)
  15118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15119. }
  15120. type IpAddressesListWarningData struct {
  15121. // Key: [Output Only] A key that provides more detail on the warning
  15122. // being returned. For example, for warnings where there are no results
  15123. // in a list request for a particular zone, this key might be scope and
  15124. // the key value might be the zone name. Other examples might be a key
  15125. // indicating a deprecated resource and a suggested replacement, or a
  15126. // warning about invalid network settings (for example, if an instance
  15127. // attempts to perform IP forwarding but is not enabled for IP
  15128. // forwarding).
  15129. Key string `json:"key,omitempty"`
  15130. // Value: [Output Only] A warning data value corresponding to the key.
  15131. Value string `json:"value,omitempty"`
  15132. // ForceSendFields is a list of field names (e.g. "Key") to
  15133. // unconditionally include in API requests. By default, fields with
  15134. // empty values are omitted from API requests. However, any non-pointer,
  15135. // non-interface field appearing in ForceSendFields will be sent to the
  15136. // server regardless of whether the field is empty or not. This may be
  15137. // used to include empty fields in Patch requests.
  15138. ForceSendFields []string `json:"-"`
  15139. // NullFields is a list of field names (e.g. "Key") to include in API
  15140. // requests with the JSON null value. By default, fields with empty
  15141. // values are omitted from API requests. However, any field with an
  15142. // empty value appearing in NullFields will be sent to the server as
  15143. // null. It is an error if a field in this list has a non-empty value.
  15144. // This may be used to include null fields in Patch requests.
  15145. NullFields []string `json:"-"`
  15146. }
  15147. func (s *IpAddressesListWarningData) MarshalJSON() ([]byte, error) {
  15148. type NoMethod IpAddressesListWarningData
  15149. raw := NoMethod(*s)
  15150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15151. }
  15152. // IpOwnerList: Contains a list of IP owners.
  15153. type IpOwnerList struct {
  15154. // Id: [Output Only] Unique identifier for the resource; defined by the
  15155. // server.
  15156. Id string `json:"id,omitempty"`
  15157. // Items: A list of InternalIpOwner resources.
  15158. Items []*InternalIpOwner `json:"items,omitempty"`
  15159. // Kind: [Output Only] Type of resource. Always compute#ipOwnerList for
  15160. // lists of IP owners.
  15161. Kind string `json:"kind,omitempty"`
  15162. // NextPageToken: [Output Only] This token allows you to get the next
  15163. // page of results for list requests. If the number of results is larger
  15164. // than maxResults, use the nextPageToken as a value for the query
  15165. // parameter pageToken in the next list request. Subsequent list
  15166. // requests will have their own nextPageToken to continue paging through
  15167. // the results.
  15168. NextPageToken string `json:"nextPageToken,omitempty"`
  15169. // SelfLink: [Output Only] Server-defined URL for this resource.
  15170. SelfLink string `json:"selfLink,omitempty"`
  15171. // Warning: [Output Only] Informational warning message.
  15172. Warning *IpOwnerListWarning `json:"warning,omitempty"`
  15173. // ServerResponse contains the HTTP response code and headers from the
  15174. // server.
  15175. googleapi.ServerResponse `json:"-"`
  15176. // ForceSendFields is a list of field names (e.g. "Id") to
  15177. // unconditionally include in API requests. By default, fields with
  15178. // empty values are omitted from API requests. However, any non-pointer,
  15179. // non-interface field appearing in ForceSendFields will be sent to the
  15180. // server regardless of whether the field is empty or not. This may be
  15181. // used to include empty fields in Patch requests.
  15182. ForceSendFields []string `json:"-"`
  15183. // NullFields is a list of field names (e.g. "Id") to include in API
  15184. // requests with the JSON null value. By default, fields with empty
  15185. // values are omitted from API requests. However, any field with an
  15186. // empty value appearing in NullFields will be sent to the server as
  15187. // null. It is an error if a field in this list has a non-empty value.
  15188. // This may be used to include null fields in Patch requests.
  15189. NullFields []string `json:"-"`
  15190. }
  15191. func (s *IpOwnerList) MarshalJSON() ([]byte, error) {
  15192. type NoMethod IpOwnerList
  15193. raw := NoMethod(*s)
  15194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15195. }
  15196. // IpOwnerListWarning: [Output Only] Informational warning message.
  15197. type IpOwnerListWarning struct {
  15198. // Code: [Output Only] A warning code, if applicable. For example,
  15199. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15200. // the response.
  15201. //
  15202. // Possible values:
  15203. // "CLEANUP_FAILED"
  15204. // "DEPRECATED_RESOURCE_USED"
  15205. // "DEPRECATED_TYPE_USED"
  15206. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15207. // "EXPERIMENTAL_TYPE_USED"
  15208. // "EXTERNAL_API_WARNING"
  15209. // "FIELD_VALUE_OVERRIDEN"
  15210. // "INJECTED_KERNELS_DEPRECATED"
  15211. // "MISSING_TYPE_DEPENDENCY"
  15212. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15213. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15214. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15215. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15216. // "NEXT_HOP_NOT_RUNNING"
  15217. // "NOT_CRITICAL_ERROR"
  15218. // "NO_RESULTS_ON_PAGE"
  15219. // "REQUIRED_TOS_AGREEMENT"
  15220. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15221. // "RESOURCE_NOT_DELETED"
  15222. // "SCHEMA_VALIDATION_IGNORED"
  15223. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15224. // "UNDECLARED_PROPERTIES"
  15225. // "UNREACHABLE"
  15226. Code string `json:"code,omitempty"`
  15227. // Data: [Output Only] Metadata about this warning in key: value format.
  15228. // For example:
  15229. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15230. Data []*IpOwnerListWarningData `json:"data,omitempty"`
  15231. // Message: [Output Only] A human-readable description of the warning
  15232. // code.
  15233. Message string `json:"message,omitempty"`
  15234. // ForceSendFields is a list of field names (e.g. "Code") to
  15235. // unconditionally include in API requests. By default, fields with
  15236. // empty values are omitted from API requests. However, any non-pointer,
  15237. // non-interface field appearing in ForceSendFields will be sent to the
  15238. // server regardless of whether the field is empty or not. This may be
  15239. // used to include empty fields in Patch requests.
  15240. ForceSendFields []string `json:"-"`
  15241. // NullFields is a list of field names (e.g. "Code") to include in API
  15242. // requests with the JSON null value. By default, fields with empty
  15243. // values are omitted from API requests. However, any field with an
  15244. // empty value appearing in NullFields will be sent to the server as
  15245. // null. It is an error if a field in this list has a non-empty value.
  15246. // This may be used to include null fields in Patch requests.
  15247. NullFields []string `json:"-"`
  15248. }
  15249. func (s *IpOwnerListWarning) MarshalJSON() ([]byte, error) {
  15250. type NoMethod IpOwnerListWarning
  15251. raw := NoMethod(*s)
  15252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15253. }
  15254. type IpOwnerListWarningData struct {
  15255. // Key: [Output Only] A key that provides more detail on the warning
  15256. // being returned. For example, for warnings where there are no results
  15257. // in a list request for a particular zone, this key might be scope and
  15258. // the key value might be the zone name. Other examples might be a key
  15259. // indicating a deprecated resource and a suggested replacement, or a
  15260. // warning about invalid network settings (for example, if an instance
  15261. // attempts to perform IP forwarding but is not enabled for IP
  15262. // forwarding).
  15263. Key string `json:"key,omitempty"`
  15264. // Value: [Output Only] A warning data value corresponding to the key.
  15265. Value string `json:"value,omitempty"`
  15266. // ForceSendFields is a list of field names (e.g. "Key") to
  15267. // unconditionally include in API requests. By default, fields with
  15268. // empty values are omitted from API requests. However, any non-pointer,
  15269. // non-interface field appearing in ForceSendFields will be sent to the
  15270. // server regardless of whether the field is empty or not. This may be
  15271. // used to include empty fields in Patch requests.
  15272. ForceSendFields []string `json:"-"`
  15273. // NullFields is a list of field names (e.g. "Key") to include in API
  15274. // requests with the JSON null value. By default, fields with empty
  15275. // values are omitted from API requests. However, any field with an
  15276. // empty value appearing in NullFields will be sent to the server as
  15277. // null. It is an error if a field in this list has a non-empty value.
  15278. // This may be used to include null fields in Patch requests.
  15279. NullFields []string `json:"-"`
  15280. }
  15281. func (s *IpOwnerListWarningData) MarshalJSON() ([]byte, error) {
  15282. type NoMethod IpOwnerListWarningData
  15283. raw := NoMethod(*s)
  15284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15285. }
  15286. // License: A license resource.
  15287. type License struct {
  15288. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  15289. // reflects whether a license charges a usage fee.
  15290. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  15291. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15292. // format.
  15293. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15294. // Description: An optional textual description of the resource;
  15295. // provided by the client when the resource is created.
  15296. Description string `json:"description,omitempty"`
  15297. // Id: [Output Only] The unique identifier for the resource. This
  15298. // identifier is defined by the server.
  15299. Id uint64 `json:"id,omitempty,string"`
  15300. // Kind: [Output Only] Type of resource. Always compute#license for
  15301. // licenses.
  15302. Kind string `json:"kind,omitempty"`
  15303. // LicenseCode: [Output Only] The unique code used to attach this
  15304. // license to images, snapshots, and disks.
  15305. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  15306. // Name: Name of the resource. The name must be 1-63 characters long and
  15307. // comply with RFC1035.
  15308. Name string `json:"name,omitempty"`
  15309. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  15310. // SelfLink: [Output Only] Server-defined URL for the resource.
  15311. SelfLink string `json:"selfLink,omitempty"`
  15312. // Transferable: If false, licenses will not be copied from the source
  15313. // resource when creating an image from a disk, disk from snapshot, or
  15314. // snapshot from disk.
  15315. Transferable bool `json:"transferable,omitempty"`
  15316. // ServerResponse contains the HTTP response code and headers from the
  15317. // server.
  15318. googleapi.ServerResponse `json:"-"`
  15319. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  15320. // unconditionally include in API requests. By default, fields with
  15321. // empty values are omitted from API requests. However, any non-pointer,
  15322. // non-interface field appearing in ForceSendFields will be sent to the
  15323. // server regardless of whether the field is empty or not. This may be
  15324. // used to include empty fields in Patch requests.
  15325. ForceSendFields []string `json:"-"`
  15326. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  15327. // in API requests with the JSON null value. By default, fields with
  15328. // empty values are omitted from API requests. However, any field with
  15329. // an empty value appearing in NullFields will be sent to the server as
  15330. // null. It is an error if a field in this list has a non-empty value.
  15331. // This may be used to include null fields in Patch requests.
  15332. NullFields []string `json:"-"`
  15333. }
  15334. func (s *License) MarshalJSON() ([]byte, error) {
  15335. type NoMethod License
  15336. raw := NoMethod(*s)
  15337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15338. }
  15339. type LicenseCode struct {
  15340. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15341. // format.
  15342. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15343. // Description: [Output Only] Description of this License Code.
  15344. Description string `json:"description,omitempty"`
  15345. // Id: [Output Only] The unique identifier for the resource. This
  15346. // identifier is defined by the server.
  15347. Id uint64 `json:"id,omitempty,string"`
  15348. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  15349. // licenses.
  15350. Kind string `json:"kind,omitempty"`
  15351. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  15352. // with the same License Code.
  15353. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  15354. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  15355. // long and must be a valid 64 bit integer.
  15356. Name string `json:"name,omitempty"`
  15357. // SelfLink: [Output Only] Server-defined URL for the resource.
  15358. SelfLink string `json:"selfLink,omitempty"`
  15359. // State: [Output Only] Current state of this License Code.
  15360. //
  15361. // Possible values:
  15362. // "DISABLED"
  15363. // "ENABLED"
  15364. // "RESTRICTED"
  15365. // "STATE_UNSPECIFIED"
  15366. // "TERMINATED"
  15367. State string `json:"state,omitempty"`
  15368. // Transferable: [Output Only] If true, the license will remain attached
  15369. // when creating images or snapshots from disks. Otherwise, the license
  15370. // is not transferred.
  15371. Transferable bool `json:"transferable,omitempty"`
  15372. // ServerResponse contains the HTTP response code and headers from the
  15373. // server.
  15374. googleapi.ServerResponse `json:"-"`
  15375. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15376. // to unconditionally include in API requests. By default, fields with
  15377. // empty values are omitted from API requests. However, any non-pointer,
  15378. // non-interface field appearing in ForceSendFields will be sent to the
  15379. // server regardless of whether the field is empty or not. This may be
  15380. // used to include empty fields in Patch requests.
  15381. ForceSendFields []string `json:"-"`
  15382. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15383. // include in API requests with the JSON null value. By default, fields
  15384. // with empty values are omitted from API requests. However, any field
  15385. // with an empty value appearing in NullFields will be sent to the
  15386. // server as null. It is an error if a field in this list has a
  15387. // non-empty value. This may be used to include null fields in Patch
  15388. // requests.
  15389. NullFields []string `json:"-"`
  15390. }
  15391. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  15392. type NoMethod LicenseCode
  15393. raw := NoMethod(*s)
  15394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15395. }
  15396. type LicenseCodeLicenseAlias struct {
  15397. // Description: [Output Only] Description of this License Code.
  15398. Description string `json:"description,omitempty"`
  15399. // SelfLink: [Output Only] URL of license corresponding to this License
  15400. // Code.
  15401. SelfLink string `json:"selfLink,omitempty"`
  15402. // ForceSendFields is a list of field names (e.g. "Description") to
  15403. // unconditionally include in API requests. By default, fields with
  15404. // empty values are omitted from API requests. However, any non-pointer,
  15405. // non-interface field appearing in ForceSendFields will be sent to the
  15406. // server regardless of whether the field is empty or not. This may be
  15407. // used to include empty fields in Patch requests.
  15408. ForceSendFields []string `json:"-"`
  15409. // NullFields is a list of field names (e.g. "Description") to include
  15410. // in API requests with the JSON null value. By default, fields with
  15411. // empty values are omitted from API requests. However, any field with
  15412. // an empty value appearing in NullFields will be sent to the server as
  15413. // null. It is an error if a field in this list has a non-empty value.
  15414. // This may be used to include null fields in Patch requests.
  15415. NullFields []string `json:"-"`
  15416. }
  15417. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  15418. type NoMethod LicenseCodeLicenseAlias
  15419. raw := NoMethod(*s)
  15420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15421. }
  15422. type LicenseResourceRequirements struct {
  15423. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  15424. // Instance. Enforced at Instance creation and Instance start.
  15425. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  15426. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  15427. // Instance creation and Instance start.
  15428. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  15429. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  15430. // unconditionally include in API requests. By default, fields with
  15431. // empty values are omitted from API requests. However, any non-pointer,
  15432. // non-interface field appearing in ForceSendFields will be sent to the
  15433. // server regardless of whether the field is empty or not. This may be
  15434. // used to include empty fields in Patch requests.
  15435. ForceSendFields []string `json:"-"`
  15436. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  15437. // include in API requests with the JSON null value. By default, fields
  15438. // with empty values are omitted from API requests. However, any field
  15439. // with an empty value appearing in NullFields will be sent to the
  15440. // server as null. It is an error if a field in this list has a
  15441. // non-empty value. This may be used to include null fields in Patch
  15442. // requests.
  15443. NullFields []string `json:"-"`
  15444. }
  15445. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  15446. type NoMethod LicenseResourceRequirements
  15447. raw := NoMethod(*s)
  15448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15449. }
  15450. type LicensesListResponse struct {
  15451. // Id: [Output Only] Unique identifier for the resource; defined by the
  15452. // server.
  15453. Id string `json:"id,omitempty"`
  15454. // Items: A list of License resources.
  15455. Items []*License `json:"items,omitempty"`
  15456. // NextPageToken: [Output Only] This token allows you to get the next
  15457. // page of results for list requests. If the number of results is larger
  15458. // than maxResults, use the nextPageToken as a value for the query
  15459. // parameter pageToken in the next list request. Subsequent list
  15460. // requests will have their own nextPageToken to continue paging through
  15461. // the results.
  15462. NextPageToken string `json:"nextPageToken,omitempty"`
  15463. // SelfLink: [Output Only] Server-defined URL for this resource.
  15464. SelfLink string `json:"selfLink,omitempty"`
  15465. // Warning: [Output Only] Informational warning message.
  15466. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  15467. // ServerResponse contains the HTTP response code and headers from the
  15468. // server.
  15469. googleapi.ServerResponse `json:"-"`
  15470. // ForceSendFields is a list of field names (e.g. "Id") to
  15471. // unconditionally include in API requests. By default, fields with
  15472. // empty values are omitted from API requests. However, any non-pointer,
  15473. // non-interface field appearing in ForceSendFields will be sent to the
  15474. // server regardless of whether the field is empty or not. This may be
  15475. // used to include empty fields in Patch requests.
  15476. ForceSendFields []string `json:"-"`
  15477. // NullFields is a list of field names (e.g. "Id") to include in API
  15478. // requests with the JSON null value. By default, fields with empty
  15479. // values are omitted from API requests. However, any field with an
  15480. // empty value appearing in NullFields will be sent to the server as
  15481. // null. It is an error if a field in this list has a non-empty value.
  15482. // This may be used to include null fields in Patch requests.
  15483. NullFields []string `json:"-"`
  15484. }
  15485. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  15486. type NoMethod LicensesListResponse
  15487. raw := NoMethod(*s)
  15488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15489. }
  15490. // LicensesListResponseWarning: [Output Only] Informational warning
  15491. // message.
  15492. type LicensesListResponseWarning struct {
  15493. // Code: [Output Only] A warning code, if applicable. For example,
  15494. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15495. // the response.
  15496. //
  15497. // Possible values:
  15498. // "CLEANUP_FAILED"
  15499. // "DEPRECATED_RESOURCE_USED"
  15500. // "DEPRECATED_TYPE_USED"
  15501. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15502. // "EXPERIMENTAL_TYPE_USED"
  15503. // "EXTERNAL_API_WARNING"
  15504. // "FIELD_VALUE_OVERRIDEN"
  15505. // "INJECTED_KERNELS_DEPRECATED"
  15506. // "MISSING_TYPE_DEPENDENCY"
  15507. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15508. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15509. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15510. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15511. // "NEXT_HOP_NOT_RUNNING"
  15512. // "NOT_CRITICAL_ERROR"
  15513. // "NO_RESULTS_ON_PAGE"
  15514. // "REQUIRED_TOS_AGREEMENT"
  15515. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15516. // "RESOURCE_NOT_DELETED"
  15517. // "SCHEMA_VALIDATION_IGNORED"
  15518. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15519. // "UNDECLARED_PROPERTIES"
  15520. // "UNREACHABLE"
  15521. Code string `json:"code,omitempty"`
  15522. // Data: [Output Only] Metadata about this warning in key: value format.
  15523. // For example:
  15524. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15525. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  15526. // Message: [Output Only] A human-readable description of the warning
  15527. // code.
  15528. Message string `json:"message,omitempty"`
  15529. // ForceSendFields is a list of field names (e.g. "Code") to
  15530. // unconditionally include in API requests. By default, fields with
  15531. // empty values are omitted from API requests. However, any non-pointer,
  15532. // non-interface field appearing in ForceSendFields will be sent to the
  15533. // server regardless of whether the field is empty or not. This may be
  15534. // used to include empty fields in Patch requests.
  15535. ForceSendFields []string `json:"-"`
  15536. // NullFields is a list of field names (e.g. "Code") to include in API
  15537. // requests with the JSON null value. By default, fields with empty
  15538. // values are omitted from API requests. However, any field with an
  15539. // empty value appearing in NullFields will be sent to the server as
  15540. // null. It is an error if a field in this list has a non-empty value.
  15541. // This may be used to include null fields in Patch requests.
  15542. NullFields []string `json:"-"`
  15543. }
  15544. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  15545. type NoMethod LicensesListResponseWarning
  15546. raw := NoMethod(*s)
  15547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15548. }
  15549. type LicensesListResponseWarningData struct {
  15550. // Key: [Output Only] A key that provides more detail on the warning
  15551. // being returned. For example, for warnings where there are no results
  15552. // in a list request for a particular zone, this key might be scope and
  15553. // the key value might be the zone name. Other examples might be a key
  15554. // indicating a deprecated resource and a suggested replacement, or a
  15555. // warning about invalid network settings (for example, if an instance
  15556. // attempts to perform IP forwarding but is not enabled for IP
  15557. // forwarding).
  15558. Key string `json:"key,omitempty"`
  15559. // Value: [Output Only] A warning data value corresponding to the key.
  15560. Value string `json:"value,omitempty"`
  15561. // ForceSendFields is a list of field names (e.g. "Key") to
  15562. // unconditionally include in API requests. By default, fields with
  15563. // empty values are omitted from API requests. However, any non-pointer,
  15564. // non-interface field appearing in ForceSendFields will be sent to the
  15565. // server regardless of whether the field is empty or not. This may be
  15566. // used to include empty fields in Patch requests.
  15567. ForceSendFields []string `json:"-"`
  15568. // NullFields is a list of field names (e.g. "Key") to include in API
  15569. // requests with the JSON null value. By default, fields with empty
  15570. // values are omitted from API requests. However, any field with an
  15571. // empty value appearing in NullFields will be sent to the server as
  15572. // null. It is an error if a field in this list has a non-empty value.
  15573. // This may be used to include null fields in Patch requests.
  15574. NullFields []string `json:"-"`
  15575. }
  15576. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  15577. type NoMethod LicensesListResponseWarningData
  15578. raw := NoMethod(*s)
  15579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15580. }
  15581. // LogConfig: Specifies what kind of log the caller must write
  15582. type LogConfig struct {
  15583. // CloudAudit: Cloud audit options.
  15584. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  15585. // Counter: Counter options.
  15586. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  15587. // DataAccess: Data access options.
  15588. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  15589. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  15590. // unconditionally include in API requests. By default, fields with
  15591. // empty values are omitted from API requests. However, any non-pointer,
  15592. // non-interface field appearing in ForceSendFields will be sent to the
  15593. // server regardless of whether the field is empty or not. This may be
  15594. // used to include empty fields in Patch requests.
  15595. ForceSendFields []string `json:"-"`
  15596. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  15597. // API requests with the JSON null value. By default, fields with empty
  15598. // values are omitted from API requests. However, any field with an
  15599. // empty value appearing in NullFields will be sent to the server as
  15600. // null. It is an error if a field in this list has a non-empty value.
  15601. // This may be used to include null fields in Patch requests.
  15602. NullFields []string `json:"-"`
  15603. }
  15604. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  15605. type NoMethod LogConfig
  15606. raw := NoMethod(*s)
  15607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15608. }
  15609. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  15610. type LogConfigCloudAuditOptions struct {
  15611. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  15612. // Logging pipeline.
  15613. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  15614. // LogName: The log_name to populate in the Cloud Audit Record.
  15615. //
  15616. // Possible values:
  15617. // "ADMIN_ACTIVITY"
  15618. // "DATA_ACCESS"
  15619. // "UNSPECIFIED_LOG_NAME"
  15620. LogName string `json:"logName,omitempty"`
  15621. // ForceSendFields is a list of field names (e.g.
  15622. // "AuthorizationLoggingOptions") to unconditionally include in API
  15623. // requests. By default, fields with empty values are omitted from API
  15624. // requests. However, any non-pointer, non-interface field appearing in
  15625. // ForceSendFields will be sent to the server regardless of whether the
  15626. // field is empty or not. This may be used to include empty fields in
  15627. // Patch requests.
  15628. ForceSendFields []string `json:"-"`
  15629. // NullFields is a list of field names (e.g.
  15630. // "AuthorizationLoggingOptions") to include in API requests with the
  15631. // JSON null value. By default, fields with empty values are omitted
  15632. // from API requests. However, any field with an empty value appearing
  15633. // in NullFields will be sent to the server as null. It is an error if a
  15634. // field in this list has a non-empty value. This may be used to include
  15635. // null fields in Patch requests.
  15636. NullFields []string `json:"-"`
  15637. }
  15638. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  15639. type NoMethod LogConfigCloudAuditOptions
  15640. raw := NoMethod(*s)
  15641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15642. }
  15643. // LogConfigCounterOptions: Increment a streamz counter with the
  15644. // specified metric and field names.
  15645. //
  15646. // Metric names should start with a '/', generally be lowercase-only,
  15647. // and end in "_count". Field names should not contain an initial slash.
  15648. // The actual exported metric names will have "/iam/policy"
  15649. // prepended.
  15650. //
  15651. // Field names correspond to IAM request parameters and field values are
  15652. // their respective values.
  15653. //
  15654. // Supported field names: - "authority", which is "[token]" if
  15655. // IAMContext.token is present, otherwise the value of
  15656. // IAMContext.authority_selector if present, and otherwise a
  15657. // representation of IAMContext.principal; or - "iam_principal", a
  15658. // representation of IAMContext.principal even if a token or authority
  15659. // selector is present; or - "" (empty string), resulting in a counter
  15660. // with no fields.
  15661. //
  15662. // Examples: counter { metric: "/debug_access_count" field:
  15663. // "iam_principal" } ==> increment counter
  15664. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  15665. // IAMContext.principal]}
  15666. //
  15667. // At this time we do not support multiple field names (though this may
  15668. // be supported in the future).
  15669. type LogConfigCounterOptions struct {
  15670. // Field: The field value to attribute.
  15671. Field string `json:"field,omitempty"`
  15672. // Metric: The metric to update.
  15673. Metric string `json:"metric,omitempty"`
  15674. // ForceSendFields is a list of field names (e.g. "Field") to
  15675. // unconditionally include in API requests. By default, fields with
  15676. // empty values are omitted from API requests. However, any non-pointer,
  15677. // non-interface field appearing in ForceSendFields will be sent to the
  15678. // server regardless of whether the field is empty or not. This may be
  15679. // used to include empty fields in Patch requests.
  15680. ForceSendFields []string `json:"-"`
  15681. // NullFields is a list of field names (e.g. "Field") to include in API
  15682. // requests with the JSON null value. By default, fields with empty
  15683. // values are omitted from API requests. However, any field with an
  15684. // empty value appearing in NullFields will be sent to the server as
  15685. // null. It is an error if a field in this list has a non-empty value.
  15686. // This may be used to include null fields in Patch requests.
  15687. NullFields []string `json:"-"`
  15688. }
  15689. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  15690. type NoMethod LogConfigCounterOptions
  15691. raw := NoMethod(*s)
  15692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15693. }
  15694. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  15695. type LogConfigDataAccessOptions struct {
  15696. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  15697. // the caller. This is relevant only in the LocalIAM implementation, for
  15698. // now.
  15699. //
  15700. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  15701. // while work is being done to satisfy the requirements of go/345.
  15702. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  15703. // still exists because there is active work being done to support it
  15704. // (b/115874152).
  15705. //
  15706. // Possible values:
  15707. // "LOG_FAIL_CLOSED"
  15708. // "LOG_MODE_UNSPECIFIED"
  15709. LogMode string `json:"logMode,omitempty"`
  15710. // ForceSendFields is a list of field names (e.g. "LogMode") to
  15711. // unconditionally include in API requests. By default, fields with
  15712. // empty values are omitted from API requests. However, any non-pointer,
  15713. // non-interface field appearing in ForceSendFields will be sent to the
  15714. // server regardless of whether the field is empty or not. This may be
  15715. // used to include empty fields in Patch requests.
  15716. ForceSendFields []string `json:"-"`
  15717. // NullFields is a list of field names (e.g. "LogMode") to include in
  15718. // API requests with the JSON null value. By default, fields with empty
  15719. // values are omitted from API requests. However, any field with an
  15720. // empty value appearing in NullFields will be sent to the server as
  15721. // null. It is an error if a field in this list has a non-empty value.
  15722. // This may be used to include null fields in Patch requests.
  15723. NullFields []string `json:"-"`
  15724. }
  15725. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  15726. type NoMethod LogConfigDataAccessOptions
  15727. raw := NoMethod(*s)
  15728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15729. }
  15730. // MachineImage: Machine image resource.
  15731. type MachineImage struct {
  15732. // CreationTimestamp: [Output Only] The creation timestamp for this
  15733. // machine image in RFC3339 text format.
  15734. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15735. // Description: An optional description of this resource. Provide this
  15736. // property when you create the resource.
  15737. Description string `json:"description,omitempty"`
  15738. // Id: [Output Only] A unique identifier for this machine image. The
  15739. // server defines this identifier.
  15740. Id uint64 `json:"id,omitempty,string"`
  15741. // Kind: [Output Only] The resource type, which is always
  15742. // compute#machineImage for machine image.
  15743. Kind string `json:"kind,omitempty"`
  15744. // Name: Name of the resource; provided by the client when the resource
  15745. // is created. The name must be 1-63 characters long, and comply with
  15746. // RFC1035. Specifically, the name must be 1-63 characters long and
  15747. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15748. // the first character must be a lowercase letter, and all following
  15749. // characters must be a dash, lowercase letter, or digit, except the
  15750. // last character, which cannot be a dash.
  15751. Name string `json:"name,omitempty"`
  15752. // SelfLink: [Output Only] The URL for this machine image. The server
  15753. // defines this URL.
  15754. SelfLink string `json:"selfLink,omitempty"`
  15755. // SourceInstance: The source instance used to create the machine image.
  15756. // You can provide this as a partial or full URL to the resource. For
  15757. // example, the following are valid values:
  15758. // -
  15759. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  15760. // - projects/project/zones/zone/instances/instance
  15761. SourceInstance string `json:"sourceInstance,omitempty"`
  15762. // SourceInstanceProperties: Properties of source instance.
  15763. SourceInstanceProperties *SourceInstanceProperties `json:"sourceInstanceProperties,omitempty"`
  15764. // Status: [Output Only] The status of disk creation.
  15765. //
  15766. // Possible values:
  15767. // "CREATING"
  15768. // "DELETING"
  15769. // "INVALID"
  15770. // "READY"
  15771. // "UPLOADING"
  15772. Status string `json:"status,omitempty"`
  15773. // StorageLocations: GCS bucket storage location of the snapshot
  15774. // (regional or multi-regional).
  15775. StorageLocations []string `json:"storageLocations,omitempty"`
  15776. // ServerResponse contains the HTTP response code and headers from the
  15777. // server.
  15778. googleapi.ServerResponse `json:"-"`
  15779. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15780. // to unconditionally include in API requests. By default, fields with
  15781. // empty values are omitted from API requests. However, any non-pointer,
  15782. // non-interface field appearing in ForceSendFields will be sent to the
  15783. // server regardless of whether the field is empty or not. This may be
  15784. // used to include empty fields in Patch requests.
  15785. ForceSendFields []string `json:"-"`
  15786. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15787. // include in API requests with the JSON null value. By default, fields
  15788. // with empty values are omitted from API requests. However, any field
  15789. // with an empty value appearing in NullFields will be sent to the
  15790. // server as null. It is an error if a field in this list has a
  15791. // non-empty value. This may be used to include null fields in Patch
  15792. // requests.
  15793. NullFields []string `json:"-"`
  15794. }
  15795. func (s *MachineImage) MarshalJSON() ([]byte, error) {
  15796. type NoMethod MachineImage
  15797. raw := NoMethod(*s)
  15798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15799. }
  15800. // MachineImageList: A list of machine images.
  15801. type MachineImageList struct {
  15802. Etag string `json:"etag,omitempty"`
  15803. // Id: [Output Only] Unique identifier for the resource; defined by the
  15804. // server.
  15805. Id string `json:"id,omitempty"`
  15806. // Items: A list of MachineImage resources.
  15807. Items []*MachineImage `json:"items,omitempty"`
  15808. // Kind: [Output Only] The resource type, which is always
  15809. // compute#machineImagesListResponse for machine image lists.
  15810. Kind string `json:"kind,omitempty"`
  15811. // NextPageToken: [Output Only] This token allows you to get the next
  15812. // page of results for list requests. If the number of results is larger
  15813. // than maxResults, use the nextPageToken as a value for the query
  15814. // parameter pageToken in the next list request. Subsequent list
  15815. // requests will have their own nextPageToken to continue paging through
  15816. // the results.
  15817. NextPageToken string `json:"nextPageToken,omitempty"`
  15818. // SelfLink: [Output Only] Server-defined URL for this resource.
  15819. SelfLink string `json:"selfLink,omitempty"`
  15820. // Warning: [Output Only] Informational warning message.
  15821. Warning *MachineImageListWarning `json:"warning,omitempty"`
  15822. // ServerResponse contains the HTTP response code and headers from the
  15823. // server.
  15824. googleapi.ServerResponse `json:"-"`
  15825. // ForceSendFields is a list of field names (e.g. "Etag") to
  15826. // unconditionally include in API requests. By default, fields with
  15827. // empty values are omitted from API requests. However, any non-pointer,
  15828. // non-interface field appearing in ForceSendFields will be sent to the
  15829. // server regardless of whether the field is empty or not. This may be
  15830. // used to include empty fields in Patch requests.
  15831. ForceSendFields []string `json:"-"`
  15832. // NullFields is a list of field names (e.g. "Etag") to include in API
  15833. // requests with the JSON null value. By default, fields with empty
  15834. // values are omitted from API requests. However, any field with an
  15835. // empty value appearing in NullFields will be sent to the server as
  15836. // null. It is an error if a field in this list has a non-empty value.
  15837. // This may be used to include null fields in Patch requests.
  15838. NullFields []string `json:"-"`
  15839. }
  15840. func (s *MachineImageList) MarshalJSON() ([]byte, error) {
  15841. type NoMethod MachineImageList
  15842. raw := NoMethod(*s)
  15843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15844. }
  15845. // MachineImageListWarning: [Output Only] Informational warning message.
  15846. type MachineImageListWarning struct {
  15847. // Code: [Output Only] A warning code, if applicable. For example,
  15848. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15849. // the response.
  15850. //
  15851. // Possible values:
  15852. // "CLEANUP_FAILED"
  15853. // "DEPRECATED_RESOURCE_USED"
  15854. // "DEPRECATED_TYPE_USED"
  15855. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15856. // "EXPERIMENTAL_TYPE_USED"
  15857. // "EXTERNAL_API_WARNING"
  15858. // "FIELD_VALUE_OVERRIDEN"
  15859. // "INJECTED_KERNELS_DEPRECATED"
  15860. // "MISSING_TYPE_DEPENDENCY"
  15861. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15862. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15863. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15864. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15865. // "NEXT_HOP_NOT_RUNNING"
  15866. // "NOT_CRITICAL_ERROR"
  15867. // "NO_RESULTS_ON_PAGE"
  15868. // "REQUIRED_TOS_AGREEMENT"
  15869. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15870. // "RESOURCE_NOT_DELETED"
  15871. // "SCHEMA_VALIDATION_IGNORED"
  15872. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15873. // "UNDECLARED_PROPERTIES"
  15874. // "UNREACHABLE"
  15875. Code string `json:"code,omitempty"`
  15876. // Data: [Output Only] Metadata about this warning in key: value format.
  15877. // For example:
  15878. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15879. Data []*MachineImageListWarningData `json:"data,omitempty"`
  15880. // Message: [Output Only] A human-readable description of the warning
  15881. // code.
  15882. Message string `json:"message,omitempty"`
  15883. // ForceSendFields is a list of field names (e.g. "Code") to
  15884. // unconditionally include in API requests. By default, fields with
  15885. // empty values are omitted from API requests. However, any non-pointer,
  15886. // non-interface field appearing in ForceSendFields will be sent to the
  15887. // server regardless of whether the field is empty or not. This may be
  15888. // used to include empty fields in Patch requests.
  15889. ForceSendFields []string `json:"-"`
  15890. // NullFields is a list of field names (e.g. "Code") to include in API
  15891. // requests with the JSON null value. By default, fields with empty
  15892. // values are omitted from API requests. However, any field with an
  15893. // empty value appearing in NullFields will be sent to the server as
  15894. // null. It is an error if a field in this list has a non-empty value.
  15895. // This may be used to include null fields in Patch requests.
  15896. NullFields []string `json:"-"`
  15897. }
  15898. func (s *MachineImageListWarning) MarshalJSON() ([]byte, error) {
  15899. type NoMethod MachineImageListWarning
  15900. raw := NoMethod(*s)
  15901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15902. }
  15903. type MachineImageListWarningData struct {
  15904. // Key: [Output Only] A key that provides more detail on the warning
  15905. // being returned. For example, for warnings where there are no results
  15906. // in a list request for a particular zone, this key might be scope and
  15907. // the key value might be the zone name. Other examples might be a key
  15908. // indicating a deprecated resource and a suggested replacement, or a
  15909. // warning about invalid network settings (for example, if an instance
  15910. // attempts to perform IP forwarding but is not enabled for IP
  15911. // forwarding).
  15912. Key string `json:"key,omitempty"`
  15913. // Value: [Output Only] A warning data value corresponding to the key.
  15914. Value string `json:"value,omitempty"`
  15915. // ForceSendFields is a list of field names (e.g. "Key") to
  15916. // unconditionally include in API requests. By default, fields with
  15917. // empty values are omitted from API requests. However, any non-pointer,
  15918. // non-interface field appearing in ForceSendFields will be sent to the
  15919. // server regardless of whether the field is empty or not. This may be
  15920. // used to include empty fields in Patch requests.
  15921. ForceSendFields []string `json:"-"`
  15922. // NullFields is a list of field names (e.g. "Key") to include in API
  15923. // requests with the JSON null value. By default, fields with empty
  15924. // values are omitted from API requests. However, any field with an
  15925. // empty value appearing in NullFields will be sent to the server as
  15926. // null. It is an error if a field in this list has a non-empty value.
  15927. // This may be used to include null fields in Patch requests.
  15928. NullFields []string `json:"-"`
  15929. }
  15930. func (s *MachineImageListWarningData) MarshalJSON() ([]byte, error) {
  15931. type NoMethod MachineImageListWarningData
  15932. raw := NoMethod(*s)
  15933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15934. }
  15935. // MachineType: A Machine Type resource. (== resource_for
  15936. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  15937. type MachineType struct {
  15938. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15939. // format.
  15940. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15941. // Deprecated: [Output Only] The deprecation status associated with this
  15942. // machine type.
  15943. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  15944. // Description: [Output Only] An optional textual description of the
  15945. // resource.
  15946. Description string `json:"description,omitempty"`
  15947. // GuestCpus: [Output Only] The number of virtual CPUs that are
  15948. // available to the instance.
  15949. GuestCpus int64 `json:"guestCpus,omitempty"`
  15950. // Id: [Output Only] The unique identifier for the resource. This
  15951. // identifier is defined by the server.
  15952. Id uint64 `json:"id,omitempty,string"`
  15953. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  15954. // CPU. See Shared-core machine types for more information.
  15955. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  15956. // Kind: [Output Only] The type of the resource. Always
  15957. // compute#machineType for machine types.
  15958. Kind string `json:"kind,omitempty"`
  15959. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  15960. // allowed.
  15961. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  15962. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  15963. // disks size (GB) allowed.
  15964. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  15965. // MemoryMb: [Output Only] The amount of physical memory available to
  15966. // the instance, defined in MB.
  15967. MemoryMb int64 `json:"memoryMb,omitempty"`
  15968. // Name: [Output Only] Name of the resource.
  15969. Name string `json:"name,omitempty"`
  15970. // SelfLink: [Output Only] Server-defined URL for the resource.
  15971. SelfLink string `json:"selfLink,omitempty"`
  15972. // Zone: [Output Only] The name of the zone where the machine type
  15973. // resides, such as us-central1-a.
  15974. Zone string `json:"zone,omitempty"`
  15975. // ServerResponse contains the HTTP response code and headers from the
  15976. // server.
  15977. googleapi.ServerResponse `json:"-"`
  15978. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15979. // to unconditionally include in API requests. By default, fields with
  15980. // empty values are omitted from API requests. However, any non-pointer,
  15981. // non-interface field appearing in ForceSendFields will be sent to the
  15982. // server regardless of whether the field is empty or not. This may be
  15983. // used to include empty fields in Patch requests.
  15984. ForceSendFields []string `json:"-"`
  15985. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15986. // include in API requests with the JSON null value. By default, fields
  15987. // with empty values are omitted from API requests. However, any field
  15988. // with an empty value appearing in NullFields will be sent to the
  15989. // server as null. It is an error if a field in this list has a
  15990. // non-empty value. This may be used to include null fields in Patch
  15991. // requests.
  15992. NullFields []string `json:"-"`
  15993. }
  15994. func (s *MachineType) MarshalJSON() ([]byte, error) {
  15995. type NoMethod MachineType
  15996. raw := NoMethod(*s)
  15997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15998. }
  15999. type MachineTypeAggregatedList struct {
  16000. // Id: [Output Only] Unique identifier for the resource; defined by the
  16001. // server.
  16002. Id string `json:"id,omitempty"`
  16003. // Items: A list of MachineTypesScopedList resources.
  16004. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  16005. // Kind: [Output Only] Type of resource. Always
  16006. // compute#machineTypeAggregatedList for aggregated lists of machine
  16007. // types.
  16008. Kind string `json:"kind,omitempty"`
  16009. // NextPageToken: [Output Only] This token allows you to get the next
  16010. // page of results for list requests. If the number of results is larger
  16011. // than maxResults, use the nextPageToken as a value for the query
  16012. // parameter pageToken in the next list request. Subsequent list
  16013. // requests will have their own nextPageToken to continue paging through
  16014. // the results.
  16015. NextPageToken string `json:"nextPageToken,omitempty"`
  16016. // SelfLink: [Output Only] Server-defined URL for this resource.
  16017. SelfLink string `json:"selfLink,omitempty"`
  16018. // Warning: [Output Only] Informational warning message.
  16019. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  16020. // ServerResponse contains the HTTP response code and headers from the
  16021. // server.
  16022. googleapi.ServerResponse `json:"-"`
  16023. // ForceSendFields is a list of field names (e.g. "Id") to
  16024. // unconditionally include in API requests. By default, fields with
  16025. // empty values are omitted from API requests. However, any non-pointer,
  16026. // non-interface field appearing in ForceSendFields will be sent to the
  16027. // server regardless of whether the field is empty or not. This may be
  16028. // used to include empty fields in Patch requests.
  16029. ForceSendFields []string `json:"-"`
  16030. // NullFields is a list of field names (e.g. "Id") to include in API
  16031. // requests with the JSON null value. By default, fields with empty
  16032. // values are omitted from API requests. However, any field with an
  16033. // empty value appearing in NullFields will be sent to the server as
  16034. // null. It is an error if a field in this list has a non-empty value.
  16035. // This may be used to include null fields in Patch requests.
  16036. NullFields []string `json:"-"`
  16037. }
  16038. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  16039. type NoMethod MachineTypeAggregatedList
  16040. raw := NoMethod(*s)
  16041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16042. }
  16043. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  16044. // message.
  16045. type MachineTypeAggregatedListWarning struct {
  16046. // Code: [Output Only] A warning code, if applicable. For example,
  16047. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16048. // the response.
  16049. //
  16050. // Possible values:
  16051. // "CLEANUP_FAILED"
  16052. // "DEPRECATED_RESOURCE_USED"
  16053. // "DEPRECATED_TYPE_USED"
  16054. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16055. // "EXPERIMENTAL_TYPE_USED"
  16056. // "EXTERNAL_API_WARNING"
  16057. // "FIELD_VALUE_OVERRIDEN"
  16058. // "INJECTED_KERNELS_DEPRECATED"
  16059. // "MISSING_TYPE_DEPENDENCY"
  16060. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16061. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16062. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16063. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16064. // "NEXT_HOP_NOT_RUNNING"
  16065. // "NOT_CRITICAL_ERROR"
  16066. // "NO_RESULTS_ON_PAGE"
  16067. // "REQUIRED_TOS_AGREEMENT"
  16068. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16069. // "RESOURCE_NOT_DELETED"
  16070. // "SCHEMA_VALIDATION_IGNORED"
  16071. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16072. // "UNDECLARED_PROPERTIES"
  16073. // "UNREACHABLE"
  16074. Code string `json:"code,omitempty"`
  16075. // Data: [Output Only] Metadata about this warning in key: value format.
  16076. // For example:
  16077. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16078. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  16079. // Message: [Output Only] A human-readable description of the warning
  16080. // code.
  16081. Message string `json:"message,omitempty"`
  16082. // ForceSendFields is a list of field names (e.g. "Code") to
  16083. // unconditionally include in API requests. By default, fields with
  16084. // empty values are omitted from API requests. However, any non-pointer,
  16085. // non-interface field appearing in ForceSendFields will be sent to the
  16086. // server regardless of whether the field is empty or not. This may be
  16087. // used to include empty fields in Patch requests.
  16088. ForceSendFields []string `json:"-"`
  16089. // NullFields is a list of field names (e.g. "Code") to include in API
  16090. // requests with the JSON null value. By default, fields with empty
  16091. // values are omitted from API requests. However, any field with an
  16092. // empty value appearing in NullFields will be sent to the server as
  16093. // null. It is an error if a field in this list has a non-empty value.
  16094. // This may be used to include null fields in Patch requests.
  16095. NullFields []string `json:"-"`
  16096. }
  16097. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16098. type NoMethod MachineTypeAggregatedListWarning
  16099. raw := NoMethod(*s)
  16100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16101. }
  16102. type MachineTypeAggregatedListWarningData struct {
  16103. // Key: [Output Only] A key that provides more detail on the warning
  16104. // being returned. For example, for warnings where there are no results
  16105. // in a list request for a particular zone, this key might be scope and
  16106. // the key value might be the zone name. Other examples might be a key
  16107. // indicating a deprecated resource and a suggested replacement, or a
  16108. // warning about invalid network settings (for example, if an instance
  16109. // attempts to perform IP forwarding but is not enabled for IP
  16110. // forwarding).
  16111. Key string `json:"key,omitempty"`
  16112. // Value: [Output Only] A warning data value corresponding to the key.
  16113. Value string `json:"value,omitempty"`
  16114. // ForceSendFields is a list of field names (e.g. "Key") to
  16115. // unconditionally include in API requests. By default, fields with
  16116. // empty values are omitted from API requests. However, any non-pointer,
  16117. // non-interface field appearing in ForceSendFields will be sent to the
  16118. // server regardless of whether the field is empty or not. This may be
  16119. // used to include empty fields in Patch requests.
  16120. ForceSendFields []string `json:"-"`
  16121. // NullFields is a list of field names (e.g. "Key") to include in API
  16122. // requests with the JSON null value. By default, fields with empty
  16123. // values are omitted from API requests. However, any field with an
  16124. // empty value appearing in NullFields will be sent to the server as
  16125. // null. It is an error if a field in this list has a non-empty value.
  16126. // This may be used to include null fields in Patch requests.
  16127. NullFields []string `json:"-"`
  16128. }
  16129. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16130. type NoMethod MachineTypeAggregatedListWarningData
  16131. raw := NoMethod(*s)
  16132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16133. }
  16134. // MachineTypeList: Contains a list of machine types.
  16135. type MachineTypeList struct {
  16136. // Id: [Output Only] Unique identifier for the resource; defined by the
  16137. // server.
  16138. Id string `json:"id,omitempty"`
  16139. // Items: A list of MachineType resources.
  16140. Items []*MachineType `json:"items,omitempty"`
  16141. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  16142. // for lists of machine types.
  16143. Kind string `json:"kind,omitempty"`
  16144. // NextPageToken: [Output Only] This token allows you to get the next
  16145. // page of results for list requests. If the number of results is larger
  16146. // than maxResults, use the nextPageToken as a value for the query
  16147. // parameter pageToken in the next list request. Subsequent list
  16148. // requests will have their own nextPageToken to continue paging through
  16149. // the results.
  16150. NextPageToken string `json:"nextPageToken,omitempty"`
  16151. // SelfLink: [Output Only] Server-defined URL for this resource.
  16152. SelfLink string `json:"selfLink,omitempty"`
  16153. // Warning: [Output Only] Informational warning message.
  16154. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  16155. // ServerResponse contains the HTTP response code and headers from the
  16156. // server.
  16157. googleapi.ServerResponse `json:"-"`
  16158. // ForceSendFields is a list of field names (e.g. "Id") to
  16159. // unconditionally include in API requests. By default, fields with
  16160. // empty values are omitted from API requests. However, any non-pointer,
  16161. // non-interface field appearing in ForceSendFields will be sent to the
  16162. // server regardless of whether the field is empty or not. This may be
  16163. // used to include empty fields in Patch requests.
  16164. ForceSendFields []string `json:"-"`
  16165. // NullFields is a list of field names (e.g. "Id") to include in API
  16166. // requests with the JSON null value. By default, fields with empty
  16167. // values are omitted from API requests. However, any field with an
  16168. // empty value appearing in NullFields will be sent to the server as
  16169. // null. It is an error if a field in this list has a non-empty value.
  16170. // This may be used to include null fields in Patch requests.
  16171. NullFields []string `json:"-"`
  16172. }
  16173. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  16174. type NoMethod MachineTypeList
  16175. raw := NoMethod(*s)
  16176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16177. }
  16178. // MachineTypeListWarning: [Output Only] Informational warning message.
  16179. type MachineTypeListWarning struct {
  16180. // Code: [Output Only] A warning code, if applicable. For example,
  16181. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16182. // the response.
  16183. //
  16184. // Possible values:
  16185. // "CLEANUP_FAILED"
  16186. // "DEPRECATED_RESOURCE_USED"
  16187. // "DEPRECATED_TYPE_USED"
  16188. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16189. // "EXPERIMENTAL_TYPE_USED"
  16190. // "EXTERNAL_API_WARNING"
  16191. // "FIELD_VALUE_OVERRIDEN"
  16192. // "INJECTED_KERNELS_DEPRECATED"
  16193. // "MISSING_TYPE_DEPENDENCY"
  16194. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16195. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16196. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16197. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16198. // "NEXT_HOP_NOT_RUNNING"
  16199. // "NOT_CRITICAL_ERROR"
  16200. // "NO_RESULTS_ON_PAGE"
  16201. // "REQUIRED_TOS_AGREEMENT"
  16202. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16203. // "RESOURCE_NOT_DELETED"
  16204. // "SCHEMA_VALIDATION_IGNORED"
  16205. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16206. // "UNDECLARED_PROPERTIES"
  16207. // "UNREACHABLE"
  16208. Code string `json:"code,omitempty"`
  16209. // Data: [Output Only] Metadata about this warning in key: value format.
  16210. // For example:
  16211. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16212. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  16213. // Message: [Output Only] A human-readable description of the warning
  16214. // code.
  16215. Message string `json:"message,omitempty"`
  16216. // ForceSendFields is a list of field names (e.g. "Code") to
  16217. // unconditionally include in API requests. By default, fields with
  16218. // empty values are omitted from API requests. However, any non-pointer,
  16219. // non-interface field appearing in ForceSendFields will be sent to the
  16220. // server regardless of whether the field is empty or not. This may be
  16221. // used to include empty fields in Patch requests.
  16222. ForceSendFields []string `json:"-"`
  16223. // NullFields is a list of field names (e.g. "Code") to include in API
  16224. // requests with the JSON null value. By default, fields with empty
  16225. // values are omitted from API requests. However, any field with an
  16226. // empty value appearing in NullFields will be sent to the server as
  16227. // null. It is an error if a field in this list has a non-empty value.
  16228. // This may be used to include null fields in Patch requests.
  16229. NullFields []string `json:"-"`
  16230. }
  16231. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  16232. type NoMethod MachineTypeListWarning
  16233. raw := NoMethod(*s)
  16234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16235. }
  16236. type MachineTypeListWarningData struct {
  16237. // Key: [Output Only] A key that provides more detail on the warning
  16238. // being returned. For example, for warnings where there are no results
  16239. // in a list request for a particular zone, this key might be scope and
  16240. // the key value might be the zone name. Other examples might be a key
  16241. // indicating a deprecated resource and a suggested replacement, or a
  16242. // warning about invalid network settings (for example, if an instance
  16243. // attempts to perform IP forwarding but is not enabled for IP
  16244. // forwarding).
  16245. Key string `json:"key,omitempty"`
  16246. // Value: [Output Only] A warning data value corresponding to the key.
  16247. Value string `json:"value,omitempty"`
  16248. // ForceSendFields is a list of field names (e.g. "Key") to
  16249. // unconditionally include in API requests. By default, fields with
  16250. // empty values are omitted from API requests. However, any non-pointer,
  16251. // non-interface field appearing in ForceSendFields will be sent to the
  16252. // server regardless of whether the field is empty or not. This may be
  16253. // used to include empty fields in Patch requests.
  16254. ForceSendFields []string `json:"-"`
  16255. // NullFields is a list of field names (e.g. "Key") to include in API
  16256. // requests with the JSON null value. By default, fields with empty
  16257. // values are omitted from API requests. However, any field with an
  16258. // empty value appearing in NullFields will be sent to the server as
  16259. // null. It is an error if a field in this list has a non-empty value.
  16260. // This may be used to include null fields in Patch requests.
  16261. NullFields []string `json:"-"`
  16262. }
  16263. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  16264. type NoMethod MachineTypeListWarningData
  16265. raw := NoMethod(*s)
  16266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16267. }
  16268. type MachineTypesScopedList struct {
  16269. // MachineTypes: [Output Only] A list of machine types contained in this
  16270. // scope.
  16271. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  16272. // Warning: [Output Only] An informational warning that appears when the
  16273. // machine types list is empty.
  16274. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  16275. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  16276. // unconditionally include in API requests. By default, fields with
  16277. // empty values are omitted from API requests. However, any non-pointer,
  16278. // non-interface field appearing in ForceSendFields will be sent to the
  16279. // server regardless of whether the field is empty or not. This may be
  16280. // used to include empty fields in Patch requests.
  16281. ForceSendFields []string `json:"-"`
  16282. // NullFields is a list of field names (e.g. "MachineTypes") to include
  16283. // in API requests with the JSON null value. By default, fields with
  16284. // empty values are omitted from API requests. However, any field with
  16285. // an empty value appearing in NullFields will be sent to the server as
  16286. // null. It is an error if a field in this list has a non-empty value.
  16287. // This may be used to include null fields in Patch requests.
  16288. NullFields []string `json:"-"`
  16289. }
  16290. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  16291. type NoMethod MachineTypesScopedList
  16292. raw := NoMethod(*s)
  16293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16294. }
  16295. // MachineTypesScopedListWarning: [Output Only] An informational warning
  16296. // that appears when the machine types list is empty.
  16297. type MachineTypesScopedListWarning struct {
  16298. // Code: [Output Only] A warning code, if applicable. For example,
  16299. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16300. // the response.
  16301. //
  16302. // Possible values:
  16303. // "CLEANUP_FAILED"
  16304. // "DEPRECATED_RESOURCE_USED"
  16305. // "DEPRECATED_TYPE_USED"
  16306. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16307. // "EXPERIMENTAL_TYPE_USED"
  16308. // "EXTERNAL_API_WARNING"
  16309. // "FIELD_VALUE_OVERRIDEN"
  16310. // "INJECTED_KERNELS_DEPRECATED"
  16311. // "MISSING_TYPE_DEPENDENCY"
  16312. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16313. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16314. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16315. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16316. // "NEXT_HOP_NOT_RUNNING"
  16317. // "NOT_CRITICAL_ERROR"
  16318. // "NO_RESULTS_ON_PAGE"
  16319. // "REQUIRED_TOS_AGREEMENT"
  16320. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16321. // "RESOURCE_NOT_DELETED"
  16322. // "SCHEMA_VALIDATION_IGNORED"
  16323. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16324. // "UNDECLARED_PROPERTIES"
  16325. // "UNREACHABLE"
  16326. Code string `json:"code,omitempty"`
  16327. // Data: [Output Only] Metadata about this warning in key: value format.
  16328. // For example:
  16329. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16330. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  16331. // Message: [Output Only] A human-readable description of the warning
  16332. // code.
  16333. Message string `json:"message,omitempty"`
  16334. // ForceSendFields is a list of field names (e.g. "Code") to
  16335. // unconditionally include in API requests. By default, fields with
  16336. // empty values are omitted from API requests. However, any non-pointer,
  16337. // non-interface field appearing in ForceSendFields will be sent to the
  16338. // server regardless of whether the field is empty or not. This may be
  16339. // used to include empty fields in Patch requests.
  16340. ForceSendFields []string `json:"-"`
  16341. // NullFields is a list of field names (e.g. "Code") to include in API
  16342. // requests with the JSON null value. By default, fields with empty
  16343. // values are omitted from API requests. However, any field with an
  16344. // empty value appearing in NullFields will be sent to the server as
  16345. // null. It is an error if a field in this list has a non-empty value.
  16346. // This may be used to include null fields in Patch requests.
  16347. NullFields []string `json:"-"`
  16348. }
  16349. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  16350. type NoMethod MachineTypesScopedListWarning
  16351. raw := NoMethod(*s)
  16352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16353. }
  16354. type MachineTypesScopedListWarningData struct {
  16355. // Key: [Output Only] A key that provides more detail on the warning
  16356. // being returned. For example, for warnings where there are no results
  16357. // in a list request for a particular zone, this key might be scope and
  16358. // the key value might be the zone name. Other examples might be a key
  16359. // indicating a deprecated resource and a suggested replacement, or a
  16360. // warning about invalid network settings (for example, if an instance
  16361. // attempts to perform IP forwarding but is not enabled for IP
  16362. // forwarding).
  16363. Key string `json:"key,omitempty"`
  16364. // Value: [Output Only] A warning data value corresponding to the key.
  16365. Value string `json:"value,omitempty"`
  16366. // ForceSendFields is a list of field names (e.g. "Key") to
  16367. // unconditionally include in API requests. By default, fields with
  16368. // empty values are omitted from API requests. However, any non-pointer,
  16369. // non-interface field appearing in ForceSendFields will be sent to the
  16370. // server regardless of whether the field is empty or not. This may be
  16371. // used to include empty fields in Patch requests.
  16372. ForceSendFields []string `json:"-"`
  16373. // NullFields is a list of field names (e.g. "Key") to include in API
  16374. // requests with the JSON null value. By default, fields with empty
  16375. // values are omitted from API requests. However, any field with an
  16376. // empty value appearing in NullFields will be sent to the server as
  16377. // null. It is an error if a field in this list has a non-empty value.
  16378. // This may be used to include null fields in Patch requests.
  16379. NullFields []string `json:"-"`
  16380. }
  16381. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  16382. type NoMethod MachineTypesScopedListWarningData
  16383. raw := NoMethod(*s)
  16384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16385. }
  16386. // ManagedInstance: A Managed Instance resource.
  16387. type ManagedInstance struct {
  16388. // CurrentAction: [Output Only] The current action that the managed
  16389. // instance group has scheduled for the instance. Possible values:
  16390. // - NONE The instance is running, and the managed instance group does
  16391. // not have any scheduled actions for this instance.
  16392. // - CREATING The managed instance group is creating this instance. If
  16393. // the group fails to create this instance, it will try again until it
  16394. // is successful.
  16395. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  16396. // to create this instance only once. If the group fails to create this
  16397. // instance, it does not try again and the group's targetSize value is
  16398. // decreased instead.
  16399. // - RECREATING The managed instance group is recreating this instance.
  16400. //
  16401. // - DELETING The managed instance group is permanently deleting this
  16402. // instance.
  16403. // - ABANDONING The managed instance group is abandoning this instance.
  16404. // The instance will be removed from the instance group and from any
  16405. // target pools that are associated with this group.
  16406. // - RESTARTING The managed instance group is restarting the instance.
  16407. //
  16408. // - REFRESHING The managed instance group is applying configuration
  16409. // changes to the instance without stopping it. For example, the group
  16410. // can update the target pool list for an instance without stopping that
  16411. // instance.
  16412. // - VERIFYING The managed instance group has created the instance and
  16413. // it is in the process of being verified.
  16414. //
  16415. // Possible values:
  16416. // "ABANDONING"
  16417. // "CREATING"
  16418. // "CREATING_WITHOUT_RETRIES"
  16419. // "DELETING"
  16420. // "NONE"
  16421. // "RECREATING"
  16422. // "REFRESHING"
  16423. // "RESTARTING"
  16424. // "VERIFYING"
  16425. CurrentAction string `json:"currentAction,omitempty"`
  16426. // Id: [Output only] The unique identifier for this resource. This field
  16427. // is empty when instance does not exist.
  16428. Id uint64 `json:"id,omitempty,string"`
  16429. // Instance: [Output Only] The URL of the instance. The URL can exist
  16430. // even if the instance has not yet been created.
  16431. Instance string `json:"instance,omitempty"`
  16432. // InstanceHealth: [Output Only] Health state of the instance per
  16433. // health-check.
  16434. InstanceHealth []*ManagedInstanceInstanceHealth `json:"instanceHealth,omitempty"`
  16435. // InstanceStatus: [Output Only] The status of the instance. This field
  16436. // is empty when the instance does not exist.
  16437. //
  16438. // Possible values:
  16439. // "PROVISIONING"
  16440. // "RUNNING"
  16441. // "STAGING"
  16442. // "STOPPED"
  16443. // "STOPPING"
  16444. // "SUSPENDED"
  16445. // "SUSPENDING"
  16446. // "TERMINATED"
  16447. InstanceStatus string `json:"instanceStatus,omitempty"`
  16448. // InstanceTemplate: [Output Only] The intended template of the
  16449. // instance. This field is empty when current_action is one of {
  16450. // DELETING, ABANDONING }.
  16451. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  16452. // LastAttempt: [Output Only] Information about the last attempt to
  16453. // create or delete the instance.
  16454. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  16455. // Override: [Output Only] Override defined for this instance.
  16456. Override *ManagedInstanceOverride `json:"override,omitempty"`
  16457. // PreservedStateFromConfig: [Output Only] Preserved state applied from
  16458. // per-instance config for this instance.
  16459. PreservedStateFromConfig *PreservedState `json:"preservedStateFromConfig,omitempty"`
  16460. // PreservedStateFromPolicy: [Output Only] Preserved state generated
  16461. // based on stateful policy for this instance.
  16462. PreservedStateFromPolicy *PreservedState `json:"preservedStateFromPolicy,omitempty"`
  16463. // Tag: [Output Only] Tag describing the version.
  16464. Tag string `json:"tag,omitempty"`
  16465. // Version: [Output Only] Intended version of this instance.
  16466. Version *ManagedInstanceVersion `json:"version,omitempty"`
  16467. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  16468. // unconditionally include in API requests. By default, fields with
  16469. // empty values are omitted from API requests. However, any non-pointer,
  16470. // non-interface field appearing in ForceSendFields will be sent to the
  16471. // server regardless of whether the field is empty or not. This may be
  16472. // used to include empty fields in Patch requests.
  16473. ForceSendFields []string `json:"-"`
  16474. // NullFields is a list of field names (e.g. "CurrentAction") to include
  16475. // in API requests with the JSON null value. By default, fields with
  16476. // empty values are omitted from API requests. However, any field with
  16477. // an empty value appearing in NullFields will be sent to the server as
  16478. // null. It is an error if a field in this list has a non-empty value.
  16479. // This may be used to include null fields in Patch requests.
  16480. NullFields []string `json:"-"`
  16481. }
  16482. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  16483. type NoMethod ManagedInstance
  16484. raw := NoMethod(*s)
  16485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16486. }
  16487. type ManagedInstanceInstanceHealth struct {
  16488. // HealthCheck: [Output Only] The URL for the health check that verifies
  16489. // whether the instance is healthy.
  16490. HealthCheck string `json:"healthCheck,omitempty"`
  16491. // HealthState: [Output Only] The current instance health state.
  16492. //
  16493. // Possible values:
  16494. // "HEALTHY"
  16495. // "UNHEALTHY"
  16496. HealthState string `json:"healthState,omitempty"`
  16497. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  16498. // unconditionally include in API requests. By default, fields with
  16499. // empty values are omitted from API requests. However, any non-pointer,
  16500. // non-interface field appearing in ForceSendFields will be sent to the
  16501. // server regardless of whether the field is empty or not. This may be
  16502. // used to include empty fields in Patch requests.
  16503. ForceSendFields []string `json:"-"`
  16504. // NullFields is a list of field names (e.g. "HealthCheck") to include
  16505. // in API requests with the JSON null value. By default, fields with
  16506. // empty values are omitted from API requests. However, any field with
  16507. // an empty value appearing in NullFields will be sent to the server as
  16508. // null. It is an error if a field in this list has a non-empty value.
  16509. // This may be used to include null fields in Patch requests.
  16510. NullFields []string `json:"-"`
  16511. }
  16512. func (s *ManagedInstanceInstanceHealth) MarshalJSON() ([]byte, error) {
  16513. type NoMethod ManagedInstanceInstanceHealth
  16514. raw := NoMethod(*s)
  16515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16516. }
  16517. type ManagedInstanceLastAttempt struct {
  16518. // Errors: [Output Only] Encountered errors during the last attempt to
  16519. // create or delete the instance.
  16520. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  16521. // ForceSendFields is a list of field names (e.g. "Errors") to
  16522. // unconditionally include in API requests. By default, fields with
  16523. // empty values are omitted from API requests. However, any non-pointer,
  16524. // non-interface field appearing in ForceSendFields will be sent to the
  16525. // server regardless of whether the field is empty or not. This may be
  16526. // used to include empty fields in Patch requests.
  16527. ForceSendFields []string `json:"-"`
  16528. // NullFields is a list of field names (e.g. "Errors") to include in API
  16529. // requests with the JSON null value. By default, fields with empty
  16530. // values are omitted from API requests. However, any field with an
  16531. // empty value appearing in NullFields will be sent to the server as
  16532. // null. It is an error if a field in this list has a non-empty value.
  16533. // This may be used to include null fields in Patch requests.
  16534. NullFields []string `json:"-"`
  16535. }
  16536. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  16537. type NoMethod ManagedInstanceLastAttempt
  16538. raw := NoMethod(*s)
  16539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16540. }
  16541. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  16542. // during the last attempt to create or delete the instance.
  16543. type ManagedInstanceLastAttemptErrors struct {
  16544. // Errors: [Output Only] The array of errors encountered while
  16545. // processing this operation.
  16546. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  16547. // ForceSendFields is a list of field names (e.g. "Errors") to
  16548. // unconditionally include in API requests. By default, fields with
  16549. // empty values are omitted from API requests. However, any non-pointer,
  16550. // non-interface field appearing in ForceSendFields will be sent to the
  16551. // server regardless of whether the field is empty or not. This may be
  16552. // used to include empty fields in Patch requests.
  16553. ForceSendFields []string `json:"-"`
  16554. // NullFields is a list of field names (e.g. "Errors") to include in API
  16555. // requests with the JSON null value. By default, fields with empty
  16556. // values are omitted from API requests. However, any field with an
  16557. // empty value appearing in NullFields will be sent to the server as
  16558. // null. It is an error if a field in this list has a non-empty value.
  16559. // This may be used to include null fields in Patch requests.
  16560. NullFields []string `json:"-"`
  16561. }
  16562. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  16563. type NoMethod ManagedInstanceLastAttemptErrors
  16564. raw := NoMethod(*s)
  16565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16566. }
  16567. type ManagedInstanceLastAttemptErrorsErrors struct {
  16568. // Code: [Output Only] The error type identifier for this error.
  16569. Code string `json:"code,omitempty"`
  16570. // Location: [Output Only] Indicates the field in the request that
  16571. // caused the error. This property is optional.
  16572. Location string `json:"location,omitempty"`
  16573. // Message: [Output Only] An optional, human-readable error message.
  16574. Message string `json:"message,omitempty"`
  16575. // ForceSendFields is a list of field names (e.g. "Code") to
  16576. // unconditionally include in API requests. By default, fields with
  16577. // empty values are omitted from API requests. However, any non-pointer,
  16578. // non-interface field appearing in ForceSendFields will be sent to the
  16579. // server regardless of whether the field is empty or not. This may be
  16580. // used to include empty fields in Patch requests.
  16581. ForceSendFields []string `json:"-"`
  16582. // NullFields is a list of field names (e.g. "Code") to include in API
  16583. // requests with the JSON null value. By default, fields with empty
  16584. // values are omitted from API requests. However, any field with an
  16585. // empty value appearing in NullFields will be sent to the server as
  16586. // null. It is an error if a field in this list has a non-empty value.
  16587. // This may be used to include null fields in Patch requests.
  16588. NullFields []string `json:"-"`
  16589. }
  16590. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  16591. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  16592. raw := NoMethod(*s)
  16593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16594. }
  16595. // ManagedInstanceOverride: Overrides of stateful properties for a given
  16596. // instance
  16597. type ManagedInstanceOverride struct {
  16598. // Disks: Disk overrides defined for this instance. According to
  16599. // documentation the maximum number of disks attached to an instance is
  16600. // 128: https://cloud.google.com/compute/docs/disks/ However, compute
  16601. // API defines the limit at 140, so this is what we check.
  16602. Disks []*ManagedInstanceOverrideDiskOverride `json:"disks,omitempty"`
  16603. // Metadata: Metadata overrides defined for this instance.
  16604. // TODO(b/69785416) validate the total length is <9 KB
  16605. Metadata []*ManagedInstanceOverrideMetadata `json:"metadata,omitempty"`
  16606. // Origin: [Output Only] Indicates where does the override come from.
  16607. //
  16608. // Possible values:
  16609. // "AUTO_GENERATED"
  16610. // "USER_PROVIDED"
  16611. Origin string `json:"origin,omitempty"`
  16612. // ForceSendFields is a list of field names (e.g. "Disks") to
  16613. // unconditionally include in API requests. By default, fields with
  16614. // empty values are omitted from API requests. However, any non-pointer,
  16615. // non-interface field appearing in ForceSendFields will be sent to the
  16616. // server regardless of whether the field is empty or not. This may be
  16617. // used to include empty fields in Patch requests.
  16618. ForceSendFields []string `json:"-"`
  16619. // NullFields is a list of field names (e.g. "Disks") to include in API
  16620. // requests with the JSON null value. By default, fields with empty
  16621. // values are omitted from API requests. However, any field with an
  16622. // empty value appearing in NullFields will be sent to the server as
  16623. // null. It is an error if a field in this list has a non-empty value.
  16624. // This may be used to include null fields in Patch requests.
  16625. NullFields []string `json:"-"`
  16626. }
  16627. func (s *ManagedInstanceOverride) MarshalJSON() ([]byte, error) {
  16628. type NoMethod ManagedInstanceOverride
  16629. raw := NoMethod(*s)
  16630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16631. }
  16632. type ManagedInstanceOverrideMetadata struct {
  16633. // Key: Key for the metadata entry. Keys must conform to the following
  16634. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  16635. // reflected as part of a URL in the metadata server. Additionally, to
  16636. // avoid ambiguity, keys must not conflict with any other metadata keys
  16637. // for the project.
  16638. Key string `json:"key,omitempty"`
  16639. // Value: Value for the metadata entry. These are free-form strings, and
  16640. // only have meaning as interpreted by the image running in the
  16641. // instance. The only restriction placed on values is that their size
  16642. // must be less than or equal to 262144 bytes (256 KiB).
  16643. Value string `json:"value,omitempty"`
  16644. // ForceSendFields is a list of field names (e.g. "Key") to
  16645. // unconditionally include in API requests. By default, fields with
  16646. // empty values are omitted from API requests. However, any non-pointer,
  16647. // non-interface field appearing in ForceSendFields will be sent to the
  16648. // server regardless of whether the field is empty or not. This may be
  16649. // used to include empty fields in Patch requests.
  16650. ForceSendFields []string `json:"-"`
  16651. // NullFields is a list of field names (e.g. "Key") to include in API
  16652. // requests with the JSON null value. By default, fields with empty
  16653. // values are omitted from API requests. However, any field with an
  16654. // empty value appearing in NullFields will be sent to the server as
  16655. // null. It is an error if a field in this list has a non-empty value.
  16656. // This may be used to include null fields in Patch requests.
  16657. NullFields []string `json:"-"`
  16658. }
  16659. func (s *ManagedInstanceOverrideMetadata) MarshalJSON() ([]byte, error) {
  16660. type NoMethod ManagedInstanceOverrideMetadata
  16661. raw := NoMethod(*s)
  16662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16663. }
  16664. type ManagedInstanceOverrideDiskOverride struct {
  16665. // DeviceName: The name of the device on the VM
  16666. DeviceName string `json:"deviceName,omitempty"`
  16667. // Mode: The mode in which to attach this disk, either READ_WRITE or
  16668. // READ_ONLY. If not specified, the default is to attach the disk in
  16669. // READ_WRITE mode.
  16670. //
  16671. // Possible values:
  16672. // "READ_ONLY"
  16673. // "READ_WRITE"
  16674. Mode string `json:"mode,omitempty"`
  16675. // Source: The disk that is/will be mounted
  16676. Source string `json:"source,omitempty"`
  16677. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  16678. // unconditionally include in API requests. By default, fields with
  16679. // empty values are omitted from API requests. However, any non-pointer,
  16680. // non-interface field appearing in ForceSendFields will be sent to the
  16681. // server regardless of whether the field is empty or not. This may be
  16682. // used to include empty fields in Patch requests.
  16683. ForceSendFields []string `json:"-"`
  16684. // NullFields is a list of field names (e.g. "DeviceName") to include in
  16685. // API requests with the JSON null value. By default, fields with empty
  16686. // values are omitted from API requests. However, any field with an
  16687. // empty value appearing in NullFields will be sent to the server as
  16688. // null. It is an error if a field in this list has a non-empty value.
  16689. // This may be used to include null fields in Patch requests.
  16690. NullFields []string `json:"-"`
  16691. }
  16692. func (s *ManagedInstanceOverrideDiskOverride) MarshalJSON() ([]byte, error) {
  16693. type NoMethod ManagedInstanceOverrideDiskOverride
  16694. raw := NoMethod(*s)
  16695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16696. }
  16697. type ManagedInstanceVersion struct {
  16698. // InstanceTemplate: [Output Only] The intended template of the
  16699. // instance. This field is empty when current_action is one of {
  16700. // DELETING, ABANDONING }.
  16701. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  16702. // Name: [Output Only] Name of the version.
  16703. Name string `json:"name,omitempty"`
  16704. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  16705. // unconditionally include in API requests. By default, fields with
  16706. // empty values are omitted from API requests. However, any non-pointer,
  16707. // non-interface field appearing in ForceSendFields will be sent to the
  16708. // server regardless of whether the field is empty or not. This may be
  16709. // used to include empty fields in Patch requests.
  16710. ForceSendFields []string `json:"-"`
  16711. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  16712. // include in API requests with the JSON null value. By default, fields
  16713. // with empty values are omitted from API requests. However, any field
  16714. // with an empty value appearing in NullFields will be sent to the
  16715. // server as null. It is an error if a field in this list has a
  16716. // non-empty value. This may be used to include null fields in Patch
  16717. // requests.
  16718. NullFields []string `json:"-"`
  16719. }
  16720. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  16721. type NoMethod ManagedInstanceVersion
  16722. raw := NoMethod(*s)
  16723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16724. }
  16725. // Metadata: A metadata key/value entry.
  16726. type Metadata struct {
  16727. // Fingerprint: Specifies a fingerprint for this request, which is
  16728. // essentially a hash of the metadata's contents and used for optimistic
  16729. // locking. The fingerprint is initially generated by Compute Engine and
  16730. // changes after every request to modify or update metadata. You must
  16731. // always provide an up-to-date fingerprint hash in order to update or
  16732. // change metadata, otherwise the request will fail with error 412
  16733. // conditionNotMet.
  16734. //
  16735. // To see the latest fingerprint, make a get() request to retrieve the
  16736. // resource.
  16737. Fingerprint string `json:"fingerprint,omitempty"`
  16738. // Items: Array of key/value pairs. The total size of all keys and
  16739. // values must be less than 512 KB.
  16740. Items []*MetadataItems `json:"items,omitempty"`
  16741. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  16742. // metadata.
  16743. Kind string `json:"kind,omitempty"`
  16744. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  16745. // unconditionally include in API requests. By default, fields with
  16746. // empty values are omitted from API requests. However, any non-pointer,
  16747. // non-interface field appearing in ForceSendFields will be sent to the
  16748. // server regardless of whether the field is empty or not. This may be
  16749. // used to include empty fields in Patch requests.
  16750. ForceSendFields []string `json:"-"`
  16751. // NullFields is a list of field names (e.g. "Fingerprint") to include
  16752. // in API requests with the JSON null value. By default, fields with
  16753. // empty values are omitted from API requests. However, any field with
  16754. // an empty value appearing in NullFields will be sent to the server as
  16755. // null. It is an error if a field in this list has a non-empty value.
  16756. // This may be used to include null fields in Patch requests.
  16757. NullFields []string `json:"-"`
  16758. }
  16759. func (s *Metadata) MarshalJSON() ([]byte, error) {
  16760. type NoMethod Metadata
  16761. raw := NoMethod(*s)
  16762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16763. }
  16764. type MetadataItems struct {
  16765. // Key: Key for the metadata entry. Keys must conform to the following
  16766. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  16767. // reflected as part of a URL in the metadata server. Additionally, to
  16768. // avoid ambiguity, keys must not conflict with any other metadata keys
  16769. // for the project.
  16770. Key string `json:"key,omitempty"`
  16771. // Value: Value for the metadata entry. These are free-form strings, and
  16772. // only have meaning as interpreted by the image running in the
  16773. // instance. The only restriction placed on values is that their size
  16774. // must be less than or equal to 262144 bytes (256 KiB).
  16775. Value string `json:"value,omitempty"`
  16776. // ForceSendFields is a list of field names (e.g. "Key") to
  16777. // unconditionally include in API requests. By default, fields with
  16778. // empty values are omitted from API requests. However, any non-pointer,
  16779. // non-interface field appearing in ForceSendFields will be sent to the
  16780. // server regardless of whether the field is empty or not. This may be
  16781. // used to include empty fields in Patch requests.
  16782. ForceSendFields []string `json:"-"`
  16783. // NullFields is a list of field names (e.g. "Key") to include in API
  16784. // requests with the JSON null value. By default, fields with empty
  16785. // values are omitted from API requests. However, any field with an
  16786. // empty value appearing in NullFields will be sent to the server as
  16787. // null. It is an error if a field in this list has a non-empty value.
  16788. // This may be used to include null fields in Patch requests.
  16789. NullFields []string `json:"-"`
  16790. }
  16791. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  16792. type NoMethod MetadataItems
  16793. raw := NoMethod(*s)
  16794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16795. }
  16796. // NamedPort: The named port. For example: .
  16797. type NamedPort struct {
  16798. // Name: The name for this named port. The name must be 1-63 characters
  16799. // long, and comply with RFC1035.
  16800. Name string `json:"name,omitempty"`
  16801. // Port: The port number, which can be a value between 1 and 65535.
  16802. Port int64 `json:"port,omitempty"`
  16803. // ForceSendFields is a list of field names (e.g. "Name") to
  16804. // unconditionally include in API requests. By default, fields with
  16805. // empty values are omitted from API requests. However, any non-pointer,
  16806. // non-interface field appearing in ForceSendFields will be sent to the
  16807. // server regardless of whether the field is empty or not. This may be
  16808. // used to include empty fields in Patch requests.
  16809. ForceSendFields []string `json:"-"`
  16810. // NullFields is a list of field names (e.g. "Name") to include in API
  16811. // requests with the JSON null value. By default, fields with empty
  16812. // values are omitted from API requests. However, any field with an
  16813. // empty value appearing in NullFields will be sent to the server as
  16814. // null. It is an error if a field in this list has a non-empty value.
  16815. // This may be used to include null fields in Patch requests.
  16816. NullFields []string `json:"-"`
  16817. }
  16818. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  16819. type NoMethod NamedPort
  16820. raw := NoMethod(*s)
  16821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16822. }
  16823. // Network: Represents a Network resource. Read Virtual Private Cloud
  16824. // (VPC) Network Overview for more information. (== resource_for
  16825. // v1.networks ==) (== resource_for beta.networks ==)
  16826. type Network struct {
  16827. // IPv4Range: The range of internal addresses that are legal on this
  16828. // network. This range is a CIDR specification, for example:
  16829. // 192.168.0.0/16. Provided by the client when the network is created.
  16830. IPv4Range string `json:"IPv4Range,omitempty"`
  16831. // AutoCreateSubnetworks: When set to true, the VPC network is created
  16832. // in "auto" mode. When set to false, the VPC network is created in
  16833. // "custom" mode.
  16834. //
  16835. // An auto mode VPC network starts with one subnet per region. Each
  16836. // subnet has a predetermined range as described in Auto mode VPC
  16837. // network IP ranges.
  16838. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  16839. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16840. // format.
  16841. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16842. // CrossVmEncryption: [Output Only] Type of VM-to-VM traffic encryption
  16843. // for this network.
  16844. //
  16845. // Possible values:
  16846. // "ENCRYPTED"
  16847. // "UNENCRYPTED"
  16848. CrossVmEncryption string `json:"crossVmEncryption,omitempty"`
  16849. // Description: An optional description of this resource. Provide this
  16850. // property when you create the resource.
  16851. Description string `json:"description,omitempty"`
  16852. // GatewayIPv4: [Output Only] The gateway address for default routing
  16853. // out of the network. This value is read only and is selected by GCP.
  16854. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  16855. // Id: [Output Only] The unique identifier for the resource. This
  16856. // identifier is defined by the server.
  16857. Id uint64 `json:"id,omitempty,string"`
  16858. // Kind: [Output Only] Type of the resource. Always compute#network for
  16859. // networks.
  16860. Kind string `json:"kind,omitempty"`
  16861. // LoadBalancerVmEncryption: [Output Only] Type of LB-to-VM traffic
  16862. // encryption for this network.
  16863. //
  16864. // Possible values:
  16865. // "ENCRYPTED"
  16866. // "UNENCRYPTED"
  16867. LoadBalancerVmEncryption string `json:"loadBalancerVmEncryption,omitempty"`
  16868. // Name: Name of the resource. Provided by the client when the resource
  16869. // is created. The name must be 1-63 characters long, and comply with
  16870. // RFC1035. Specifically, the name must be 1-63 characters long and
  16871. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16872. // the first character must be a lowercase letter, and all following
  16873. // characters must be a dash, lowercase letter, or digit, except the
  16874. // last character, which cannot be a dash.
  16875. Name string `json:"name,omitempty"`
  16876. // Peerings: [Output Only] A list of network peerings for the resource.
  16877. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  16878. // RoutingConfig: The network-level routing configuration for this
  16879. // network. Used by Cloud Router to determine what type of network-wide
  16880. // routing behavior to enforce.
  16881. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  16882. // SelfLink: [Output Only] Server-defined URL for the resource.
  16883. SelfLink string `json:"selfLink,omitempty"`
  16884. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  16885. // all subnetworks in this VPC network.
  16886. Subnetworks []string `json:"subnetworks,omitempty"`
  16887. // ServerResponse contains the HTTP response code and headers from the
  16888. // server.
  16889. googleapi.ServerResponse `json:"-"`
  16890. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  16891. // unconditionally include in API requests. By default, fields with
  16892. // empty values are omitted from API requests. However, any non-pointer,
  16893. // non-interface field appearing in ForceSendFields will be sent to the
  16894. // server regardless of whether the field is empty or not. This may be
  16895. // used to include empty fields in Patch requests.
  16896. ForceSendFields []string `json:"-"`
  16897. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  16898. // API requests with the JSON null value. By default, fields with empty
  16899. // values are omitted from API requests. However, any field with an
  16900. // empty value appearing in NullFields will be sent to the server as
  16901. // null. It is an error if a field in this list has a non-empty value.
  16902. // This may be used to include null fields in Patch requests.
  16903. NullFields []string `json:"-"`
  16904. }
  16905. func (s *Network) MarshalJSON() ([]byte, error) {
  16906. type NoMethod Network
  16907. raw := NoMethod(*s)
  16908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16909. }
  16910. // NetworkEndpoint: The network endpoint.
  16911. type NetworkEndpoint struct {
  16912. // Annotations: Metadata defined as annotations on the network endpoint.
  16913. Annotations map[string]string `json:"annotations,omitempty"`
  16914. // Instance: The name for a specific VM instance that the IP address
  16915. // belongs to. This is required for network endpoints of type
  16916. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  16917. // endpoint group.
  16918. //
  16919. // The name must be 1-63 characters long, and comply with RFC1035.
  16920. Instance string `json:"instance,omitempty"`
  16921. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  16922. // must belong to a VM in GCE (either the primary IP or as part of an
  16923. // aliased IP range). If the IP address is not specified, then the
  16924. // primary IP address for the VM instance in the network that the
  16925. // network endpoint group belongs to will be used.
  16926. IpAddress string `json:"ipAddress,omitempty"`
  16927. // Port: Optional port number of network endpoint. If not specified and
  16928. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  16929. // defaultPort for the network endpoint group will be used.
  16930. Port int64 `json:"port,omitempty"`
  16931. // ForceSendFields is a list of field names (e.g. "Annotations") to
  16932. // unconditionally include in API requests. By default, fields with
  16933. // empty values are omitted from API requests. However, any non-pointer,
  16934. // non-interface field appearing in ForceSendFields will be sent to the
  16935. // server regardless of whether the field is empty or not. This may be
  16936. // used to include empty fields in Patch requests.
  16937. ForceSendFields []string `json:"-"`
  16938. // NullFields is a list of field names (e.g. "Annotations") to include
  16939. // in API requests with the JSON null value. By default, fields with
  16940. // empty values are omitted from API requests. However, any field with
  16941. // an empty value appearing in NullFields will be sent to the server as
  16942. // null. It is an error if a field in this list has a non-empty value.
  16943. // This may be used to include null fields in Patch requests.
  16944. NullFields []string `json:"-"`
  16945. }
  16946. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  16947. type NoMethod NetworkEndpoint
  16948. raw := NoMethod(*s)
  16949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16950. }
  16951. // NetworkEndpointGroup: Represents a collection of network endpoints.
  16952. type NetworkEndpointGroup struct {
  16953. // Annotations: Metadata defined as annotations on the network endpoint
  16954. // group.
  16955. Annotations map[string]string `json:"annotations,omitempty"`
  16956. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16957. // format.
  16958. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16959. // DefaultPort: The default port used if the port number is not
  16960. // specified in the network endpoint.
  16961. DefaultPort int64 `json:"defaultPort,omitempty"`
  16962. // Description: An optional description of this resource. Provide this
  16963. // property when you create the resource.
  16964. Description string `json:"description,omitempty"`
  16965. // Id: [Output Only] The unique identifier for the resource. This
  16966. // identifier is defined by the server.
  16967. Id uint64 `json:"id,omitempty,string"`
  16968. // Kind: [Output Only] Type of the resource. Always
  16969. // compute#networkEndpointGroup for network endpoint group.
  16970. Kind string `json:"kind,omitempty"`
  16971. // LoadBalancer: This field is only valid when the network endpoint
  16972. // group is used for load balancing. [Deprecated] This field is
  16973. // deprecated.
  16974. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  16975. // Name: Name of the resource; provided by the client when the resource
  16976. // is created. The name must be 1-63 characters long, and comply with
  16977. // RFC1035. Specifically, the name must be 1-63 characters long and
  16978. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16979. // the first character must be a lowercase letter, and all following
  16980. // characters must be a dash, lowercase letter, or digit, except the
  16981. // last character, which cannot be a dash.
  16982. Name string `json:"name,omitempty"`
  16983. // Network: The URL of the network to which all network endpoints in the
  16984. // NEG belong. Uses "default" project network if unspecified.
  16985. Network string `json:"network,omitempty"`
  16986. // NetworkEndpointType: Type of network endpoints in this network
  16987. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  16988. //
  16989. // Possible values:
  16990. // "GCE_VM_IP_PORT"
  16991. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  16992. // SelfLink: [Output Only] Server-defined URL for the resource.
  16993. SelfLink string `json:"selfLink,omitempty"`
  16994. // Size: [Output only] Number of network endpoints in the network
  16995. // endpoint group.
  16996. Size int64 `json:"size,omitempty"`
  16997. // Subnetwork: Optional URL of the subnetwork to which all network
  16998. // endpoints in the NEG belong.
  16999. Subnetwork string `json:"subnetwork,omitempty"`
  17000. // Type: Specify the type of this network endpoint group. Only
  17001. // LOAD_BALANCING is valid for now.
  17002. //
  17003. // Possible values:
  17004. // "LOAD_BALANCING"
  17005. Type string `json:"type,omitempty"`
  17006. // Zone: [Output Only] The URL of the zone where the network endpoint
  17007. // group is located.
  17008. Zone string `json:"zone,omitempty"`
  17009. // ServerResponse contains the HTTP response code and headers from the
  17010. // server.
  17011. googleapi.ServerResponse `json:"-"`
  17012. // ForceSendFields is a list of field names (e.g. "Annotations") to
  17013. // unconditionally include in API requests. By default, fields with
  17014. // empty values are omitted from API requests. However, any non-pointer,
  17015. // non-interface field appearing in ForceSendFields will be sent to the
  17016. // server regardless of whether the field is empty or not. This may be
  17017. // used to include empty fields in Patch requests.
  17018. ForceSendFields []string `json:"-"`
  17019. // NullFields is a list of field names (e.g. "Annotations") to include
  17020. // in API requests with the JSON null value. By default, fields with
  17021. // empty values are omitted from API requests. However, any field with
  17022. // an empty value appearing in NullFields will be sent to the server as
  17023. // null. It is an error if a field in this list has a non-empty value.
  17024. // This may be used to include null fields in Patch requests.
  17025. NullFields []string `json:"-"`
  17026. }
  17027. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  17028. type NoMethod NetworkEndpointGroup
  17029. raw := NoMethod(*s)
  17030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17031. }
  17032. type NetworkEndpointGroupAggregatedList struct {
  17033. // Id: [Output Only] Unique identifier for the resource; defined by the
  17034. // server.
  17035. Id string `json:"id,omitempty"`
  17036. // Items: A list of NetworkEndpointGroupsScopedList resources.
  17037. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  17038. // Kind: [Output Only] The resource type, which is always
  17039. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  17040. // network endpoint groups.
  17041. Kind string `json:"kind,omitempty"`
  17042. // NextPageToken: [Output Only] This token allows you to get the next
  17043. // page of results for list requests. If the number of results is larger
  17044. // than maxResults, use the nextPageToken as a value for the query
  17045. // parameter pageToken in the next list request. Subsequent list
  17046. // requests will have their own nextPageToken to continue paging through
  17047. // the results.
  17048. NextPageToken string `json:"nextPageToken,omitempty"`
  17049. // SelfLink: [Output Only] Server-defined URL for this resource.
  17050. SelfLink string `json:"selfLink,omitempty"`
  17051. // Warning: [Output Only] Informational warning message.
  17052. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  17053. // ServerResponse contains the HTTP response code and headers from the
  17054. // server.
  17055. googleapi.ServerResponse `json:"-"`
  17056. // ForceSendFields is a list of field names (e.g. "Id") to
  17057. // unconditionally include in API requests. By default, fields with
  17058. // empty values are omitted from API requests. However, any non-pointer,
  17059. // non-interface field appearing in ForceSendFields will be sent to the
  17060. // server regardless of whether the field is empty or not. This may be
  17061. // used to include empty fields in Patch requests.
  17062. ForceSendFields []string `json:"-"`
  17063. // NullFields is a list of field names (e.g. "Id") to include in API
  17064. // requests with the JSON null value. By default, fields with empty
  17065. // values are omitted from API requests. However, any field with an
  17066. // empty value appearing in NullFields will be sent to the server as
  17067. // null. It is an error if a field in this list has a non-empty value.
  17068. // This may be used to include null fields in Patch requests.
  17069. NullFields []string `json:"-"`
  17070. }
  17071. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  17072. type NoMethod NetworkEndpointGroupAggregatedList
  17073. raw := NoMethod(*s)
  17074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17075. }
  17076. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  17077. // Informational warning message.
  17078. type NetworkEndpointGroupAggregatedListWarning struct {
  17079. // Code: [Output Only] A warning code, if applicable. For example,
  17080. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17081. // the response.
  17082. //
  17083. // Possible values:
  17084. // "CLEANUP_FAILED"
  17085. // "DEPRECATED_RESOURCE_USED"
  17086. // "DEPRECATED_TYPE_USED"
  17087. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17088. // "EXPERIMENTAL_TYPE_USED"
  17089. // "EXTERNAL_API_WARNING"
  17090. // "FIELD_VALUE_OVERRIDEN"
  17091. // "INJECTED_KERNELS_DEPRECATED"
  17092. // "MISSING_TYPE_DEPENDENCY"
  17093. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17094. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17095. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17096. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17097. // "NEXT_HOP_NOT_RUNNING"
  17098. // "NOT_CRITICAL_ERROR"
  17099. // "NO_RESULTS_ON_PAGE"
  17100. // "REQUIRED_TOS_AGREEMENT"
  17101. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17102. // "RESOURCE_NOT_DELETED"
  17103. // "SCHEMA_VALIDATION_IGNORED"
  17104. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17105. // "UNDECLARED_PROPERTIES"
  17106. // "UNREACHABLE"
  17107. Code string `json:"code,omitempty"`
  17108. // Data: [Output Only] Metadata about this warning in key: value format.
  17109. // For example:
  17110. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17111. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  17112. // Message: [Output Only] A human-readable description of the warning
  17113. // code.
  17114. Message string `json:"message,omitempty"`
  17115. // ForceSendFields is a list of field names (e.g. "Code") to
  17116. // unconditionally include in API requests. By default, fields with
  17117. // empty values are omitted from API requests. However, any non-pointer,
  17118. // non-interface field appearing in ForceSendFields will be sent to the
  17119. // server regardless of whether the field is empty or not. This may be
  17120. // used to include empty fields in Patch requests.
  17121. ForceSendFields []string `json:"-"`
  17122. // NullFields is a list of field names (e.g. "Code") to include in API
  17123. // requests with the JSON null value. By default, fields with empty
  17124. // values are omitted from API requests. However, any field with an
  17125. // empty value appearing in NullFields will be sent to the server as
  17126. // null. It is an error if a field in this list has a non-empty value.
  17127. // This may be used to include null fields in Patch requests.
  17128. NullFields []string `json:"-"`
  17129. }
  17130. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17131. type NoMethod NetworkEndpointGroupAggregatedListWarning
  17132. raw := NoMethod(*s)
  17133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17134. }
  17135. type NetworkEndpointGroupAggregatedListWarningData struct {
  17136. // Key: [Output Only] A key that provides more detail on the warning
  17137. // being returned. For example, for warnings where there are no results
  17138. // in a list request for a particular zone, this key might be scope and
  17139. // the key value might be the zone name. Other examples might be a key
  17140. // indicating a deprecated resource and a suggested replacement, or a
  17141. // warning about invalid network settings (for example, if an instance
  17142. // attempts to perform IP forwarding but is not enabled for IP
  17143. // forwarding).
  17144. Key string `json:"key,omitempty"`
  17145. // Value: [Output Only] A warning data value corresponding to the key.
  17146. Value string `json:"value,omitempty"`
  17147. // ForceSendFields is a list of field names (e.g. "Key") to
  17148. // unconditionally include in API requests. By default, fields with
  17149. // empty values are omitted from API requests. However, any non-pointer,
  17150. // non-interface field appearing in ForceSendFields will be sent to the
  17151. // server regardless of whether the field is empty or not. This may be
  17152. // used to include empty fields in Patch requests.
  17153. ForceSendFields []string `json:"-"`
  17154. // NullFields is a list of field names (e.g. "Key") to include in API
  17155. // requests with the JSON null value. By default, fields with empty
  17156. // values are omitted from API requests. However, any field with an
  17157. // empty value appearing in NullFields will be sent to the server as
  17158. // null. It is an error if a field in this list has a non-empty value.
  17159. // This may be used to include null fields in Patch requests.
  17160. NullFields []string `json:"-"`
  17161. }
  17162. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17163. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  17164. raw := NoMethod(*s)
  17165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17166. }
  17167. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  17168. // fields for network endpoint group.
  17169. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  17170. // DefaultPort: The default port used if the port number is not
  17171. // specified in the network endpoint. [Deprecated] This field is
  17172. // deprecated.
  17173. DefaultPort int64 `json:"defaultPort,omitempty"`
  17174. // Network: The URL of the network to which all network endpoints in the
  17175. // NEG belong. Uses "default" project network if unspecified.
  17176. // [Deprecated] This field is deprecated.
  17177. Network string `json:"network,omitempty"`
  17178. // Subnetwork: Optional URL of the subnetwork to which all network
  17179. // endpoints in the NEG belong. [Deprecated] This field is deprecated.
  17180. Subnetwork string `json:"subnetwork,omitempty"`
  17181. // Zone: [Output Only] The URL of the zone where the network endpoint
  17182. // group is located. [Deprecated] This field is deprecated.
  17183. Zone string `json:"zone,omitempty"`
  17184. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  17185. // unconditionally include in API requests. By default, fields with
  17186. // empty values are omitted from API requests. However, any non-pointer,
  17187. // non-interface field appearing in ForceSendFields will be sent to the
  17188. // server regardless of whether the field is empty or not. This may be
  17189. // used to include empty fields in Patch requests.
  17190. ForceSendFields []string `json:"-"`
  17191. // NullFields is a list of field names (e.g. "DefaultPort") to include
  17192. // in API requests with the JSON null value. By default, fields with
  17193. // empty values are omitted from API requests. However, any field with
  17194. // an empty value appearing in NullFields will be sent to the server as
  17195. // null. It is an error if a field in this list has a non-empty value.
  17196. // This may be used to include null fields in Patch requests.
  17197. NullFields []string `json:"-"`
  17198. }
  17199. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  17200. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  17201. raw := NoMethod(*s)
  17202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17203. }
  17204. type NetworkEndpointGroupList struct {
  17205. // Id: [Output Only] Unique identifier for the resource; defined by the
  17206. // server.
  17207. Id string `json:"id,omitempty"`
  17208. // Items: A list of NetworkEndpointGroup resources.
  17209. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  17210. // Kind: [Output Only] The resource type, which is always
  17211. // compute#networkEndpointGroupList for network endpoint group lists.
  17212. Kind string `json:"kind,omitempty"`
  17213. // NextPageToken: [Output Only] This token allows you to get the next
  17214. // page of results for list requests. If the number of results is larger
  17215. // than maxResults, use the nextPageToken as a value for the query
  17216. // parameter pageToken in the next list request. Subsequent list
  17217. // requests will have their own nextPageToken to continue paging through
  17218. // the results.
  17219. NextPageToken string `json:"nextPageToken,omitempty"`
  17220. // SelfLink: [Output Only] Server-defined URL for this resource.
  17221. SelfLink string `json:"selfLink,omitempty"`
  17222. // Warning: [Output Only] Informational warning message.
  17223. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  17224. // ServerResponse contains the HTTP response code and headers from the
  17225. // server.
  17226. googleapi.ServerResponse `json:"-"`
  17227. // ForceSendFields is a list of field names (e.g. "Id") to
  17228. // unconditionally include in API requests. By default, fields with
  17229. // empty values are omitted from API requests. However, any non-pointer,
  17230. // non-interface field appearing in ForceSendFields will be sent to the
  17231. // server regardless of whether the field is empty or not. This may be
  17232. // used to include empty fields in Patch requests.
  17233. ForceSendFields []string `json:"-"`
  17234. // NullFields is a list of field names (e.g. "Id") to include in API
  17235. // requests with the JSON null value. By default, fields with empty
  17236. // values are omitted from API requests. However, any field with an
  17237. // empty value appearing in NullFields will be sent to the server as
  17238. // null. It is an error if a field in this list has a non-empty value.
  17239. // This may be used to include null fields in Patch requests.
  17240. NullFields []string `json:"-"`
  17241. }
  17242. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  17243. type NoMethod NetworkEndpointGroupList
  17244. raw := NoMethod(*s)
  17245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17246. }
  17247. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  17248. // message.
  17249. type NetworkEndpointGroupListWarning struct {
  17250. // Code: [Output Only] A warning code, if applicable. For example,
  17251. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17252. // the response.
  17253. //
  17254. // Possible values:
  17255. // "CLEANUP_FAILED"
  17256. // "DEPRECATED_RESOURCE_USED"
  17257. // "DEPRECATED_TYPE_USED"
  17258. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17259. // "EXPERIMENTAL_TYPE_USED"
  17260. // "EXTERNAL_API_WARNING"
  17261. // "FIELD_VALUE_OVERRIDEN"
  17262. // "INJECTED_KERNELS_DEPRECATED"
  17263. // "MISSING_TYPE_DEPENDENCY"
  17264. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17265. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17266. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17267. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17268. // "NEXT_HOP_NOT_RUNNING"
  17269. // "NOT_CRITICAL_ERROR"
  17270. // "NO_RESULTS_ON_PAGE"
  17271. // "REQUIRED_TOS_AGREEMENT"
  17272. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17273. // "RESOURCE_NOT_DELETED"
  17274. // "SCHEMA_VALIDATION_IGNORED"
  17275. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17276. // "UNDECLARED_PROPERTIES"
  17277. // "UNREACHABLE"
  17278. Code string `json:"code,omitempty"`
  17279. // Data: [Output Only] Metadata about this warning in key: value format.
  17280. // For example:
  17281. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17282. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  17283. // Message: [Output Only] A human-readable description of the warning
  17284. // code.
  17285. Message string `json:"message,omitempty"`
  17286. // ForceSendFields is a list of field names (e.g. "Code") to
  17287. // unconditionally include in API requests. By default, fields with
  17288. // empty values are omitted from API requests. However, any non-pointer,
  17289. // non-interface field appearing in ForceSendFields will be sent to the
  17290. // server regardless of whether the field is empty or not. This may be
  17291. // used to include empty fields in Patch requests.
  17292. ForceSendFields []string `json:"-"`
  17293. // NullFields is a list of field names (e.g. "Code") to include in API
  17294. // requests with the JSON null value. By default, fields with empty
  17295. // values are omitted from API requests. However, any field with an
  17296. // empty value appearing in NullFields will be sent to the server as
  17297. // null. It is an error if a field in this list has a non-empty value.
  17298. // This may be used to include null fields in Patch requests.
  17299. NullFields []string `json:"-"`
  17300. }
  17301. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  17302. type NoMethod NetworkEndpointGroupListWarning
  17303. raw := NoMethod(*s)
  17304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17305. }
  17306. type NetworkEndpointGroupListWarningData struct {
  17307. // Key: [Output Only] A key that provides more detail on the warning
  17308. // being returned. For example, for warnings where there are no results
  17309. // in a list request for a particular zone, this key might be scope and
  17310. // the key value might be the zone name. Other examples might be a key
  17311. // indicating a deprecated resource and a suggested replacement, or a
  17312. // warning about invalid network settings (for example, if an instance
  17313. // attempts to perform IP forwarding but is not enabled for IP
  17314. // forwarding).
  17315. Key string `json:"key,omitempty"`
  17316. // Value: [Output Only] A warning data value corresponding to the key.
  17317. Value string `json:"value,omitempty"`
  17318. // ForceSendFields is a list of field names (e.g. "Key") to
  17319. // unconditionally include in API requests. By default, fields with
  17320. // empty values are omitted from API requests. However, any non-pointer,
  17321. // non-interface field appearing in ForceSendFields will be sent to the
  17322. // server regardless of whether the field is empty or not. This may be
  17323. // used to include empty fields in Patch requests.
  17324. ForceSendFields []string `json:"-"`
  17325. // NullFields is a list of field names (e.g. "Key") to include in API
  17326. // requests with the JSON null value. By default, fields with empty
  17327. // values are omitted from API requests. However, any field with an
  17328. // empty value appearing in NullFields will be sent to the server as
  17329. // null. It is an error if a field in this list has a non-empty value.
  17330. // This may be used to include null fields in Patch requests.
  17331. NullFields []string `json:"-"`
  17332. }
  17333. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  17334. type NoMethod NetworkEndpointGroupListWarningData
  17335. raw := NoMethod(*s)
  17336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17337. }
  17338. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  17339. // NetworkEndpoints: The list of network endpoints to be attached.
  17340. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  17341. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  17342. // unconditionally include in API requests. By default, fields with
  17343. // empty values are omitted from API requests. However, any non-pointer,
  17344. // non-interface field appearing in ForceSendFields will be sent to the
  17345. // server regardless of whether the field is empty or not. This may be
  17346. // used to include empty fields in Patch requests.
  17347. ForceSendFields []string `json:"-"`
  17348. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  17349. // include in API requests with the JSON null value. By default, fields
  17350. // with empty values are omitted from API requests. However, any field
  17351. // with an empty value appearing in NullFields will be sent to the
  17352. // server as null. It is an error if a field in this list has a
  17353. // non-empty value. This may be used to include null fields in Patch
  17354. // requests.
  17355. NullFields []string `json:"-"`
  17356. }
  17357. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  17358. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  17359. raw := NoMethod(*s)
  17360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17361. }
  17362. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  17363. // NetworkEndpoints: The list of network endpoints to be detached.
  17364. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  17365. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  17366. // unconditionally include in API requests. By default, fields with
  17367. // empty values are omitted from API requests. However, any non-pointer,
  17368. // non-interface field appearing in ForceSendFields will be sent to the
  17369. // server regardless of whether the field is empty or not. This may be
  17370. // used to include empty fields in Patch requests.
  17371. ForceSendFields []string `json:"-"`
  17372. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  17373. // include in API requests with the JSON null value. By default, fields
  17374. // with empty values are omitted from API requests. However, any field
  17375. // with an empty value appearing in NullFields will be sent to the
  17376. // server as null. It is an error if a field in this list has a
  17377. // non-empty value. This may be used to include null fields in Patch
  17378. // requests.
  17379. NullFields []string `json:"-"`
  17380. }
  17381. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  17382. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  17383. raw := NoMethod(*s)
  17384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17385. }
  17386. type NetworkEndpointGroupsListEndpointsRequest struct {
  17387. // HealthStatus: Optional query parameter for showing the health status
  17388. // of each network endpoint. Valid options are SKIP or SHOW. If you
  17389. // don't specifiy this parameter, the health status of network endpoints
  17390. // will not be provided.
  17391. //
  17392. // Possible values:
  17393. // "SHOW"
  17394. // "SKIP"
  17395. HealthStatus string `json:"healthStatus,omitempty"`
  17396. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  17397. // unconditionally include in API requests. By default, fields with
  17398. // empty values are omitted from API requests. However, any non-pointer,
  17399. // non-interface field appearing in ForceSendFields will be sent to the
  17400. // server regardless of whether the field is empty or not. This may be
  17401. // used to include empty fields in Patch requests.
  17402. ForceSendFields []string `json:"-"`
  17403. // NullFields is a list of field names (e.g. "HealthStatus") to include
  17404. // in API requests with the JSON null value. By default, fields with
  17405. // empty values are omitted from API requests. However, any field with
  17406. // an empty value appearing in NullFields will be sent to the server as
  17407. // null. It is an error if a field in this list has a non-empty value.
  17408. // This may be used to include null fields in Patch requests.
  17409. NullFields []string `json:"-"`
  17410. }
  17411. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  17412. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  17413. raw := NoMethod(*s)
  17414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17415. }
  17416. type NetworkEndpointGroupsListNetworkEndpoints struct {
  17417. // Id: [Output Only] Unique identifier for the resource; defined by the
  17418. // server.
  17419. Id string `json:"id,omitempty"`
  17420. // Items: A list of NetworkEndpointWithHealthStatus resources.
  17421. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  17422. // Kind: [Output Only] The resource type, which is always
  17423. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  17424. // network endpoints in the specified network endpoint group.
  17425. Kind string `json:"kind,omitempty"`
  17426. // NextPageToken: [Output Only] This token allows you to get the next
  17427. // page of results for list requests. If the number of results is larger
  17428. // than maxResults, use the nextPageToken as a value for the query
  17429. // parameter pageToken in the next list request. Subsequent list
  17430. // requests will have their own nextPageToken to continue paging through
  17431. // the results.
  17432. NextPageToken string `json:"nextPageToken,omitempty"`
  17433. // Warning: [Output Only] Informational warning message.
  17434. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  17435. // ServerResponse contains the HTTP response code and headers from the
  17436. // server.
  17437. googleapi.ServerResponse `json:"-"`
  17438. // ForceSendFields is a list of field names (e.g. "Id") to
  17439. // unconditionally include in API requests. By default, fields with
  17440. // empty values are omitted from API requests. However, any non-pointer,
  17441. // non-interface field appearing in ForceSendFields will be sent to the
  17442. // server regardless of whether the field is empty or not. This may be
  17443. // used to include empty fields in Patch requests.
  17444. ForceSendFields []string `json:"-"`
  17445. // NullFields is a list of field names (e.g. "Id") to include in API
  17446. // requests with the JSON null value. By default, fields with empty
  17447. // values are omitted from API requests. However, any field with an
  17448. // empty value appearing in NullFields will be sent to the server as
  17449. // null. It is an error if a field in this list has a non-empty value.
  17450. // This may be used to include null fields in Patch requests.
  17451. NullFields []string `json:"-"`
  17452. }
  17453. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  17454. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  17455. raw := NoMethod(*s)
  17456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17457. }
  17458. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  17459. // Informational warning message.
  17460. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  17461. // Code: [Output Only] A warning code, if applicable. For example,
  17462. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17463. // the response.
  17464. //
  17465. // Possible values:
  17466. // "CLEANUP_FAILED"
  17467. // "DEPRECATED_RESOURCE_USED"
  17468. // "DEPRECATED_TYPE_USED"
  17469. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17470. // "EXPERIMENTAL_TYPE_USED"
  17471. // "EXTERNAL_API_WARNING"
  17472. // "FIELD_VALUE_OVERRIDEN"
  17473. // "INJECTED_KERNELS_DEPRECATED"
  17474. // "MISSING_TYPE_DEPENDENCY"
  17475. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17476. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17477. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17478. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17479. // "NEXT_HOP_NOT_RUNNING"
  17480. // "NOT_CRITICAL_ERROR"
  17481. // "NO_RESULTS_ON_PAGE"
  17482. // "REQUIRED_TOS_AGREEMENT"
  17483. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17484. // "RESOURCE_NOT_DELETED"
  17485. // "SCHEMA_VALIDATION_IGNORED"
  17486. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17487. // "UNDECLARED_PROPERTIES"
  17488. // "UNREACHABLE"
  17489. Code string `json:"code,omitempty"`
  17490. // Data: [Output Only] Metadata about this warning in key: value format.
  17491. // For example:
  17492. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17493. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  17494. // Message: [Output Only] A human-readable description of the warning
  17495. // code.
  17496. Message string `json:"message,omitempty"`
  17497. // ForceSendFields is a list of field names (e.g. "Code") to
  17498. // unconditionally include in API requests. By default, fields with
  17499. // empty values are omitted from API requests. However, any non-pointer,
  17500. // non-interface field appearing in ForceSendFields will be sent to the
  17501. // server regardless of whether the field is empty or not. This may be
  17502. // used to include empty fields in Patch requests.
  17503. ForceSendFields []string `json:"-"`
  17504. // NullFields is a list of field names (e.g. "Code") to include in API
  17505. // requests with the JSON null value. By default, fields with empty
  17506. // values are omitted from API requests. However, any field with an
  17507. // empty value appearing in NullFields will be sent to the server as
  17508. // null. It is an error if a field in this list has a non-empty value.
  17509. // This may be used to include null fields in Patch requests.
  17510. NullFields []string `json:"-"`
  17511. }
  17512. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  17513. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  17514. raw := NoMethod(*s)
  17515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17516. }
  17517. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  17518. // Key: [Output Only] A key that provides more detail on the warning
  17519. // being returned. For example, for warnings where there are no results
  17520. // in a list request for a particular zone, this key might be scope and
  17521. // the key value might be the zone name. Other examples might be a key
  17522. // indicating a deprecated resource and a suggested replacement, or a
  17523. // warning about invalid network settings (for example, if an instance
  17524. // attempts to perform IP forwarding but is not enabled for IP
  17525. // forwarding).
  17526. Key string `json:"key,omitempty"`
  17527. // Value: [Output Only] A warning data value corresponding to the key.
  17528. Value string `json:"value,omitempty"`
  17529. // ForceSendFields is a list of field names (e.g. "Key") to
  17530. // unconditionally include in API requests. By default, fields with
  17531. // empty values are omitted from API requests. However, any non-pointer,
  17532. // non-interface field appearing in ForceSendFields will be sent to the
  17533. // server regardless of whether the field is empty or not. This may be
  17534. // used to include empty fields in Patch requests.
  17535. ForceSendFields []string `json:"-"`
  17536. // NullFields is a list of field names (e.g. "Key") to include in API
  17537. // requests with the JSON null value. By default, fields with empty
  17538. // values are omitted from API requests. However, any field with an
  17539. // empty value appearing in NullFields will be sent to the server as
  17540. // null. It is an error if a field in this list has a non-empty value.
  17541. // This may be used to include null fields in Patch requests.
  17542. NullFields []string `json:"-"`
  17543. }
  17544. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  17545. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  17546. raw := NoMethod(*s)
  17547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17548. }
  17549. type NetworkEndpointGroupsScopedList struct {
  17550. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  17551. // groups that are contained in this scope.
  17552. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  17553. // Warning: [Output Only] An informational warning that replaces the
  17554. // list of network endpoint groups when the list is empty.
  17555. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  17556. // ForceSendFields is a list of field names (e.g.
  17557. // "NetworkEndpointGroups") to unconditionally include in API requests.
  17558. // By default, fields with empty values are omitted from API requests.
  17559. // However, any non-pointer, non-interface field appearing in
  17560. // ForceSendFields will be sent to the server regardless of whether the
  17561. // field is empty or not. This may be used to include empty fields in
  17562. // Patch requests.
  17563. ForceSendFields []string `json:"-"`
  17564. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  17565. // include in API requests with the JSON null value. By default, fields
  17566. // with empty values are omitted from API requests. However, any field
  17567. // with an empty value appearing in NullFields will be sent to the
  17568. // server as null. It is an error if a field in this list has a
  17569. // non-empty value. This may be used to include null fields in Patch
  17570. // requests.
  17571. NullFields []string `json:"-"`
  17572. }
  17573. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  17574. type NoMethod NetworkEndpointGroupsScopedList
  17575. raw := NoMethod(*s)
  17576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17577. }
  17578. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  17579. // informational warning that replaces the list of network endpoint
  17580. // groups when the list is empty.
  17581. type NetworkEndpointGroupsScopedListWarning struct {
  17582. // Code: [Output Only] A warning code, if applicable. For example,
  17583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17584. // the response.
  17585. //
  17586. // Possible values:
  17587. // "CLEANUP_FAILED"
  17588. // "DEPRECATED_RESOURCE_USED"
  17589. // "DEPRECATED_TYPE_USED"
  17590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17591. // "EXPERIMENTAL_TYPE_USED"
  17592. // "EXTERNAL_API_WARNING"
  17593. // "FIELD_VALUE_OVERRIDEN"
  17594. // "INJECTED_KERNELS_DEPRECATED"
  17595. // "MISSING_TYPE_DEPENDENCY"
  17596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17600. // "NEXT_HOP_NOT_RUNNING"
  17601. // "NOT_CRITICAL_ERROR"
  17602. // "NO_RESULTS_ON_PAGE"
  17603. // "REQUIRED_TOS_AGREEMENT"
  17604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17605. // "RESOURCE_NOT_DELETED"
  17606. // "SCHEMA_VALIDATION_IGNORED"
  17607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17608. // "UNDECLARED_PROPERTIES"
  17609. // "UNREACHABLE"
  17610. Code string `json:"code,omitempty"`
  17611. // Data: [Output Only] Metadata about this warning in key: value format.
  17612. // For example:
  17613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17614. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  17615. // Message: [Output Only] A human-readable description of the warning
  17616. // code.
  17617. Message string `json:"message,omitempty"`
  17618. // ForceSendFields is a list of field names (e.g. "Code") to
  17619. // unconditionally include in API requests. By default, fields with
  17620. // empty values are omitted from API requests. However, any non-pointer,
  17621. // non-interface field appearing in ForceSendFields will be sent to the
  17622. // server regardless of whether the field is empty or not. This may be
  17623. // used to include empty fields in Patch requests.
  17624. ForceSendFields []string `json:"-"`
  17625. // NullFields is a list of field names (e.g. "Code") to include in API
  17626. // requests with the JSON null value. By default, fields with empty
  17627. // values are omitted from API requests. However, any field with an
  17628. // empty value appearing in NullFields will be sent to the server as
  17629. // null. It is an error if a field in this list has a non-empty value.
  17630. // This may be used to include null fields in Patch requests.
  17631. NullFields []string `json:"-"`
  17632. }
  17633. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  17634. type NoMethod NetworkEndpointGroupsScopedListWarning
  17635. raw := NoMethod(*s)
  17636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17637. }
  17638. type NetworkEndpointGroupsScopedListWarningData struct {
  17639. // Key: [Output Only] A key that provides more detail on the warning
  17640. // being returned. For example, for warnings where there are no results
  17641. // in a list request for a particular zone, this key might be scope and
  17642. // the key value might be the zone name. Other examples might be a key
  17643. // indicating a deprecated resource and a suggested replacement, or a
  17644. // warning about invalid network settings (for example, if an instance
  17645. // attempts to perform IP forwarding but is not enabled for IP
  17646. // forwarding).
  17647. Key string `json:"key,omitempty"`
  17648. // Value: [Output Only] A warning data value corresponding to the key.
  17649. Value string `json:"value,omitempty"`
  17650. // ForceSendFields is a list of field names (e.g. "Key") to
  17651. // unconditionally include in API requests. By default, fields with
  17652. // empty values are omitted from API requests. However, any non-pointer,
  17653. // non-interface field appearing in ForceSendFields will be sent to the
  17654. // server regardless of whether the field is empty or not. This may be
  17655. // used to include empty fields in Patch requests.
  17656. ForceSendFields []string `json:"-"`
  17657. // NullFields is a list of field names (e.g. "Key") to include in API
  17658. // requests with the JSON null value. By default, fields with empty
  17659. // values are omitted from API requests. However, any field with an
  17660. // empty value appearing in NullFields will be sent to the server as
  17661. // null. It is an error if a field in this list has a non-empty value.
  17662. // This may be used to include null fields in Patch requests.
  17663. NullFields []string `json:"-"`
  17664. }
  17665. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  17666. type NoMethod NetworkEndpointGroupsScopedListWarningData
  17667. raw := NoMethod(*s)
  17668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17669. }
  17670. type NetworkEndpointWithHealthStatus struct {
  17671. // Healths: [Output only] The health status of network endpoint;
  17672. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  17673. // NetworkEndpoint: [Output only] The network endpoint;
  17674. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  17675. // ForceSendFields is a list of field names (e.g. "Healths") 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. "Healths") to include in
  17683. // API 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 *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  17691. type NoMethod NetworkEndpointWithHealthStatus
  17692. raw := NoMethod(*s)
  17693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17694. }
  17695. // NetworkInterface: A network interface resource attached to an
  17696. // instance.
  17697. type NetworkInterface struct {
  17698. // AccessConfigs: An array of configurations for this interface.
  17699. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  17700. // there are no accessConfigs specified, then this instance will have no
  17701. // external internet access.
  17702. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  17703. // AliasIpRanges: An array of alias IP ranges for this network
  17704. // interface. Can only be specified for network interfaces on
  17705. // subnet-mode networks.
  17706. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  17707. // Fingerprint: Fingerprint hash of contents stored in this network
  17708. // interface. This field will be ignored when inserting an Instance or
  17709. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  17710. // in order to update the NetworkInterface, otherwise the request will
  17711. // fail with error 412 conditionNotMet.
  17712. Fingerprint string `json:"fingerprint,omitempty"`
  17713. // Kind: [Output Only] Type of the resource. Always
  17714. // compute#networkInterface for network interfaces.
  17715. Kind string `json:"kind,omitempty"`
  17716. // Name: [Output Only] The name of the network interface, generated by
  17717. // the server. For network devices, these are eth0, eth1, etc.
  17718. Name string `json:"name,omitempty"`
  17719. // Network: URL of the network resource for this instance. When creating
  17720. // an instance, if neither the network nor the subnetwork is specified,
  17721. // the default network global/networks/default is used; if the network
  17722. // is not specified but the subnetwork is specified, the network is
  17723. // inferred.
  17724. //
  17725. // This field is optional when creating a firewall rule. If not
  17726. // specified when creating a firewall rule, the default network
  17727. // global/networks/default is used.
  17728. //
  17729. // If you specify this property, you can specify the network as a full
  17730. // or partial URL. For example, the following are all valid URLs:
  17731. // -
  17732. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  17733. // - projects/project/global/networks/network
  17734. // - global/networks/default
  17735. Network string `json:"network,omitempty"`
  17736. // NetworkIP: An IPv4 internal network address to assign to the instance
  17737. // for this network interface. If not specified by the user, an unused
  17738. // internal IP is assigned by the system.
  17739. NetworkIP string `json:"networkIP,omitempty"`
  17740. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  17741. // the network resource is in legacy mode, do not provide this property.
  17742. // If the network is in auto subnet mode, providing the subnetwork is
  17743. // optional. If the network is in custom subnet mode, then this field
  17744. // should be specified. If you specify this property, you can specify
  17745. // the subnetwork as a full or partial URL. For example, the following
  17746. // are all valid URLs:
  17747. // -
  17748. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  17749. // - regions/region/subnetworks/subnetwork
  17750. Subnetwork string `json:"subnetwork,omitempty"`
  17751. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  17752. // unconditionally include in API requests. By default, fields with
  17753. // empty values are omitted from API requests. However, any non-pointer,
  17754. // non-interface field appearing in ForceSendFields will be sent to the
  17755. // server regardless of whether the field is empty or not. This may be
  17756. // used to include empty fields in Patch requests.
  17757. ForceSendFields []string `json:"-"`
  17758. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  17759. // in API requests with the JSON null value. By default, fields with
  17760. // empty values are omitted from API requests. However, any field with
  17761. // an empty value appearing in NullFields will be sent to the server as
  17762. // null. It is an error if a field in this list has a non-empty value.
  17763. // This may be used to include null fields in Patch requests.
  17764. NullFields []string `json:"-"`
  17765. }
  17766. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  17767. type NoMethod NetworkInterface
  17768. raw := NoMethod(*s)
  17769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17770. }
  17771. // NetworkList: Contains a list of networks.
  17772. type NetworkList struct {
  17773. // Id: [Output Only] Unique identifier for the resource; defined by the
  17774. // server.
  17775. Id string `json:"id,omitempty"`
  17776. // Items: A list of Network resources.
  17777. Items []*Network `json:"items,omitempty"`
  17778. // Kind: [Output Only] Type of resource. Always compute#networkList for
  17779. // lists of networks.
  17780. Kind string `json:"kind,omitempty"`
  17781. // NextPageToken: [Output Only] This token allows you to get the next
  17782. // page of results for list requests. If the number of results is larger
  17783. // than maxResults, use the nextPageToken as a value for the query
  17784. // parameter pageToken in the next list request. Subsequent list
  17785. // requests will have their own nextPageToken to continue paging through
  17786. // the results.
  17787. NextPageToken string `json:"nextPageToken,omitempty"`
  17788. // SelfLink: [Output Only] Server-defined URL for this resource.
  17789. SelfLink string `json:"selfLink,omitempty"`
  17790. // Warning: [Output Only] Informational warning message.
  17791. Warning *NetworkListWarning `json:"warning,omitempty"`
  17792. // ServerResponse contains the HTTP response code and headers from the
  17793. // server.
  17794. googleapi.ServerResponse `json:"-"`
  17795. // ForceSendFields is a list of field names (e.g. "Id") to
  17796. // unconditionally include in API requests. By default, fields with
  17797. // empty values are omitted from API requests. However, any non-pointer,
  17798. // non-interface field appearing in ForceSendFields will be sent to the
  17799. // server regardless of whether the field is empty or not. This may be
  17800. // used to include empty fields in Patch requests.
  17801. ForceSendFields []string `json:"-"`
  17802. // NullFields is a list of field names (e.g. "Id") to include in API
  17803. // requests with the JSON null value. By default, fields with empty
  17804. // values are omitted from API requests. However, any field with an
  17805. // empty value appearing in NullFields will be sent to the server as
  17806. // null. It is an error if a field in this list has a non-empty value.
  17807. // This may be used to include null fields in Patch requests.
  17808. NullFields []string `json:"-"`
  17809. }
  17810. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  17811. type NoMethod NetworkList
  17812. raw := NoMethod(*s)
  17813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17814. }
  17815. // NetworkListWarning: [Output Only] Informational warning message.
  17816. type NetworkListWarning struct {
  17817. // Code: [Output Only] A warning code, if applicable. For example,
  17818. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17819. // the response.
  17820. //
  17821. // Possible values:
  17822. // "CLEANUP_FAILED"
  17823. // "DEPRECATED_RESOURCE_USED"
  17824. // "DEPRECATED_TYPE_USED"
  17825. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17826. // "EXPERIMENTAL_TYPE_USED"
  17827. // "EXTERNAL_API_WARNING"
  17828. // "FIELD_VALUE_OVERRIDEN"
  17829. // "INJECTED_KERNELS_DEPRECATED"
  17830. // "MISSING_TYPE_DEPENDENCY"
  17831. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17832. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17833. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17834. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17835. // "NEXT_HOP_NOT_RUNNING"
  17836. // "NOT_CRITICAL_ERROR"
  17837. // "NO_RESULTS_ON_PAGE"
  17838. // "REQUIRED_TOS_AGREEMENT"
  17839. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17840. // "RESOURCE_NOT_DELETED"
  17841. // "SCHEMA_VALIDATION_IGNORED"
  17842. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17843. // "UNDECLARED_PROPERTIES"
  17844. // "UNREACHABLE"
  17845. Code string `json:"code,omitempty"`
  17846. // Data: [Output Only] Metadata about this warning in key: value format.
  17847. // For example:
  17848. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17849. Data []*NetworkListWarningData `json:"data,omitempty"`
  17850. // Message: [Output Only] A human-readable description of the warning
  17851. // code.
  17852. Message string `json:"message,omitempty"`
  17853. // ForceSendFields is a list of field names (e.g. "Code") to
  17854. // unconditionally include in API requests. By default, fields with
  17855. // empty values are omitted from API requests. However, any non-pointer,
  17856. // non-interface field appearing in ForceSendFields will be sent to the
  17857. // server regardless of whether the field is empty or not. This may be
  17858. // used to include empty fields in Patch requests.
  17859. ForceSendFields []string `json:"-"`
  17860. // NullFields is a list of field names (e.g. "Code") to include in API
  17861. // requests with the JSON null value. By default, fields with empty
  17862. // values are omitted from API requests. However, any field with an
  17863. // empty value appearing in NullFields will be sent to the server as
  17864. // null. It is an error if a field in this list has a non-empty value.
  17865. // This may be used to include null fields in Patch requests.
  17866. NullFields []string `json:"-"`
  17867. }
  17868. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  17869. type NoMethod NetworkListWarning
  17870. raw := NoMethod(*s)
  17871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17872. }
  17873. type NetworkListWarningData struct {
  17874. // Key: [Output Only] A key that provides more detail on the warning
  17875. // being returned. For example, for warnings where there are no results
  17876. // in a list request for a particular zone, this key might be scope and
  17877. // the key value might be the zone name. Other examples might be a key
  17878. // indicating a deprecated resource and a suggested replacement, or a
  17879. // warning about invalid network settings (for example, if an instance
  17880. // attempts to perform IP forwarding but is not enabled for IP
  17881. // forwarding).
  17882. Key string `json:"key,omitempty"`
  17883. // Value: [Output Only] A warning data value corresponding to the key.
  17884. Value string `json:"value,omitempty"`
  17885. // ForceSendFields is a list of field names (e.g. "Key") to
  17886. // unconditionally include in API requests. By default, fields with
  17887. // empty values are omitted from API requests. However, any non-pointer,
  17888. // non-interface field appearing in ForceSendFields will be sent to the
  17889. // server regardless of whether the field is empty or not. This may be
  17890. // used to include empty fields in Patch requests.
  17891. ForceSendFields []string `json:"-"`
  17892. // NullFields is a list of field names (e.g. "Key") to include in API
  17893. // requests with the JSON null value. By default, fields with empty
  17894. // values are omitted from API requests. However, any field with an
  17895. // empty value appearing in NullFields will be sent to the server as
  17896. // null. It is an error if a field in this list has a non-empty value.
  17897. // This may be used to include null fields in Patch requests.
  17898. NullFields []string `json:"-"`
  17899. }
  17900. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  17901. type NoMethod NetworkListWarningData
  17902. raw := NoMethod(*s)
  17903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17904. }
  17905. // NetworkPeering: A network peering attached to a network resource. The
  17906. // message includes the peering name, peer network, peering state, and a
  17907. // flag indicating whether Google Compute Engine should automatically
  17908. // create routes for the peering.
  17909. type NetworkPeering struct {
  17910. // AdvertisePeerSubnetsViaRouters: Whether Cloud Routers in this network
  17911. // can automatically advertise subnets from the peer network.
  17912. AdvertisePeerSubnetsViaRouters bool `json:"advertisePeerSubnetsViaRouters,omitempty"`
  17913. // AutoCreateRoutes: Indicates whether full mesh connectivity is created
  17914. // and managed automatically. When it is set to true, Google Compute
  17915. // Engine will automatically create and manage the routes between two
  17916. // networks when the state is ACTIVE. Otherwise, user needs to create
  17917. // routes manually to route packets to peer network.
  17918. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  17919. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  17920. // managed automatically. When it is set to true, Google Compute Engine
  17921. // will automatically create and manage the routes between two networks
  17922. // when the peering state is ACTIVE. Otherwise, user needs to create
  17923. // routes manually to route packets to peer network.
  17924. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  17925. // ExportCustomRoutes: Whether to export the custom routes to peer
  17926. // network.
  17927. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  17928. // ImportCustomRoutes: Whether to import the custom routes from peer
  17929. // network.
  17930. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  17931. // Name: Name of this peering. Provided by the client when the peering
  17932. // is created. The name must comply with RFC1035. Specifically, the name
  17933. // must be 1-63 characters long and match regular expression
  17934. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  17935. // a lowercase letter, and all the following characters must be a dash,
  17936. // lowercase letter, or digit, except the last character, which cannot
  17937. // be a dash.
  17938. Name string `json:"name,omitempty"`
  17939. // Network: The URL of the peer network. It can be either full URL or
  17940. // partial URL. The peer network may belong to a different project. If
  17941. // the partial URL does not contain project, it is assumed that the peer
  17942. // network is in the same project as the current network.
  17943. Network string `json:"network,omitempty"`
  17944. // State: [Output Only] State for the peering.
  17945. //
  17946. // Possible values:
  17947. // "ACTIVE"
  17948. // "INACTIVE"
  17949. State string `json:"state,omitempty"`
  17950. // StateDetails: [Output Only] Details about the current state of the
  17951. // peering.
  17952. StateDetails string `json:"stateDetails,omitempty"`
  17953. // ForceSendFields is a list of field names (e.g.
  17954. // "AdvertisePeerSubnetsViaRouters") to unconditionally include in API
  17955. // requests. By default, fields with empty values are omitted from API
  17956. // requests. However, any non-pointer, non-interface field appearing in
  17957. // ForceSendFields will be sent to the server regardless of whether the
  17958. // field is empty or not. This may be used to include empty fields in
  17959. // Patch requests.
  17960. ForceSendFields []string `json:"-"`
  17961. // NullFields is a list of field names (e.g.
  17962. // "AdvertisePeerSubnetsViaRouters") to include in API requests with the
  17963. // JSON null value. By default, fields with empty values are omitted
  17964. // from API requests. However, any field with an empty value appearing
  17965. // in NullFields will be sent to the server as null. It is an error if a
  17966. // field in this list has a non-empty value. This may be used to include
  17967. // null fields in Patch requests.
  17968. NullFields []string `json:"-"`
  17969. }
  17970. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  17971. type NoMethod NetworkPeering
  17972. raw := NoMethod(*s)
  17973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17974. }
  17975. // NetworkRoutingConfig: A routing configuration attached to a network
  17976. // resource. The message includes the list of routers associated with
  17977. // the network, and a flag indicating the type of routing behavior to
  17978. // enforce network-wide.
  17979. type NetworkRoutingConfig struct {
  17980. // RoutingMode: The network-wide routing mode to use. If set to
  17981. // REGIONAL, this network's cloud routers will only advertise routes
  17982. // with subnets of this network in the same region as the router. If set
  17983. // to GLOBAL, this network's cloud routers will advertise routes with
  17984. // all subnets of this network, across regions.
  17985. //
  17986. // Possible values:
  17987. // "GLOBAL"
  17988. // "REGIONAL"
  17989. RoutingMode string `json:"routingMode,omitempty"`
  17990. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  17991. // unconditionally include in API requests. By default, fields with
  17992. // empty values are omitted from API requests. However, any non-pointer,
  17993. // non-interface field appearing in ForceSendFields will be sent to the
  17994. // server regardless of whether the field is empty or not. This may be
  17995. // used to include empty fields in Patch requests.
  17996. ForceSendFields []string `json:"-"`
  17997. // NullFields is a list of field names (e.g. "RoutingMode") to include
  17998. // in API requests with the JSON null value. By default, fields with
  17999. // empty values are omitted from API requests. However, any field with
  18000. // an empty value appearing in NullFields will be sent to the server as
  18001. // null. It is an error if a field in this list has a non-empty value.
  18002. // This may be used to include null fields in Patch requests.
  18003. NullFields []string `json:"-"`
  18004. }
  18005. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  18006. type NoMethod NetworkRoutingConfig
  18007. raw := NoMethod(*s)
  18008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18009. }
  18010. type NetworksAddPeeringRequest struct {
  18011. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  18012. // automatically.
  18013. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  18014. // ExportCustomRoutes: This field will be deprecated soon. Prefer using
  18015. // export_custom_routes in network_peering instead. Whether to export
  18016. // the custom routes to peer network.
  18017. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  18018. // ImportCustomRoutes: This field will be deprecated soon. Prefer using
  18019. // import_custom_routes in network_peering instead. Whether to import
  18020. // the custom routes from peer network.
  18021. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  18022. // Name: Name of the peering, which should conform to RFC1035.
  18023. Name string `json:"name,omitempty"`
  18024. // NetworkPeering: Network peering parameters. In order to specify route
  18025. // policies for peering using import/export custom routes, you will have
  18026. // to fill all peering related parameters (name, peer network,
  18027. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  18028. // in NetworksAddPeeringRequest will be deprecated soon.
  18029. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  18030. // PeerNetwork: URL of the peer network. It can be either full URL or
  18031. // partial URL. The peer network may belong to a different project. If
  18032. // the partial URL does not contain project, it is assumed that the peer
  18033. // network is in the same project as the current network.
  18034. PeerNetwork string `json:"peerNetwork,omitempty"`
  18035. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  18036. // unconditionally include in API requests. By default, fields with
  18037. // empty values are omitted from API requests. However, any non-pointer,
  18038. // non-interface field appearing in ForceSendFields will be sent to the
  18039. // server regardless of whether the field is empty or not. This may be
  18040. // used to include empty fields in Patch requests.
  18041. ForceSendFields []string `json:"-"`
  18042. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  18043. // include in API requests with the JSON null value. By default, fields
  18044. // with empty values are omitted from API requests. However, any field
  18045. // with an empty value appearing in NullFields will be sent to the
  18046. // server as null. It is an error if a field in this list has a
  18047. // non-empty value. This may be used to include null fields in Patch
  18048. // requests.
  18049. NullFields []string `json:"-"`
  18050. }
  18051. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  18052. type NoMethod NetworksAddPeeringRequest
  18053. raw := NoMethod(*s)
  18054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18055. }
  18056. type NetworksRemovePeeringRequest struct {
  18057. // Name: Name of the peering, which should conform to RFC1035.
  18058. Name string `json:"name,omitempty"`
  18059. // ForceSendFields is a list of field names (e.g. "Name") to
  18060. // unconditionally include in API requests. By default, fields with
  18061. // empty values are omitted from API requests. However, any non-pointer,
  18062. // non-interface field appearing in ForceSendFields will be sent to the
  18063. // server regardless of whether the field is empty or not. This may be
  18064. // used to include empty fields in Patch requests.
  18065. ForceSendFields []string `json:"-"`
  18066. // NullFields is a list of field names (e.g. "Name") to include in API
  18067. // requests with the JSON null value. By default, fields with empty
  18068. // values are omitted from API requests. However, any field with an
  18069. // empty value appearing in NullFields will be sent to the server as
  18070. // null. It is an error if a field in this list has a non-empty value.
  18071. // This may be used to include null fields in Patch requests.
  18072. NullFields []string `json:"-"`
  18073. }
  18074. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  18075. type NoMethod NetworksRemovePeeringRequest
  18076. raw := NoMethod(*s)
  18077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18078. }
  18079. type NetworksUpdatePeeringRequest struct {
  18080. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  18081. // ForceSendFields is a list of field names (e.g. "NetworkPeering") to
  18082. // unconditionally include in API requests. By default, fields with
  18083. // empty values are omitted from API requests. However, any non-pointer,
  18084. // non-interface field appearing in ForceSendFields will be sent to the
  18085. // server regardless of whether the field is empty or not. This may be
  18086. // used to include empty fields in Patch requests.
  18087. ForceSendFields []string `json:"-"`
  18088. // NullFields is a list of field names (e.g. "NetworkPeering") to
  18089. // include in API requests with the JSON null value. By default, fields
  18090. // with empty values are omitted from API requests. However, any field
  18091. // with an empty value appearing in NullFields will be sent to the
  18092. // server as null. It is an error if a field in this list has a
  18093. // non-empty value. This may be used to include null fields in Patch
  18094. // requests.
  18095. NullFields []string `json:"-"`
  18096. }
  18097. func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
  18098. type NoMethod NetworksUpdatePeeringRequest
  18099. raw := NoMethod(*s)
  18100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18101. }
  18102. // NodeGroup: A NodeGroup resource.
  18103. type NodeGroup struct {
  18104. AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  18105. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18106. // format.
  18107. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18108. // Description: An optional description of this resource. Provide this
  18109. // property when you create the resource.
  18110. Description string `json:"description,omitempty"`
  18111. // Id: [Output Only] The unique identifier for the resource. This
  18112. // identifier is defined by the server.
  18113. Id uint64 `json:"id,omitempty,string"`
  18114. // Kind: [Output Only] The type of the resource. Always
  18115. // compute#nodeGroup for node group.
  18116. Kind string `json:"kind,omitempty"`
  18117. // Name: The name of the resource, provided by the client when initially
  18118. // creating the resource. The resource name must be 1-63 characters
  18119. // long, and comply with RFC1035. Specifically, the name must be 1-63
  18120. // characters long and match the regular expression
  18121. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  18122. // a lowercase letter, and all following characters must be a dash,
  18123. // lowercase letter, or digit, except the last character, which cannot
  18124. // be a dash.
  18125. Name string `json:"name,omitempty"`
  18126. // NodeTemplate: The URL of the node template to which this node group
  18127. // belongs.
  18128. NodeTemplate string `json:"nodeTemplate,omitempty"`
  18129. // SelfLink: [Output Only] Server-defined URL for the resource.
  18130. SelfLink string `json:"selfLink,omitempty"`
  18131. // Size: [Output Only] The total number of nodes in the node group.
  18132. Size int64 `json:"size,omitempty"`
  18133. // Possible values:
  18134. // "CREATING"
  18135. // "DELETING"
  18136. // "INVALID"
  18137. // "READY"
  18138. Status string `json:"status,omitempty"`
  18139. // Zone: [Output Only] The name of the zone where the node group
  18140. // resides, such as us-central1-a.
  18141. Zone string `json:"zone,omitempty"`
  18142. // ServerResponse contains the HTTP response code and headers from the
  18143. // server.
  18144. googleapi.ServerResponse `json:"-"`
  18145. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  18146. // to unconditionally include in API requests. By default, fields with
  18147. // empty values are omitted from API requests. However, any non-pointer,
  18148. // non-interface field appearing in ForceSendFields will be sent to the
  18149. // server regardless of whether the field is empty or not. This may be
  18150. // used to include empty fields in Patch requests.
  18151. ForceSendFields []string `json:"-"`
  18152. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  18153. // include in API requests with the JSON null value. By default, fields
  18154. // with empty values are omitted from API requests. However, any field
  18155. // with an empty value appearing in NullFields will be sent to the
  18156. // server as null. It is an error if a field in this list has a
  18157. // non-empty value. This may be used to include null fields in Patch
  18158. // requests.
  18159. NullFields []string `json:"-"`
  18160. }
  18161. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  18162. type NoMethod NodeGroup
  18163. raw := NoMethod(*s)
  18164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18165. }
  18166. type NodeGroupAggregatedList struct {
  18167. // Id: [Output Only] Unique identifier for the resource; defined by the
  18168. // server.
  18169. Id string `json:"id,omitempty"`
  18170. // Items: A list of NodeGroupsScopedList resources.
  18171. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  18172. // Kind: [Output Only] Type of resource.Always
  18173. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  18174. Kind string `json:"kind,omitempty"`
  18175. // NextPageToken: [Output Only] This token allows you to get the next
  18176. // page of results for list requests. If the number of results is larger
  18177. // than maxResults, use the nextPageToken as a value for the query
  18178. // parameter pageToken in the next list request. Subsequent list
  18179. // requests will have their own nextPageToken to continue paging through
  18180. // the results.
  18181. NextPageToken string `json:"nextPageToken,omitempty"`
  18182. // SelfLink: [Output Only] Server-defined URL for this resource.
  18183. SelfLink string `json:"selfLink,omitempty"`
  18184. // Warning: [Output Only] Informational warning message.
  18185. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  18186. // ServerResponse contains the HTTP response code and headers from the
  18187. // server.
  18188. googleapi.ServerResponse `json:"-"`
  18189. // ForceSendFields is a list of field names (e.g. "Id") to
  18190. // unconditionally include in API requests. By default, fields with
  18191. // empty values are omitted from API requests. However, any non-pointer,
  18192. // non-interface field appearing in ForceSendFields will be sent to the
  18193. // server regardless of whether the field is empty or not. This may be
  18194. // used to include empty fields in Patch requests.
  18195. ForceSendFields []string `json:"-"`
  18196. // NullFields is a list of field names (e.g. "Id") to include in API
  18197. // requests with the JSON null value. By default, fields with empty
  18198. // values are omitted from API requests. However, any field with an
  18199. // empty value appearing in NullFields will be sent to the server as
  18200. // null. It is an error if a field in this list has a non-empty value.
  18201. // This may be used to include null fields in Patch requests.
  18202. NullFields []string `json:"-"`
  18203. }
  18204. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  18205. type NoMethod NodeGroupAggregatedList
  18206. raw := NoMethod(*s)
  18207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18208. }
  18209. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  18210. // message.
  18211. type NodeGroupAggregatedListWarning struct {
  18212. // Code: [Output Only] A warning code, if applicable. For example,
  18213. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18214. // the response.
  18215. //
  18216. // Possible values:
  18217. // "CLEANUP_FAILED"
  18218. // "DEPRECATED_RESOURCE_USED"
  18219. // "DEPRECATED_TYPE_USED"
  18220. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18221. // "EXPERIMENTAL_TYPE_USED"
  18222. // "EXTERNAL_API_WARNING"
  18223. // "FIELD_VALUE_OVERRIDEN"
  18224. // "INJECTED_KERNELS_DEPRECATED"
  18225. // "MISSING_TYPE_DEPENDENCY"
  18226. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18227. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18228. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18229. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18230. // "NEXT_HOP_NOT_RUNNING"
  18231. // "NOT_CRITICAL_ERROR"
  18232. // "NO_RESULTS_ON_PAGE"
  18233. // "REQUIRED_TOS_AGREEMENT"
  18234. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18235. // "RESOURCE_NOT_DELETED"
  18236. // "SCHEMA_VALIDATION_IGNORED"
  18237. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18238. // "UNDECLARED_PROPERTIES"
  18239. // "UNREACHABLE"
  18240. Code string `json:"code,omitempty"`
  18241. // Data: [Output Only] Metadata about this warning in key: value format.
  18242. // For example:
  18243. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18244. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  18245. // Message: [Output Only] A human-readable description of the warning
  18246. // code.
  18247. Message string `json:"message,omitempty"`
  18248. // ForceSendFields is a list of field names (e.g. "Code") to
  18249. // unconditionally include in API requests. By default, fields with
  18250. // empty values are omitted from API requests. However, any non-pointer,
  18251. // non-interface field appearing in ForceSendFields will be sent to the
  18252. // server regardless of whether the field is empty or not. This may be
  18253. // used to include empty fields in Patch requests.
  18254. ForceSendFields []string `json:"-"`
  18255. // NullFields is a list of field names (e.g. "Code") to include in API
  18256. // requests with the JSON null value. By default, fields with empty
  18257. // values are omitted from API requests. However, any field with an
  18258. // empty value appearing in NullFields will be sent to the server as
  18259. // null. It is an error if a field in this list has a non-empty value.
  18260. // This may be used to include null fields in Patch requests.
  18261. NullFields []string `json:"-"`
  18262. }
  18263. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18264. type NoMethod NodeGroupAggregatedListWarning
  18265. raw := NoMethod(*s)
  18266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18267. }
  18268. type NodeGroupAggregatedListWarningData struct {
  18269. // Key: [Output Only] A key that provides more detail on the warning
  18270. // being returned. For example, for warnings where there are no results
  18271. // in a list request for a particular zone, this key might be scope and
  18272. // the key value might be the zone name. Other examples might be a key
  18273. // indicating a deprecated resource and a suggested replacement, or a
  18274. // warning about invalid network settings (for example, if an instance
  18275. // attempts to perform IP forwarding but is not enabled for IP
  18276. // forwarding).
  18277. Key string `json:"key,omitempty"`
  18278. // Value: [Output Only] A warning data value corresponding to the key.
  18279. Value string `json:"value,omitempty"`
  18280. // ForceSendFields is a list of field names (e.g. "Key") to
  18281. // unconditionally include in API requests. By default, fields with
  18282. // empty values are omitted from API requests. However, any non-pointer,
  18283. // non-interface field appearing in ForceSendFields will be sent to the
  18284. // server regardless of whether the field is empty or not. This may be
  18285. // used to include empty fields in Patch requests.
  18286. ForceSendFields []string `json:"-"`
  18287. // NullFields is a list of field names (e.g. "Key") to include in API
  18288. // requests with the JSON null value. By default, fields with empty
  18289. // values are omitted from API requests. However, any field with an
  18290. // empty value appearing in NullFields will be sent to the server as
  18291. // null. It is an error if a field in this list has a non-empty value.
  18292. // This may be used to include null fields in Patch requests.
  18293. NullFields []string `json:"-"`
  18294. }
  18295. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18296. type NoMethod NodeGroupAggregatedListWarningData
  18297. raw := NoMethod(*s)
  18298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18299. }
  18300. type NodeGroupAutoscalingPolicy struct {
  18301. MaxSize int64 `json:"maxSize,omitempty"`
  18302. MinSize int64 `json:"minSize,omitempty"`
  18303. // ForceSendFields is a list of field names (e.g. "MaxSize") to
  18304. // unconditionally include in API requests. By default, fields with
  18305. // empty values are omitted from API requests. However, any non-pointer,
  18306. // non-interface field appearing in ForceSendFields will be sent to the
  18307. // server regardless of whether the field is empty or not. This may be
  18308. // used to include empty fields in Patch requests.
  18309. ForceSendFields []string `json:"-"`
  18310. // NullFields is a list of field names (e.g. "MaxSize") to include in
  18311. // API requests with the JSON null value. By default, fields with empty
  18312. // values are omitted from API requests. However, any field with an
  18313. // empty value appearing in NullFields will be sent to the server as
  18314. // null. It is an error if a field in this list has a non-empty value.
  18315. // This may be used to include null fields in Patch requests.
  18316. NullFields []string `json:"-"`
  18317. }
  18318. func (s *NodeGroupAutoscalingPolicy) MarshalJSON() ([]byte, error) {
  18319. type NoMethod NodeGroupAutoscalingPolicy
  18320. raw := NoMethod(*s)
  18321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18322. }
  18323. // NodeGroupList: Contains a list of nodeGroups.
  18324. type NodeGroupList struct {
  18325. // Id: [Output Only] Unique identifier for the resource; defined by the
  18326. // server.
  18327. Id string `json:"id,omitempty"`
  18328. // Items: A list of NodeGroup resources.
  18329. Items []*NodeGroup `json:"items,omitempty"`
  18330. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  18331. // lists of node groups.
  18332. Kind string `json:"kind,omitempty"`
  18333. // NextPageToken: [Output Only] This token allows you to get the next
  18334. // page of results for list requests. If the number of results is larger
  18335. // than maxResults, use the nextPageToken as a value for the query
  18336. // parameter pageToken in the next list request. Subsequent list
  18337. // requests will have their own nextPageToken to continue paging through
  18338. // the results.
  18339. NextPageToken string `json:"nextPageToken,omitempty"`
  18340. // SelfLink: [Output Only] Server-defined URL for this resource.
  18341. SelfLink string `json:"selfLink,omitempty"`
  18342. // Warning: [Output Only] Informational warning message.
  18343. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  18344. // ServerResponse contains the HTTP response code and headers from the
  18345. // server.
  18346. googleapi.ServerResponse `json:"-"`
  18347. // ForceSendFields is a list of field names (e.g. "Id") to
  18348. // unconditionally include in API requests. By default, fields with
  18349. // empty values are omitted from API requests. However, any non-pointer,
  18350. // non-interface field appearing in ForceSendFields will be sent to the
  18351. // server regardless of whether the field is empty or not. This may be
  18352. // used to include empty fields in Patch requests.
  18353. ForceSendFields []string `json:"-"`
  18354. // NullFields is a list of field names (e.g. "Id") to include in API
  18355. // requests with the JSON null value. By default, fields with empty
  18356. // values are omitted from API requests. However, any field with an
  18357. // empty value appearing in NullFields will be sent to the server as
  18358. // null. It is an error if a field in this list has a non-empty value.
  18359. // This may be used to include null fields in Patch requests.
  18360. NullFields []string `json:"-"`
  18361. }
  18362. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  18363. type NoMethod NodeGroupList
  18364. raw := NoMethod(*s)
  18365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18366. }
  18367. // NodeGroupListWarning: [Output Only] Informational warning message.
  18368. type NodeGroupListWarning struct {
  18369. // Code: [Output Only] A warning code, if applicable. For example,
  18370. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18371. // the response.
  18372. //
  18373. // Possible values:
  18374. // "CLEANUP_FAILED"
  18375. // "DEPRECATED_RESOURCE_USED"
  18376. // "DEPRECATED_TYPE_USED"
  18377. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18378. // "EXPERIMENTAL_TYPE_USED"
  18379. // "EXTERNAL_API_WARNING"
  18380. // "FIELD_VALUE_OVERRIDEN"
  18381. // "INJECTED_KERNELS_DEPRECATED"
  18382. // "MISSING_TYPE_DEPENDENCY"
  18383. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18384. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18385. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18386. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18387. // "NEXT_HOP_NOT_RUNNING"
  18388. // "NOT_CRITICAL_ERROR"
  18389. // "NO_RESULTS_ON_PAGE"
  18390. // "REQUIRED_TOS_AGREEMENT"
  18391. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18392. // "RESOURCE_NOT_DELETED"
  18393. // "SCHEMA_VALIDATION_IGNORED"
  18394. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18395. // "UNDECLARED_PROPERTIES"
  18396. // "UNREACHABLE"
  18397. Code string `json:"code,omitempty"`
  18398. // Data: [Output Only] Metadata about this warning in key: value format.
  18399. // For example:
  18400. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18401. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  18402. // Message: [Output Only] A human-readable description of the warning
  18403. // code.
  18404. Message string `json:"message,omitempty"`
  18405. // ForceSendFields is a list of field names (e.g. "Code") to
  18406. // unconditionally include in API requests. By default, fields with
  18407. // empty values are omitted from API requests. However, any non-pointer,
  18408. // non-interface field appearing in ForceSendFields will be sent to the
  18409. // server regardless of whether the field is empty or not. This may be
  18410. // used to include empty fields in Patch requests.
  18411. ForceSendFields []string `json:"-"`
  18412. // NullFields is a list of field names (e.g. "Code") to include in API
  18413. // requests with the JSON null value. By default, fields with empty
  18414. // values are omitted from API requests. However, any field with an
  18415. // empty value appearing in NullFields will be sent to the server as
  18416. // null. It is an error if a field in this list has a non-empty value.
  18417. // This may be used to include null fields in Patch requests.
  18418. NullFields []string `json:"-"`
  18419. }
  18420. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  18421. type NoMethod NodeGroupListWarning
  18422. raw := NoMethod(*s)
  18423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18424. }
  18425. type NodeGroupListWarningData struct {
  18426. // Key: [Output Only] A key that provides more detail on the warning
  18427. // being returned. For example, for warnings where there are no results
  18428. // in a list request for a particular zone, this key might be scope and
  18429. // the key value might be the zone name. Other examples might be a key
  18430. // indicating a deprecated resource and a suggested replacement, or a
  18431. // warning about invalid network settings (for example, if an instance
  18432. // attempts to perform IP forwarding but is not enabled for IP
  18433. // forwarding).
  18434. Key string `json:"key,omitempty"`
  18435. // Value: [Output Only] A warning data value corresponding to the key.
  18436. Value string `json:"value,omitempty"`
  18437. // ForceSendFields is a list of field names (e.g. "Key") to
  18438. // unconditionally include in API requests. By default, fields with
  18439. // empty values are omitted from API requests. However, any non-pointer,
  18440. // non-interface field appearing in ForceSendFields will be sent to the
  18441. // server regardless of whether the field is empty or not. This may be
  18442. // used to include empty fields in Patch requests.
  18443. ForceSendFields []string `json:"-"`
  18444. // NullFields is a list of field names (e.g. "Key") to include in API
  18445. // requests with the JSON null value. By default, fields with empty
  18446. // values are omitted from API requests. However, any field with an
  18447. // empty value appearing in NullFields will be sent to the server as
  18448. // null. It is an error if a field in this list has a non-empty value.
  18449. // This may be used to include null fields in Patch requests.
  18450. NullFields []string `json:"-"`
  18451. }
  18452. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  18453. type NoMethod NodeGroupListWarningData
  18454. raw := NoMethod(*s)
  18455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18456. }
  18457. type NodeGroupNode struct {
  18458. // Instances: Instances scheduled on this node.
  18459. Instances []string `json:"instances,omitempty"`
  18460. // Name: The name of the node.
  18461. Name string `json:"name,omitempty"`
  18462. // NodeType: The type of this node.
  18463. NodeType string `json:"nodeType,omitempty"`
  18464. // ServerBinding: Binding properties for the physical server.
  18465. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  18466. // Possible values:
  18467. // "CREATING"
  18468. // "DELETING"
  18469. // "INVALID"
  18470. // "READY"
  18471. // "REPAIRING"
  18472. Status string `json:"status,omitempty"`
  18473. // ForceSendFields is a list of field names (e.g. "Instances") to
  18474. // unconditionally include in API requests. By default, fields with
  18475. // empty values are omitted from API requests. However, any non-pointer,
  18476. // non-interface field appearing in ForceSendFields will be sent to the
  18477. // server regardless of whether the field is empty or not. This may be
  18478. // used to include empty fields in Patch requests.
  18479. ForceSendFields []string `json:"-"`
  18480. // NullFields is a list of field names (e.g. "Instances") to include in
  18481. // API requests with the JSON null value. By default, fields with empty
  18482. // values are omitted from API requests. However, any field with an
  18483. // empty value appearing in NullFields will be sent to the server as
  18484. // null. It is an error if a field in this list has a non-empty value.
  18485. // This may be used to include null fields in Patch requests.
  18486. NullFields []string `json:"-"`
  18487. }
  18488. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  18489. type NoMethod NodeGroupNode
  18490. raw := NoMethod(*s)
  18491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18492. }
  18493. type NodeGroupsAddNodesRequest struct {
  18494. // AdditionalNodeCount: Count of additional nodes to be added to the
  18495. // node group.
  18496. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  18497. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  18498. // to unconditionally include in API requests. By default, fields with
  18499. // empty values are omitted from API requests. However, any non-pointer,
  18500. // non-interface field appearing in ForceSendFields will be sent to the
  18501. // server regardless of whether the field is empty or not. This may be
  18502. // used to include empty fields in Patch requests.
  18503. ForceSendFields []string `json:"-"`
  18504. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  18505. // include in API requests with the JSON null value. By default, fields
  18506. // with empty values are omitted from API requests. However, any field
  18507. // with an empty value appearing in NullFields will be sent to the
  18508. // server as null. It is an error if a field in this list has a
  18509. // non-empty value. This may be used to include null fields in Patch
  18510. // requests.
  18511. NullFields []string `json:"-"`
  18512. }
  18513. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  18514. type NoMethod NodeGroupsAddNodesRequest
  18515. raw := NoMethod(*s)
  18516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18517. }
  18518. type NodeGroupsDeleteNodesRequest struct {
  18519. Nodes []string `json:"nodes,omitempty"`
  18520. // ForceSendFields is a list of field names (e.g. "Nodes") to
  18521. // unconditionally include in API requests. By default, fields with
  18522. // empty values are omitted from API requests. However, any non-pointer,
  18523. // non-interface field appearing in ForceSendFields will be sent to the
  18524. // server regardless of whether the field is empty or not. This may be
  18525. // used to include empty fields in Patch requests.
  18526. ForceSendFields []string `json:"-"`
  18527. // NullFields is a list of field names (e.g. "Nodes") to include in API
  18528. // requests with the JSON null value. By default, fields with empty
  18529. // values are omitted from API requests. However, any field with an
  18530. // empty value appearing in NullFields will be sent to the server as
  18531. // null. It is an error if a field in this list has a non-empty value.
  18532. // This may be used to include null fields in Patch requests.
  18533. NullFields []string `json:"-"`
  18534. }
  18535. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  18536. type NoMethod NodeGroupsDeleteNodesRequest
  18537. raw := NoMethod(*s)
  18538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18539. }
  18540. type NodeGroupsListNodes struct {
  18541. // Id: [Output Only] Unique identifier for the resource; defined by the
  18542. // server.
  18543. Id string `json:"id,omitempty"`
  18544. // Items: A list of Node resources.
  18545. Items []*NodeGroupNode `json:"items,omitempty"`
  18546. // Kind: [Output Only] The resource type, which is always
  18547. // compute.nodeGroupsListNodes for the list of nodes in the specified
  18548. // node group.
  18549. Kind string `json:"kind,omitempty"`
  18550. // NextPageToken: [Output Only] This token allows you to get the next
  18551. // page of results for list requests. If the number of results is larger
  18552. // than maxResults, use the nextPageToken as a value for the query
  18553. // parameter pageToken in the next list request. Subsequent list
  18554. // requests will have their own nextPageToken to continue paging through
  18555. // the results.
  18556. NextPageToken string `json:"nextPageToken,omitempty"`
  18557. // SelfLink: [Output Only] Server-defined URL for this resource.
  18558. SelfLink string `json:"selfLink,omitempty"`
  18559. // Warning: [Output Only] Informational warning message.
  18560. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  18561. // ServerResponse contains the HTTP response code and headers from the
  18562. // server.
  18563. googleapi.ServerResponse `json:"-"`
  18564. // ForceSendFields is a list of field names (e.g. "Id") to
  18565. // unconditionally include in API requests. By default, fields with
  18566. // empty values are omitted from API requests. However, any non-pointer,
  18567. // non-interface field appearing in ForceSendFields will be sent to the
  18568. // server regardless of whether the field is empty or not. This may be
  18569. // used to include empty fields in Patch requests.
  18570. ForceSendFields []string `json:"-"`
  18571. // NullFields is a list of field names (e.g. "Id") to include in API
  18572. // requests with the JSON null value. By default, fields with empty
  18573. // values are omitted from API requests. However, any field with an
  18574. // empty value appearing in NullFields will be sent to the server as
  18575. // null. It is an error if a field in this list has a non-empty value.
  18576. // This may be used to include null fields in Patch requests.
  18577. NullFields []string `json:"-"`
  18578. }
  18579. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  18580. type NoMethod NodeGroupsListNodes
  18581. raw := NoMethod(*s)
  18582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18583. }
  18584. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  18585. // message.
  18586. type NodeGroupsListNodesWarning struct {
  18587. // Code: [Output Only] A warning code, if applicable. For example,
  18588. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18589. // the response.
  18590. //
  18591. // Possible values:
  18592. // "CLEANUP_FAILED"
  18593. // "DEPRECATED_RESOURCE_USED"
  18594. // "DEPRECATED_TYPE_USED"
  18595. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18596. // "EXPERIMENTAL_TYPE_USED"
  18597. // "EXTERNAL_API_WARNING"
  18598. // "FIELD_VALUE_OVERRIDEN"
  18599. // "INJECTED_KERNELS_DEPRECATED"
  18600. // "MISSING_TYPE_DEPENDENCY"
  18601. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18602. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18603. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18604. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18605. // "NEXT_HOP_NOT_RUNNING"
  18606. // "NOT_CRITICAL_ERROR"
  18607. // "NO_RESULTS_ON_PAGE"
  18608. // "REQUIRED_TOS_AGREEMENT"
  18609. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18610. // "RESOURCE_NOT_DELETED"
  18611. // "SCHEMA_VALIDATION_IGNORED"
  18612. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18613. // "UNDECLARED_PROPERTIES"
  18614. // "UNREACHABLE"
  18615. Code string `json:"code,omitempty"`
  18616. // Data: [Output Only] Metadata about this warning in key: value format.
  18617. // For example:
  18618. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18619. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  18620. // Message: [Output Only] A human-readable description of the warning
  18621. // code.
  18622. Message string `json:"message,omitempty"`
  18623. // ForceSendFields is a list of field names (e.g. "Code") to
  18624. // unconditionally include in API requests. By default, fields with
  18625. // empty values are omitted from API requests. However, any non-pointer,
  18626. // non-interface field appearing in ForceSendFields will be sent to the
  18627. // server regardless of whether the field is empty or not. This may be
  18628. // used to include empty fields in Patch requests.
  18629. ForceSendFields []string `json:"-"`
  18630. // NullFields is a list of field names (e.g. "Code") to include in API
  18631. // requests with the JSON null value. By default, fields with empty
  18632. // values are omitted from API requests. However, any field with an
  18633. // empty value appearing in NullFields will be sent to the server as
  18634. // null. It is an error if a field in this list has a non-empty value.
  18635. // This may be used to include null fields in Patch requests.
  18636. NullFields []string `json:"-"`
  18637. }
  18638. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  18639. type NoMethod NodeGroupsListNodesWarning
  18640. raw := NoMethod(*s)
  18641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18642. }
  18643. type NodeGroupsListNodesWarningData struct {
  18644. // Key: [Output Only] A key that provides more detail on the warning
  18645. // being returned. For example, for warnings where there are no results
  18646. // in a list request for a particular zone, this key might be scope and
  18647. // the key value might be the zone name. Other examples might be a key
  18648. // indicating a deprecated resource and a suggested replacement, or a
  18649. // warning about invalid network settings (for example, if an instance
  18650. // attempts to perform IP forwarding but is not enabled for IP
  18651. // forwarding).
  18652. Key string `json:"key,omitempty"`
  18653. // Value: [Output Only] A warning data value corresponding to the key.
  18654. Value string `json:"value,omitempty"`
  18655. // ForceSendFields is a list of field names (e.g. "Key") to
  18656. // unconditionally include in API requests. By default, fields with
  18657. // empty values are omitted from API requests. However, any non-pointer,
  18658. // non-interface field appearing in ForceSendFields will be sent to the
  18659. // server regardless of whether the field is empty or not. This may be
  18660. // used to include empty fields in Patch requests.
  18661. ForceSendFields []string `json:"-"`
  18662. // NullFields is a list of field names (e.g. "Key") to include in API
  18663. // requests with the JSON null value. By default, fields with empty
  18664. // values are omitted from API requests. However, any field with an
  18665. // empty value appearing in NullFields will be sent to the server as
  18666. // null. It is an error if a field in this list has a non-empty value.
  18667. // This may be used to include null fields in Patch requests.
  18668. NullFields []string `json:"-"`
  18669. }
  18670. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  18671. type NoMethod NodeGroupsListNodesWarningData
  18672. raw := NoMethod(*s)
  18673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18674. }
  18675. type NodeGroupsScopedList struct {
  18676. // NodeGroups: [Output Only] A list of node groups contained in this
  18677. // scope.
  18678. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  18679. // Warning: [Output Only] An informational warning that appears when the
  18680. // nodeGroup list is empty.
  18681. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  18682. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  18683. // unconditionally include in API requests. By default, fields with
  18684. // empty values are omitted from API requests. However, any non-pointer,
  18685. // non-interface field appearing in ForceSendFields will be sent to the
  18686. // server regardless of whether the field is empty or not. This may be
  18687. // used to include empty fields in Patch requests.
  18688. ForceSendFields []string `json:"-"`
  18689. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  18690. // API requests with the JSON null value. By default, fields with empty
  18691. // values are omitted from API requests. However, any field with an
  18692. // empty value appearing in NullFields will be sent to the server as
  18693. // null. It is an error if a field in this list has a non-empty value.
  18694. // This may be used to include null fields in Patch requests.
  18695. NullFields []string `json:"-"`
  18696. }
  18697. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  18698. type NoMethod NodeGroupsScopedList
  18699. raw := NoMethod(*s)
  18700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18701. }
  18702. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  18703. // that appears when the nodeGroup list is empty.
  18704. type NodeGroupsScopedListWarning struct {
  18705. // Code: [Output Only] A warning code, if applicable. For example,
  18706. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18707. // the response.
  18708. //
  18709. // Possible values:
  18710. // "CLEANUP_FAILED"
  18711. // "DEPRECATED_RESOURCE_USED"
  18712. // "DEPRECATED_TYPE_USED"
  18713. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18714. // "EXPERIMENTAL_TYPE_USED"
  18715. // "EXTERNAL_API_WARNING"
  18716. // "FIELD_VALUE_OVERRIDEN"
  18717. // "INJECTED_KERNELS_DEPRECATED"
  18718. // "MISSING_TYPE_DEPENDENCY"
  18719. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18720. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18721. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18722. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18723. // "NEXT_HOP_NOT_RUNNING"
  18724. // "NOT_CRITICAL_ERROR"
  18725. // "NO_RESULTS_ON_PAGE"
  18726. // "REQUIRED_TOS_AGREEMENT"
  18727. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18728. // "RESOURCE_NOT_DELETED"
  18729. // "SCHEMA_VALIDATION_IGNORED"
  18730. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18731. // "UNDECLARED_PROPERTIES"
  18732. // "UNREACHABLE"
  18733. Code string `json:"code,omitempty"`
  18734. // Data: [Output Only] Metadata about this warning in key: value format.
  18735. // For example:
  18736. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18737. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  18738. // Message: [Output Only] A human-readable description of the warning
  18739. // code.
  18740. Message string `json:"message,omitempty"`
  18741. // ForceSendFields is a list of field names (e.g. "Code") to
  18742. // unconditionally include in API requests. By default, fields with
  18743. // empty values are omitted from API requests. However, any non-pointer,
  18744. // non-interface field appearing in ForceSendFields will be sent to the
  18745. // server regardless of whether the field is empty or not. This may be
  18746. // used to include empty fields in Patch requests.
  18747. ForceSendFields []string `json:"-"`
  18748. // NullFields is a list of field names (e.g. "Code") to include in API
  18749. // requests with the JSON null value. By default, fields with empty
  18750. // values are omitted from API requests. However, any field with an
  18751. // empty value appearing in NullFields will be sent to the server as
  18752. // null. It is an error if a field in this list has a non-empty value.
  18753. // This may be used to include null fields in Patch requests.
  18754. NullFields []string `json:"-"`
  18755. }
  18756. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  18757. type NoMethod NodeGroupsScopedListWarning
  18758. raw := NoMethod(*s)
  18759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18760. }
  18761. type NodeGroupsScopedListWarningData struct {
  18762. // Key: [Output Only] A key that provides more detail on the warning
  18763. // being returned. For example, for warnings where there are no results
  18764. // in a list request for a particular zone, this key might be scope and
  18765. // the key value might be the zone name. Other examples might be a key
  18766. // indicating a deprecated resource and a suggested replacement, or a
  18767. // warning about invalid network settings (for example, if an instance
  18768. // attempts to perform IP forwarding but is not enabled for IP
  18769. // forwarding).
  18770. Key string `json:"key,omitempty"`
  18771. // Value: [Output Only] A warning data value corresponding to the key.
  18772. Value string `json:"value,omitempty"`
  18773. // ForceSendFields is a list of field names (e.g. "Key") to
  18774. // unconditionally include in API requests. By default, fields with
  18775. // empty values are omitted from API requests. However, any non-pointer,
  18776. // non-interface field appearing in ForceSendFields will be sent to the
  18777. // server regardless of whether the field is empty or not. This may be
  18778. // used to include empty fields in Patch requests.
  18779. ForceSendFields []string `json:"-"`
  18780. // NullFields is a list of field names (e.g. "Key") to include in API
  18781. // requests with the JSON null value. By default, fields with empty
  18782. // values are omitted from API requests. However, any field with an
  18783. // empty value appearing in NullFields will be sent to the server as
  18784. // null. It is an error if a field in this list has a non-empty value.
  18785. // This may be used to include null fields in Patch requests.
  18786. NullFields []string `json:"-"`
  18787. }
  18788. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  18789. type NoMethod NodeGroupsScopedListWarningData
  18790. raw := NoMethod(*s)
  18791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18792. }
  18793. type NodeGroupsSetNodeTemplateRequest struct {
  18794. // NodeTemplate: Full or partial URL of the node template resource to be
  18795. // updated for this node group.
  18796. NodeTemplate string `json:"nodeTemplate,omitempty"`
  18797. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  18798. // unconditionally include in API requests. By default, fields with
  18799. // empty values are omitted from API requests. However, any non-pointer,
  18800. // non-interface field appearing in ForceSendFields will be sent to the
  18801. // server regardless of whether the field is empty or not. This may be
  18802. // used to include empty fields in Patch requests.
  18803. ForceSendFields []string `json:"-"`
  18804. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  18805. // in API requests with the JSON null value. By default, fields with
  18806. // empty values are omitted from API requests. However, any field with
  18807. // an empty value appearing in NullFields will be sent to the server as
  18808. // null. It is an error if a field in this list has a non-empty value.
  18809. // This may be used to include null fields in Patch requests.
  18810. NullFields []string `json:"-"`
  18811. }
  18812. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  18813. type NoMethod NodeGroupsSetNodeTemplateRequest
  18814. raw := NoMethod(*s)
  18815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18816. }
  18817. // NodeTemplate: A Node Template resource.
  18818. type NodeTemplate struct {
  18819. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18820. // format.
  18821. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18822. // Description: An optional description of this resource. Provide this
  18823. // property when you create the resource.
  18824. Description string `json:"description,omitempty"`
  18825. // Id: [Output Only] The unique identifier for the resource. This
  18826. // identifier is defined by the server.
  18827. Id uint64 `json:"id,omitempty,string"`
  18828. // Kind: [Output Only] The type of the resource. Always
  18829. // compute#nodeTemplate for node templates.
  18830. Kind string `json:"kind,omitempty"`
  18831. // Name: The name of the resource, provided by the client when initially
  18832. // creating the resource. The resource name must be 1-63 characters
  18833. // long, and comply with RFC1035. Specifically, the name must be 1-63
  18834. // characters long and match the regular expression
  18835. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  18836. // a lowercase letter, and all following characters must be a dash,
  18837. // lowercase letter, or digit, except the last character, which cannot
  18838. // be a dash.
  18839. Name string `json:"name,omitempty"`
  18840. // NodeAffinityLabels: Labels to use for node affinity, which will be
  18841. // used in instance scheduling.
  18842. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  18843. // NodeType: The node type to use for nodes group that are created from
  18844. // this template.
  18845. NodeType string `json:"nodeType,omitempty"`
  18846. // NodeTypeFlexibility: The flexible properties of the desired node
  18847. // type. Node groups that use this node template will create nodes of a
  18848. // type that matches these properties.
  18849. //
  18850. // This field is mutually exclusive with the node_type property; you can
  18851. // only define one or the other, but not both.
  18852. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  18853. // Region: [Output Only] The name of the region where the node template
  18854. // resides, such as us-central1.
  18855. Region string `json:"region,omitempty"`
  18856. // SelfLink: [Output Only] Server-defined URL for the resource.
  18857. SelfLink string `json:"selfLink,omitempty"`
  18858. // ServerBinding: Binding properties for the physical server.
  18859. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  18860. // Status: [Output Only] The status of the node template. One of the
  18861. // following values: CREATING, READY, and DELETING.
  18862. //
  18863. // Possible values:
  18864. // "CREATING"
  18865. // "DELETING"
  18866. // "INVALID"
  18867. // "READY"
  18868. Status string `json:"status,omitempty"`
  18869. // StatusMessage: [Output Only] An optional, human-readable explanation
  18870. // of the status.
  18871. StatusMessage string `json:"statusMessage,omitempty"`
  18872. // ServerResponse contains the HTTP response code and headers from the
  18873. // server.
  18874. googleapi.ServerResponse `json:"-"`
  18875. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  18876. // to unconditionally include in API requests. By default, fields with
  18877. // empty values are omitted from API requests. However, any non-pointer,
  18878. // non-interface field appearing in ForceSendFields will be sent to the
  18879. // server regardless of whether the field is empty or not. This may be
  18880. // used to include empty fields in Patch requests.
  18881. ForceSendFields []string `json:"-"`
  18882. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  18883. // include in API requests with the JSON null value. By default, fields
  18884. // with empty values are omitted from API requests. However, any field
  18885. // with an empty value appearing in NullFields will be sent to the
  18886. // server as null. It is an error if a field in this list has a
  18887. // non-empty value. This may be used to include null fields in Patch
  18888. // requests.
  18889. NullFields []string `json:"-"`
  18890. }
  18891. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  18892. type NoMethod NodeTemplate
  18893. raw := NoMethod(*s)
  18894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18895. }
  18896. type NodeTemplateAggregatedList struct {
  18897. // Id: [Output Only] Unique identifier for the resource; defined by the
  18898. // server.
  18899. Id string `json:"id,omitempty"`
  18900. // Items: A list of NodeTemplatesScopedList resources.
  18901. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  18902. // Kind: [Output Only] Type of resource.Always
  18903. // compute#nodeTemplateAggregatedList for aggregated lists of node
  18904. // templates.
  18905. Kind string `json:"kind,omitempty"`
  18906. // NextPageToken: [Output Only] This token allows you to get the next
  18907. // page of results for list requests. If the number of results is larger
  18908. // than maxResults, use the nextPageToken as a value for the query
  18909. // parameter pageToken in the next list request. Subsequent list
  18910. // requests will have their own nextPageToken to continue paging through
  18911. // the results.
  18912. NextPageToken string `json:"nextPageToken,omitempty"`
  18913. // SelfLink: [Output Only] Server-defined URL for this resource.
  18914. SelfLink string `json:"selfLink,omitempty"`
  18915. // Warning: [Output Only] Informational warning message.
  18916. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  18917. // ServerResponse contains the HTTP response code and headers from the
  18918. // server.
  18919. googleapi.ServerResponse `json:"-"`
  18920. // ForceSendFields is a list of field names (e.g. "Id") to
  18921. // unconditionally include in API requests. By default, fields with
  18922. // empty values are omitted from API requests. However, any non-pointer,
  18923. // non-interface field appearing in ForceSendFields will be sent to the
  18924. // server regardless of whether the field is empty or not. This may be
  18925. // used to include empty fields in Patch requests.
  18926. ForceSendFields []string `json:"-"`
  18927. // NullFields is a list of field names (e.g. "Id") to include in API
  18928. // requests with the JSON null value. By default, fields with empty
  18929. // values are omitted from API requests. However, any field with an
  18930. // empty value appearing in NullFields will be sent to the server as
  18931. // null. It is an error if a field in this list has a non-empty value.
  18932. // This may be used to include null fields in Patch requests.
  18933. NullFields []string `json:"-"`
  18934. }
  18935. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  18936. type NoMethod NodeTemplateAggregatedList
  18937. raw := NoMethod(*s)
  18938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18939. }
  18940. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  18941. // warning message.
  18942. type NodeTemplateAggregatedListWarning struct {
  18943. // Code: [Output Only] A warning code, if applicable. For example,
  18944. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18945. // the response.
  18946. //
  18947. // Possible values:
  18948. // "CLEANUP_FAILED"
  18949. // "DEPRECATED_RESOURCE_USED"
  18950. // "DEPRECATED_TYPE_USED"
  18951. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18952. // "EXPERIMENTAL_TYPE_USED"
  18953. // "EXTERNAL_API_WARNING"
  18954. // "FIELD_VALUE_OVERRIDEN"
  18955. // "INJECTED_KERNELS_DEPRECATED"
  18956. // "MISSING_TYPE_DEPENDENCY"
  18957. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18958. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18959. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18960. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18961. // "NEXT_HOP_NOT_RUNNING"
  18962. // "NOT_CRITICAL_ERROR"
  18963. // "NO_RESULTS_ON_PAGE"
  18964. // "REQUIRED_TOS_AGREEMENT"
  18965. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18966. // "RESOURCE_NOT_DELETED"
  18967. // "SCHEMA_VALIDATION_IGNORED"
  18968. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18969. // "UNDECLARED_PROPERTIES"
  18970. // "UNREACHABLE"
  18971. Code string `json:"code,omitempty"`
  18972. // Data: [Output Only] Metadata about this warning in key: value format.
  18973. // For example:
  18974. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18975. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  18976. // Message: [Output Only] A human-readable description of the warning
  18977. // code.
  18978. Message string `json:"message,omitempty"`
  18979. // ForceSendFields is a list of field names (e.g. "Code") to
  18980. // unconditionally include in API requests. By default, fields with
  18981. // empty values are omitted from API requests. However, any non-pointer,
  18982. // non-interface field appearing in ForceSendFields will be sent to the
  18983. // server regardless of whether the field is empty or not. This may be
  18984. // used to include empty fields in Patch requests.
  18985. ForceSendFields []string `json:"-"`
  18986. // NullFields is a list of field names (e.g. "Code") to include in API
  18987. // requests with the JSON null value. By default, fields with empty
  18988. // values are omitted from API requests. However, any field with an
  18989. // empty value appearing in NullFields will be sent to the server as
  18990. // null. It is an error if a field in this list has a non-empty value.
  18991. // This may be used to include null fields in Patch requests.
  18992. NullFields []string `json:"-"`
  18993. }
  18994. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18995. type NoMethod NodeTemplateAggregatedListWarning
  18996. raw := NoMethod(*s)
  18997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18998. }
  18999. type NodeTemplateAggregatedListWarningData struct {
  19000. // Key: [Output Only] A key that provides more detail on the warning
  19001. // being returned. For example, for warnings where there are no results
  19002. // in a list request for a particular zone, this key might be scope and
  19003. // the key value might be the zone name. Other examples might be a key
  19004. // indicating a deprecated resource and a suggested replacement, or a
  19005. // warning about invalid network settings (for example, if an instance
  19006. // attempts to perform IP forwarding but is not enabled for IP
  19007. // forwarding).
  19008. Key string `json:"key,omitempty"`
  19009. // Value: [Output Only] A warning data value corresponding to the key.
  19010. Value string `json:"value,omitempty"`
  19011. // ForceSendFields is a list of field names (e.g. "Key") to
  19012. // unconditionally include in API requests. By default, fields with
  19013. // empty values are omitted from API requests. However, any non-pointer,
  19014. // non-interface field appearing in ForceSendFields will be sent to the
  19015. // server regardless of whether the field is empty or not. This may be
  19016. // used to include empty fields in Patch requests.
  19017. ForceSendFields []string `json:"-"`
  19018. // NullFields is a list of field names (e.g. "Key") to include in API
  19019. // requests with the JSON null value. By default, fields with empty
  19020. // values are omitted from API requests. However, any field with an
  19021. // empty value appearing in NullFields will be sent to the server as
  19022. // null. It is an error if a field in this list has a non-empty value.
  19023. // This may be used to include null fields in Patch requests.
  19024. NullFields []string `json:"-"`
  19025. }
  19026. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19027. type NoMethod NodeTemplateAggregatedListWarningData
  19028. raw := NoMethod(*s)
  19029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19030. }
  19031. // NodeTemplateList: Contains a list of node templates.
  19032. type NodeTemplateList struct {
  19033. // Id: [Output Only] Unique identifier for the resource; defined by the
  19034. // server.
  19035. Id string `json:"id,omitempty"`
  19036. // Items: A list of NodeTemplate resources.
  19037. Items []*NodeTemplate `json:"items,omitempty"`
  19038. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  19039. // for lists of node templates.
  19040. Kind string `json:"kind,omitempty"`
  19041. // NextPageToken: [Output Only] This token allows you to get the next
  19042. // page of results for list requests. If the number of results is larger
  19043. // than maxResults, use the nextPageToken as a value for the query
  19044. // parameter pageToken in the next list request. Subsequent list
  19045. // requests will have their own nextPageToken to continue paging through
  19046. // the results.
  19047. NextPageToken string `json:"nextPageToken,omitempty"`
  19048. // SelfLink: [Output Only] Server-defined URL for this resource.
  19049. SelfLink string `json:"selfLink,omitempty"`
  19050. // Warning: [Output Only] Informational warning message.
  19051. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  19052. // ServerResponse contains the HTTP response code and headers from the
  19053. // server.
  19054. googleapi.ServerResponse `json:"-"`
  19055. // ForceSendFields is a list of field names (e.g. "Id") to
  19056. // unconditionally include in API requests. By default, fields with
  19057. // empty values are omitted from API requests. However, any non-pointer,
  19058. // non-interface field appearing in ForceSendFields will be sent to the
  19059. // server regardless of whether the field is empty or not. This may be
  19060. // used to include empty fields in Patch requests.
  19061. ForceSendFields []string `json:"-"`
  19062. // NullFields is a list of field names (e.g. "Id") to include in API
  19063. // requests with the JSON null value. By default, fields with empty
  19064. // values are omitted from API requests. However, any field with an
  19065. // empty value appearing in NullFields will be sent to the server as
  19066. // null. It is an error if a field in this list has a non-empty value.
  19067. // This may be used to include null fields in Patch requests.
  19068. NullFields []string `json:"-"`
  19069. }
  19070. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  19071. type NoMethod NodeTemplateList
  19072. raw := NoMethod(*s)
  19073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19074. }
  19075. // NodeTemplateListWarning: [Output Only] Informational warning message.
  19076. type NodeTemplateListWarning struct {
  19077. // Code: [Output Only] A warning code, if applicable. For example,
  19078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19079. // the response.
  19080. //
  19081. // Possible values:
  19082. // "CLEANUP_FAILED"
  19083. // "DEPRECATED_RESOURCE_USED"
  19084. // "DEPRECATED_TYPE_USED"
  19085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19086. // "EXPERIMENTAL_TYPE_USED"
  19087. // "EXTERNAL_API_WARNING"
  19088. // "FIELD_VALUE_OVERRIDEN"
  19089. // "INJECTED_KERNELS_DEPRECATED"
  19090. // "MISSING_TYPE_DEPENDENCY"
  19091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19095. // "NEXT_HOP_NOT_RUNNING"
  19096. // "NOT_CRITICAL_ERROR"
  19097. // "NO_RESULTS_ON_PAGE"
  19098. // "REQUIRED_TOS_AGREEMENT"
  19099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19100. // "RESOURCE_NOT_DELETED"
  19101. // "SCHEMA_VALIDATION_IGNORED"
  19102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19103. // "UNDECLARED_PROPERTIES"
  19104. // "UNREACHABLE"
  19105. Code string `json:"code,omitempty"`
  19106. // Data: [Output Only] Metadata about this warning in key: value format.
  19107. // For example:
  19108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19109. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  19110. // Message: [Output Only] A human-readable description of the warning
  19111. // code.
  19112. Message string `json:"message,omitempty"`
  19113. // ForceSendFields is a list of field names (e.g. "Code") to
  19114. // unconditionally include in API requests. By default, fields with
  19115. // empty values are omitted from API requests. However, any non-pointer,
  19116. // non-interface field appearing in ForceSendFields will be sent to the
  19117. // server regardless of whether the field is empty or not. This may be
  19118. // used to include empty fields in Patch requests.
  19119. ForceSendFields []string `json:"-"`
  19120. // NullFields is a list of field names (e.g. "Code") to include in API
  19121. // requests with the JSON null value. By default, fields with empty
  19122. // values are omitted from API requests. However, any field with an
  19123. // empty value appearing in NullFields will be sent to the server as
  19124. // null. It is an error if a field in this list has a non-empty value.
  19125. // This may be used to include null fields in Patch requests.
  19126. NullFields []string `json:"-"`
  19127. }
  19128. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  19129. type NoMethod NodeTemplateListWarning
  19130. raw := NoMethod(*s)
  19131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19132. }
  19133. type NodeTemplateListWarningData struct {
  19134. // Key: [Output Only] A key that provides more detail on the warning
  19135. // being returned. For example, for warnings where there are no results
  19136. // in a list request for a particular zone, this key might be scope and
  19137. // the key value might be the zone name. Other examples might be a key
  19138. // indicating a deprecated resource and a suggested replacement, or a
  19139. // warning about invalid network settings (for example, if an instance
  19140. // attempts to perform IP forwarding but is not enabled for IP
  19141. // forwarding).
  19142. Key string `json:"key,omitempty"`
  19143. // Value: [Output Only] A warning data value corresponding to the key.
  19144. Value string `json:"value,omitempty"`
  19145. // ForceSendFields is a list of field names (e.g. "Key") to
  19146. // unconditionally include in API requests. By default, fields with
  19147. // empty values are omitted from API requests. However, any non-pointer,
  19148. // non-interface field appearing in ForceSendFields will be sent to the
  19149. // server regardless of whether the field is empty or not. This may be
  19150. // used to include empty fields in Patch requests.
  19151. ForceSendFields []string `json:"-"`
  19152. // NullFields is a list of field names (e.g. "Key") to include in API
  19153. // requests with the JSON null value. By default, fields with empty
  19154. // values are omitted from API requests. However, any field with an
  19155. // empty value appearing in NullFields will be sent to the server as
  19156. // null. It is an error if a field in this list has a non-empty value.
  19157. // This may be used to include null fields in Patch requests.
  19158. NullFields []string `json:"-"`
  19159. }
  19160. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  19161. type NoMethod NodeTemplateListWarningData
  19162. raw := NoMethod(*s)
  19163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19164. }
  19165. type NodeTemplateNodeTypeFlexibility struct {
  19166. Cpus string `json:"cpus,omitempty"`
  19167. LocalSsd string `json:"localSsd,omitempty"`
  19168. Memory string `json:"memory,omitempty"`
  19169. // ForceSendFields is a list of field names (e.g. "Cpus") to
  19170. // unconditionally include in API requests. By default, fields with
  19171. // empty values are omitted from API requests. However, any non-pointer,
  19172. // non-interface field appearing in ForceSendFields will be sent to the
  19173. // server regardless of whether the field is empty or not. This may be
  19174. // used to include empty fields in Patch requests.
  19175. ForceSendFields []string `json:"-"`
  19176. // NullFields is a list of field names (e.g. "Cpus") to include in API
  19177. // requests with the JSON null value. By default, fields with empty
  19178. // values are omitted from API requests. However, any field with an
  19179. // empty value appearing in NullFields will be sent to the server as
  19180. // null. It is an error if a field in this list has a non-empty value.
  19181. // This may be used to include null fields in Patch requests.
  19182. NullFields []string `json:"-"`
  19183. }
  19184. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  19185. type NoMethod NodeTemplateNodeTypeFlexibility
  19186. raw := NoMethod(*s)
  19187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19188. }
  19189. type NodeTemplatesScopedList struct {
  19190. // NodeTemplates: [Output Only] A list of node templates contained in
  19191. // this scope.
  19192. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  19193. // Warning: [Output Only] An informational warning that appears when the
  19194. // node templates list is empty.
  19195. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  19196. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  19197. // unconditionally include in API requests. By default, fields with
  19198. // empty values are omitted from API requests. However, any non-pointer,
  19199. // non-interface field appearing in ForceSendFields will be sent to the
  19200. // server regardless of whether the field is empty or not. This may be
  19201. // used to include empty fields in Patch requests.
  19202. ForceSendFields []string `json:"-"`
  19203. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  19204. // in API requests with the JSON null value. By default, fields with
  19205. // empty values are omitted from API requests. However, any field with
  19206. // an empty value appearing in NullFields will be sent to the server as
  19207. // null. It is an error if a field in this list has a non-empty value.
  19208. // This may be used to include null fields in Patch requests.
  19209. NullFields []string `json:"-"`
  19210. }
  19211. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  19212. type NoMethod NodeTemplatesScopedList
  19213. raw := NoMethod(*s)
  19214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19215. }
  19216. // NodeTemplatesScopedListWarning: [Output Only] An informational
  19217. // warning that appears when the node templates list is empty.
  19218. type NodeTemplatesScopedListWarning struct {
  19219. // Code: [Output Only] A warning code, if applicable. For example,
  19220. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19221. // the response.
  19222. //
  19223. // Possible values:
  19224. // "CLEANUP_FAILED"
  19225. // "DEPRECATED_RESOURCE_USED"
  19226. // "DEPRECATED_TYPE_USED"
  19227. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19228. // "EXPERIMENTAL_TYPE_USED"
  19229. // "EXTERNAL_API_WARNING"
  19230. // "FIELD_VALUE_OVERRIDEN"
  19231. // "INJECTED_KERNELS_DEPRECATED"
  19232. // "MISSING_TYPE_DEPENDENCY"
  19233. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19234. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19235. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19236. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19237. // "NEXT_HOP_NOT_RUNNING"
  19238. // "NOT_CRITICAL_ERROR"
  19239. // "NO_RESULTS_ON_PAGE"
  19240. // "REQUIRED_TOS_AGREEMENT"
  19241. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19242. // "RESOURCE_NOT_DELETED"
  19243. // "SCHEMA_VALIDATION_IGNORED"
  19244. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19245. // "UNDECLARED_PROPERTIES"
  19246. // "UNREACHABLE"
  19247. Code string `json:"code,omitempty"`
  19248. // Data: [Output Only] Metadata about this warning in key: value format.
  19249. // For example:
  19250. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19251. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  19252. // Message: [Output Only] A human-readable description of the warning
  19253. // code.
  19254. Message string `json:"message,omitempty"`
  19255. // ForceSendFields is a list of field names (e.g. "Code") to
  19256. // unconditionally include in API requests. By default, fields with
  19257. // empty values are omitted from API requests. However, any non-pointer,
  19258. // non-interface field appearing in ForceSendFields will be sent to the
  19259. // server regardless of whether the field is empty or not. This may be
  19260. // used to include empty fields in Patch requests.
  19261. ForceSendFields []string `json:"-"`
  19262. // NullFields is a list of field names (e.g. "Code") to include in API
  19263. // requests with the JSON null value. By default, fields with empty
  19264. // values are omitted from API requests. However, any field with an
  19265. // empty value appearing in NullFields will be sent to the server as
  19266. // null. It is an error if a field in this list has a non-empty value.
  19267. // This may be used to include null fields in Patch requests.
  19268. NullFields []string `json:"-"`
  19269. }
  19270. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  19271. type NoMethod NodeTemplatesScopedListWarning
  19272. raw := NoMethod(*s)
  19273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19274. }
  19275. type NodeTemplatesScopedListWarningData struct {
  19276. // Key: [Output Only] A key that provides more detail on the warning
  19277. // being returned. For example, for warnings where there are no results
  19278. // in a list request for a particular zone, this key might be scope and
  19279. // the key value might be the zone name. Other examples might be a key
  19280. // indicating a deprecated resource and a suggested replacement, or a
  19281. // warning about invalid network settings (for example, if an instance
  19282. // attempts to perform IP forwarding but is not enabled for IP
  19283. // forwarding).
  19284. Key string `json:"key,omitempty"`
  19285. // Value: [Output Only] A warning data value corresponding to the key.
  19286. Value string `json:"value,omitempty"`
  19287. // ForceSendFields is a list of field names (e.g. "Key") to
  19288. // unconditionally include in API requests. By default, fields with
  19289. // empty values are omitted from API requests. However, any non-pointer,
  19290. // non-interface field appearing in ForceSendFields will be sent to the
  19291. // server regardless of whether the field is empty or not. This may be
  19292. // used to include empty fields in Patch requests.
  19293. ForceSendFields []string `json:"-"`
  19294. // NullFields is a list of field names (e.g. "Key") to include in API
  19295. // requests with the JSON null value. By default, fields with empty
  19296. // values are omitted from API requests. However, any field with an
  19297. // empty value appearing in NullFields will be sent to the server as
  19298. // null. It is an error if a field in this list has a non-empty value.
  19299. // This may be used to include null fields in Patch requests.
  19300. NullFields []string `json:"-"`
  19301. }
  19302. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  19303. type NoMethod NodeTemplatesScopedListWarningData
  19304. raw := NoMethod(*s)
  19305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19306. }
  19307. // NodeType: A Node Type resource.
  19308. type NodeType struct {
  19309. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  19310. CpuPlatform string `json:"cpuPlatform,omitempty"`
  19311. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19312. // format.
  19313. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19314. // Deprecated: [Output Only] The deprecation status associated with this
  19315. // node type.
  19316. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  19317. // Description: [Output Only] An optional textual description of the
  19318. // resource.
  19319. Description string `json:"description,omitempty"`
  19320. // GuestCpus: [Output Only] The number of virtual CPUs that are
  19321. // available to the node type.
  19322. GuestCpus int64 `json:"guestCpus,omitempty"`
  19323. // Id: [Output Only] The unique identifier for the resource. This
  19324. // identifier is defined by the server.
  19325. Id uint64 `json:"id,omitempty,string"`
  19326. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  19327. // for node types.
  19328. Kind string `json:"kind,omitempty"`
  19329. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  19330. // defined in GB.
  19331. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  19332. // MemoryMb: [Output Only] The amount of physical memory available to
  19333. // the node type, defined in MB.
  19334. MemoryMb int64 `json:"memoryMb,omitempty"`
  19335. // Name: [Output Only] Name of the resource.
  19336. Name string `json:"name,omitempty"`
  19337. // SelfLink: [Output Only] Server-defined URL for the resource.
  19338. SelfLink string `json:"selfLink,omitempty"`
  19339. // Zone: [Output Only] The name of the zone where the node type resides,
  19340. // such as us-central1-a.
  19341. Zone string `json:"zone,omitempty"`
  19342. // ServerResponse contains the HTTP response code and headers from the
  19343. // server.
  19344. googleapi.ServerResponse `json:"-"`
  19345. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  19346. // unconditionally include in API requests. By default, fields with
  19347. // empty values are omitted from API requests. However, any non-pointer,
  19348. // non-interface field appearing in ForceSendFields will be sent to the
  19349. // server regardless of whether the field is empty or not. This may be
  19350. // used to include empty fields in Patch requests.
  19351. ForceSendFields []string `json:"-"`
  19352. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  19353. // in API requests with the JSON null value. By default, fields with
  19354. // empty values are omitted from API requests. However, any field with
  19355. // an empty value appearing in NullFields will be sent to the server as
  19356. // null. It is an error if a field in this list has a non-empty value.
  19357. // This may be used to include null fields in Patch requests.
  19358. NullFields []string `json:"-"`
  19359. }
  19360. func (s *NodeType) MarshalJSON() ([]byte, error) {
  19361. type NoMethod NodeType
  19362. raw := NoMethod(*s)
  19363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19364. }
  19365. type NodeTypeAggregatedList struct {
  19366. // Id: [Output Only] Unique identifier for the resource; defined by the
  19367. // server.
  19368. Id string `json:"id,omitempty"`
  19369. // Items: A list of NodeTypesScopedList resources.
  19370. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  19371. // Kind: [Output Only] Type of resource.Always
  19372. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  19373. Kind string `json:"kind,omitempty"`
  19374. // NextPageToken: [Output Only] This token allows you to get the next
  19375. // page of results for list requests. If the number of results is larger
  19376. // than maxResults, use the nextPageToken as a value for the query
  19377. // parameter pageToken in the next list request. Subsequent list
  19378. // requests will have their own nextPageToken to continue paging through
  19379. // the results.
  19380. NextPageToken string `json:"nextPageToken,omitempty"`
  19381. // SelfLink: [Output Only] Server-defined URL for this resource.
  19382. SelfLink string `json:"selfLink,omitempty"`
  19383. // Warning: [Output Only] Informational warning message.
  19384. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  19385. // ServerResponse contains the HTTP response code and headers from the
  19386. // server.
  19387. googleapi.ServerResponse `json:"-"`
  19388. // ForceSendFields is a list of field names (e.g. "Id") to
  19389. // unconditionally include in API requests. By default, fields with
  19390. // empty values are omitted from API requests. However, any non-pointer,
  19391. // non-interface field appearing in ForceSendFields will be sent to the
  19392. // server regardless of whether the field is empty or not. This may be
  19393. // used to include empty fields in Patch requests.
  19394. ForceSendFields []string `json:"-"`
  19395. // NullFields is a list of field names (e.g. "Id") to include in API
  19396. // requests with the JSON null value. By default, fields with empty
  19397. // values are omitted from API requests. However, any field with an
  19398. // empty value appearing in NullFields will be sent to the server as
  19399. // null. It is an error if a field in this list has a non-empty value.
  19400. // This may be used to include null fields in Patch requests.
  19401. NullFields []string `json:"-"`
  19402. }
  19403. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  19404. type NoMethod NodeTypeAggregatedList
  19405. raw := NoMethod(*s)
  19406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19407. }
  19408. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  19409. // message.
  19410. type NodeTypeAggregatedListWarning struct {
  19411. // Code: [Output Only] A warning code, if applicable. For example,
  19412. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19413. // the response.
  19414. //
  19415. // Possible values:
  19416. // "CLEANUP_FAILED"
  19417. // "DEPRECATED_RESOURCE_USED"
  19418. // "DEPRECATED_TYPE_USED"
  19419. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19420. // "EXPERIMENTAL_TYPE_USED"
  19421. // "EXTERNAL_API_WARNING"
  19422. // "FIELD_VALUE_OVERRIDEN"
  19423. // "INJECTED_KERNELS_DEPRECATED"
  19424. // "MISSING_TYPE_DEPENDENCY"
  19425. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19426. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19427. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19428. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19429. // "NEXT_HOP_NOT_RUNNING"
  19430. // "NOT_CRITICAL_ERROR"
  19431. // "NO_RESULTS_ON_PAGE"
  19432. // "REQUIRED_TOS_AGREEMENT"
  19433. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19434. // "RESOURCE_NOT_DELETED"
  19435. // "SCHEMA_VALIDATION_IGNORED"
  19436. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19437. // "UNDECLARED_PROPERTIES"
  19438. // "UNREACHABLE"
  19439. Code string `json:"code,omitempty"`
  19440. // Data: [Output Only] Metadata about this warning in key: value format.
  19441. // For example:
  19442. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19443. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  19444. // Message: [Output Only] A human-readable description of the warning
  19445. // code.
  19446. Message string `json:"message,omitempty"`
  19447. // ForceSendFields is a list of field names (e.g. "Code") to
  19448. // unconditionally include in API requests. By default, fields with
  19449. // empty values are omitted from API requests. However, any non-pointer,
  19450. // non-interface field appearing in ForceSendFields will be sent to the
  19451. // server regardless of whether the field is empty or not. This may be
  19452. // used to include empty fields in Patch requests.
  19453. ForceSendFields []string `json:"-"`
  19454. // NullFields is a list of field names (e.g. "Code") to include in API
  19455. // requests with the JSON null value. By default, fields with empty
  19456. // values are omitted from API requests. However, any field with an
  19457. // empty value appearing in NullFields will be sent to the server as
  19458. // null. It is an error if a field in this list has a non-empty value.
  19459. // This may be used to include null fields in Patch requests.
  19460. NullFields []string `json:"-"`
  19461. }
  19462. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19463. type NoMethod NodeTypeAggregatedListWarning
  19464. raw := NoMethod(*s)
  19465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19466. }
  19467. type NodeTypeAggregatedListWarningData struct {
  19468. // Key: [Output Only] A key that provides more detail on the warning
  19469. // being returned. For example, for warnings where there are no results
  19470. // in a list request for a particular zone, this key might be scope and
  19471. // the key value might be the zone name. Other examples might be a key
  19472. // indicating a deprecated resource and a suggested replacement, or a
  19473. // warning about invalid network settings (for example, if an instance
  19474. // attempts to perform IP forwarding but is not enabled for IP
  19475. // forwarding).
  19476. Key string `json:"key,omitempty"`
  19477. // Value: [Output Only] A warning data value corresponding to the key.
  19478. Value string `json:"value,omitempty"`
  19479. // ForceSendFields is a list of field names (e.g. "Key") to
  19480. // unconditionally include in API requests. By default, fields with
  19481. // empty values are omitted from API requests. However, any non-pointer,
  19482. // non-interface field appearing in ForceSendFields will be sent to the
  19483. // server regardless of whether the field is empty or not. This may be
  19484. // used to include empty fields in Patch requests.
  19485. ForceSendFields []string `json:"-"`
  19486. // NullFields is a list of field names (e.g. "Key") to include in API
  19487. // requests with the JSON null value. By default, fields with empty
  19488. // values are omitted from API requests. However, any field with an
  19489. // empty value appearing in NullFields will be sent to the server as
  19490. // null. It is an error if a field in this list has a non-empty value.
  19491. // This may be used to include null fields in Patch requests.
  19492. NullFields []string `json:"-"`
  19493. }
  19494. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19495. type NoMethod NodeTypeAggregatedListWarningData
  19496. raw := NoMethod(*s)
  19497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19498. }
  19499. // NodeTypeList: Contains a list of node types.
  19500. type NodeTypeList struct {
  19501. // Id: [Output Only] Unique identifier for the resource; defined by the
  19502. // server.
  19503. Id string `json:"id,omitempty"`
  19504. // Items: A list of NodeType resources.
  19505. Items []*NodeType `json:"items,omitempty"`
  19506. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  19507. // lists of node types.
  19508. Kind string `json:"kind,omitempty"`
  19509. // NextPageToken: [Output Only] This token allows you to get the next
  19510. // page of results for list requests. If the number of results is larger
  19511. // than maxResults, use the nextPageToken as a value for the query
  19512. // parameter pageToken in the next list request. Subsequent list
  19513. // requests will have their own nextPageToken to continue paging through
  19514. // the results.
  19515. NextPageToken string `json:"nextPageToken,omitempty"`
  19516. // SelfLink: [Output Only] Server-defined URL for this resource.
  19517. SelfLink string `json:"selfLink,omitempty"`
  19518. // Warning: [Output Only] Informational warning message.
  19519. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  19520. // ServerResponse contains the HTTP response code and headers from the
  19521. // server.
  19522. googleapi.ServerResponse `json:"-"`
  19523. // ForceSendFields is a list of field names (e.g. "Id") to
  19524. // unconditionally include in API requests. By default, fields with
  19525. // empty values are omitted from API requests. However, any non-pointer,
  19526. // non-interface field appearing in ForceSendFields will be sent to the
  19527. // server regardless of whether the field is empty or not. This may be
  19528. // used to include empty fields in Patch requests.
  19529. ForceSendFields []string `json:"-"`
  19530. // NullFields is a list of field names (e.g. "Id") to include in API
  19531. // requests with the JSON null value. By default, fields with empty
  19532. // values are omitted from API requests. However, any field with an
  19533. // empty value appearing in NullFields will be sent to the server as
  19534. // null. It is an error if a field in this list has a non-empty value.
  19535. // This may be used to include null fields in Patch requests.
  19536. NullFields []string `json:"-"`
  19537. }
  19538. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  19539. type NoMethod NodeTypeList
  19540. raw := NoMethod(*s)
  19541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19542. }
  19543. // NodeTypeListWarning: [Output Only] Informational warning message.
  19544. type NodeTypeListWarning struct {
  19545. // Code: [Output Only] A warning code, if applicable. For example,
  19546. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19547. // the response.
  19548. //
  19549. // Possible values:
  19550. // "CLEANUP_FAILED"
  19551. // "DEPRECATED_RESOURCE_USED"
  19552. // "DEPRECATED_TYPE_USED"
  19553. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19554. // "EXPERIMENTAL_TYPE_USED"
  19555. // "EXTERNAL_API_WARNING"
  19556. // "FIELD_VALUE_OVERRIDEN"
  19557. // "INJECTED_KERNELS_DEPRECATED"
  19558. // "MISSING_TYPE_DEPENDENCY"
  19559. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19560. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19561. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19562. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19563. // "NEXT_HOP_NOT_RUNNING"
  19564. // "NOT_CRITICAL_ERROR"
  19565. // "NO_RESULTS_ON_PAGE"
  19566. // "REQUIRED_TOS_AGREEMENT"
  19567. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19568. // "RESOURCE_NOT_DELETED"
  19569. // "SCHEMA_VALIDATION_IGNORED"
  19570. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19571. // "UNDECLARED_PROPERTIES"
  19572. // "UNREACHABLE"
  19573. Code string `json:"code,omitempty"`
  19574. // Data: [Output Only] Metadata about this warning in key: value format.
  19575. // For example:
  19576. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19577. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  19578. // Message: [Output Only] A human-readable description of the warning
  19579. // code.
  19580. Message string `json:"message,omitempty"`
  19581. // ForceSendFields is a list of field names (e.g. "Code") to
  19582. // unconditionally include in API requests. By default, fields with
  19583. // empty values are omitted from API requests. However, any non-pointer,
  19584. // non-interface field appearing in ForceSendFields will be sent to the
  19585. // server regardless of whether the field is empty or not. This may be
  19586. // used to include empty fields in Patch requests.
  19587. ForceSendFields []string `json:"-"`
  19588. // NullFields is a list of field names (e.g. "Code") to include in API
  19589. // requests with the JSON null value. By default, fields with empty
  19590. // values are omitted from API requests. However, any field with an
  19591. // empty value appearing in NullFields will be sent to the server as
  19592. // null. It is an error if a field in this list has a non-empty value.
  19593. // This may be used to include null fields in Patch requests.
  19594. NullFields []string `json:"-"`
  19595. }
  19596. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  19597. type NoMethod NodeTypeListWarning
  19598. raw := NoMethod(*s)
  19599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19600. }
  19601. type NodeTypeListWarningData struct {
  19602. // Key: [Output Only] A key that provides more detail on the warning
  19603. // being returned. For example, for warnings where there are no results
  19604. // in a list request for a particular zone, this key might be scope and
  19605. // the key value might be the zone name. Other examples might be a key
  19606. // indicating a deprecated resource and a suggested replacement, or a
  19607. // warning about invalid network settings (for example, if an instance
  19608. // attempts to perform IP forwarding but is not enabled for IP
  19609. // forwarding).
  19610. Key string `json:"key,omitempty"`
  19611. // Value: [Output Only] A warning data value corresponding to the key.
  19612. Value string `json:"value,omitempty"`
  19613. // ForceSendFields is a list of field names (e.g. "Key") to
  19614. // unconditionally include in API requests. By default, fields with
  19615. // empty values are omitted from API requests. However, any non-pointer,
  19616. // non-interface field appearing in ForceSendFields will be sent to the
  19617. // server regardless of whether the field is empty or not. This may be
  19618. // used to include empty fields in Patch requests.
  19619. ForceSendFields []string `json:"-"`
  19620. // NullFields is a list of field names (e.g. "Key") to include in API
  19621. // requests with the JSON null value. By default, fields with empty
  19622. // values are omitted from API requests. However, any field with an
  19623. // empty value appearing in NullFields will be sent to the server as
  19624. // null. It is an error if a field in this list has a non-empty value.
  19625. // This may be used to include null fields in Patch requests.
  19626. NullFields []string `json:"-"`
  19627. }
  19628. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  19629. type NoMethod NodeTypeListWarningData
  19630. raw := NoMethod(*s)
  19631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19632. }
  19633. type NodeTypesScopedList struct {
  19634. // NodeTypes: [Output Only] A list of node types contained in this
  19635. // scope.
  19636. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  19637. // Warning: [Output Only] An informational warning that appears when the
  19638. // node types list is empty.
  19639. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  19640. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  19641. // unconditionally include in API requests. By default, fields with
  19642. // empty values are omitted from API requests. However, any non-pointer,
  19643. // non-interface field appearing in ForceSendFields will be sent to the
  19644. // server regardless of whether the field is empty or not. This may be
  19645. // used to include empty fields in Patch requests.
  19646. ForceSendFields []string `json:"-"`
  19647. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  19648. // API requests with the JSON null value. By default, fields with empty
  19649. // values are omitted from API requests. However, any field with an
  19650. // empty value appearing in NullFields will be sent to the server as
  19651. // null. It is an error if a field in this list has a non-empty value.
  19652. // This may be used to include null fields in Patch requests.
  19653. NullFields []string `json:"-"`
  19654. }
  19655. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  19656. type NoMethod NodeTypesScopedList
  19657. raw := NoMethod(*s)
  19658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19659. }
  19660. // NodeTypesScopedListWarning: [Output Only] An informational warning
  19661. // that appears when the node types list is empty.
  19662. type NodeTypesScopedListWarning struct {
  19663. // Code: [Output Only] A warning code, if applicable. For example,
  19664. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19665. // the response.
  19666. //
  19667. // Possible values:
  19668. // "CLEANUP_FAILED"
  19669. // "DEPRECATED_RESOURCE_USED"
  19670. // "DEPRECATED_TYPE_USED"
  19671. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19672. // "EXPERIMENTAL_TYPE_USED"
  19673. // "EXTERNAL_API_WARNING"
  19674. // "FIELD_VALUE_OVERRIDEN"
  19675. // "INJECTED_KERNELS_DEPRECATED"
  19676. // "MISSING_TYPE_DEPENDENCY"
  19677. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19678. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19679. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19680. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19681. // "NEXT_HOP_NOT_RUNNING"
  19682. // "NOT_CRITICAL_ERROR"
  19683. // "NO_RESULTS_ON_PAGE"
  19684. // "REQUIRED_TOS_AGREEMENT"
  19685. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19686. // "RESOURCE_NOT_DELETED"
  19687. // "SCHEMA_VALIDATION_IGNORED"
  19688. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19689. // "UNDECLARED_PROPERTIES"
  19690. // "UNREACHABLE"
  19691. Code string `json:"code,omitempty"`
  19692. // Data: [Output Only] Metadata about this warning in key: value format.
  19693. // For example:
  19694. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19695. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  19696. // Message: [Output Only] A human-readable description of the warning
  19697. // code.
  19698. Message string `json:"message,omitempty"`
  19699. // ForceSendFields is a list of field names (e.g. "Code") to
  19700. // unconditionally include in API requests. By default, fields with
  19701. // empty values are omitted from API requests. However, any non-pointer,
  19702. // non-interface field appearing in ForceSendFields will be sent to the
  19703. // server regardless of whether the field is empty or not. This may be
  19704. // used to include empty fields in Patch requests.
  19705. ForceSendFields []string `json:"-"`
  19706. // NullFields is a list of field names (e.g. "Code") to include in API
  19707. // requests with the JSON null value. By default, fields with empty
  19708. // values are omitted from API requests. However, any field with an
  19709. // empty value appearing in NullFields will be sent to the server as
  19710. // null. It is an error if a field in this list has a non-empty value.
  19711. // This may be used to include null fields in Patch requests.
  19712. NullFields []string `json:"-"`
  19713. }
  19714. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  19715. type NoMethod NodeTypesScopedListWarning
  19716. raw := NoMethod(*s)
  19717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19718. }
  19719. type NodeTypesScopedListWarningData struct {
  19720. // Key: [Output Only] A key that provides more detail on the warning
  19721. // being returned. For example, for warnings where there are no results
  19722. // in a list request for a particular zone, this key might be scope and
  19723. // the key value might be the zone name. Other examples might be a key
  19724. // indicating a deprecated resource and a suggested replacement, or a
  19725. // warning about invalid network settings (for example, if an instance
  19726. // attempts to perform IP forwarding but is not enabled for IP
  19727. // forwarding).
  19728. Key string `json:"key,omitempty"`
  19729. // Value: [Output Only] A warning data value corresponding to the key.
  19730. Value string `json:"value,omitempty"`
  19731. // ForceSendFields is a list of field names (e.g. "Key") to
  19732. // unconditionally include in API requests. By default, fields with
  19733. // empty values are omitted from API requests. However, any non-pointer,
  19734. // non-interface field appearing in ForceSendFields will be sent to the
  19735. // server regardless of whether the field is empty or not. This may be
  19736. // used to include empty fields in Patch requests.
  19737. ForceSendFields []string `json:"-"`
  19738. // NullFields is a list of field names (e.g. "Key") to include in API
  19739. // requests with the JSON null value. By default, fields with empty
  19740. // values are omitted from API requests. However, any field with an
  19741. // empty value appearing in NullFields will be sent to the server as
  19742. // null. It is an error if a field in this list has a non-empty value.
  19743. // This may be used to include null fields in Patch requests.
  19744. NullFields []string `json:"-"`
  19745. }
  19746. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  19747. type NoMethod NodeTypesScopedListWarningData
  19748. raw := NoMethod(*s)
  19749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19750. }
  19751. // Operation: An Operation resource, used to manage asynchronous API
  19752. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  19753. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  19754. // (== resource_for beta.regionOperations ==) (== resource_for
  19755. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  19756. type Operation struct {
  19757. // ClientOperationId: [Output Only] The value of `requestId` if you
  19758. // provided it in the request. Not present otherwise.
  19759. ClientOperationId string `json:"clientOperationId,omitempty"`
  19760. // CreationTimestamp: [Deprecated] This field is deprecated.
  19761. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19762. // Description: [Output Only] A textual description of the operation,
  19763. // which is set when the operation is created.
  19764. Description string `json:"description,omitempty"`
  19765. // EndTime: [Output Only] The time that this operation was completed.
  19766. // This value is in RFC3339 text format.
  19767. EndTime string `json:"endTime,omitempty"`
  19768. // Error: [Output Only] If errors are generated during processing of the
  19769. // operation, this field will be populated.
  19770. Error *OperationError `json:"error,omitempty"`
  19771. // HttpErrorMessage: [Output Only] If the operation fails, this field
  19772. // contains the HTTP error message that was returned, such as NOT FOUND.
  19773. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  19774. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  19775. // contains the HTTP error status code that was returned. For example, a
  19776. // 404 means the resource was not found.
  19777. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  19778. // Id: [Output Only] The unique identifier for the resource. This
  19779. // identifier is defined by the server.
  19780. Id uint64 `json:"id,omitempty,string"`
  19781. // InsertTime: [Output Only] The time that this operation was requested.
  19782. // This value is in RFC3339 text format.
  19783. InsertTime string `json:"insertTime,omitempty"`
  19784. // Kind: [Output Only] Type of the resource. Always compute#operation
  19785. // for Operation resources.
  19786. Kind string `json:"kind,omitempty"`
  19787. // Name: [Output Only] Name of the resource.
  19788. Name string `json:"name,omitempty"`
  19789. // OperationType: [Output Only] The type of operation, such as insert,
  19790. // update, or delete, and so on.
  19791. OperationType string `json:"operationType,omitempty"`
  19792. // Progress: [Output Only] An optional progress indicator that ranges
  19793. // from 0 to 100. There is no requirement that this be linear or support
  19794. // any granularity of operations. This should not be used to guess when
  19795. // the operation will be complete. This number should monotonically
  19796. // increase as the operation progresses.
  19797. Progress int64 `json:"progress,omitempty"`
  19798. // Region: [Output Only] The URL of the region where the operation
  19799. // resides. Only available when performing regional operations. You must
  19800. // specify this field as part of the HTTP request URL. It is not
  19801. // settable as a field in the request body.
  19802. Region string `json:"region,omitempty"`
  19803. // SelfLink: [Output Only] Server-defined URL for the resource.
  19804. SelfLink string `json:"selfLink,omitempty"`
  19805. // StartTime: [Output Only] The time that this operation was started by
  19806. // the server. This value is in RFC3339 text format.
  19807. StartTime string `json:"startTime,omitempty"`
  19808. // Status: [Output Only] The status of the operation, which can be one
  19809. // of the following: PENDING, RUNNING, or DONE.
  19810. //
  19811. // Possible values:
  19812. // "DONE"
  19813. // "PENDING"
  19814. // "RUNNING"
  19815. Status string `json:"status,omitempty"`
  19816. // StatusMessage: [Output Only] An optional textual description of the
  19817. // current status of the operation.
  19818. StatusMessage string `json:"statusMessage,omitempty"`
  19819. // TargetId: [Output Only] The unique target ID, which identifies a
  19820. // specific incarnation of the target resource.
  19821. TargetId uint64 `json:"targetId,omitempty,string"`
  19822. // TargetLink: [Output Only] The URL of the resource that the operation
  19823. // modifies. For operations related to creating a snapshot, this points
  19824. // to the persistent disk that the snapshot was created from.
  19825. TargetLink string `json:"targetLink,omitempty"`
  19826. // User: [Output Only] User who requested the operation, for example:
  19827. // user@example.com.
  19828. User string `json:"user,omitempty"`
  19829. // Warnings: [Output Only] If warning messages are generated during
  19830. // processing of the operation, this field will be populated.
  19831. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  19832. // Zone: [Output Only] The URL of the zone where the operation resides.
  19833. // Only available when performing per-zone operations. You must specify
  19834. // this field as part of the HTTP request URL. It is not settable as a
  19835. // field in the request body.
  19836. Zone string `json:"zone,omitempty"`
  19837. // ServerResponse contains the HTTP response code and headers from the
  19838. // server.
  19839. googleapi.ServerResponse `json:"-"`
  19840. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  19841. // to unconditionally include in API requests. By default, fields with
  19842. // empty values are omitted from API requests. However, any non-pointer,
  19843. // non-interface field appearing in ForceSendFields will be sent to the
  19844. // server regardless of whether the field is empty or not. This may be
  19845. // used to include empty fields in Patch requests.
  19846. ForceSendFields []string `json:"-"`
  19847. // NullFields is a list of field names (e.g. "ClientOperationId") to
  19848. // include in API requests with the JSON null value. By default, fields
  19849. // with empty values are omitted from API requests. However, any field
  19850. // with an empty value appearing in NullFields will be sent to the
  19851. // server as null. It is an error if a field in this list has a
  19852. // non-empty value. This may be used to include null fields in Patch
  19853. // requests.
  19854. NullFields []string `json:"-"`
  19855. }
  19856. func (s *Operation) MarshalJSON() ([]byte, error) {
  19857. type NoMethod Operation
  19858. raw := NoMethod(*s)
  19859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19860. }
  19861. // OperationError: [Output Only] If errors are generated during
  19862. // processing of the operation, this field will be populated.
  19863. type OperationError struct {
  19864. // Errors: [Output Only] The array of errors encountered while
  19865. // processing this operation.
  19866. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  19867. // ForceSendFields is a list of field names (e.g. "Errors") to
  19868. // unconditionally include in API requests. By default, fields with
  19869. // empty values are omitted from API requests. However, any non-pointer,
  19870. // non-interface field appearing in ForceSendFields will be sent to the
  19871. // server regardless of whether the field is empty or not. This may be
  19872. // used to include empty fields in Patch requests.
  19873. ForceSendFields []string `json:"-"`
  19874. // NullFields is a list of field names (e.g. "Errors") to include in API
  19875. // requests with the JSON null value. By default, fields with empty
  19876. // values are omitted from API requests. However, any field with an
  19877. // empty value appearing in NullFields will be sent to the server as
  19878. // null. It is an error if a field in this list has a non-empty value.
  19879. // This may be used to include null fields in Patch requests.
  19880. NullFields []string `json:"-"`
  19881. }
  19882. func (s *OperationError) MarshalJSON() ([]byte, error) {
  19883. type NoMethod OperationError
  19884. raw := NoMethod(*s)
  19885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19886. }
  19887. type OperationErrorErrors struct {
  19888. // Code: [Output Only] The error type identifier for this error.
  19889. Code string `json:"code,omitempty"`
  19890. // Location: [Output Only] Indicates the field in the request that
  19891. // caused the error. This property is optional.
  19892. Location string `json:"location,omitempty"`
  19893. // Message: [Output Only] An optional, human-readable error message.
  19894. Message string `json:"message,omitempty"`
  19895. // ForceSendFields is a list of field names (e.g. "Code") to
  19896. // unconditionally include in API requests. By default, fields with
  19897. // empty values are omitted from API requests. However, any non-pointer,
  19898. // non-interface field appearing in ForceSendFields will be sent to the
  19899. // server regardless of whether the field is empty or not. This may be
  19900. // used to include empty fields in Patch requests.
  19901. ForceSendFields []string `json:"-"`
  19902. // NullFields is a list of field names (e.g. "Code") to include in API
  19903. // requests with the JSON null value. By default, fields with empty
  19904. // values are omitted from API requests. However, any field with an
  19905. // empty value appearing in NullFields will be sent to the server as
  19906. // null. It is an error if a field in this list has a non-empty value.
  19907. // This may be used to include null fields in Patch requests.
  19908. NullFields []string `json:"-"`
  19909. }
  19910. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  19911. type NoMethod OperationErrorErrors
  19912. raw := NoMethod(*s)
  19913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19914. }
  19915. type OperationWarnings struct {
  19916. // Code: [Output Only] A warning code, if applicable. For example,
  19917. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19918. // the response.
  19919. //
  19920. // Possible values:
  19921. // "CLEANUP_FAILED"
  19922. // "DEPRECATED_RESOURCE_USED"
  19923. // "DEPRECATED_TYPE_USED"
  19924. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19925. // "EXPERIMENTAL_TYPE_USED"
  19926. // "EXTERNAL_API_WARNING"
  19927. // "FIELD_VALUE_OVERRIDEN"
  19928. // "INJECTED_KERNELS_DEPRECATED"
  19929. // "MISSING_TYPE_DEPENDENCY"
  19930. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19931. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19932. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19933. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19934. // "NEXT_HOP_NOT_RUNNING"
  19935. // "NOT_CRITICAL_ERROR"
  19936. // "NO_RESULTS_ON_PAGE"
  19937. // "REQUIRED_TOS_AGREEMENT"
  19938. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19939. // "RESOURCE_NOT_DELETED"
  19940. // "SCHEMA_VALIDATION_IGNORED"
  19941. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19942. // "UNDECLARED_PROPERTIES"
  19943. // "UNREACHABLE"
  19944. Code string `json:"code,omitempty"`
  19945. // Data: [Output Only] Metadata about this warning in key: value format.
  19946. // For example:
  19947. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19948. Data []*OperationWarningsData `json:"data,omitempty"`
  19949. // Message: [Output Only] A human-readable description of the warning
  19950. // code.
  19951. Message string `json:"message,omitempty"`
  19952. // ForceSendFields is a list of field names (e.g. "Code") to
  19953. // unconditionally include in API requests. By default, fields with
  19954. // empty values are omitted from API requests. However, any non-pointer,
  19955. // non-interface field appearing in ForceSendFields will be sent to the
  19956. // server regardless of whether the field is empty or not. This may be
  19957. // used to include empty fields in Patch requests.
  19958. ForceSendFields []string `json:"-"`
  19959. // NullFields is a list of field names (e.g. "Code") to include in API
  19960. // requests with the JSON null value. By default, fields with empty
  19961. // values are omitted from API requests. However, any field with an
  19962. // empty value appearing in NullFields will be sent to the server as
  19963. // null. It is an error if a field in this list has a non-empty value.
  19964. // This may be used to include null fields in Patch requests.
  19965. NullFields []string `json:"-"`
  19966. }
  19967. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  19968. type NoMethod OperationWarnings
  19969. raw := NoMethod(*s)
  19970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19971. }
  19972. type OperationWarningsData struct {
  19973. // Key: [Output Only] A key that provides more detail on the warning
  19974. // being returned. For example, for warnings where there are no results
  19975. // in a list request for a particular zone, this key might be scope and
  19976. // the key value might be the zone name. Other examples might be a key
  19977. // indicating a deprecated resource and a suggested replacement, or a
  19978. // warning about invalid network settings (for example, if an instance
  19979. // attempts to perform IP forwarding but is not enabled for IP
  19980. // forwarding).
  19981. Key string `json:"key,omitempty"`
  19982. // Value: [Output Only] A warning data value corresponding to the key.
  19983. Value string `json:"value,omitempty"`
  19984. // ForceSendFields is a list of field names (e.g. "Key") to
  19985. // unconditionally include in API requests. By default, fields with
  19986. // empty values are omitted from API requests. However, any non-pointer,
  19987. // non-interface field appearing in ForceSendFields will be sent to the
  19988. // server regardless of whether the field is empty or not. This may be
  19989. // used to include empty fields in Patch requests.
  19990. ForceSendFields []string `json:"-"`
  19991. // NullFields is a list of field names (e.g. "Key") to include in API
  19992. // requests with the JSON null value. By default, fields with empty
  19993. // values are omitted from API requests. However, any field with an
  19994. // empty value appearing in NullFields will be sent to the server as
  19995. // null. It is an error if a field in this list has a non-empty value.
  19996. // This may be used to include null fields in Patch requests.
  19997. NullFields []string `json:"-"`
  19998. }
  19999. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  20000. type NoMethod OperationWarningsData
  20001. raw := NoMethod(*s)
  20002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20003. }
  20004. type OperationAggregatedList struct {
  20005. // Id: [Output Only] The unique identifier for the resource. This
  20006. // identifier is defined by the server.
  20007. Id string `json:"id,omitempty"`
  20008. // Items: [Output Only] A map of scoped operation lists.
  20009. Items map[string]OperationsScopedList `json:"items,omitempty"`
  20010. // Kind: [Output Only] Type of resource. Always
  20011. // compute#operationAggregatedList for aggregated lists of operations.
  20012. Kind string `json:"kind,omitempty"`
  20013. // NextPageToken: [Output Only] This token allows you to get the next
  20014. // page of results for list requests. If the number of results is larger
  20015. // than maxResults, use the nextPageToken as a value for the query
  20016. // parameter pageToken in the next list request. Subsequent list
  20017. // requests will have their own nextPageToken to continue paging through
  20018. // the results.
  20019. NextPageToken string `json:"nextPageToken,omitempty"`
  20020. // SelfLink: [Output Only] Server-defined URL for this resource.
  20021. SelfLink string `json:"selfLink,omitempty"`
  20022. // Warning: [Output Only] Informational warning message.
  20023. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  20024. // ServerResponse contains the HTTP response code and headers from the
  20025. // server.
  20026. googleapi.ServerResponse `json:"-"`
  20027. // ForceSendFields is a list of field names (e.g. "Id") to
  20028. // unconditionally include in API requests. By default, fields with
  20029. // empty values are omitted from API requests. However, any non-pointer,
  20030. // non-interface field appearing in ForceSendFields will be sent to the
  20031. // server regardless of whether the field is empty or not. This may be
  20032. // used to include empty fields in Patch requests.
  20033. ForceSendFields []string `json:"-"`
  20034. // NullFields is a list of field names (e.g. "Id") to include in API
  20035. // requests with the JSON null value. By default, fields with empty
  20036. // values are omitted from API requests. However, any field with an
  20037. // empty value appearing in NullFields will be sent to the server as
  20038. // null. It is an error if a field in this list has a non-empty value.
  20039. // This may be used to include null fields in Patch requests.
  20040. NullFields []string `json:"-"`
  20041. }
  20042. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  20043. type NoMethod OperationAggregatedList
  20044. raw := NoMethod(*s)
  20045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20046. }
  20047. // OperationAggregatedListWarning: [Output Only] Informational warning
  20048. // message.
  20049. type OperationAggregatedListWarning struct {
  20050. // Code: [Output Only] A warning code, if applicable. For example,
  20051. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20052. // the response.
  20053. //
  20054. // Possible values:
  20055. // "CLEANUP_FAILED"
  20056. // "DEPRECATED_RESOURCE_USED"
  20057. // "DEPRECATED_TYPE_USED"
  20058. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20059. // "EXPERIMENTAL_TYPE_USED"
  20060. // "EXTERNAL_API_WARNING"
  20061. // "FIELD_VALUE_OVERRIDEN"
  20062. // "INJECTED_KERNELS_DEPRECATED"
  20063. // "MISSING_TYPE_DEPENDENCY"
  20064. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20065. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20066. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20067. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20068. // "NEXT_HOP_NOT_RUNNING"
  20069. // "NOT_CRITICAL_ERROR"
  20070. // "NO_RESULTS_ON_PAGE"
  20071. // "REQUIRED_TOS_AGREEMENT"
  20072. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20073. // "RESOURCE_NOT_DELETED"
  20074. // "SCHEMA_VALIDATION_IGNORED"
  20075. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20076. // "UNDECLARED_PROPERTIES"
  20077. // "UNREACHABLE"
  20078. Code string `json:"code,omitempty"`
  20079. // Data: [Output Only] Metadata about this warning in key: value format.
  20080. // For example:
  20081. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20082. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  20083. // Message: [Output Only] A human-readable description of the warning
  20084. // code.
  20085. Message string `json:"message,omitempty"`
  20086. // ForceSendFields is a list of field names (e.g. "Code") to
  20087. // unconditionally include in API requests. By default, fields with
  20088. // empty values are omitted from API requests. However, any non-pointer,
  20089. // non-interface field appearing in ForceSendFields will be sent to the
  20090. // server regardless of whether the field is empty or not. This may be
  20091. // used to include empty fields in Patch requests.
  20092. ForceSendFields []string `json:"-"`
  20093. // NullFields is a list of field names (e.g. "Code") to include in API
  20094. // requests with the JSON null value. By default, fields with empty
  20095. // values are omitted from API requests. However, any field with an
  20096. // empty value appearing in NullFields will be sent to the server as
  20097. // null. It is an error if a field in this list has a non-empty value.
  20098. // This may be used to include null fields in Patch requests.
  20099. NullFields []string `json:"-"`
  20100. }
  20101. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20102. type NoMethod OperationAggregatedListWarning
  20103. raw := NoMethod(*s)
  20104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20105. }
  20106. type OperationAggregatedListWarningData struct {
  20107. // Key: [Output Only] A key that provides more detail on the warning
  20108. // being returned. For example, for warnings where there are no results
  20109. // in a list request for a particular zone, this key might be scope and
  20110. // the key value might be the zone name. Other examples might be a key
  20111. // indicating a deprecated resource and a suggested replacement, or a
  20112. // warning about invalid network settings (for example, if an instance
  20113. // attempts to perform IP forwarding but is not enabled for IP
  20114. // forwarding).
  20115. Key string `json:"key,omitempty"`
  20116. // Value: [Output Only] A warning data value corresponding to the key.
  20117. Value string `json:"value,omitempty"`
  20118. // ForceSendFields is a list of field names (e.g. "Key") to
  20119. // unconditionally include in API requests. By default, fields with
  20120. // empty values are omitted from API requests. However, any non-pointer,
  20121. // non-interface field appearing in ForceSendFields will be sent to the
  20122. // server regardless of whether the field is empty or not. This may be
  20123. // used to include empty fields in Patch requests.
  20124. ForceSendFields []string `json:"-"`
  20125. // NullFields is a list of field names (e.g. "Key") to include in API
  20126. // requests with the JSON null value. By default, fields with empty
  20127. // values are omitted from API requests. However, any field with an
  20128. // empty value appearing in NullFields will be sent to the server as
  20129. // null. It is an error if a field in this list has a non-empty value.
  20130. // This may be used to include null fields in Patch requests.
  20131. NullFields []string `json:"-"`
  20132. }
  20133. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20134. type NoMethod OperationAggregatedListWarningData
  20135. raw := NoMethod(*s)
  20136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20137. }
  20138. // OperationList: Contains a list of Operation resources.
  20139. type OperationList struct {
  20140. // Id: [Output Only] The unique identifier for the resource. This
  20141. // identifier is defined by the server.
  20142. Id string `json:"id,omitempty"`
  20143. // Items: [Output Only] A list of Operation resources.
  20144. Items []*Operation `json:"items,omitempty"`
  20145. // Kind: [Output Only] Type of resource. Always compute#operations for
  20146. // Operations resource.
  20147. Kind string `json:"kind,omitempty"`
  20148. // NextPageToken: [Output Only] This token allows you to get the next
  20149. // page of results for list requests. If the number of results is larger
  20150. // than maxResults, use the nextPageToken as a value for the query
  20151. // parameter pageToken in the next list request. Subsequent list
  20152. // requests will have their own nextPageToken to continue paging through
  20153. // the results.
  20154. NextPageToken string `json:"nextPageToken,omitempty"`
  20155. // SelfLink: [Output Only] Server-defined URL for this resource.
  20156. SelfLink string `json:"selfLink,omitempty"`
  20157. // Warning: [Output Only] Informational warning message.
  20158. Warning *OperationListWarning `json:"warning,omitempty"`
  20159. // ServerResponse contains the HTTP response code and headers from the
  20160. // server.
  20161. googleapi.ServerResponse `json:"-"`
  20162. // ForceSendFields is a list of field names (e.g. "Id") to
  20163. // unconditionally include in API requests. By default, fields with
  20164. // empty values are omitted from API requests. However, any non-pointer,
  20165. // non-interface field appearing in ForceSendFields will be sent to the
  20166. // server regardless of whether the field is empty or not. This may be
  20167. // used to include empty fields in Patch requests.
  20168. ForceSendFields []string `json:"-"`
  20169. // NullFields is a list of field names (e.g. "Id") to include in API
  20170. // requests with the JSON null value. By default, fields with empty
  20171. // values are omitted from API requests. However, any field with an
  20172. // empty value appearing in NullFields will be sent to the server as
  20173. // null. It is an error if a field in this list has a non-empty value.
  20174. // This may be used to include null fields in Patch requests.
  20175. NullFields []string `json:"-"`
  20176. }
  20177. func (s *OperationList) MarshalJSON() ([]byte, error) {
  20178. type NoMethod OperationList
  20179. raw := NoMethod(*s)
  20180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20181. }
  20182. // OperationListWarning: [Output Only] Informational warning message.
  20183. type OperationListWarning struct {
  20184. // Code: [Output Only] A warning code, if applicable. For example,
  20185. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20186. // the response.
  20187. //
  20188. // Possible values:
  20189. // "CLEANUP_FAILED"
  20190. // "DEPRECATED_RESOURCE_USED"
  20191. // "DEPRECATED_TYPE_USED"
  20192. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20193. // "EXPERIMENTAL_TYPE_USED"
  20194. // "EXTERNAL_API_WARNING"
  20195. // "FIELD_VALUE_OVERRIDEN"
  20196. // "INJECTED_KERNELS_DEPRECATED"
  20197. // "MISSING_TYPE_DEPENDENCY"
  20198. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20199. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20200. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20201. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20202. // "NEXT_HOP_NOT_RUNNING"
  20203. // "NOT_CRITICAL_ERROR"
  20204. // "NO_RESULTS_ON_PAGE"
  20205. // "REQUIRED_TOS_AGREEMENT"
  20206. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20207. // "RESOURCE_NOT_DELETED"
  20208. // "SCHEMA_VALIDATION_IGNORED"
  20209. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20210. // "UNDECLARED_PROPERTIES"
  20211. // "UNREACHABLE"
  20212. Code string `json:"code,omitempty"`
  20213. // Data: [Output Only] Metadata about this warning in key: value format.
  20214. // For example:
  20215. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20216. Data []*OperationListWarningData `json:"data,omitempty"`
  20217. // Message: [Output Only] A human-readable description of the warning
  20218. // code.
  20219. Message string `json:"message,omitempty"`
  20220. // ForceSendFields is a list of field names (e.g. "Code") to
  20221. // unconditionally include in API requests. By default, fields with
  20222. // empty values are omitted from API requests. However, any non-pointer,
  20223. // non-interface field appearing in ForceSendFields will be sent to the
  20224. // server regardless of whether the field is empty or not. This may be
  20225. // used to include empty fields in Patch requests.
  20226. ForceSendFields []string `json:"-"`
  20227. // NullFields is a list of field names (e.g. "Code") to include in API
  20228. // requests with the JSON null value. By default, fields with empty
  20229. // values are omitted from API requests. However, any field with an
  20230. // empty value appearing in NullFields will be sent to the server as
  20231. // null. It is an error if a field in this list has a non-empty value.
  20232. // This may be used to include null fields in Patch requests.
  20233. NullFields []string `json:"-"`
  20234. }
  20235. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  20236. type NoMethod OperationListWarning
  20237. raw := NoMethod(*s)
  20238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20239. }
  20240. type OperationListWarningData struct {
  20241. // Key: [Output Only] A key that provides more detail on the warning
  20242. // being returned. For example, for warnings where there are no results
  20243. // in a list request for a particular zone, this key might be scope and
  20244. // the key value might be the zone name. Other examples might be a key
  20245. // indicating a deprecated resource and a suggested replacement, or a
  20246. // warning about invalid network settings (for example, if an instance
  20247. // attempts to perform IP forwarding but is not enabled for IP
  20248. // forwarding).
  20249. Key string `json:"key,omitempty"`
  20250. // Value: [Output Only] A warning data value corresponding to the key.
  20251. Value string `json:"value,omitempty"`
  20252. // ForceSendFields is a list of field names (e.g. "Key") to
  20253. // unconditionally include in API requests. By default, fields with
  20254. // empty values are omitted from API requests. However, any non-pointer,
  20255. // non-interface field appearing in ForceSendFields will be sent to the
  20256. // server regardless of whether the field is empty or not. This may be
  20257. // used to include empty fields in Patch requests.
  20258. ForceSendFields []string `json:"-"`
  20259. // NullFields is a list of field names (e.g. "Key") to include in API
  20260. // requests with the JSON null value. By default, fields with empty
  20261. // values are omitted from API requests. However, any field with an
  20262. // empty value appearing in NullFields will be sent to the server as
  20263. // null. It is an error if a field in this list has a non-empty value.
  20264. // This may be used to include null fields in Patch requests.
  20265. NullFields []string `json:"-"`
  20266. }
  20267. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  20268. type NoMethod OperationListWarningData
  20269. raw := NoMethod(*s)
  20270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20271. }
  20272. type OperationsScopedList struct {
  20273. // Operations: [Output Only] A list of operations contained in this
  20274. // scope.
  20275. Operations []*Operation `json:"operations,omitempty"`
  20276. // Warning: [Output Only] Informational warning which replaces the list
  20277. // of operations when the list is empty.
  20278. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  20279. // ForceSendFields is a list of field names (e.g. "Operations") to
  20280. // unconditionally include in API requests. By default, fields with
  20281. // empty values are omitted from API requests. However, any non-pointer,
  20282. // non-interface field appearing in ForceSendFields will be sent to the
  20283. // server regardless of whether the field is empty or not. This may be
  20284. // used to include empty fields in Patch requests.
  20285. ForceSendFields []string `json:"-"`
  20286. // NullFields is a list of field names (e.g. "Operations") to include in
  20287. // API requests with the JSON null value. By default, fields with empty
  20288. // values are omitted from API requests. However, any field with an
  20289. // empty value appearing in NullFields will be sent to the server as
  20290. // null. It is an error if a field in this list has a non-empty value.
  20291. // This may be used to include null fields in Patch requests.
  20292. NullFields []string `json:"-"`
  20293. }
  20294. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  20295. type NoMethod OperationsScopedList
  20296. raw := NoMethod(*s)
  20297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20298. }
  20299. // OperationsScopedListWarning: [Output Only] Informational warning
  20300. // which replaces the list of operations when the list is empty.
  20301. type OperationsScopedListWarning struct {
  20302. // Code: [Output Only] A warning code, if applicable. For example,
  20303. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20304. // the response.
  20305. //
  20306. // Possible values:
  20307. // "CLEANUP_FAILED"
  20308. // "DEPRECATED_RESOURCE_USED"
  20309. // "DEPRECATED_TYPE_USED"
  20310. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20311. // "EXPERIMENTAL_TYPE_USED"
  20312. // "EXTERNAL_API_WARNING"
  20313. // "FIELD_VALUE_OVERRIDEN"
  20314. // "INJECTED_KERNELS_DEPRECATED"
  20315. // "MISSING_TYPE_DEPENDENCY"
  20316. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20317. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20318. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20319. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20320. // "NEXT_HOP_NOT_RUNNING"
  20321. // "NOT_CRITICAL_ERROR"
  20322. // "NO_RESULTS_ON_PAGE"
  20323. // "REQUIRED_TOS_AGREEMENT"
  20324. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20325. // "RESOURCE_NOT_DELETED"
  20326. // "SCHEMA_VALIDATION_IGNORED"
  20327. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20328. // "UNDECLARED_PROPERTIES"
  20329. // "UNREACHABLE"
  20330. Code string `json:"code,omitempty"`
  20331. // Data: [Output Only] Metadata about this warning in key: value format.
  20332. // For example:
  20333. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20334. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  20335. // Message: [Output Only] A human-readable description of the warning
  20336. // code.
  20337. Message string `json:"message,omitempty"`
  20338. // ForceSendFields is a list of field names (e.g. "Code") to
  20339. // unconditionally include in API requests. By default, fields with
  20340. // empty values are omitted from API requests. However, any non-pointer,
  20341. // non-interface field appearing in ForceSendFields will be sent to the
  20342. // server regardless of whether the field is empty or not. This may be
  20343. // used to include empty fields in Patch requests.
  20344. ForceSendFields []string `json:"-"`
  20345. // NullFields is a list of field names (e.g. "Code") to include in API
  20346. // requests with the JSON null value. By default, fields with empty
  20347. // values are omitted from API requests. However, any field with an
  20348. // empty value appearing in NullFields will be sent to the server as
  20349. // null. It is an error if a field in this list has a non-empty value.
  20350. // This may be used to include null fields in Patch requests.
  20351. NullFields []string `json:"-"`
  20352. }
  20353. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  20354. type NoMethod OperationsScopedListWarning
  20355. raw := NoMethod(*s)
  20356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20357. }
  20358. type OperationsScopedListWarningData struct {
  20359. // Key: [Output Only] A key that provides more detail on the warning
  20360. // being returned. For example, for warnings where there are no results
  20361. // in a list request for a particular zone, this key might be scope and
  20362. // the key value might be the zone name. Other examples might be a key
  20363. // indicating a deprecated resource and a suggested replacement, or a
  20364. // warning about invalid network settings (for example, if an instance
  20365. // attempts to perform IP forwarding but is not enabled for IP
  20366. // forwarding).
  20367. Key string `json:"key,omitempty"`
  20368. // Value: [Output Only] A warning data value corresponding to the key.
  20369. Value string `json:"value,omitempty"`
  20370. // ForceSendFields is a list of field names (e.g. "Key") to
  20371. // unconditionally include in API requests. By default, fields with
  20372. // empty values are omitted from API requests. However, any non-pointer,
  20373. // non-interface field appearing in ForceSendFields will be sent to the
  20374. // server regardless of whether the field is empty or not. This may be
  20375. // used to include empty fields in Patch requests.
  20376. ForceSendFields []string `json:"-"`
  20377. // NullFields is a list of field names (e.g. "Key") to include in API
  20378. // requests with the JSON null value. By default, fields with empty
  20379. // values are omitted from API requests. However, any field with an
  20380. // empty value appearing in NullFields will be sent to the server as
  20381. // null. It is an error if a field in this list has a non-empty value.
  20382. // This may be used to include null fields in Patch requests.
  20383. NullFields []string `json:"-"`
  20384. }
  20385. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  20386. type NoMethod OperationsScopedListWarningData
  20387. raw := NoMethod(*s)
  20388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20389. }
  20390. // PathMatcher: A matcher for the path portion of the URL. The
  20391. // BackendService from the longest-matched rule will serve the URL. If
  20392. // no rule was matched, the default service will be used.
  20393. type PathMatcher struct {
  20394. // DefaultService: The full or partial URL to the BackendService
  20395. // resource. This will be used if none of the pathRules or routeRules
  20396. // defined by this PathMatcher are matched. For example, the following
  20397. // are all valid URLs to a BackendService resource:
  20398. // -
  20399. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  20400. // - compute/v1/projects/project/global/backendServices/backendService
  20401. //
  20402. // - global/backendServices/backendService
  20403. // Use defaultService instead of defaultRouteAction when simple routing
  20404. // to a backend service is desired and other advanced capabilities like
  20405. // traffic splitting and URL rewrites are not required.
  20406. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  20407. // must be set.
  20408. // Authorization requires one or more of the following Google IAM
  20409. // permissions on the specified resource default_service:
  20410. // - compute.backendBuckets.use
  20411. // - compute.backendServices.use
  20412. DefaultService string `json:"defaultService,omitempty"`
  20413. // Description: An optional description of this resource. Provide this
  20414. // property when you create the resource.
  20415. Description string `json:"description,omitempty"`
  20416. // Name: The name to which this PathMatcher is referred by the HostRule.
  20417. Name string `json:"name,omitempty"`
  20418. // PathRules: The list of path rules. Use this list instead of
  20419. // routeRules when routing based on simple path matching is all that's
  20420. // required. The order by which path rules are specified does not
  20421. // matter. Matches are always done on the longest-path-first basis.
  20422. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  20423. // irrespective of the order in which those paths appear in this
  20424. // list.
  20425. // Only one of pathRules or routeRules must be set.
  20426. PathRules []*PathRule `json:"pathRules,omitempty"`
  20427. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  20428. // unconditionally include in API requests. By default, fields with
  20429. // empty values are omitted from API requests. However, any non-pointer,
  20430. // non-interface field appearing in ForceSendFields will be sent to the
  20431. // server regardless of whether the field is empty or not. This may be
  20432. // used to include empty fields in Patch requests.
  20433. ForceSendFields []string `json:"-"`
  20434. // NullFields is a list of field names (e.g. "DefaultService") to
  20435. // include in API requests with the JSON null value. By default, fields
  20436. // with empty values are omitted from API requests. However, any field
  20437. // with an empty value appearing in NullFields will be sent to the
  20438. // server as null. It is an error if a field in this list has a
  20439. // non-empty value. This may be used to include null fields in Patch
  20440. // requests.
  20441. NullFields []string `json:"-"`
  20442. }
  20443. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  20444. type NoMethod PathMatcher
  20445. raw := NoMethod(*s)
  20446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20447. }
  20448. // PathRule: A path-matching rule for a URL. If matched, will use the
  20449. // specified BackendService to handle the traffic arriving at this URL.
  20450. type PathRule struct {
  20451. // Paths: The list of path patterns to match. Each must start with / and
  20452. // the only place a * is allowed is at the end following a /. The string
  20453. // fed to the path matcher does not include any text after the first ?
  20454. // or #, and those chars are not allowed here.
  20455. Paths []string `json:"paths,omitempty"`
  20456. // Service: The URL of the backend service resource if this rule is
  20457. // matched.
  20458. // Use service instead of routeAction when simple routing to a backend
  20459. // service is desired and other advanced capabilities like traffic
  20460. // splitting and rewrites are not required.
  20461. // Only one of service, routeAction or urlRedirect should must be set.
  20462. Service string `json:"service,omitempty"`
  20463. // ForceSendFields is a list of field names (e.g. "Paths") to
  20464. // unconditionally include in API requests. By default, fields with
  20465. // empty values are omitted from API requests. However, any non-pointer,
  20466. // non-interface field appearing in ForceSendFields will be sent to the
  20467. // server regardless of whether the field is empty or not. This may be
  20468. // used to include empty fields in Patch requests.
  20469. ForceSendFields []string `json:"-"`
  20470. // NullFields is a list of field names (e.g. "Paths") to include in API
  20471. // requests with the JSON null value. By default, fields with empty
  20472. // values are omitted from API requests. However, any field with an
  20473. // empty value appearing in NullFields will be sent to the server as
  20474. // null. It is an error if a field in this list has a non-empty value.
  20475. // This may be used to include null fields in Patch requests.
  20476. NullFields []string `json:"-"`
  20477. }
  20478. func (s *PathRule) MarshalJSON() ([]byte, error) {
  20479. type NoMethod PathRule
  20480. raw := NoMethod(*s)
  20481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20482. }
  20483. type PerInstanceConfig struct {
  20484. // Fingerprint: Fingerprint of this per-instance config. This field may
  20485. // be used in optimistic locking. It will be ignored when inserting a
  20486. // per-instance config. An up-to-date fingerprint must be provided in
  20487. // order to update an existing per-instance config or the field needs to
  20488. // be unset.
  20489. Fingerprint string `json:"fingerprint,omitempty"`
  20490. // Instance: The URL of the instance. Serves as a merge key during
  20491. // UpdatePerInstanceConfigs operation, i.e. if per-instance config with
  20492. // the same instance URL exists then it will be updated, otherwise a new
  20493. // one will be created.
  20494. Instance string `json:"instance,omitempty"`
  20495. // Name: The name of the per-instance config and the corresponding
  20496. // instance. Serves as a merge key during UpdatePerInstanceConfigs
  20497. // operation, i.e. if per-instance config with the same name exists then
  20498. // it will be updated, otherwise a new one will be created for the VM
  20499. // instance with the same name. An attempt to create a per-instance
  20500. // config for a VM instance that either doesn't exist or is not part of
  20501. // the group will result in a failure.
  20502. Name string `json:"name,omitempty"`
  20503. Override *ManagedInstanceOverride `json:"override,omitempty"`
  20504. // PreservedState: Intended preserved state for the given instance. Does
  20505. // not contain state generated based on Stateful Policy.
  20506. PreservedState *PreservedState `json:"preservedState,omitempty"`
  20507. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  20508. // unconditionally include in API requests. By default, fields with
  20509. // empty values are omitted from API requests. However, any non-pointer,
  20510. // non-interface field appearing in ForceSendFields will be sent to the
  20511. // server regardless of whether the field is empty or not. This may be
  20512. // used to include empty fields in Patch requests.
  20513. ForceSendFields []string `json:"-"`
  20514. // NullFields is a list of field names (e.g. "Fingerprint") to include
  20515. // in API requests with the JSON null value. By default, fields with
  20516. // empty values are omitted from API requests. However, any field with
  20517. // an empty value appearing in NullFields will be sent to the server as
  20518. // null. It is an error if a field in this list has a non-empty value.
  20519. // This may be used to include null fields in Patch requests.
  20520. NullFields []string `json:"-"`
  20521. }
  20522. func (s *PerInstanceConfig) MarshalJSON() ([]byte, error) {
  20523. type NoMethod PerInstanceConfig
  20524. raw := NoMethod(*s)
  20525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20526. }
  20527. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  20528. // used to specify access control policies for Cloud Platform
  20529. // resources.
  20530. //
  20531. //
  20532. //
  20533. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  20534. // of `members` to a `role`, where the members can be user accounts,
  20535. // Google groups, Google domains, and service accounts. A `role` is a
  20536. // named list of permissions defined by IAM.
  20537. //
  20538. // **JSON Example**
  20539. //
  20540. // { "bindings": [ { "role": "roles/owner", "members": [
  20541. // "user:mike@example.com", "group:admins@example.com",
  20542. // "domain:google.com",
  20543. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  20544. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  20545. // }
  20546. //
  20547. // **YAML Example**
  20548. //
  20549. // bindings: - members: - user:mike@example.com -
  20550. // group:admins@example.com - domain:google.com -
  20551. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  20552. // roles/owner - members: - user:sean@example.com role:
  20553. // roles/viewer
  20554. //
  20555. //
  20556. //
  20557. // For a description of IAM and its features, see the [IAM developer's
  20558. // guide](https://cloud.google.com/iam/docs).
  20559. type Policy struct {
  20560. // AuditConfigs: Specifies cloud audit logging configuration for this
  20561. // policy.
  20562. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  20563. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  20564. // no members will result in an error.
  20565. Bindings []*Binding `json:"bindings,omitempty"`
  20566. // Etag: `etag` is used for optimistic concurrency control as a way to
  20567. // help prevent simultaneous updates of a policy from overwriting each
  20568. // other. It is strongly suggested that systems make use of the `etag`
  20569. // in the read-modify-write cycle to perform policy updates in order to
  20570. // avoid race conditions: An `etag` is returned in the response to
  20571. // `getIamPolicy`, and systems are expected to put that etag in the
  20572. // request to `setIamPolicy` to ensure that their change will be applied
  20573. // to the same version of the policy.
  20574. //
  20575. // If no `etag` is provided in the call to `setIamPolicy`, then the
  20576. // existing policy is overwritten blindly.
  20577. Etag string `json:"etag,omitempty"`
  20578. IamOwned bool `json:"iamOwned,omitempty"`
  20579. // Rules: If more than one rule is specified, the rules are applied in
  20580. // the following manner: - All matching LOG rules are always applied. -
  20581. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  20582. // will be applied if one or more matching rule requires logging. -
  20583. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  20584. // granted. Logging will be applied if one or more matching rule
  20585. // requires logging. - Otherwise, if no rule applies, permission is
  20586. // denied.
  20587. Rules []*Rule `json:"rules,omitempty"`
  20588. // Version: Deprecated.
  20589. Version int64 `json:"version,omitempty"`
  20590. // ServerResponse contains the HTTP response code and headers from the
  20591. // server.
  20592. googleapi.ServerResponse `json:"-"`
  20593. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  20594. // unconditionally include in API requests. By default, fields with
  20595. // empty values are omitted from API requests. However, any non-pointer,
  20596. // non-interface field appearing in ForceSendFields will be sent to the
  20597. // server regardless of whether the field is empty or not. This may be
  20598. // used to include empty fields in Patch requests.
  20599. ForceSendFields []string `json:"-"`
  20600. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  20601. // in API requests with the JSON null value. By default, fields with
  20602. // empty values are omitted from API requests. However, any field with
  20603. // an empty value appearing in NullFields will be sent to the server as
  20604. // null. It is an error if a field in this list has a non-empty value.
  20605. // This may be used to include null fields in Patch requests.
  20606. NullFields []string `json:"-"`
  20607. }
  20608. func (s *Policy) MarshalJSON() ([]byte, error) {
  20609. type NoMethod Policy
  20610. raw := NoMethod(*s)
  20611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20612. }
  20613. type PreconfiguredWafSet struct {
  20614. // ExpressionSets: List of entities that are currently supported for WAF
  20615. // rules.
  20616. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  20617. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  20618. // unconditionally include in API requests. By default, fields with
  20619. // empty values are omitted from API requests. However, any non-pointer,
  20620. // non-interface field appearing in ForceSendFields will be sent to the
  20621. // server regardless of whether the field is empty or not. This may be
  20622. // used to include empty fields in Patch requests.
  20623. ForceSendFields []string `json:"-"`
  20624. // NullFields is a list of field names (e.g. "ExpressionSets") to
  20625. // include in API requests with the JSON null value. By default, fields
  20626. // with empty values are omitted from API requests. However, any field
  20627. // with an empty value appearing in NullFields will be sent to the
  20628. // server as null. It is an error if a field in this list has a
  20629. // non-empty value. This may be used to include null fields in Patch
  20630. // requests.
  20631. NullFields []string `json:"-"`
  20632. }
  20633. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  20634. type NoMethod PreconfiguredWafSet
  20635. raw := NoMethod(*s)
  20636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20637. }
  20638. // PreservedState: Preserved state for a given instance.
  20639. type PreservedState struct {
  20640. // Disks: Preserved disks defined for this instance. This map is keyed
  20641. // with the device names of the disks.
  20642. Disks map[string]PreservedStatePreservedDisk `json:"disks,omitempty"`
  20643. // Metadata: Preserved metadata defined for this instance.
  20644. Metadata map[string]string `json:"metadata,omitempty"`
  20645. // ForceSendFields is a list of field names (e.g. "Disks") to
  20646. // unconditionally include in API requests. By default, fields with
  20647. // empty values are omitted from API requests. However, any non-pointer,
  20648. // non-interface field appearing in ForceSendFields will be sent to the
  20649. // server regardless of whether the field is empty or not. This may be
  20650. // used to include empty fields in Patch requests.
  20651. ForceSendFields []string `json:"-"`
  20652. // NullFields is a list of field names (e.g. "Disks") to include in API
  20653. // requests with the JSON null value. By default, fields with empty
  20654. // values are omitted from API requests. However, any field with an
  20655. // empty value appearing in NullFields will be sent to the server as
  20656. // null. It is an error if a field in this list has a non-empty value.
  20657. // This may be used to include null fields in Patch requests.
  20658. NullFields []string `json:"-"`
  20659. }
  20660. func (s *PreservedState) MarshalJSON() ([]byte, error) {
  20661. type NoMethod PreservedState
  20662. raw := NoMethod(*s)
  20663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20664. }
  20665. type PreservedStatePreservedDisk struct {
  20666. // AutoDelete: These stateful disks will never be deleted during
  20667. // autohealing, update, instance recreate operations. This flag is used
  20668. // to configure if the disk should be deleted after it is no longer used
  20669. // by the group, e.g. when the given instance or the whole MIG is
  20670. // deleted. Note: disks attached in READ_ONLY mode cannot be
  20671. // auto-deleted.
  20672. //
  20673. // Possible values:
  20674. // "NEVER"
  20675. // "WHEN_NOT_IN_USE"
  20676. AutoDelete string `json:"autoDelete,omitempty"`
  20677. // Mode: The mode in which to attach this disk, either READ_WRITE or
  20678. // READ_ONLY. If not specified, the default is to attach the disk in
  20679. // READ_WRITE mode.
  20680. //
  20681. // Possible values:
  20682. // "READ_ONLY"
  20683. // "READ_WRITE"
  20684. Mode string `json:"mode,omitempty"`
  20685. // Source: The URL of the disk resource that is stateful and should be
  20686. // attached to the VM instance.
  20687. Source string `json:"source,omitempty"`
  20688. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  20689. // unconditionally include in API requests. By default, fields with
  20690. // empty values are omitted from API requests. However, any non-pointer,
  20691. // non-interface field appearing in ForceSendFields will be sent to the
  20692. // server regardless of whether the field is empty or not. This may be
  20693. // used to include empty fields in Patch requests.
  20694. ForceSendFields []string `json:"-"`
  20695. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  20696. // API requests with the JSON null value. By default, fields with empty
  20697. // values are omitted from API requests. However, any field with an
  20698. // empty value appearing in NullFields will be sent to the server as
  20699. // null. It is an error if a field in this list has a non-empty value.
  20700. // This may be used to include null fields in Patch requests.
  20701. NullFields []string `json:"-"`
  20702. }
  20703. func (s *PreservedStatePreservedDisk) MarshalJSON() ([]byte, error) {
  20704. type NoMethod PreservedStatePreservedDisk
  20705. raw := NoMethod(*s)
  20706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20707. }
  20708. // Project: A Project resource. For an overview of projects, see Cloud
  20709. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  20710. // resource_for beta.projects ==)
  20711. type Project struct {
  20712. // CommonInstanceMetadata: Metadata key/value pairs available to all
  20713. // instances contained in this project. See Custom metadata for more
  20714. // information.
  20715. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  20716. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20717. // format.
  20718. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20719. // DefaultNetworkTier: This signifies the default network tier used for
  20720. // configuring resources of the project and can only take the following
  20721. // values: PREMIUM, STANDARD. Initially the default network tier is
  20722. // PREMIUM.
  20723. //
  20724. // Possible values:
  20725. // "PREMIUM"
  20726. // "SELECT"
  20727. // "STANDARD"
  20728. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  20729. // DefaultServiceAccount: [Output Only] Default service account used by
  20730. // VMs running in this project.
  20731. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  20732. // Description: An optional textual description of the resource.
  20733. Description string `json:"description,omitempty"`
  20734. // EnabledFeatures: Restricted features enabled for use on this project.
  20735. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  20736. // Id: [Output Only] The unique identifier for the resource. This
  20737. // identifier is defined by the server. This is not the project ID, and
  20738. // is just a unique ID used by Compute Engine to identify resources.
  20739. Id uint64 `json:"id,omitempty,string"`
  20740. // Kind: [Output Only] Type of the resource. Always compute#project for
  20741. // projects.
  20742. Kind string `json:"kind,omitempty"`
  20743. // Name: The project ID. For example: my-example-project. Use the
  20744. // project ID to make requests to Compute Engine.
  20745. Name string `json:"name,omitempty"`
  20746. // Quotas: [Output Only] Quotas assigned to this project.
  20747. Quotas []*Quota `json:"quotas,omitempty"`
  20748. // SelfLink: [Output Only] Server-defined URL for the resource.
  20749. SelfLink string `json:"selfLink,omitempty"`
  20750. // UsageExportLocation: The naming prefix for daily usage reports and
  20751. // the Google Cloud Storage bucket where they are stored.
  20752. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  20753. // XpnProjectStatus: [Output Only] The role this project has in a shared
  20754. // VPC configuration. Currently only HOST projects are differentiated.
  20755. //
  20756. // Possible values:
  20757. // "HOST"
  20758. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  20759. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  20760. // ServerResponse contains the HTTP response code and headers from the
  20761. // server.
  20762. googleapi.ServerResponse `json:"-"`
  20763. // ForceSendFields is a list of field names (e.g.
  20764. // "CommonInstanceMetadata") to unconditionally include in API requests.
  20765. // By default, fields with empty values are omitted from API requests.
  20766. // However, any non-pointer, non-interface field appearing in
  20767. // ForceSendFields will be sent to the server regardless of whether the
  20768. // field is empty or not. This may be used to include empty fields in
  20769. // Patch requests.
  20770. ForceSendFields []string `json:"-"`
  20771. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  20772. // to include in API requests with the JSON null value. By default,
  20773. // fields with empty values are omitted from API requests. However, any
  20774. // field with an empty value appearing in NullFields will be sent to the
  20775. // server as null. It is an error if a field in this list has a
  20776. // non-empty value. This may be used to include null fields in Patch
  20777. // requests.
  20778. NullFields []string `json:"-"`
  20779. }
  20780. func (s *Project) MarshalJSON() ([]byte, error) {
  20781. type NoMethod Project
  20782. raw := NoMethod(*s)
  20783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20784. }
  20785. type ProjectsDisableXpnResourceRequest struct {
  20786. // XpnResource: Service resource (a.k.a service project) ID.
  20787. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  20788. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  20789. // unconditionally include in API requests. By default, fields with
  20790. // empty values are omitted from API requests. However, any non-pointer,
  20791. // non-interface field appearing in ForceSendFields will be sent to the
  20792. // server regardless of whether the field is empty or not. This may be
  20793. // used to include empty fields in Patch requests.
  20794. ForceSendFields []string `json:"-"`
  20795. // NullFields is a list of field names (e.g. "XpnResource") to include
  20796. // in API requests with the JSON null value. By default, fields with
  20797. // empty values are omitted from API requests. However, any field with
  20798. // an empty value appearing in NullFields will be sent to the server as
  20799. // null. It is an error if a field in this list has a non-empty value.
  20800. // This may be used to include null fields in Patch requests.
  20801. NullFields []string `json:"-"`
  20802. }
  20803. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  20804. type NoMethod ProjectsDisableXpnResourceRequest
  20805. raw := NoMethod(*s)
  20806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20807. }
  20808. type ProjectsEnableXpnResourceRequest struct {
  20809. // XpnResource: Service resource (a.k.a service project) ID.
  20810. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  20811. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  20812. // unconditionally include in API requests. By default, fields with
  20813. // empty values are omitted from API requests. However, any non-pointer,
  20814. // non-interface field appearing in ForceSendFields will be sent to the
  20815. // server regardless of whether the field is empty or not. This may be
  20816. // used to include empty fields in Patch requests.
  20817. ForceSendFields []string `json:"-"`
  20818. // NullFields is a list of field names (e.g. "XpnResource") to include
  20819. // in API requests with the JSON null value. By default, fields with
  20820. // empty values are omitted from API requests. However, any field with
  20821. // an empty value appearing in NullFields will be sent to the server as
  20822. // null. It is an error if a field in this list has a non-empty value.
  20823. // This may be used to include null fields in Patch requests.
  20824. NullFields []string `json:"-"`
  20825. }
  20826. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  20827. type NoMethod ProjectsEnableXpnResourceRequest
  20828. raw := NoMethod(*s)
  20829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20830. }
  20831. type ProjectsGetXpnResources struct {
  20832. // Kind: [Output Only] Type of resource. Always
  20833. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  20834. // service projects)
  20835. Kind string `json:"kind,omitempty"`
  20836. // NextPageToken: [Output Only] This token allows you to get the next
  20837. // page of results for list requests. If the number of results is larger
  20838. // than maxResults, use the nextPageToken as a value for the query
  20839. // parameter pageToken in the next list request. Subsequent list
  20840. // requests will have their own nextPageToken to continue paging through
  20841. // the results.
  20842. NextPageToken string `json:"nextPageToken,omitempty"`
  20843. // Resources: Service resources (a.k.a service projects) attached to
  20844. // this project as their shared VPC host.
  20845. Resources []*XpnResourceId `json:"resources,omitempty"`
  20846. // ServerResponse contains the HTTP response code and headers from the
  20847. // server.
  20848. googleapi.ServerResponse `json:"-"`
  20849. // ForceSendFields is a list of field names (e.g. "Kind") to
  20850. // unconditionally include in API requests. By default, fields with
  20851. // empty values are omitted from API requests. However, any non-pointer,
  20852. // non-interface field appearing in ForceSendFields will be sent to the
  20853. // server regardless of whether the field is empty or not. This may be
  20854. // used to include empty fields in Patch requests.
  20855. ForceSendFields []string `json:"-"`
  20856. // NullFields is a list of field names (e.g. "Kind") to include in API
  20857. // requests with the JSON null value. By default, fields with empty
  20858. // values are omitted from API requests. However, any field with an
  20859. // empty value appearing in NullFields will be sent to the server as
  20860. // null. It is an error if a field in this list has a non-empty value.
  20861. // This may be used to include null fields in Patch requests.
  20862. NullFields []string `json:"-"`
  20863. }
  20864. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  20865. type NoMethod ProjectsGetXpnResources
  20866. raw := NoMethod(*s)
  20867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20868. }
  20869. type ProjectsListXpnHostsRequest struct {
  20870. // Organization: Optional organization ID managed by Cloud Resource
  20871. // Manager, for which to list shared VPC host projects. If not
  20872. // specified, the organization will be inferred from the project.
  20873. Organization string `json:"organization,omitempty"`
  20874. // ForceSendFields is a list of field names (e.g. "Organization") to
  20875. // unconditionally include in API requests. By default, fields with
  20876. // empty values are omitted from API requests. However, any non-pointer,
  20877. // non-interface field appearing in ForceSendFields will be sent to the
  20878. // server regardless of whether the field is empty or not. This may be
  20879. // used to include empty fields in Patch requests.
  20880. ForceSendFields []string `json:"-"`
  20881. // NullFields is a list of field names (e.g. "Organization") to include
  20882. // in API requests with the JSON null value. By default, fields with
  20883. // empty values are omitted from API requests. However, any field with
  20884. // an empty value appearing in NullFields will be sent to the server as
  20885. // null. It is an error if a field in this list has a non-empty value.
  20886. // This may be used to include null fields in Patch requests.
  20887. NullFields []string `json:"-"`
  20888. }
  20889. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  20890. type NoMethod ProjectsListXpnHostsRequest
  20891. raw := NoMethod(*s)
  20892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20893. }
  20894. type ProjectsSetDefaultNetworkTierRequest struct {
  20895. // NetworkTier: Default network tier to be set.
  20896. //
  20897. // Possible values:
  20898. // "PREMIUM"
  20899. // "SELECT"
  20900. // "STANDARD"
  20901. NetworkTier string `json:"networkTier,omitempty"`
  20902. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  20903. // unconditionally include in API requests. By default, fields with
  20904. // empty values are omitted from API requests. However, any non-pointer,
  20905. // non-interface field appearing in ForceSendFields will be sent to the
  20906. // server regardless of whether the field is empty or not. This may be
  20907. // used to include empty fields in Patch requests.
  20908. ForceSendFields []string `json:"-"`
  20909. // NullFields is a list of field names (e.g. "NetworkTier") to include
  20910. // in API requests with the JSON null value. By default, fields with
  20911. // empty values are omitted from API requests. However, any field with
  20912. // an empty value appearing in NullFields will be sent to the server as
  20913. // null. It is an error if a field in this list has a non-empty value.
  20914. // This may be used to include null fields in Patch requests.
  20915. NullFields []string `json:"-"`
  20916. }
  20917. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  20918. type NoMethod ProjectsSetDefaultNetworkTierRequest
  20919. raw := NoMethod(*s)
  20920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20921. }
  20922. type ProjectsSetDefaultServiceAccountRequest struct {
  20923. // Email: Email address of the service account.
  20924. Email string `json:"email,omitempty"`
  20925. // ForceSendFields is a list of field names (e.g. "Email") 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. "Email") 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 *ProjectsSetDefaultServiceAccountRequest) MarshalJSON() ([]byte, error) {
  20941. type NoMethod ProjectsSetDefaultServiceAccountRequest
  20942. raw := NoMethod(*s)
  20943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20944. }
  20945. // Quota: A quotas entry.
  20946. type Quota struct {
  20947. // Limit: [Output Only] Quota limit for this metric.
  20948. Limit float64 `json:"limit,omitempty"`
  20949. // Metric: [Output Only] Name of the quota metric.
  20950. //
  20951. // Possible values:
  20952. // "AMD_S9300_GPUS"
  20953. // "AUTOSCALERS"
  20954. // "BACKEND_BUCKETS"
  20955. // "BACKEND_SERVICES"
  20956. // "COMMITMENTS"
  20957. // "CPUS"
  20958. // "CPUS_ALL_REGIONS"
  20959. // "DISKS_TOTAL_GB"
  20960. // "FIREWALLS"
  20961. // "FORWARDING_RULES"
  20962. // "GLOBAL_INTERNAL_ADDRESSES"
  20963. // "GPUS_ALL_REGIONS"
  20964. // "HEALTH_CHECKS"
  20965. // "IMAGES"
  20966. // "INSTANCES"
  20967. // "INSTANCE_GROUPS"
  20968. // "INSTANCE_GROUP_MANAGERS"
  20969. // "INSTANCE_TEMPLATES"
  20970. // "INTERCONNECTS"
  20971. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  20972. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  20973. // "INTERNAL_ADDRESSES"
  20974. // "IN_USE_ADDRESSES"
  20975. // "IN_USE_BACKUP_SCHEDULES"
  20976. // "IN_USE_MAINTENANCE_WINDOWS"
  20977. // "LOCAL_SSD_TOTAL_GB"
  20978. // "MACHINE_IMAGES"
  20979. // "NETWORKS"
  20980. // "NETWORK_ENDPOINT_GROUPS"
  20981. // "NVIDIA_K80_GPUS"
  20982. // "NVIDIA_P100_GPUS"
  20983. // "NVIDIA_P100_VWS_GPUS"
  20984. // "NVIDIA_P4_GPUS"
  20985. // "NVIDIA_P4_VWS_GPUS"
  20986. // "NVIDIA_T4_GPUS"
  20987. // "NVIDIA_T4_VWS_GPUS"
  20988. // "NVIDIA_V100_GPUS"
  20989. // "PREEMPTIBLE_CPUS"
  20990. // "PREEMPTIBLE_LOCAL_SSD_GB"
  20991. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  20992. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  20993. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  20994. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  20995. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  20996. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  20997. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  20998. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  20999. // "PRIVATE_V6_ACCESS_SUBNETWORKS"
  21000. // "REGIONAL_AUTOSCALERS"
  21001. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  21002. // "RESOURCE_POLICIES"
  21003. // "ROUTERS"
  21004. // "ROUTES"
  21005. // "SECURITY_POLICIES"
  21006. // "SECURITY_POLICY_RULES"
  21007. // "SNAPSHOTS"
  21008. // "SSD_TOTAL_GB"
  21009. // "SSL_CERTIFICATES"
  21010. // "STATIC_ADDRESSES"
  21011. // "SUBNETWORKS"
  21012. // "TARGET_HTTPS_PROXIES"
  21013. // "TARGET_HTTP_PROXIES"
  21014. // "TARGET_INSTANCES"
  21015. // "TARGET_POOLS"
  21016. // "TARGET_SSL_PROXIES"
  21017. // "TARGET_TCP_PROXIES"
  21018. // "TARGET_VPN_GATEWAYS"
  21019. // "URL_MAPS"
  21020. // "VPN_GATEWAYS"
  21021. // "VPN_TUNNELS"
  21022. Metric string `json:"metric,omitempty"`
  21023. // Usage: [Output Only] Current usage of this metric.
  21024. Usage float64 `json:"usage,omitempty"`
  21025. // ForceSendFields is a list of field names (e.g. "Limit") to
  21026. // unconditionally include in API requests. By default, fields with
  21027. // empty values are omitted from API requests. However, any non-pointer,
  21028. // non-interface field appearing in ForceSendFields will be sent to the
  21029. // server regardless of whether the field is empty or not. This may be
  21030. // used to include empty fields in Patch requests.
  21031. ForceSendFields []string `json:"-"`
  21032. // NullFields is a list of field names (e.g. "Limit") to include in API
  21033. // requests with the JSON null value. By default, fields with empty
  21034. // values are omitted from API requests. However, any field with an
  21035. // empty value appearing in NullFields will be sent to the server as
  21036. // null. It is an error if a field in this list has a non-empty value.
  21037. // This may be used to include null fields in Patch requests.
  21038. NullFields []string `json:"-"`
  21039. }
  21040. func (s *Quota) MarshalJSON() ([]byte, error) {
  21041. type NoMethod Quota
  21042. raw := NoMethod(*s)
  21043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21044. }
  21045. func (s *Quota) UnmarshalJSON(data []byte) error {
  21046. type NoMethod Quota
  21047. var s1 struct {
  21048. Limit gensupport.JSONFloat64 `json:"limit"`
  21049. Usage gensupport.JSONFloat64 `json:"usage"`
  21050. *NoMethod
  21051. }
  21052. s1.NoMethod = (*NoMethod)(s)
  21053. if err := json.Unmarshal(data, &s1); err != nil {
  21054. return err
  21055. }
  21056. s.Limit = float64(s1.Limit)
  21057. s.Usage = float64(s1.Usage)
  21058. return nil
  21059. }
  21060. // Reference: Represents a reference to a resource.
  21061. type Reference struct {
  21062. // Kind: [Output Only] Type of the resource. Always compute#reference
  21063. // for references.
  21064. Kind string `json:"kind,omitempty"`
  21065. // ReferenceType: A description of the reference type with no implied
  21066. // semantics. Possible values include:
  21067. // - MEMBER_OF
  21068. ReferenceType string `json:"referenceType,omitempty"`
  21069. // Referrer: URL of the resource which refers to the target.
  21070. Referrer string `json:"referrer,omitempty"`
  21071. // Target: URL of the resource to which this reference points.
  21072. Target string `json:"target,omitempty"`
  21073. // ForceSendFields is a list of field names (e.g. "Kind") to
  21074. // unconditionally include in API requests. By default, fields with
  21075. // empty values are omitted from API requests. However, any non-pointer,
  21076. // non-interface field appearing in ForceSendFields will be sent to the
  21077. // server regardless of whether the field is empty or not. This may be
  21078. // used to include empty fields in Patch requests.
  21079. ForceSendFields []string `json:"-"`
  21080. // NullFields is a list of field names (e.g. "Kind") to include in API
  21081. // requests with the JSON null value. By default, fields with empty
  21082. // values are omitted from API requests. However, any field with an
  21083. // empty value appearing in NullFields will be sent to the server as
  21084. // null. It is an error if a field in this list has a non-empty value.
  21085. // This may be used to include null fields in Patch requests.
  21086. NullFields []string `json:"-"`
  21087. }
  21088. func (s *Reference) MarshalJSON() ([]byte, error) {
  21089. type NoMethod Reference
  21090. raw := NoMethod(*s)
  21091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21092. }
  21093. // Region: Region resource. (== resource_for beta.regions ==) (==
  21094. // resource_for v1.regions ==)
  21095. type Region struct {
  21096. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21097. // format.
  21098. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21099. // Deprecated: [Output Only] The deprecation status associated with this
  21100. // region.
  21101. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  21102. // Description: [Output Only] Textual description of the resource.
  21103. Description string `json:"description,omitempty"`
  21104. // Id: [Output Only] The unique identifier for the resource. This
  21105. // identifier is defined by the server.
  21106. Id uint64 `json:"id,omitempty,string"`
  21107. // Kind: [Output Only] Type of the resource. Always compute#region for
  21108. // regions.
  21109. Kind string `json:"kind,omitempty"`
  21110. // Name: [Output Only] Name of the resource.
  21111. Name string `json:"name,omitempty"`
  21112. // Quotas: [Output Only] Quotas assigned to this region.
  21113. Quotas []*Quota `json:"quotas,omitempty"`
  21114. // SelfLink: [Output Only] Server-defined URL for the resource.
  21115. SelfLink string `json:"selfLink,omitempty"`
  21116. // Status: [Output Only] Status of the region, either UP or DOWN.
  21117. //
  21118. // Possible values:
  21119. // "DOWN"
  21120. // "UP"
  21121. Status string `json:"status,omitempty"`
  21122. // Zones: [Output Only] A list of zones available in this region, in the
  21123. // form of resource URLs.
  21124. Zones []string `json:"zones,omitempty"`
  21125. // ServerResponse contains the HTTP response code and headers from the
  21126. // server.
  21127. googleapi.ServerResponse `json:"-"`
  21128. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21129. // to unconditionally include in API requests. By default, fields with
  21130. // empty values are omitted from API requests. However, any non-pointer,
  21131. // non-interface field appearing in ForceSendFields will be sent to the
  21132. // server regardless of whether the field is empty or not. This may be
  21133. // used to include empty fields in Patch requests.
  21134. ForceSendFields []string `json:"-"`
  21135. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21136. // include in API requests with the JSON null value. By default, fields
  21137. // with empty values are omitted from API requests. However, any field
  21138. // with an empty value appearing in NullFields will be sent to the
  21139. // server as null. It is an error if a field in this list has a
  21140. // non-empty value. This may be used to include null fields in Patch
  21141. // requests.
  21142. NullFields []string `json:"-"`
  21143. }
  21144. func (s *Region) MarshalJSON() ([]byte, error) {
  21145. type NoMethod Region
  21146. raw := NoMethod(*s)
  21147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21148. }
  21149. // RegionAutoscalerList: Contains a list of autoscalers.
  21150. type RegionAutoscalerList struct {
  21151. // Id: [Output Only] Unique identifier for the resource; defined by the
  21152. // server.
  21153. Id string `json:"id,omitempty"`
  21154. // Items: A list of Autoscaler resources.
  21155. Items []*Autoscaler `json:"items,omitempty"`
  21156. // Kind: Type of resource.
  21157. Kind string `json:"kind,omitempty"`
  21158. // NextPageToken: [Output Only] This token allows you to get the next
  21159. // page of results for list requests. If the number of results is larger
  21160. // than maxResults, use the nextPageToken as a value for the query
  21161. // parameter pageToken in the next list request. Subsequent list
  21162. // requests will have their own nextPageToken to continue paging through
  21163. // the results.
  21164. NextPageToken string `json:"nextPageToken,omitempty"`
  21165. // SelfLink: [Output Only] Server-defined URL for this resource.
  21166. SelfLink string `json:"selfLink,omitempty"`
  21167. // Warning: [Output Only] Informational warning message.
  21168. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  21169. // ServerResponse contains the HTTP response code and headers from the
  21170. // server.
  21171. googleapi.ServerResponse `json:"-"`
  21172. // ForceSendFields is a list of field names (e.g. "Id") to
  21173. // unconditionally include in API requests. By default, fields with
  21174. // empty values are omitted from API requests. However, any non-pointer,
  21175. // non-interface field appearing in ForceSendFields will be sent to the
  21176. // server regardless of whether the field is empty or not. This may be
  21177. // used to include empty fields in Patch requests.
  21178. ForceSendFields []string `json:"-"`
  21179. // NullFields is a list of field names (e.g. "Id") to include in API
  21180. // requests with the JSON null value. By default, fields with empty
  21181. // values are omitted from API requests. However, any field with an
  21182. // empty value appearing in NullFields will be sent to the server as
  21183. // null. It is an error if a field in this list has a non-empty value.
  21184. // This may be used to include null fields in Patch requests.
  21185. NullFields []string `json:"-"`
  21186. }
  21187. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  21188. type NoMethod RegionAutoscalerList
  21189. raw := NoMethod(*s)
  21190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21191. }
  21192. // RegionAutoscalerListWarning: [Output Only] Informational warning
  21193. // message.
  21194. type RegionAutoscalerListWarning struct {
  21195. // Code: [Output Only] A warning code, if applicable. For example,
  21196. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21197. // the response.
  21198. //
  21199. // Possible values:
  21200. // "CLEANUP_FAILED"
  21201. // "DEPRECATED_RESOURCE_USED"
  21202. // "DEPRECATED_TYPE_USED"
  21203. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21204. // "EXPERIMENTAL_TYPE_USED"
  21205. // "EXTERNAL_API_WARNING"
  21206. // "FIELD_VALUE_OVERRIDEN"
  21207. // "INJECTED_KERNELS_DEPRECATED"
  21208. // "MISSING_TYPE_DEPENDENCY"
  21209. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21210. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21211. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21212. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21213. // "NEXT_HOP_NOT_RUNNING"
  21214. // "NOT_CRITICAL_ERROR"
  21215. // "NO_RESULTS_ON_PAGE"
  21216. // "REQUIRED_TOS_AGREEMENT"
  21217. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21218. // "RESOURCE_NOT_DELETED"
  21219. // "SCHEMA_VALIDATION_IGNORED"
  21220. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21221. // "UNDECLARED_PROPERTIES"
  21222. // "UNREACHABLE"
  21223. Code string `json:"code,omitempty"`
  21224. // Data: [Output Only] Metadata about this warning in key: value format.
  21225. // For example:
  21226. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21227. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  21228. // Message: [Output Only] A human-readable description of the warning
  21229. // code.
  21230. Message string `json:"message,omitempty"`
  21231. // ForceSendFields is a list of field names (e.g. "Code") to
  21232. // unconditionally include in API requests. By default, fields with
  21233. // empty values are omitted from API requests. However, any non-pointer,
  21234. // non-interface field appearing in ForceSendFields will be sent to the
  21235. // server regardless of whether the field is empty or not. This may be
  21236. // used to include empty fields in Patch requests.
  21237. ForceSendFields []string `json:"-"`
  21238. // NullFields is a list of field names (e.g. "Code") to include in API
  21239. // requests with the JSON null value. By default, fields with empty
  21240. // values are omitted from API requests. However, any field with an
  21241. // empty value appearing in NullFields will be sent to the server as
  21242. // null. It is an error if a field in this list has a non-empty value.
  21243. // This may be used to include null fields in Patch requests.
  21244. NullFields []string `json:"-"`
  21245. }
  21246. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  21247. type NoMethod RegionAutoscalerListWarning
  21248. raw := NoMethod(*s)
  21249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21250. }
  21251. type RegionAutoscalerListWarningData struct {
  21252. // Key: [Output Only] A key that provides more detail on the warning
  21253. // being returned. For example, for warnings where there are no results
  21254. // in a list request for a particular zone, this key might be scope and
  21255. // the key value might be the zone name. Other examples might be a key
  21256. // indicating a deprecated resource and a suggested replacement, or a
  21257. // warning about invalid network settings (for example, if an instance
  21258. // attempts to perform IP forwarding but is not enabled for IP
  21259. // forwarding).
  21260. Key string `json:"key,omitempty"`
  21261. // Value: [Output Only] A warning data value corresponding to the key.
  21262. Value string `json:"value,omitempty"`
  21263. // ForceSendFields is a list of field names (e.g. "Key") to
  21264. // unconditionally include in API requests. By default, fields with
  21265. // empty values are omitted from API requests. However, any non-pointer,
  21266. // non-interface field appearing in ForceSendFields will be sent to the
  21267. // server regardless of whether the field is empty or not. This may be
  21268. // used to include empty fields in Patch requests.
  21269. ForceSendFields []string `json:"-"`
  21270. // NullFields is a list of field names (e.g. "Key") to include in API
  21271. // requests with the JSON null value. By default, fields with empty
  21272. // values are omitted from API requests. However, any field with an
  21273. // empty value appearing in NullFields will be sent to the server as
  21274. // null. It is an error if a field in this list has a non-empty value.
  21275. // This may be used to include null fields in Patch requests.
  21276. NullFields []string `json:"-"`
  21277. }
  21278. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  21279. type NoMethod RegionAutoscalerListWarningData
  21280. raw := NoMethod(*s)
  21281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21282. }
  21283. type RegionDiskTypeList struct {
  21284. // Id: [Output Only] Unique identifier for the resource; defined by the
  21285. // server.
  21286. Id string `json:"id,omitempty"`
  21287. // Items: A list of DiskType resources.
  21288. Items []*DiskType `json:"items,omitempty"`
  21289. // Kind: [Output Only] Type of resource. Always
  21290. // compute#regionDiskTypeList for region disk types.
  21291. Kind string `json:"kind,omitempty"`
  21292. // NextPageToken: [Output Only] This token allows you to get the next
  21293. // page of results for list requests. If the number of results is larger
  21294. // than maxResults, use the nextPageToken as a value for the query
  21295. // parameter pageToken in the next list request. Subsequent list
  21296. // requests will have their own nextPageToken to continue paging through
  21297. // the results.
  21298. NextPageToken string `json:"nextPageToken,omitempty"`
  21299. // SelfLink: [Output Only] Server-defined URL for this resource.
  21300. SelfLink string `json:"selfLink,omitempty"`
  21301. // Warning: [Output Only] Informational warning message.
  21302. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  21303. // ServerResponse contains the HTTP response code and headers from the
  21304. // server.
  21305. googleapi.ServerResponse `json:"-"`
  21306. // ForceSendFields is a list of field names (e.g. "Id") to
  21307. // unconditionally include in API requests. By default, fields with
  21308. // empty values are omitted from API requests. However, any non-pointer,
  21309. // non-interface field appearing in ForceSendFields will be sent to the
  21310. // server regardless of whether the field is empty or not. This may be
  21311. // used to include empty fields in Patch requests.
  21312. ForceSendFields []string `json:"-"`
  21313. // NullFields is a list of field names (e.g. "Id") to include in API
  21314. // requests with the JSON null value. By default, fields with empty
  21315. // values are omitted from API requests. However, any field with an
  21316. // empty value appearing in NullFields will be sent to the server as
  21317. // null. It is an error if a field in this list has a non-empty value.
  21318. // This may be used to include null fields in Patch requests.
  21319. NullFields []string `json:"-"`
  21320. }
  21321. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  21322. type NoMethod RegionDiskTypeList
  21323. raw := NoMethod(*s)
  21324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21325. }
  21326. // RegionDiskTypeListWarning: [Output Only] Informational warning
  21327. // message.
  21328. type RegionDiskTypeListWarning struct {
  21329. // Code: [Output Only] A warning code, if applicable. For example,
  21330. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21331. // the response.
  21332. //
  21333. // Possible values:
  21334. // "CLEANUP_FAILED"
  21335. // "DEPRECATED_RESOURCE_USED"
  21336. // "DEPRECATED_TYPE_USED"
  21337. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21338. // "EXPERIMENTAL_TYPE_USED"
  21339. // "EXTERNAL_API_WARNING"
  21340. // "FIELD_VALUE_OVERRIDEN"
  21341. // "INJECTED_KERNELS_DEPRECATED"
  21342. // "MISSING_TYPE_DEPENDENCY"
  21343. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21344. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21345. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21346. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21347. // "NEXT_HOP_NOT_RUNNING"
  21348. // "NOT_CRITICAL_ERROR"
  21349. // "NO_RESULTS_ON_PAGE"
  21350. // "REQUIRED_TOS_AGREEMENT"
  21351. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21352. // "RESOURCE_NOT_DELETED"
  21353. // "SCHEMA_VALIDATION_IGNORED"
  21354. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21355. // "UNDECLARED_PROPERTIES"
  21356. // "UNREACHABLE"
  21357. Code string `json:"code,omitempty"`
  21358. // Data: [Output Only] Metadata about this warning in key: value format.
  21359. // For example:
  21360. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21361. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  21362. // Message: [Output Only] A human-readable description of the warning
  21363. // code.
  21364. Message string `json:"message,omitempty"`
  21365. // ForceSendFields is a list of field names (e.g. "Code") to
  21366. // unconditionally include in API requests. By default, fields with
  21367. // empty values are omitted from API requests. However, any non-pointer,
  21368. // non-interface field appearing in ForceSendFields will be sent to the
  21369. // server regardless of whether the field is empty or not. This may be
  21370. // used to include empty fields in Patch requests.
  21371. ForceSendFields []string `json:"-"`
  21372. // NullFields is a list of field names (e.g. "Code") to include in API
  21373. // requests with the JSON null value. By default, fields with empty
  21374. // values are omitted from API requests. However, any field with an
  21375. // empty value appearing in NullFields will be sent to the server as
  21376. // null. It is an error if a field in this list has a non-empty value.
  21377. // This may be used to include null fields in Patch requests.
  21378. NullFields []string `json:"-"`
  21379. }
  21380. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  21381. type NoMethod RegionDiskTypeListWarning
  21382. raw := NoMethod(*s)
  21383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21384. }
  21385. type RegionDiskTypeListWarningData struct {
  21386. // Key: [Output Only] A key that provides more detail on the warning
  21387. // being returned. For example, for warnings where there are no results
  21388. // in a list request for a particular zone, this key might be scope and
  21389. // the key value might be the zone name. Other examples might be a key
  21390. // indicating a deprecated resource and a suggested replacement, or a
  21391. // warning about invalid network settings (for example, if an instance
  21392. // attempts to perform IP forwarding but is not enabled for IP
  21393. // forwarding).
  21394. Key string `json:"key,omitempty"`
  21395. // Value: [Output Only] A warning data value corresponding to the key.
  21396. Value string `json:"value,omitempty"`
  21397. // ForceSendFields is a list of field names (e.g. "Key") to
  21398. // unconditionally include in API requests. By default, fields with
  21399. // empty values are omitted from API requests. However, any non-pointer,
  21400. // non-interface field appearing in ForceSendFields will be sent to the
  21401. // server regardless of whether the field is empty or not. This may be
  21402. // used to include empty fields in Patch requests.
  21403. ForceSendFields []string `json:"-"`
  21404. // NullFields is a list of field names (e.g. "Key") to include in API
  21405. // requests with the JSON null value. By default, fields with empty
  21406. // values are omitted from API requests. However, any field with an
  21407. // empty value appearing in NullFields will be sent to the server as
  21408. // null. It is an error if a field in this list has a non-empty value.
  21409. // This may be used to include null fields in Patch requests.
  21410. NullFields []string `json:"-"`
  21411. }
  21412. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  21413. type NoMethod RegionDiskTypeListWarningData
  21414. raw := NoMethod(*s)
  21415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21416. }
  21417. type RegionDisksAddResourcePoliciesRequest struct {
  21418. // ResourcePolicies: Resource policies to be added to this disk.
  21419. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  21420. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  21421. // unconditionally include in API requests. By default, fields with
  21422. // empty values are omitted from API requests. However, any non-pointer,
  21423. // non-interface field appearing in ForceSendFields will be sent to the
  21424. // server regardless of whether the field is empty or not. This may be
  21425. // used to include empty fields in Patch requests.
  21426. ForceSendFields []string `json:"-"`
  21427. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  21428. // include in API requests with the JSON null value. By default, fields
  21429. // with empty values are omitted from API requests. However, any field
  21430. // with an empty value appearing in NullFields will be sent to the
  21431. // server as null. It is an error if a field in this list has a
  21432. // non-empty value. This may be used to include null fields in Patch
  21433. // requests.
  21434. NullFields []string `json:"-"`
  21435. }
  21436. func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  21437. type NoMethod RegionDisksAddResourcePoliciesRequest
  21438. raw := NoMethod(*s)
  21439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21440. }
  21441. type RegionDisksRemoveResourcePoliciesRequest struct {
  21442. // ResourcePolicies: Resource policies to be removed from this disk.
  21443. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  21444. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  21445. // unconditionally include in API requests. By default, fields with
  21446. // empty values are omitted from API requests. However, any non-pointer,
  21447. // non-interface field appearing in ForceSendFields will be sent to the
  21448. // server regardless of whether the field is empty or not. This may be
  21449. // used to include empty fields in Patch requests.
  21450. ForceSendFields []string `json:"-"`
  21451. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  21452. // include in API requests with the JSON null value. By default, fields
  21453. // with empty values are omitted from API requests. However, any field
  21454. // with an empty value appearing in NullFields will be sent to the
  21455. // server as null. It is an error if a field in this list has a
  21456. // non-empty value. This may be used to include null fields in Patch
  21457. // requests.
  21458. NullFields []string `json:"-"`
  21459. }
  21460. func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  21461. type NoMethod RegionDisksRemoveResourcePoliciesRequest
  21462. raw := NoMethod(*s)
  21463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21464. }
  21465. type RegionDisksResizeRequest struct {
  21466. // SizeGb: The new size of the regional persistent disk, which is
  21467. // specified in GB.
  21468. SizeGb int64 `json:"sizeGb,omitempty,string"`
  21469. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  21470. // unconditionally include in API requests. By default, fields with
  21471. // empty values are omitted from API requests. However, any non-pointer,
  21472. // non-interface field appearing in ForceSendFields will be sent to the
  21473. // server regardless of whether the field is empty or not. This may be
  21474. // used to include empty fields in Patch requests.
  21475. ForceSendFields []string `json:"-"`
  21476. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  21477. // requests with the JSON null value. By default, fields with empty
  21478. // values are omitted from API requests. However, any field with an
  21479. // empty value appearing in NullFields will be sent to the server as
  21480. // null. It is an error if a field in this list has a non-empty value.
  21481. // This may be used to include null fields in Patch requests.
  21482. NullFields []string `json:"-"`
  21483. }
  21484. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  21485. type NoMethod RegionDisksResizeRequest
  21486. raw := NoMethod(*s)
  21487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21488. }
  21489. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  21490. type RegionInstanceGroupList struct {
  21491. // Id: [Output Only] Unique identifier for the resource; defined by the
  21492. // server.
  21493. Id string `json:"id,omitempty"`
  21494. // Items: A list of InstanceGroup resources.
  21495. Items []*InstanceGroup `json:"items,omitempty"`
  21496. // Kind: The resource type.
  21497. Kind string `json:"kind,omitempty"`
  21498. // NextPageToken: [Output Only] This token allows you to get the next
  21499. // page of results for list requests. If the number of results is larger
  21500. // than maxResults, use the nextPageToken as a value for the query
  21501. // parameter pageToken in the next list request. Subsequent list
  21502. // requests will have their own nextPageToken to continue paging through
  21503. // the results.
  21504. NextPageToken string `json:"nextPageToken,omitempty"`
  21505. // SelfLink: [Output Only] Server-defined URL for this resource.
  21506. SelfLink string `json:"selfLink,omitempty"`
  21507. // Warning: [Output Only] Informational warning message.
  21508. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  21509. // ServerResponse contains the HTTP response code and headers from the
  21510. // server.
  21511. googleapi.ServerResponse `json:"-"`
  21512. // ForceSendFields is a list of field names (e.g. "Id") to
  21513. // unconditionally include in API requests. By default, fields with
  21514. // empty values are omitted from API requests. However, any non-pointer,
  21515. // non-interface field appearing in ForceSendFields will be sent to the
  21516. // server regardless of whether the field is empty or not. This may be
  21517. // used to include empty fields in Patch requests.
  21518. ForceSendFields []string `json:"-"`
  21519. // NullFields is a list of field names (e.g. "Id") to include in API
  21520. // requests with the JSON null value. By default, fields with empty
  21521. // values are omitted from API requests. However, any field with an
  21522. // empty value appearing in NullFields will be sent to the server as
  21523. // null. It is an error if a field in this list has a non-empty value.
  21524. // This may be used to include null fields in Patch requests.
  21525. NullFields []string `json:"-"`
  21526. }
  21527. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  21528. type NoMethod RegionInstanceGroupList
  21529. raw := NoMethod(*s)
  21530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21531. }
  21532. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  21533. // message.
  21534. type RegionInstanceGroupListWarning struct {
  21535. // Code: [Output Only] A warning code, if applicable. For example,
  21536. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21537. // the response.
  21538. //
  21539. // Possible values:
  21540. // "CLEANUP_FAILED"
  21541. // "DEPRECATED_RESOURCE_USED"
  21542. // "DEPRECATED_TYPE_USED"
  21543. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21544. // "EXPERIMENTAL_TYPE_USED"
  21545. // "EXTERNAL_API_WARNING"
  21546. // "FIELD_VALUE_OVERRIDEN"
  21547. // "INJECTED_KERNELS_DEPRECATED"
  21548. // "MISSING_TYPE_DEPENDENCY"
  21549. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21550. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21551. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21552. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21553. // "NEXT_HOP_NOT_RUNNING"
  21554. // "NOT_CRITICAL_ERROR"
  21555. // "NO_RESULTS_ON_PAGE"
  21556. // "REQUIRED_TOS_AGREEMENT"
  21557. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21558. // "RESOURCE_NOT_DELETED"
  21559. // "SCHEMA_VALIDATION_IGNORED"
  21560. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21561. // "UNDECLARED_PROPERTIES"
  21562. // "UNREACHABLE"
  21563. Code string `json:"code,omitempty"`
  21564. // Data: [Output Only] Metadata about this warning in key: value format.
  21565. // For example:
  21566. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21567. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  21568. // Message: [Output Only] A human-readable description of the warning
  21569. // code.
  21570. Message string `json:"message,omitempty"`
  21571. // ForceSendFields is a list of field names (e.g. "Code") to
  21572. // unconditionally include in API requests. By default, fields with
  21573. // empty values are omitted from API requests. However, any non-pointer,
  21574. // non-interface field appearing in ForceSendFields will be sent to the
  21575. // server regardless of whether the field is empty or not. This may be
  21576. // used to include empty fields in Patch requests.
  21577. ForceSendFields []string `json:"-"`
  21578. // NullFields is a list of field names (e.g. "Code") to include in API
  21579. // requests with the JSON null value. By default, fields with empty
  21580. // values are omitted from API requests. However, any field with an
  21581. // empty value appearing in NullFields will be sent to the server as
  21582. // null. It is an error if a field in this list has a non-empty value.
  21583. // This may be used to include null fields in Patch requests.
  21584. NullFields []string `json:"-"`
  21585. }
  21586. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  21587. type NoMethod RegionInstanceGroupListWarning
  21588. raw := NoMethod(*s)
  21589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21590. }
  21591. type RegionInstanceGroupListWarningData struct {
  21592. // Key: [Output Only] A key that provides more detail on the warning
  21593. // being returned. For example, for warnings where there are no results
  21594. // in a list request for a particular zone, this key might be scope and
  21595. // the key value might be the zone name. Other examples might be a key
  21596. // indicating a deprecated resource and a suggested replacement, or a
  21597. // warning about invalid network settings (for example, if an instance
  21598. // attempts to perform IP forwarding but is not enabled for IP
  21599. // forwarding).
  21600. Key string `json:"key,omitempty"`
  21601. // Value: [Output Only] A warning data value corresponding to the key.
  21602. Value string `json:"value,omitempty"`
  21603. // ForceSendFields is a list of field names (e.g. "Key") to
  21604. // unconditionally include in API requests. By default, fields with
  21605. // empty values are omitted from API requests. However, any non-pointer,
  21606. // non-interface field appearing in ForceSendFields will be sent to the
  21607. // server regardless of whether the field is empty or not. This may be
  21608. // used to include empty fields in Patch requests.
  21609. ForceSendFields []string `json:"-"`
  21610. // NullFields is a list of field names (e.g. "Key") to include in API
  21611. // requests with the JSON null value. By default, fields with empty
  21612. // values are omitted from API requests. However, any field with an
  21613. // empty value appearing in NullFields will be sent to the server as
  21614. // null. It is an error if a field in this list has a non-empty value.
  21615. // This may be used to include null fields in Patch requests.
  21616. NullFields []string `json:"-"`
  21617. }
  21618. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  21619. type NoMethod RegionInstanceGroupListWarningData
  21620. raw := NoMethod(*s)
  21621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21622. }
  21623. // RegionInstanceGroupManagerDeleteInstanceConfigReq:
  21624. // RegionInstanceGroupManagers.deletePerInstanceConfigs
  21625. type RegionInstanceGroupManagerDeleteInstanceConfigReq struct {
  21626. // Instances: The list of instances for which we want to delete
  21627. // per-instance configs on this managed instance group.
  21628. Instances []string `json:"instances,omitempty"`
  21629. // Names: The list of instance names for which we want to delete
  21630. // per-instance configs on this managed instance group.
  21631. Names []string `json:"names,omitempty"`
  21632. // ForceSendFields is a list of field names (e.g. "Instances") to
  21633. // unconditionally include in API requests. By default, fields with
  21634. // empty values are omitted from API requests. However, any non-pointer,
  21635. // non-interface field appearing in ForceSendFields will be sent to the
  21636. // server regardless of whether the field is empty or not. This may be
  21637. // used to include empty fields in Patch requests.
  21638. ForceSendFields []string `json:"-"`
  21639. // NullFields is a list of field names (e.g. "Instances") to include in
  21640. // API requests with the JSON null value. By default, fields with empty
  21641. // values are omitted from API requests. However, any field with an
  21642. // empty value appearing in NullFields will be sent to the server as
  21643. // null. It is an error if a field in this list has a non-empty value.
  21644. // This may be used to include null fields in Patch requests.
  21645. NullFields []string `json:"-"`
  21646. }
  21647. func (s *RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
  21648. type NoMethod RegionInstanceGroupManagerDeleteInstanceConfigReq
  21649. raw := NoMethod(*s)
  21650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21651. }
  21652. // RegionInstanceGroupManagerList: Contains a list of managed instance
  21653. // groups.
  21654. type RegionInstanceGroupManagerList struct {
  21655. // Id: [Output Only] Unique identifier for the resource; defined by the
  21656. // server.
  21657. Id string `json:"id,omitempty"`
  21658. // Items: A list of InstanceGroupManager resources.
  21659. Items []*InstanceGroupManager `json:"items,omitempty"`
  21660. // Kind: [Output Only] The resource type, which is always
  21661. // compute#instanceGroupManagerList for a list of managed instance
  21662. // groups that exist in th regional scope.
  21663. Kind string `json:"kind,omitempty"`
  21664. // NextPageToken: [Output Only] This token allows you to get the next
  21665. // page of results for list requests. If the number of results is larger
  21666. // than maxResults, use the nextPageToken as a value for the query
  21667. // parameter pageToken in the next list request. Subsequent list
  21668. // requests will have their own nextPageToken to continue paging through
  21669. // the results.
  21670. NextPageToken string `json:"nextPageToken,omitempty"`
  21671. // SelfLink: [Output Only] Server-defined URL for this resource.
  21672. SelfLink string `json:"selfLink,omitempty"`
  21673. // Warning: [Output Only] Informational warning message.
  21674. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  21675. // ServerResponse contains the HTTP response code and headers from the
  21676. // server.
  21677. googleapi.ServerResponse `json:"-"`
  21678. // ForceSendFields is a list of field names (e.g. "Id") to
  21679. // unconditionally include in API requests. By default, fields with
  21680. // empty values are omitted from API requests. However, any non-pointer,
  21681. // non-interface field appearing in ForceSendFields will be sent to the
  21682. // server regardless of whether the field is empty or not. This may be
  21683. // used to include empty fields in Patch requests.
  21684. ForceSendFields []string `json:"-"`
  21685. // NullFields is a list of field names (e.g. "Id") to include in API
  21686. // requests with the JSON null value. By default, fields with empty
  21687. // values are omitted from API requests. However, any field with an
  21688. // empty value appearing in NullFields will be sent to the server as
  21689. // null. It is an error if a field in this list has a non-empty value.
  21690. // This may be used to include null fields in Patch requests.
  21691. NullFields []string `json:"-"`
  21692. }
  21693. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  21694. type NoMethod RegionInstanceGroupManagerList
  21695. raw := NoMethod(*s)
  21696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21697. }
  21698. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  21699. // warning message.
  21700. type RegionInstanceGroupManagerListWarning struct {
  21701. // Code: [Output Only] A warning code, if applicable. For example,
  21702. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21703. // the response.
  21704. //
  21705. // Possible values:
  21706. // "CLEANUP_FAILED"
  21707. // "DEPRECATED_RESOURCE_USED"
  21708. // "DEPRECATED_TYPE_USED"
  21709. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21710. // "EXPERIMENTAL_TYPE_USED"
  21711. // "EXTERNAL_API_WARNING"
  21712. // "FIELD_VALUE_OVERRIDEN"
  21713. // "INJECTED_KERNELS_DEPRECATED"
  21714. // "MISSING_TYPE_DEPENDENCY"
  21715. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21716. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21717. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21718. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21719. // "NEXT_HOP_NOT_RUNNING"
  21720. // "NOT_CRITICAL_ERROR"
  21721. // "NO_RESULTS_ON_PAGE"
  21722. // "REQUIRED_TOS_AGREEMENT"
  21723. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21724. // "RESOURCE_NOT_DELETED"
  21725. // "SCHEMA_VALIDATION_IGNORED"
  21726. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21727. // "UNDECLARED_PROPERTIES"
  21728. // "UNREACHABLE"
  21729. Code string `json:"code,omitempty"`
  21730. // Data: [Output Only] Metadata about this warning in key: value format.
  21731. // For example:
  21732. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21733. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  21734. // Message: [Output Only] A human-readable description of the warning
  21735. // code.
  21736. Message string `json:"message,omitempty"`
  21737. // ForceSendFields is a list of field names (e.g. "Code") to
  21738. // unconditionally include in API requests. By default, fields with
  21739. // empty values are omitted from API requests. However, any non-pointer,
  21740. // non-interface field appearing in ForceSendFields will be sent to the
  21741. // server regardless of whether the field is empty or not. This may be
  21742. // used to include empty fields in Patch requests.
  21743. ForceSendFields []string `json:"-"`
  21744. // NullFields is a list of field names (e.g. "Code") to include in API
  21745. // requests with the JSON null value. By default, fields with empty
  21746. // values are omitted from API requests. However, any field with an
  21747. // empty value appearing in NullFields will be sent to the server as
  21748. // null. It is an error if a field in this list has a non-empty value.
  21749. // This may be used to include null fields in Patch requests.
  21750. NullFields []string `json:"-"`
  21751. }
  21752. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  21753. type NoMethod RegionInstanceGroupManagerListWarning
  21754. raw := NoMethod(*s)
  21755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21756. }
  21757. type RegionInstanceGroupManagerListWarningData struct {
  21758. // Key: [Output Only] A key that provides more detail on the warning
  21759. // being returned. For example, for warnings where there are no results
  21760. // in a list request for a particular zone, this key might be scope and
  21761. // the key value might be the zone name. Other examples might be a key
  21762. // indicating a deprecated resource and a suggested replacement, or a
  21763. // warning about invalid network settings (for example, if an instance
  21764. // attempts to perform IP forwarding but is not enabled for IP
  21765. // forwarding).
  21766. Key string `json:"key,omitempty"`
  21767. // Value: [Output Only] A warning data value corresponding to the key.
  21768. Value string `json:"value,omitempty"`
  21769. // ForceSendFields is a list of field names (e.g. "Key") to
  21770. // unconditionally include in API requests. By default, fields with
  21771. // empty values are omitted from API requests. However, any non-pointer,
  21772. // non-interface field appearing in ForceSendFields will be sent to the
  21773. // server regardless of whether the field is empty or not. This may be
  21774. // used to include empty fields in Patch requests.
  21775. ForceSendFields []string `json:"-"`
  21776. // NullFields is a list of field names (e.g. "Key") to include in API
  21777. // requests with the JSON null value. By default, fields with empty
  21778. // values are omitted from API requests. However, any field with an
  21779. // empty value appearing in NullFields will be sent to the server as
  21780. // null. It is an error if a field in this list has a non-empty value.
  21781. // This may be used to include null fields in Patch requests.
  21782. NullFields []string `json:"-"`
  21783. }
  21784. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  21785. type NoMethod RegionInstanceGroupManagerListWarningData
  21786. raw := NoMethod(*s)
  21787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21788. }
  21789. // RegionInstanceGroupManagerUpdateInstanceConfigReq:
  21790. // RegionInstanceGroupManagers.updatePerInstanceConfigs
  21791. type RegionInstanceGroupManagerUpdateInstanceConfigReq struct {
  21792. // PerInstanceConfigs: The list of per-instance configs to insert or
  21793. // patch on this managed instance group.
  21794. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  21795. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  21796. // to unconditionally include in API requests. By default, fields with
  21797. // empty values are omitted from API requests. However, any non-pointer,
  21798. // non-interface field appearing in ForceSendFields will be sent to the
  21799. // server regardless of whether the field is empty or not. This may be
  21800. // used to include empty fields in Patch requests.
  21801. ForceSendFields []string `json:"-"`
  21802. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  21803. // include in API requests with the JSON null value. By default, fields
  21804. // with empty values are omitted from API requests. However, any field
  21805. // with an empty value appearing in NullFields will be sent to the
  21806. // server as null. It is an error if a field in this list has a
  21807. // non-empty value. This may be used to include null fields in Patch
  21808. // requests.
  21809. NullFields []string `json:"-"`
  21810. }
  21811. func (s *RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
  21812. type NoMethod RegionInstanceGroupManagerUpdateInstanceConfigReq
  21813. raw := NoMethod(*s)
  21814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21815. }
  21816. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  21817. // Instances: The URLs of one or more instances to abandon. This can be
  21818. // a full URL or a partial URL, such as
  21819. // zones/[ZONE]/instances/[INSTANCE_NAME].
  21820. Instances []string `json:"instances,omitempty"`
  21821. // ForceSendFields is a list of field names (e.g. "Instances") to
  21822. // unconditionally include in API requests. By default, fields with
  21823. // empty values are omitted from API requests. However, any non-pointer,
  21824. // non-interface field appearing in ForceSendFields will be sent to the
  21825. // server regardless of whether the field is empty or not. This may be
  21826. // used to include empty fields in Patch requests.
  21827. ForceSendFields []string `json:"-"`
  21828. // NullFields is a list of field names (e.g. "Instances") to include in
  21829. // API requests with the JSON null value. By default, fields with empty
  21830. // values are omitted from API requests. However, any field with an
  21831. // empty value appearing in NullFields will be sent to the server as
  21832. // null. It is an error if a field in this list has a non-empty value.
  21833. // This may be used to include null fields in Patch requests.
  21834. NullFields []string `json:"-"`
  21835. }
  21836. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  21837. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  21838. raw := NoMethod(*s)
  21839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21840. }
  21841. // RegionInstanceGroupManagersApplyUpdatesRequest:
  21842. // InstanceGroupManagers.applyUpdatesToInstances
  21843. type RegionInstanceGroupManagersApplyUpdatesRequest struct {
  21844. // Instances: The list of instances for which we want to apply changes
  21845. // on this managed instance group.
  21846. Instances []string `json:"instances,omitempty"`
  21847. // MaximalAction: The maximal action that should be perfomed on the
  21848. // instances. By default REPLACE.
  21849. //
  21850. // Possible values:
  21851. // "NONE"
  21852. // "REFRESH"
  21853. // "REPLACE"
  21854. // "RESTART"
  21855. MaximalAction string `json:"maximalAction,omitempty"`
  21856. // MinimalAction: The minimal action that should be perfomed on the
  21857. // instances. By default NONE.
  21858. //
  21859. // Possible values:
  21860. // "NONE"
  21861. // "REFRESH"
  21862. // "REPLACE"
  21863. // "RESTART"
  21864. MinimalAction string `json:"minimalAction,omitempty"`
  21865. // ForceSendFields is a list of field names (e.g. "Instances") to
  21866. // unconditionally include in API requests. By default, fields with
  21867. // empty values are omitted from API requests. However, any non-pointer,
  21868. // non-interface field appearing in ForceSendFields will be sent to the
  21869. // server regardless of whether the field is empty or not. This may be
  21870. // used to include empty fields in Patch requests.
  21871. ForceSendFields []string `json:"-"`
  21872. // NullFields is a list of field names (e.g. "Instances") to include in
  21873. // API requests with the JSON null value. By default, fields with empty
  21874. // values are omitted from API requests. However, any field with an
  21875. // empty value appearing in NullFields will be sent to the server as
  21876. // null. It is an error if a field in this list has a non-empty value.
  21877. // This may be used to include null fields in Patch requests.
  21878. NullFields []string `json:"-"`
  21879. }
  21880. func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  21881. type NoMethod RegionInstanceGroupManagersApplyUpdatesRequest
  21882. raw := NoMethod(*s)
  21883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21884. }
  21885. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  21886. // Instances: The URLs of one or more instances to delete. This can be a
  21887. // full URL or a partial URL, such as
  21888. // zones/[ZONE]/instances/[INSTANCE_NAME].
  21889. Instances []string `json:"instances,omitempty"`
  21890. // ForceSendFields is a list of field names (e.g. "Instances") to
  21891. // unconditionally include in API requests. By default, fields with
  21892. // empty values are omitted from API requests. However, any non-pointer,
  21893. // non-interface field appearing in ForceSendFields will be sent to the
  21894. // server regardless of whether the field is empty or not. This may be
  21895. // used to include empty fields in Patch requests.
  21896. ForceSendFields []string `json:"-"`
  21897. // NullFields is a list of field names (e.g. "Instances") to include in
  21898. // API requests with the JSON null value. By default, fields with empty
  21899. // values are omitted from API requests. However, any field with an
  21900. // empty value appearing in NullFields will be sent to the server as
  21901. // null. It is an error if a field in this list has a non-empty value.
  21902. // This may be used to include null fields in Patch requests.
  21903. NullFields []string `json:"-"`
  21904. }
  21905. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  21906. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  21907. raw := NoMethod(*s)
  21908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21909. }
  21910. type RegionInstanceGroupManagersListInstanceConfigsResp struct {
  21911. // Items: [Output Only] The list of PerInstanceConfig.
  21912. Items []*PerInstanceConfig `json:"items,omitempty"`
  21913. // NextPageToken: [Output Only] This token allows you to get the next
  21914. // page of results for list requests. If the number of results is larger
  21915. // than maxResults, use the nextPageToken as a value for the query
  21916. // parameter pageToken in the next list request. Subsequent list
  21917. // requests will have their own nextPageToken to continue paging through
  21918. // the results.
  21919. NextPageToken string `json:"nextPageToken,omitempty"`
  21920. // Warning: [Output Only] Informational warning message.
  21921. Warning *RegionInstanceGroupManagersListInstanceConfigsRespWarning `json:"warning,omitempty"`
  21922. // ServerResponse contains the HTTP response code and headers from the
  21923. // server.
  21924. googleapi.ServerResponse `json:"-"`
  21925. // ForceSendFields is a list of field names (e.g. "Items") to
  21926. // unconditionally include in API requests. By default, fields with
  21927. // empty values are omitted from API requests. However, any non-pointer,
  21928. // non-interface field appearing in ForceSendFields will be sent to the
  21929. // server regardless of whether the field is empty or not. This may be
  21930. // used to include empty fields in Patch requests.
  21931. ForceSendFields []string `json:"-"`
  21932. // NullFields is a list of field names (e.g. "Items") to include in API
  21933. // requests with the JSON null value. By default, fields with empty
  21934. // values are omitted from API requests. However, any field with an
  21935. // empty value appearing in NullFields will be sent to the server as
  21936. // null. It is an error if a field in this list has a non-empty value.
  21937. // This may be used to include null fields in Patch requests.
  21938. NullFields []string `json:"-"`
  21939. }
  21940. func (s *RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  21941. type NoMethod RegionInstanceGroupManagersListInstanceConfigsResp
  21942. raw := NoMethod(*s)
  21943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21944. }
  21945. // RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output
  21946. // Only] Informational warning message.
  21947. type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct {
  21948. // Code: [Output Only] A warning code, if applicable. For example,
  21949. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21950. // the response.
  21951. //
  21952. // Possible values:
  21953. // "CLEANUP_FAILED"
  21954. // "DEPRECATED_RESOURCE_USED"
  21955. // "DEPRECATED_TYPE_USED"
  21956. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21957. // "EXPERIMENTAL_TYPE_USED"
  21958. // "EXTERNAL_API_WARNING"
  21959. // "FIELD_VALUE_OVERRIDEN"
  21960. // "INJECTED_KERNELS_DEPRECATED"
  21961. // "MISSING_TYPE_DEPENDENCY"
  21962. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21963. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21964. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21965. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21966. // "NEXT_HOP_NOT_RUNNING"
  21967. // "NOT_CRITICAL_ERROR"
  21968. // "NO_RESULTS_ON_PAGE"
  21969. // "REQUIRED_TOS_AGREEMENT"
  21970. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21971. // "RESOURCE_NOT_DELETED"
  21972. // "SCHEMA_VALIDATION_IGNORED"
  21973. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21974. // "UNDECLARED_PROPERTIES"
  21975. // "UNREACHABLE"
  21976. Code string `json:"code,omitempty"`
  21977. // Data: [Output Only] Metadata about this warning in key: value format.
  21978. // For example:
  21979. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21980. Data []*RegionInstanceGroupManagersListInstanceConfigsRespWarningData `json:"data,omitempty"`
  21981. // Message: [Output Only] A human-readable description of the warning
  21982. // code.
  21983. Message string `json:"message,omitempty"`
  21984. // ForceSendFields is a list of field names (e.g. "Code") to
  21985. // unconditionally include in API requests. By default, fields with
  21986. // empty values are omitted from API requests. However, any non-pointer,
  21987. // non-interface field appearing in ForceSendFields will be sent to the
  21988. // server regardless of whether the field is empty or not. This may be
  21989. // used to include empty fields in Patch requests.
  21990. ForceSendFields []string `json:"-"`
  21991. // NullFields is a list of field names (e.g. "Code") to include in API
  21992. // requests with the JSON null value. By default, fields with empty
  21993. // values are omitted from API requests. However, any field with an
  21994. // empty value appearing in NullFields will be sent to the server as
  21995. // null. It is an error if a field in this list has a non-empty value.
  21996. // This may be used to include null fields in Patch requests.
  21997. NullFields []string `json:"-"`
  21998. }
  21999. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  22000. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarning
  22001. raw := NoMethod(*s)
  22002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22003. }
  22004. type RegionInstanceGroupManagersListInstanceConfigsRespWarningData struct {
  22005. // Key: [Output Only] A key that provides more detail on the warning
  22006. // being returned. For example, for warnings where there are no results
  22007. // in a list request for a particular zone, this key might be scope and
  22008. // the key value might be the zone name. Other examples might be a key
  22009. // indicating a deprecated resource and a suggested replacement, or a
  22010. // warning about invalid network settings (for example, if an instance
  22011. // attempts to perform IP forwarding but is not enabled for IP
  22012. // forwarding).
  22013. Key string `json:"key,omitempty"`
  22014. // Value: [Output Only] A warning data value corresponding to the key.
  22015. Value string `json:"value,omitempty"`
  22016. // ForceSendFields is a list of field names (e.g. "Key") to
  22017. // unconditionally include in API requests. By default, fields with
  22018. // empty values are omitted from API requests. However, any non-pointer,
  22019. // non-interface field appearing in ForceSendFields will be sent to the
  22020. // server regardless of whether the field is empty or not. This may be
  22021. // used to include empty fields in Patch requests.
  22022. ForceSendFields []string `json:"-"`
  22023. // NullFields is a list of field names (e.g. "Key") to include in API
  22024. // requests with the JSON null value. By default, fields with empty
  22025. // values are omitted from API requests. However, any field with an
  22026. // empty value appearing in NullFields will be sent to the server as
  22027. // null. It is an error if a field in this list has a non-empty value.
  22028. // This may be used to include null fields in Patch requests.
  22029. NullFields []string `json:"-"`
  22030. }
  22031. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  22032. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarningData
  22033. raw := NoMethod(*s)
  22034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22035. }
  22036. type RegionInstanceGroupManagersListInstancesResponse struct {
  22037. // ManagedInstances: A list of managed instances.
  22038. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  22039. // NextPageToken: [Output Only] This token allows you to get the next
  22040. // page of results for list requests. If the number of results is larger
  22041. // than maxResults, use the nextPageToken as a value for the query
  22042. // parameter pageToken in the next list request. Subsequent list
  22043. // requests will have their own nextPageToken to continue paging through
  22044. // the results.
  22045. NextPageToken string `json:"nextPageToken,omitempty"`
  22046. // ServerResponse contains the HTTP response code and headers from the
  22047. // server.
  22048. googleapi.ServerResponse `json:"-"`
  22049. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  22050. // unconditionally include in API requests. By default, fields with
  22051. // empty values are omitted from API requests. However, any non-pointer,
  22052. // non-interface field appearing in ForceSendFields will be sent to the
  22053. // server regardless of whether the field is empty or not. This may be
  22054. // used to include empty fields in Patch requests.
  22055. ForceSendFields []string `json:"-"`
  22056. // NullFields is a list of field names (e.g. "ManagedInstances") to
  22057. // include in API requests with the JSON null value. By default, fields
  22058. // with empty values are omitted from API requests. However, any field
  22059. // with an empty value appearing in NullFields will be sent to the
  22060. // server as null. It is an error if a field in this list has a
  22061. // non-empty value. This may be used to include null fields in Patch
  22062. // requests.
  22063. NullFields []string `json:"-"`
  22064. }
  22065. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  22066. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  22067. raw := NoMethod(*s)
  22068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22069. }
  22070. type RegionInstanceGroupManagersRecreateRequest struct {
  22071. // Instances: The URLs of one or more instances to recreate. This can be
  22072. // a full URL or a partial URL, such as
  22073. // zones/[ZONE]/instances/[INSTANCE_NAME].
  22074. Instances []string `json:"instances,omitempty"`
  22075. // ForceSendFields is a list of field names (e.g. "Instances") to
  22076. // unconditionally include in API requests. By default, fields with
  22077. // empty values are omitted from API requests. However, any non-pointer,
  22078. // non-interface field appearing in ForceSendFields will be sent to the
  22079. // server regardless of whether the field is empty or not. This may be
  22080. // used to include empty fields in Patch requests.
  22081. ForceSendFields []string `json:"-"`
  22082. // NullFields is a list of field names (e.g. "Instances") to include in
  22083. // API requests with the JSON null value. By default, fields with empty
  22084. // values are omitted from API requests. However, any field with an
  22085. // empty value appearing in NullFields will be sent to the server as
  22086. // null. It is an error if a field in this list has a non-empty value.
  22087. // This may be used to include null fields in Patch requests.
  22088. NullFields []string `json:"-"`
  22089. }
  22090. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  22091. type NoMethod RegionInstanceGroupManagersRecreateRequest
  22092. raw := NoMethod(*s)
  22093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22094. }
  22095. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  22096. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  22097. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  22098. // to unconditionally include in API requests. By default, fields with
  22099. // empty values are omitted from API requests. However, any non-pointer,
  22100. // non-interface field appearing in ForceSendFields will be sent to the
  22101. // server regardless of whether the field is empty or not. This may be
  22102. // used to include empty fields in Patch requests.
  22103. ForceSendFields []string `json:"-"`
  22104. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  22105. // include in API requests with the JSON null value. By default, fields
  22106. // with empty values are omitted from API requests. However, any field
  22107. // with an empty value appearing in NullFields will be sent to the
  22108. // server as null. It is an error if a field in this list has a
  22109. // non-empty value. This may be used to include null fields in Patch
  22110. // requests.
  22111. NullFields []string `json:"-"`
  22112. }
  22113. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  22114. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  22115. raw := NoMethod(*s)
  22116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22117. }
  22118. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  22119. // Fingerprint: Fingerprint of the target pools information, which is a
  22120. // hash of the contents. This field is used for optimistic locking when
  22121. // you update the target pool entries. This field is optional.
  22122. Fingerprint string `json:"fingerprint,omitempty"`
  22123. // TargetPools: The URL of all TargetPool resources to which instances
  22124. // in the instanceGroup field are added. The target pools automatically
  22125. // apply to all of the instances in the managed instance group.
  22126. TargetPools []string `json:"targetPools,omitempty"`
  22127. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  22128. // unconditionally include in API requests. By default, fields with
  22129. // empty values are omitted from API requests. However, any non-pointer,
  22130. // non-interface field appearing in ForceSendFields will be sent to the
  22131. // server regardless of whether the field is empty or not. This may be
  22132. // used to include empty fields in Patch requests.
  22133. ForceSendFields []string `json:"-"`
  22134. // NullFields is a list of field names (e.g. "Fingerprint") to include
  22135. // in API requests with the JSON null value. By default, fields with
  22136. // empty values are omitted from API requests. However, any field with
  22137. // an empty value appearing in NullFields will be sent to the server as
  22138. // null. It is an error if a field in this list has a non-empty value.
  22139. // This may be used to include null fields in Patch requests.
  22140. NullFields []string `json:"-"`
  22141. }
  22142. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  22143. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  22144. raw := NoMethod(*s)
  22145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22146. }
  22147. type RegionInstanceGroupManagersSetTemplateRequest struct {
  22148. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  22149. // new instances will be created.
  22150. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  22151. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  22152. // unconditionally include in API requests. By default, fields with
  22153. // empty values are omitted from API requests. However, any non-pointer,
  22154. // non-interface field appearing in ForceSendFields will be sent to the
  22155. // server regardless of whether the field is empty or not. This may be
  22156. // used to include empty fields in Patch requests.
  22157. ForceSendFields []string `json:"-"`
  22158. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  22159. // include in API requests with the JSON null value. By default, fields
  22160. // with empty values are omitted from API requests. However, any field
  22161. // with an empty value appearing in NullFields will be sent to the
  22162. // server as null. It is an error if a field in this list has a
  22163. // non-empty value. This may be used to include null fields in Patch
  22164. // requests.
  22165. NullFields []string `json:"-"`
  22166. }
  22167. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  22168. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  22169. raw := NoMethod(*s)
  22170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22171. }
  22172. type RegionInstanceGroupsListInstances struct {
  22173. // Id: [Output Only] Unique identifier for the resource; defined by the
  22174. // server.
  22175. Id string `json:"id,omitempty"`
  22176. // Items: A list of InstanceWithNamedPorts resources.
  22177. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  22178. // Kind: The resource type.
  22179. Kind string `json:"kind,omitempty"`
  22180. // NextPageToken: [Output Only] This token allows you to get the next
  22181. // page of results for list requests. If the number of results is larger
  22182. // than maxResults, use the nextPageToken as a value for the query
  22183. // parameter pageToken in the next list request. Subsequent list
  22184. // requests will have their own nextPageToken to continue paging through
  22185. // the results.
  22186. NextPageToken string `json:"nextPageToken,omitempty"`
  22187. // SelfLink: [Output Only] Server-defined URL for this resource.
  22188. SelfLink string `json:"selfLink,omitempty"`
  22189. // Warning: [Output Only] Informational warning message.
  22190. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  22191. // ServerResponse contains the HTTP response code and headers from the
  22192. // server.
  22193. googleapi.ServerResponse `json:"-"`
  22194. // ForceSendFields is a list of field names (e.g. "Id") to
  22195. // unconditionally include in API requests. By default, fields with
  22196. // empty values are omitted from API requests. However, any non-pointer,
  22197. // non-interface field appearing in ForceSendFields will be sent to the
  22198. // server regardless of whether the field is empty or not. This may be
  22199. // used to include empty fields in Patch requests.
  22200. ForceSendFields []string `json:"-"`
  22201. // NullFields is a list of field names (e.g. "Id") to include in API
  22202. // requests with the JSON null value. By default, fields with empty
  22203. // values are omitted from API requests. However, any field with an
  22204. // empty value appearing in NullFields will be sent to the server as
  22205. // null. It is an error if a field in this list has a non-empty value.
  22206. // This may be used to include null fields in Patch requests.
  22207. NullFields []string `json:"-"`
  22208. }
  22209. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  22210. type NoMethod RegionInstanceGroupsListInstances
  22211. raw := NoMethod(*s)
  22212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22213. }
  22214. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  22215. // warning message.
  22216. type RegionInstanceGroupsListInstancesWarning struct {
  22217. // Code: [Output Only] A warning code, if applicable. For example,
  22218. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22219. // the response.
  22220. //
  22221. // Possible values:
  22222. // "CLEANUP_FAILED"
  22223. // "DEPRECATED_RESOURCE_USED"
  22224. // "DEPRECATED_TYPE_USED"
  22225. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22226. // "EXPERIMENTAL_TYPE_USED"
  22227. // "EXTERNAL_API_WARNING"
  22228. // "FIELD_VALUE_OVERRIDEN"
  22229. // "INJECTED_KERNELS_DEPRECATED"
  22230. // "MISSING_TYPE_DEPENDENCY"
  22231. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22232. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22233. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22234. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22235. // "NEXT_HOP_NOT_RUNNING"
  22236. // "NOT_CRITICAL_ERROR"
  22237. // "NO_RESULTS_ON_PAGE"
  22238. // "REQUIRED_TOS_AGREEMENT"
  22239. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22240. // "RESOURCE_NOT_DELETED"
  22241. // "SCHEMA_VALIDATION_IGNORED"
  22242. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22243. // "UNDECLARED_PROPERTIES"
  22244. // "UNREACHABLE"
  22245. Code string `json:"code,omitempty"`
  22246. // Data: [Output Only] Metadata about this warning in key: value format.
  22247. // For example:
  22248. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22249. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  22250. // Message: [Output Only] A human-readable description of the warning
  22251. // code.
  22252. Message string `json:"message,omitempty"`
  22253. // ForceSendFields is a list of field names (e.g. "Code") to
  22254. // unconditionally include in API requests. By default, fields with
  22255. // empty values are omitted from API requests. However, any non-pointer,
  22256. // non-interface field appearing in ForceSendFields will be sent to the
  22257. // server regardless of whether the field is empty or not. This may be
  22258. // used to include empty fields in Patch requests.
  22259. ForceSendFields []string `json:"-"`
  22260. // NullFields is a list of field names (e.g. "Code") to include in API
  22261. // requests with the JSON null value. By default, fields with empty
  22262. // values are omitted from API requests. However, any field with an
  22263. // empty value appearing in NullFields will be sent to the server as
  22264. // null. It is an error if a field in this list has a non-empty value.
  22265. // This may be used to include null fields in Patch requests.
  22266. NullFields []string `json:"-"`
  22267. }
  22268. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  22269. type NoMethod RegionInstanceGroupsListInstancesWarning
  22270. raw := NoMethod(*s)
  22271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22272. }
  22273. type RegionInstanceGroupsListInstancesWarningData struct {
  22274. // Key: [Output Only] A key that provides more detail on the warning
  22275. // being returned. For example, for warnings where there are no results
  22276. // in a list request for a particular zone, this key might be scope and
  22277. // the key value might be the zone name. Other examples might be a key
  22278. // indicating a deprecated resource and a suggested replacement, or a
  22279. // warning about invalid network settings (for example, if an instance
  22280. // attempts to perform IP forwarding but is not enabled for IP
  22281. // forwarding).
  22282. Key string `json:"key,omitempty"`
  22283. // Value: [Output Only] A warning data value corresponding to the key.
  22284. Value string `json:"value,omitempty"`
  22285. // ForceSendFields is a list of field names (e.g. "Key") to
  22286. // unconditionally include in API requests. By default, fields with
  22287. // empty values are omitted from API requests. However, any non-pointer,
  22288. // non-interface field appearing in ForceSendFields will be sent to the
  22289. // server regardless of whether the field is empty or not. This may be
  22290. // used to include empty fields in Patch requests.
  22291. ForceSendFields []string `json:"-"`
  22292. // NullFields is a list of field names (e.g. "Key") to include in API
  22293. // requests with the JSON null value. By default, fields with empty
  22294. // values are omitted from API requests. However, any field with an
  22295. // empty value appearing in NullFields will be sent to the server as
  22296. // null. It is an error if a field in this list has a non-empty value.
  22297. // This may be used to include null fields in Patch requests.
  22298. NullFields []string `json:"-"`
  22299. }
  22300. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  22301. type NoMethod RegionInstanceGroupsListInstancesWarningData
  22302. raw := NoMethod(*s)
  22303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22304. }
  22305. type RegionInstanceGroupsListInstancesRequest struct {
  22306. // InstanceState: Instances in which state should be returned. Valid
  22307. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  22308. //
  22309. // Possible values:
  22310. // "ALL"
  22311. // "RUNNING"
  22312. InstanceState string `json:"instanceState,omitempty"`
  22313. // PortName: Name of port user is interested in. It is optional. If it
  22314. // is set, only information about this ports will be returned. If it is
  22315. // not set, all the named ports will be returned. Always lists all
  22316. // instances.
  22317. PortName string `json:"portName,omitempty"`
  22318. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  22319. // unconditionally include in API requests. By default, fields with
  22320. // empty values are omitted from API requests. However, any non-pointer,
  22321. // non-interface field appearing in ForceSendFields will be sent to the
  22322. // server regardless of whether the field is empty or not. This may be
  22323. // used to include empty fields in Patch requests.
  22324. ForceSendFields []string `json:"-"`
  22325. // NullFields is a list of field names (e.g. "InstanceState") to include
  22326. // in API requests with the JSON null value. By default, fields with
  22327. // empty values are omitted from API requests. However, any field with
  22328. // an empty value appearing in NullFields will be sent to the server as
  22329. // null. It is an error if a field in this list has a non-empty value.
  22330. // This may be used to include null fields in Patch requests.
  22331. NullFields []string `json:"-"`
  22332. }
  22333. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  22334. type NoMethod RegionInstanceGroupsListInstancesRequest
  22335. raw := NoMethod(*s)
  22336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22337. }
  22338. type RegionInstanceGroupsSetNamedPortsRequest struct {
  22339. // Fingerprint: The fingerprint of the named ports information for this
  22340. // instance group. Use this optional property to prevent conflicts when
  22341. // multiple users change the named ports settings concurrently. Obtain
  22342. // the fingerprint with the instanceGroups.get method. Then, include the
  22343. // fingerprint in your request to ensure that you do not overwrite
  22344. // changes that were applied from another concurrent request.
  22345. Fingerprint string `json:"fingerprint,omitempty"`
  22346. // NamedPorts: The list of named ports to set for this instance group.
  22347. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  22348. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  22349. // unconditionally include in API requests. By default, fields with
  22350. // empty values are omitted from API requests. However, any non-pointer,
  22351. // non-interface field appearing in ForceSendFields will be sent to the
  22352. // server regardless of whether the field is empty or not. This may be
  22353. // used to include empty fields in Patch requests.
  22354. ForceSendFields []string `json:"-"`
  22355. // NullFields is a list of field names (e.g. "Fingerprint") to include
  22356. // in API requests with the JSON null value. By default, fields with
  22357. // empty values are omitted from API requests. However, any field with
  22358. // an empty value appearing in NullFields will be sent to the server as
  22359. // null. It is an error if a field in this list has a non-empty value.
  22360. // This may be used to include null fields in Patch requests.
  22361. NullFields []string `json:"-"`
  22362. }
  22363. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  22364. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  22365. raw := NoMethod(*s)
  22366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22367. }
  22368. // RegionList: Contains a list of region resources.
  22369. type RegionList struct {
  22370. // Id: [Output Only] Unique identifier for the resource; defined by the
  22371. // server.
  22372. Id string `json:"id,omitempty"`
  22373. // Items: A list of Region resources.
  22374. Items []*Region `json:"items,omitempty"`
  22375. // Kind: [Output Only] Type of resource. Always compute#regionList for
  22376. // lists of regions.
  22377. Kind string `json:"kind,omitempty"`
  22378. // NextPageToken: [Output Only] This token allows you to get the next
  22379. // page of results for list requests. If the number of results is larger
  22380. // than maxResults, use the nextPageToken as a value for the query
  22381. // parameter pageToken in the next list request. Subsequent list
  22382. // requests will have their own nextPageToken to continue paging through
  22383. // the results.
  22384. NextPageToken string `json:"nextPageToken,omitempty"`
  22385. // SelfLink: [Output Only] Server-defined URL for this resource.
  22386. SelfLink string `json:"selfLink,omitempty"`
  22387. // Warning: [Output Only] Informational warning message.
  22388. Warning *RegionListWarning `json:"warning,omitempty"`
  22389. // ServerResponse contains the HTTP response code and headers from the
  22390. // server.
  22391. googleapi.ServerResponse `json:"-"`
  22392. // ForceSendFields is a list of field names (e.g. "Id") to
  22393. // unconditionally include in API requests. By default, fields with
  22394. // empty values are omitted from API requests. However, any non-pointer,
  22395. // non-interface field appearing in ForceSendFields will be sent to the
  22396. // server regardless of whether the field is empty or not. This may be
  22397. // used to include empty fields in Patch requests.
  22398. ForceSendFields []string `json:"-"`
  22399. // NullFields is a list of field names (e.g. "Id") to include in API
  22400. // requests with the JSON null value. By default, fields with empty
  22401. // values are omitted from API requests. However, any field with an
  22402. // empty value appearing in NullFields will be sent to the server as
  22403. // null. It is an error if a field in this list has a non-empty value.
  22404. // This may be used to include null fields in Patch requests.
  22405. NullFields []string `json:"-"`
  22406. }
  22407. func (s *RegionList) MarshalJSON() ([]byte, error) {
  22408. type NoMethod RegionList
  22409. raw := NoMethod(*s)
  22410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22411. }
  22412. // RegionListWarning: [Output Only] Informational warning message.
  22413. type RegionListWarning struct {
  22414. // Code: [Output Only] A warning code, if applicable. For example,
  22415. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22416. // the response.
  22417. //
  22418. // Possible values:
  22419. // "CLEANUP_FAILED"
  22420. // "DEPRECATED_RESOURCE_USED"
  22421. // "DEPRECATED_TYPE_USED"
  22422. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22423. // "EXPERIMENTAL_TYPE_USED"
  22424. // "EXTERNAL_API_WARNING"
  22425. // "FIELD_VALUE_OVERRIDEN"
  22426. // "INJECTED_KERNELS_DEPRECATED"
  22427. // "MISSING_TYPE_DEPENDENCY"
  22428. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22429. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22430. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22431. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22432. // "NEXT_HOP_NOT_RUNNING"
  22433. // "NOT_CRITICAL_ERROR"
  22434. // "NO_RESULTS_ON_PAGE"
  22435. // "REQUIRED_TOS_AGREEMENT"
  22436. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22437. // "RESOURCE_NOT_DELETED"
  22438. // "SCHEMA_VALIDATION_IGNORED"
  22439. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22440. // "UNDECLARED_PROPERTIES"
  22441. // "UNREACHABLE"
  22442. Code string `json:"code,omitempty"`
  22443. // Data: [Output Only] Metadata about this warning in key: value format.
  22444. // For example:
  22445. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22446. Data []*RegionListWarningData `json:"data,omitempty"`
  22447. // Message: [Output Only] A human-readable description of the warning
  22448. // code.
  22449. Message string `json:"message,omitempty"`
  22450. // ForceSendFields is a list of field names (e.g. "Code") to
  22451. // unconditionally include in API requests. By default, fields with
  22452. // empty values are omitted from API requests. However, any non-pointer,
  22453. // non-interface field appearing in ForceSendFields will be sent to the
  22454. // server regardless of whether the field is empty or not. This may be
  22455. // used to include empty fields in Patch requests.
  22456. ForceSendFields []string `json:"-"`
  22457. // NullFields is a list of field names (e.g. "Code") to include in API
  22458. // requests with the JSON null value. By default, fields with empty
  22459. // values are omitted from API requests. However, any field with an
  22460. // empty value appearing in NullFields will be sent to the server as
  22461. // null. It is an error if a field in this list has a non-empty value.
  22462. // This may be used to include null fields in Patch requests.
  22463. NullFields []string `json:"-"`
  22464. }
  22465. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  22466. type NoMethod RegionListWarning
  22467. raw := NoMethod(*s)
  22468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22469. }
  22470. type RegionListWarningData struct {
  22471. // Key: [Output Only] A key that provides more detail on the warning
  22472. // being returned. For example, for warnings where there are no results
  22473. // in a list request for a particular zone, this key might be scope and
  22474. // the key value might be the zone name. Other examples might be a key
  22475. // indicating a deprecated resource and a suggested replacement, or a
  22476. // warning about invalid network settings (for example, if an instance
  22477. // attempts to perform IP forwarding but is not enabled for IP
  22478. // forwarding).
  22479. Key string `json:"key,omitempty"`
  22480. // Value: [Output Only] A warning data value corresponding to the key.
  22481. Value string `json:"value,omitempty"`
  22482. // ForceSendFields is a list of field names (e.g. "Key") to
  22483. // unconditionally include in API requests. By default, fields with
  22484. // empty values are omitted from API requests. However, any non-pointer,
  22485. // non-interface field appearing in ForceSendFields will be sent to the
  22486. // server regardless of whether the field is empty or not. This may be
  22487. // used to include empty fields in Patch requests.
  22488. ForceSendFields []string `json:"-"`
  22489. // NullFields is a list of field names (e.g. "Key") to include in API
  22490. // requests with the JSON null value. By default, fields with empty
  22491. // values are omitted from API requests. However, any field with an
  22492. // empty value appearing in NullFields will be sent to the server as
  22493. // null. It is an error if a field in this list has a non-empty value.
  22494. // This may be used to include null fields in Patch requests.
  22495. NullFields []string `json:"-"`
  22496. }
  22497. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  22498. type NoMethod RegionListWarningData
  22499. raw := NoMethod(*s)
  22500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22501. }
  22502. type RegionSetLabelsRequest struct {
  22503. // LabelFingerprint: The fingerprint of the previous set of labels for
  22504. // this resource, used to detect conflicts. The fingerprint is initially
  22505. // generated by Compute Engine and changes after every request to modify
  22506. // or update labels. You must always provide an up-to-date fingerprint
  22507. // hash in order to update or change labels. Make a get() request to the
  22508. // resource to get the latest fingerprint.
  22509. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  22510. // Labels: The labels to set for this resource.
  22511. Labels map[string]string `json:"labels,omitempty"`
  22512. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  22513. // unconditionally include in API requests. By default, fields with
  22514. // empty values are omitted from API requests. However, any non-pointer,
  22515. // non-interface field appearing in ForceSendFields will be sent to the
  22516. // server regardless of whether the field is empty or not. This may be
  22517. // used to include empty fields in Patch requests.
  22518. ForceSendFields []string `json:"-"`
  22519. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  22520. // include in API requests with the JSON null value. By default, fields
  22521. // with empty values are omitted from API requests. However, any field
  22522. // with an empty value appearing in NullFields will be sent to the
  22523. // server as null. It is an error if a field in this list has a
  22524. // non-empty value. This may be used to include null fields in Patch
  22525. // requests.
  22526. NullFields []string `json:"-"`
  22527. }
  22528. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  22529. type NoMethod RegionSetLabelsRequest
  22530. raw := NoMethod(*s)
  22531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22532. }
  22533. type RegionSetPolicyRequest struct {
  22534. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  22535. // Deprecated. Use 'policy' to specify bindings.
  22536. Bindings []*Binding `json:"bindings,omitempty"`
  22537. // Etag: Flatten Policy to create a backward compatible wire-format.
  22538. // Deprecated. Use 'policy' to specify the etag.
  22539. Etag string `json:"etag,omitempty"`
  22540. // Policy: REQUIRED: The complete policy to be applied to the
  22541. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  22542. // empty policy is in general a valid policy but certain services (like
  22543. // Projects) might reject them.
  22544. Policy *Policy `json:"policy,omitempty"`
  22545. // ForceSendFields is a list of field names (e.g. "Bindings") to
  22546. // unconditionally include in API requests. By default, fields with
  22547. // empty values are omitted from API requests. However, any non-pointer,
  22548. // non-interface field appearing in ForceSendFields will be sent to the
  22549. // server regardless of whether the field is empty or not. This may be
  22550. // used to include empty fields in Patch requests.
  22551. ForceSendFields []string `json:"-"`
  22552. // NullFields is a list of field names (e.g. "Bindings") to include in
  22553. // API requests with the JSON null value. By default, fields with empty
  22554. // values are omitted from API requests. However, any field with an
  22555. // empty value appearing in NullFields will be sent to the server as
  22556. // null. It is an error if a field in this list has a non-empty value.
  22557. // This may be used to include null fields in Patch requests.
  22558. NullFields []string `json:"-"`
  22559. }
  22560. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  22561. type NoMethod RegionSetPolicyRequest
  22562. raw := NoMethod(*s)
  22563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22564. }
  22565. type RegionTargetHttpsProxiesSetSslCertificatesRequest struct {
  22566. // SslCertificates: New set of SslCertificate resources to associate
  22567. // with this TargetHttpsProxy resource. Currently exactly one
  22568. // SslCertificate resource must be specified.
  22569. SslCertificates []string `json:"sslCertificates,omitempty"`
  22570. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  22571. // unconditionally include in API requests. By default, fields with
  22572. // empty values are omitted from API requests. However, any non-pointer,
  22573. // non-interface field appearing in ForceSendFields will be sent to the
  22574. // server regardless of whether the field is empty or not. This may be
  22575. // used to include empty fields in Patch requests.
  22576. ForceSendFields []string `json:"-"`
  22577. // NullFields is a list of field names (e.g. "SslCertificates") to
  22578. // include in API requests with the JSON null value. By default, fields
  22579. // with empty values are omitted from API requests. However, any field
  22580. // with an empty value appearing in NullFields will be sent to the
  22581. // server as null. It is an error if a field in this list has a
  22582. // non-empty value. This may be used to include null fields in Patch
  22583. // requests.
  22584. NullFields []string `json:"-"`
  22585. }
  22586. func (s *RegionTargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  22587. type NoMethod RegionTargetHttpsProxiesSetSslCertificatesRequest
  22588. raw := NoMethod(*s)
  22589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22590. }
  22591. type RegionUrlMapsValidateRequest struct {
  22592. // Resource: Content of the UrlMap to be validated.
  22593. Resource *UrlMap `json:"resource,omitempty"`
  22594. // ForceSendFields is a list of field names (e.g. "Resource") to
  22595. // unconditionally include in API requests. By default, fields with
  22596. // empty values are omitted from API requests. However, any non-pointer,
  22597. // non-interface field appearing in ForceSendFields will be sent to the
  22598. // server regardless of whether the field is empty or not. This may be
  22599. // used to include empty fields in Patch requests.
  22600. ForceSendFields []string `json:"-"`
  22601. // NullFields is a list of field names (e.g. "Resource") to include in
  22602. // API requests with the JSON null value. By default, fields with empty
  22603. // values are omitted from API requests. However, any field with an
  22604. // empty value appearing in NullFields will be sent to the server as
  22605. // null. It is an error if a field in this list has a non-empty value.
  22606. // This may be used to include null fields in Patch requests.
  22607. NullFields []string `json:"-"`
  22608. }
  22609. func (s *RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  22610. type NoMethod RegionUrlMapsValidateRequest
  22611. raw := NoMethod(*s)
  22612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22613. }
  22614. // ResourceCommitment: Commitment for a particular resource (a
  22615. // Commitment is composed of one or more of these).
  22616. type ResourceCommitment struct {
  22617. // AcceleratorType: Name of the accelerator type resource. Applicable
  22618. // only when the type is ACCELERATOR.
  22619. AcceleratorType string `json:"acceleratorType,omitempty"`
  22620. // Amount: The amount of the resource purchased (in a type-dependent
  22621. // unit, such as bytes). For vCPUs, this can just be an integer. For
  22622. // memory, this must be provided in MB. Memory must be a multiple of 256
  22623. // MB, with up to 6.5GB of memory per every vCPU.
  22624. Amount int64 `json:"amount,omitempty,string"`
  22625. // Type: Type of resource for which this commitment applies. Possible
  22626. // values are VCPU and MEMORY
  22627. //
  22628. // Possible values:
  22629. // "ACCELERATOR"
  22630. // "LOCAL_SSD"
  22631. // "MEMORY"
  22632. // "UNSPECIFIED"
  22633. // "VCPU"
  22634. Type string `json:"type,omitempty"`
  22635. // ForceSendFields is a list of field names (e.g. "AcceleratorType") to
  22636. // unconditionally include in API requests. By default, fields with
  22637. // empty values are omitted from API requests. However, any non-pointer,
  22638. // non-interface field appearing in ForceSendFields will be sent to the
  22639. // server regardless of whether the field is empty or not. This may be
  22640. // used to include empty fields in Patch requests.
  22641. ForceSendFields []string `json:"-"`
  22642. // NullFields is a list of field names (e.g. "AcceleratorType") to
  22643. // include in API requests with the JSON null value. By default, fields
  22644. // with empty values are omitted from API requests. However, any field
  22645. // with an empty value appearing in NullFields will be sent to the
  22646. // server as null. It is an error if a field in this list has a
  22647. // non-empty value. This may be used to include null fields in Patch
  22648. // requests.
  22649. NullFields []string `json:"-"`
  22650. }
  22651. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  22652. type NoMethod ResourceCommitment
  22653. raw := NoMethod(*s)
  22654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22655. }
  22656. type ResourceGroupReference struct {
  22657. // Group: A URI referencing one of the instance groups or network
  22658. // endpoint groups listed in the backend service.
  22659. Group string `json:"group,omitempty"`
  22660. // ForceSendFields is a list of field names (e.g. "Group") to
  22661. // unconditionally include in API requests. By default, fields with
  22662. // empty values are omitted from API requests. However, any non-pointer,
  22663. // non-interface field appearing in ForceSendFields will be sent to the
  22664. // server regardless of whether the field is empty or not. This may be
  22665. // used to include empty fields in Patch requests.
  22666. ForceSendFields []string `json:"-"`
  22667. // NullFields is a list of field names (e.g. "Group") to include in API
  22668. // requests with the JSON null value. By default, fields with empty
  22669. // values are omitted from API requests. However, any field with an
  22670. // empty value appearing in NullFields will be sent to the server as
  22671. // null. It is an error if a field in this list has a non-empty value.
  22672. // This may be used to include null fields in Patch requests.
  22673. NullFields []string `json:"-"`
  22674. }
  22675. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  22676. type NoMethod ResourceGroupReference
  22677. raw := NoMethod(*s)
  22678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22679. }
  22680. type ResourcePoliciesScopedList struct {
  22681. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  22682. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  22683. // Warning: Informational warning which replaces the list of
  22684. // resourcePolicies when the list is empty.
  22685. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  22686. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  22687. // unconditionally include in API requests. By default, fields with
  22688. // empty values are omitted from API requests. However, any non-pointer,
  22689. // non-interface field appearing in ForceSendFields will be sent to the
  22690. // server regardless of whether the field is empty or not. This may be
  22691. // used to include empty fields in Patch requests.
  22692. ForceSendFields []string `json:"-"`
  22693. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  22694. // include in API requests with the JSON null value. By default, fields
  22695. // with empty values are omitted from API requests. However, any field
  22696. // with an empty value appearing in NullFields will be sent to the
  22697. // server as null. It is an error if a field in this list has a
  22698. // non-empty value. This may be used to include null fields in Patch
  22699. // requests.
  22700. NullFields []string `json:"-"`
  22701. }
  22702. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  22703. type NoMethod ResourcePoliciesScopedList
  22704. raw := NoMethod(*s)
  22705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22706. }
  22707. // ResourcePoliciesScopedListWarning: Informational warning which
  22708. // replaces the list of resourcePolicies when the list is empty.
  22709. type ResourcePoliciesScopedListWarning struct {
  22710. // Code: [Output Only] A warning code, if applicable. For example,
  22711. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22712. // the response.
  22713. //
  22714. // Possible values:
  22715. // "CLEANUP_FAILED"
  22716. // "DEPRECATED_RESOURCE_USED"
  22717. // "DEPRECATED_TYPE_USED"
  22718. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22719. // "EXPERIMENTAL_TYPE_USED"
  22720. // "EXTERNAL_API_WARNING"
  22721. // "FIELD_VALUE_OVERRIDEN"
  22722. // "INJECTED_KERNELS_DEPRECATED"
  22723. // "MISSING_TYPE_DEPENDENCY"
  22724. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22725. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22726. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22727. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22728. // "NEXT_HOP_NOT_RUNNING"
  22729. // "NOT_CRITICAL_ERROR"
  22730. // "NO_RESULTS_ON_PAGE"
  22731. // "REQUIRED_TOS_AGREEMENT"
  22732. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22733. // "RESOURCE_NOT_DELETED"
  22734. // "SCHEMA_VALIDATION_IGNORED"
  22735. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22736. // "UNDECLARED_PROPERTIES"
  22737. // "UNREACHABLE"
  22738. Code string `json:"code,omitempty"`
  22739. // Data: [Output Only] Metadata about this warning in key: value format.
  22740. // For example:
  22741. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22742. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  22743. // Message: [Output Only] A human-readable description of the warning
  22744. // code.
  22745. Message string `json:"message,omitempty"`
  22746. // ForceSendFields is a list of field names (e.g. "Code") to
  22747. // unconditionally include in API requests. By default, fields with
  22748. // empty values are omitted from API requests. However, any non-pointer,
  22749. // non-interface field appearing in ForceSendFields will be sent to the
  22750. // server regardless of whether the field is empty or not. This may be
  22751. // used to include empty fields in Patch requests.
  22752. ForceSendFields []string `json:"-"`
  22753. // NullFields is a list of field names (e.g. "Code") to include in API
  22754. // requests with the JSON null value. By default, fields with empty
  22755. // values are omitted from API requests. However, any field with an
  22756. // empty value appearing in NullFields will be sent to the server as
  22757. // null. It is an error if a field in this list has a non-empty value.
  22758. // This may be used to include null fields in Patch requests.
  22759. NullFields []string `json:"-"`
  22760. }
  22761. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  22762. type NoMethod ResourcePoliciesScopedListWarning
  22763. raw := NoMethod(*s)
  22764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22765. }
  22766. type ResourcePoliciesScopedListWarningData struct {
  22767. // Key: [Output Only] A key that provides more detail on the warning
  22768. // being returned. For example, for warnings where there are no results
  22769. // in a list request for a particular zone, this key might be scope and
  22770. // the key value might be the zone name. Other examples might be a key
  22771. // indicating a deprecated resource and a suggested replacement, or a
  22772. // warning about invalid network settings (for example, if an instance
  22773. // attempts to perform IP forwarding but is not enabled for IP
  22774. // forwarding).
  22775. Key string `json:"key,omitempty"`
  22776. // Value: [Output Only] A warning data value corresponding to the key.
  22777. Value string `json:"value,omitempty"`
  22778. // ForceSendFields is a list of field names (e.g. "Key") to
  22779. // unconditionally include in API requests. By default, fields with
  22780. // empty values are omitted from API requests. However, any non-pointer,
  22781. // non-interface field appearing in ForceSendFields will be sent to the
  22782. // server regardless of whether the field is empty or not. This may be
  22783. // used to include empty fields in Patch requests.
  22784. ForceSendFields []string `json:"-"`
  22785. // NullFields is a list of field names (e.g. "Key") to include in API
  22786. // requests with the JSON null value. By default, fields with empty
  22787. // values are omitted from API requests. However, any field with an
  22788. // empty value appearing in NullFields will be sent to the server as
  22789. // null. It is an error if a field in this list has a non-empty value.
  22790. // This may be used to include null fields in Patch requests.
  22791. NullFields []string `json:"-"`
  22792. }
  22793. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  22794. type NoMethod ResourcePoliciesScopedListWarningData
  22795. raw := NoMethod(*s)
  22796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22797. }
  22798. type ResourcePolicy struct {
  22799. // BackupSchedulePolicy: Resource policy for persistent disks for
  22800. // creating snapshots.
  22801. BackupSchedulePolicy *ResourcePolicyBackupSchedulePolicy `json:"backupSchedulePolicy,omitempty"`
  22802. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22803. // format.
  22804. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22805. Description string `json:"description,omitempty"`
  22806. // Id: [Output Only] The unique identifier for the resource. This
  22807. // identifier is defined by the server.
  22808. Id uint64 `json:"id,omitempty,string"`
  22809. // Kind: [Output Only] Type of the resource. Always
  22810. // compute#resource_policies for resource policies.
  22811. Kind string `json:"kind,omitempty"`
  22812. // Name: The name of the resource, provided by the client when initially
  22813. // creating the resource. The resource name must be 1-63 characters
  22814. // long, and comply with RFC1035. Specifically, the name must be 1-63
  22815. // characters long and match the regular expression
  22816. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  22817. // a lowercase letter, and all following characters must be a dash,
  22818. // lowercase letter, or digit, except the last character, which cannot
  22819. // be a dash.
  22820. Name string `json:"name,omitempty"`
  22821. Region string `json:"region,omitempty"`
  22822. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  22823. // resource.
  22824. SelfLink string `json:"selfLink,omitempty"`
  22825. // VmMaintenancePolicy: Resource policy applicable to VMs for
  22826. // infrastructure maintenance.
  22827. VmMaintenancePolicy *ResourcePolicyVmMaintenancePolicy `json:"vmMaintenancePolicy,omitempty"`
  22828. // ServerResponse contains the HTTP response code and headers from the
  22829. // server.
  22830. googleapi.ServerResponse `json:"-"`
  22831. // ForceSendFields is a list of field names (e.g.
  22832. // "BackupSchedulePolicy") to unconditionally include in API requests.
  22833. // By default, fields with empty values are omitted from API requests.
  22834. // However, any non-pointer, non-interface field appearing in
  22835. // ForceSendFields will be sent to the server regardless of whether the
  22836. // field is empty or not. This may be used to include empty fields in
  22837. // Patch requests.
  22838. ForceSendFields []string `json:"-"`
  22839. // NullFields is a list of field names (e.g. "BackupSchedulePolicy") to
  22840. // include in API requests with the JSON null value. By default, fields
  22841. // with empty values are omitted from API requests. However, any field
  22842. // with an empty value appearing in NullFields will be sent to the
  22843. // server as null. It is an error if a field in this list has a
  22844. // non-empty value. This may be used to include null fields in Patch
  22845. // requests.
  22846. NullFields []string `json:"-"`
  22847. }
  22848. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  22849. type NoMethod ResourcePolicy
  22850. raw := NoMethod(*s)
  22851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22852. }
  22853. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  22854. type ResourcePolicyAggregatedList struct {
  22855. Etag string `json:"etag,omitempty"`
  22856. // Id: [Output Only] Unique identifier for the resource; defined by the
  22857. // server.
  22858. Id string `json:"id,omitempty"`
  22859. // Items: A list of ResourcePolicy resources.
  22860. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  22861. // Kind: Type of resource.
  22862. Kind string `json:"kind,omitempty"`
  22863. // NextPageToken: [Output Only] This token allows you to get the next
  22864. // page of results for list requests. If the number of results is larger
  22865. // than maxResults, use the nextPageToken as a value for the query
  22866. // parameter pageToken in the next list request. Subsequent list
  22867. // requests will have their own nextPageToken to continue paging through
  22868. // the results.
  22869. NextPageToken string `json:"nextPageToken,omitempty"`
  22870. // SelfLink: [Output Only] Server-defined URL for this resource.
  22871. SelfLink string `json:"selfLink,omitempty"`
  22872. // Warning: [Output Only] Informational warning message.
  22873. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  22874. // ServerResponse contains the HTTP response code and headers from the
  22875. // server.
  22876. googleapi.ServerResponse `json:"-"`
  22877. // ForceSendFields is a list of field names (e.g. "Etag") to
  22878. // unconditionally include in API requests. By default, fields with
  22879. // empty values are omitted from API requests. However, any non-pointer,
  22880. // non-interface field appearing in ForceSendFields will be sent to the
  22881. // server regardless of whether the field is empty or not. This may be
  22882. // used to include empty fields in Patch requests.
  22883. ForceSendFields []string `json:"-"`
  22884. // NullFields is a list of field names (e.g. "Etag") to include in API
  22885. // requests with the JSON null value. By default, fields with empty
  22886. // values are omitted from API requests. However, any field with an
  22887. // empty value appearing in NullFields will be sent to the server as
  22888. // null. It is an error if a field in this list has a non-empty value.
  22889. // This may be used to include null fields in Patch requests.
  22890. NullFields []string `json:"-"`
  22891. }
  22892. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  22893. type NoMethod ResourcePolicyAggregatedList
  22894. raw := NoMethod(*s)
  22895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22896. }
  22897. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  22898. // warning message.
  22899. type ResourcePolicyAggregatedListWarning struct {
  22900. // Code: [Output Only] A warning code, if applicable. For example,
  22901. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22902. // the response.
  22903. //
  22904. // Possible values:
  22905. // "CLEANUP_FAILED"
  22906. // "DEPRECATED_RESOURCE_USED"
  22907. // "DEPRECATED_TYPE_USED"
  22908. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22909. // "EXPERIMENTAL_TYPE_USED"
  22910. // "EXTERNAL_API_WARNING"
  22911. // "FIELD_VALUE_OVERRIDEN"
  22912. // "INJECTED_KERNELS_DEPRECATED"
  22913. // "MISSING_TYPE_DEPENDENCY"
  22914. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22915. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22916. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22917. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22918. // "NEXT_HOP_NOT_RUNNING"
  22919. // "NOT_CRITICAL_ERROR"
  22920. // "NO_RESULTS_ON_PAGE"
  22921. // "REQUIRED_TOS_AGREEMENT"
  22922. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22923. // "RESOURCE_NOT_DELETED"
  22924. // "SCHEMA_VALIDATION_IGNORED"
  22925. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22926. // "UNDECLARED_PROPERTIES"
  22927. // "UNREACHABLE"
  22928. Code string `json:"code,omitempty"`
  22929. // Data: [Output Only] Metadata about this warning in key: value format.
  22930. // For example:
  22931. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22932. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  22933. // Message: [Output Only] A human-readable description of the warning
  22934. // code.
  22935. Message string `json:"message,omitempty"`
  22936. // ForceSendFields is a list of field names (e.g. "Code") to
  22937. // unconditionally include in API requests. By default, fields with
  22938. // empty values are omitted from API requests. However, any non-pointer,
  22939. // non-interface field appearing in ForceSendFields will be sent to the
  22940. // server regardless of whether the field is empty or not. This may be
  22941. // used to include empty fields in Patch requests.
  22942. ForceSendFields []string `json:"-"`
  22943. // NullFields is a list of field names (e.g. "Code") to include in API
  22944. // requests with the JSON null value. By default, fields with empty
  22945. // values are omitted from API requests. However, any field with an
  22946. // empty value appearing in NullFields will be sent to the server as
  22947. // null. It is an error if a field in this list has a non-empty value.
  22948. // This may be used to include null fields in Patch requests.
  22949. NullFields []string `json:"-"`
  22950. }
  22951. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22952. type NoMethod ResourcePolicyAggregatedListWarning
  22953. raw := NoMethod(*s)
  22954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22955. }
  22956. type ResourcePolicyAggregatedListWarningData struct {
  22957. // Key: [Output Only] A key that provides more detail on the warning
  22958. // being returned. For example, for warnings where there are no results
  22959. // in a list request for a particular zone, this key might be scope and
  22960. // the key value might be the zone name. Other examples might be a key
  22961. // indicating a deprecated resource and a suggested replacement, or a
  22962. // warning about invalid network settings (for example, if an instance
  22963. // attempts to perform IP forwarding but is not enabled for IP
  22964. // forwarding).
  22965. Key string `json:"key,omitempty"`
  22966. // Value: [Output Only] A warning data value corresponding to the key.
  22967. Value string `json:"value,omitempty"`
  22968. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22984. type NoMethod ResourcePolicyAggregatedListWarningData
  22985. raw := NoMethod(*s)
  22986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22987. }
  22988. // ResourcePolicyBackupSchedulePolicy: A backup schedule policy
  22989. // specifies when and how frequently snapshots are to be created for the
  22990. // target disk. Also specifies how many and how long these scheduled
  22991. // snapshots should be retained.
  22992. type ResourcePolicyBackupSchedulePolicy struct {
  22993. // RetentionPolicy: Retention policy applied to snapshots created by
  22994. // this resource policy.
  22995. RetentionPolicy *ResourcePolicyBackupSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  22996. // Schedule: A Vm Maintenance Policy specifies what kind of
  22997. // infrastructure maintenance we are allowed to perform on this VM and
  22998. // when. Schedule that is applied to disks covered by this policy.
  22999. Schedule *ResourcePolicyBackupSchedulePolicySchedule `json:"schedule,omitempty"`
  23000. // SnapshotProperties: Properties with which snapshots are created such
  23001. // as labels, encryption keys.
  23002. SnapshotProperties *ResourcePolicyBackupSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  23003. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  23004. // unconditionally include in API requests. By default, fields with
  23005. // empty values are omitted from API requests. However, any non-pointer,
  23006. // non-interface field appearing in ForceSendFields will be sent to the
  23007. // server regardless of whether the field is empty or not. This may be
  23008. // used to include empty fields in Patch requests.
  23009. ForceSendFields []string `json:"-"`
  23010. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  23011. // include in API requests with the JSON null value. By default, fields
  23012. // with empty values are omitted from API requests. However, any field
  23013. // with an empty value appearing in NullFields will be sent to the
  23014. // server as null. It is an error if a field in this list has a
  23015. // non-empty value. This may be used to include null fields in Patch
  23016. // requests.
  23017. NullFields []string `json:"-"`
  23018. }
  23019. func (s *ResourcePolicyBackupSchedulePolicy) MarshalJSON() ([]byte, error) {
  23020. type NoMethod ResourcePolicyBackupSchedulePolicy
  23021. raw := NoMethod(*s)
  23022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23023. }
  23024. // ResourcePolicyBackupSchedulePolicyRetentionPolicy: Policy for
  23025. // retention of scheduled snapshots.
  23026. type ResourcePolicyBackupSchedulePolicyRetentionPolicy struct {
  23027. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  23028. // kept.
  23029. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  23030. // OnPolicySwitch: Specifies the behavior to apply to existing,
  23031. // scheduled snapshots snapshots if the policy is changed.
  23032. //
  23033. // Possible values:
  23034. // "DO_NOT_RETROACTIVELY_APPLY"
  23035. // "RETROACTIVELY_APPLY"
  23036. // "UNSPECIFIED_ON_POLICY_SWITCH"
  23037. OnPolicySwitch string `json:"onPolicySwitch,omitempty"`
  23038. // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
  23039. // snapshots when the source disk is deleted.
  23040. //
  23041. // Possible values:
  23042. // "APPLY_RETENTION_POLICY"
  23043. // "KEEP_AUTO_SNAPSHOTS"
  23044. // "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
  23045. OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
  23046. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  23047. // unconditionally include in API requests. By default, fields with
  23048. // empty values are omitted from API requests. However, any non-pointer,
  23049. // non-interface field appearing in ForceSendFields will be sent to the
  23050. // server regardless of whether the field is empty or not. This may be
  23051. // used to include empty fields in Patch requests.
  23052. ForceSendFields []string `json:"-"`
  23053. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  23054. // include in API requests with the JSON null value. By default, fields
  23055. // with empty values are omitted from API requests. However, any field
  23056. // with an empty value appearing in NullFields will be sent to the
  23057. // server as null. It is an error if a field in this list has a
  23058. // non-empty value. This may be used to include null fields in Patch
  23059. // requests.
  23060. NullFields []string `json:"-"`
  23061. }
  23062. func (s *ResourcePolicyBackupSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  23063. type NoMethod ResourcePolicyBackupSchedulePolicyRetentionPolicy
  23064. raw := NoMethod(*s)
  23065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23066. }
  23067. // ResourcePolicyBackupSchedulePolicySchedule: A schedule for disks
  23068. // where the schedueled operations are performed.
  23069. type ResourcePolicyBackupSchedulePolicySchedule struct {
  23070. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  23071. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  23072. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  23073. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  23074. // unconditionally include in API requests. By default, fields with
  23075. // empty values are omitted from API requests. However, any non-pointer,
  23076. // non-interface field appearing in ForceSendFields will be sent to the
  23077. // server regardless of whether the field is empty or not. This may be
  23078. // used to include empty fields in Patch requests.
  23079. ForceSendFields []string `json:"-"`
  23080. // NullFields is a list of field names (e.g. "DailySchedule") to include
  23081. // in API requests with the JSON null value. By default, fields with
  23082. // empty values are omitted from API requests. However, any field with
  23083. // an empty value appearing in NullFields will be sent to the server as
  23084. // null. It is an error if a field in this list has a non-empty value.
  23085. // This may be used to include null fields in Patch requests.
  23086. NullFields []string `json:"-"`
  23087. }
  23088. func (s *ResourcePolicyBackupSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  23089. type NoMethod ResourcePolicyBackupSchedulePolicySchedule
  23090. raw := NoMethod(*s)
  23091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23092. }
  23093. // ResourcePolicyBackupSchedulePolicySnapshotProperties: Specified
  23094. // snapshot properties for scheduled snapshots created by this policy.
  23095. type ResourcePolicyBackupSchedulePolicySnapshotProperties struct {
  23096. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  23097. GuestFlush bool `json:"guestFlush,omitempty"`
  23098. // Labels: Labels to apply to scheduled snapshots. These can be later
  23099. // modified by the setLabels method. Label values may be empty.
  23100. Labels map[string]string `json:"labels,omitempty"`
  23101. // StorageLocations: GCS bucket storage location of the auto snapshot
  23102. // (regional or multi-regional).
  23103. StorageLocations []string `json:"storageLocations,omitempty"`
  23104. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  23105. // unconditionally include in API requests. By default, fields with
  23106. // empty values are omitted from API requests. However, any non-pointer,
  23107. // non-interface field appearing in ForceSendFields will be sent to the
  23108. // server regardless of whether the field is empty or not. This may be
  23109. // used to include empty fields in Patch requests.
  23110. ForceSendFields []string `json:"-"`
  23111. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  23112. // API requests with the JSON null value. By default, fields with empty
  23113. // values are omitted from API requests. However, any field with an
  23114. // empty value appearing in NullFields will be sent to the server as
  23115. // null. It is an error if a field in this list has a non-empty value.
  23116. // This may be used to include null fields in Patch requests.
  23117. NullFields []string `json:"-"`
  23118. }
  23119. func (s *ResourcePolicyBackupSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  23120. type NoMethod ResourcePolicyBackupSchedulePolicySnapshotProperties
  23121. raw := NoMethod(*s)
  23122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23123. }
  23124. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  23125. type ResourcePolicyDailyCycle struct {
  23126. // DaysInCycle: Allows to define schedule that runs every nth day of the
  23127. // month.
  23128. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  23129. // Duration: [Output only] Duration of the time window, automatically
  23130. // chosen to be smallest possible in the given scenario.
  23131. Duration string `json:"duration,omitempty"`
  23132. // StartTime: Time within the window to start the operations. It must be
  23133. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  23134. StartTime string `json:"startTime,omitempty"`
  23135. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  23136. // unconditionally include in API requests. By default, fields with
  23137. // empty values are omitted from API requests. However, any non-pointer,
  23138. // non-interface field appearing in ForceSendFields will be sent to the
  23139. // server regardless of whether the field is empty or not. This may be
  23140. // used to include empty fields in Patch requests.
  23141. ForceSendFields []string `json:"-"`
  23142. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  23143. // in API requests with the JSON null value. By default, fields with
  23144. // empty values are omitted from API requests. However, any field with
  23145. // an empty value appearing in NullFields will be sent to the server as
  23146. // null. It is an error if a field in this list has a non-empty value.
  23147. // This may be used to include null fields in Patch requests.
  23148. NullFields []string `json:"-"`
  23149. }
  23150. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  23151. type NoMethod ResourcePolicyDailyCycle
  23152. raw := NoMethod(*s)
  23153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23154. }
  23155. // ResourcePolicyHourlyCycle: Time window specified for hourly
  23156. // operations.
  23157. type ResourcePolicyHourlyCycle struct {
  23158. // Duration: [Output only] Duration of the time window, automatically
  23159. // chosen to be smallest possible in the given scenario.
  23160. Duration string `json:"duration,omitempty"`
  23161. // HoursInCycle: Allows to define schedule that runs every nth hour.
  23162. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  23163. // StartTime: Time within the window to start the operations. It must be
  23164. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  23165. StartTime string `json:"startTime,omitempty"`
  23166. // ForceSendFields is a list of field names (e.g. "Duration") to
  23167. // unconditionally include in API requests. By default, fields with
  23168. // empty values are omitted from API requests. However, any non-pointer,
  23169. // non-interface field appearing in ForceSendFields will be sent to the
  23170. // server regardless of whether the field is empty or not. This may be
  23171. // used to include empty fields in Patch requests.
  23172. ForceSendFields []string `json:"-"`
  23173. // NullFields is a list of field names (e.g. "Duration") to include in
  23174. // API requests with the JSON null value. By default, fields with empty
  23175. // values are omitted from API requests. However, any field with an
  23176. // empty value appearing in NullFields will be sent to the server as
  23177. // null. It is an error if a field in this list has a non-empty value.
  23178. // This may be used to include null fields in Patch requests.
  23179. NullFields []string `json:"-"`
  23180. }
  23181. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  23182. type NoMethod ResourcePolicyHourlyCycle
  23183. raw := NoMethod(*s)
  23184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23185. }
  23186. type ResourcePolicyList struct {
  23187. Etag string `json:"etag,omitempty"`
  23188. // Id: [Output Only] The unique identifier for the resource. This
  23189. // identifier is defined by the server.
  23190. Id string `json:"id,omitempty"`
  23191. // Items: [Output Only] A list of ResourcePolicy resources.
  23192. Items []*ResourcePolicy `json:"items,omitempty"`
  23193. // Kind: [Output Only] Type of resource.Always
  23194. // compute#resourcePoliciesList for listsof resourcePolicies
  23195. Kind string `json:"kind,omitempty"`
  23196. // NextPageToken: [Output Only] This token allows you to get the next
  23197. // page of results for list requests. If the number of results is larger
  23198. // than maxResults, use the nextPageToken as a value for the query
  23199. // parameter pageToken in the next list request. Subsequent list
  23200. // requests will have their own nextPageToken to continue paging through
  23201. // the results.
  23202. NextPageToken string `json:"nextPageToken,omitempty"`
  23203. // SelfLink: [Output Only] Server-defined URL for this resource.
  23204. SelfLink string `json:"selfLink,omitempty"`
  23205. // Warning: [Output Only] Informational warning message.
  23206. Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
  23207. // ServerResponse contains the HTTP response code and headers from the
  23208. // server.
  23209. googleapi.ServerResponse `json:"-"`
  23210. // ForceSendFields is a list of field names (e.g. "Etag") to
  23211. // unconditionally include in API requests. By default, fields with
  23212. // empty values are omitted from API requests. However, any non-pointer,
  23213. // non-interface field appearing in ForceSendFields will be sent to the
  23214. // server regardless of whether the field is empty or not. This may be
  23215. // used to include empty fields in Patch requests.
  23216. ForceSendFields []string `json:"-"`
  23217. // NullFields is a list of field names (e.g. "Etag") to include in API
  23218. // requests with the JSON null value. By default, fields with empty
  23219. // values are omitted from API requests. However, any field with an
  23220. // empty value appearing in NullFields will be sent to the server as
  23221. // null. It is an error if a field in this list has a non-empty value.
  23222. // This may be used to include null fields in Patch requests.
  23223. NullFields []string `json:"-"`
  23224. }
  23225. func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
  23226. type NoMethod ResourcePolicyList
  23227. raw := NoMethod(*s)
  23228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23229. }
  23230. // ResourcePolicyListWarning: [Output Only] Informational warning
  23231. // message.
  23232. type ResourcePolicyListWarning struct {
  23233. // Code: [Output Only] A warning code, if applicable. For example,
  23234. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23235. // the response.
  23236. //
  23237. // Possible values:
  23238. // "CLEANUP_FAILED"
  23239. // "DEPRECATED_RESOURCE_USED"
  23240. // "DEPRECATED_TYPE_USED"
  23241. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23242. // "EXPERIMENTAL_TYPE_USED"
  23243. // "EXTERNAL_API_WARNING"
  23244. // "FIELD_VALUE_OVERRIDEN"
  23245. // "INJECTED_KERNELS_DEPRECATED"
  23246. // "MISSING_TYPE_DEPENDENCY"
  23247. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23248. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23249. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23250. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23251. // "NEXT_HOP_NOT_RUNNING"
  23252. // "NOT_CRITICAL_ERROR"
  23253. // "NO_RESULTS_ON_PAGE"
  23254. // "REQUIRED_TOS_AGREEMENT"
  23255. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23256. // "RESOURCE_NOT_DELETED"
  23257. // "SCHEMA_VALIDATION_IGNORED"
  23258. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23259. // "UNDECLARED_PROPERTIES"
  23260. // "UNREACHABLE"
  23261. Code string `json:"code,omitempty"`
  23262. // Data: [Output Only] Metadata about this warning in key: value format.
  23263. // For example:
  23264. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23265. Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
  23266. // Message: [Output Only] A human-readable description of the warning
  23267. // code.
  23268. Message string `json:"message,omitempty"`
  23269. // ForceSendFields is a list of field names (e.g. "Code") to
  23270. // unconditionally include in API requests. By default, fields with
  23271. // empty values are omitted from API requests. However, any non-pointer,
  23272. // non-interface field appearing in ForceSendFields will be sent to the
  23273. // server regardless of whether the field is empty or not. This may be
  23274. // used to include empty fields in Patch requests.
  23275. ForceSendFields []string `json:"-"`
  23276. // NullFields is a list of field names (e.g. "Code") to include in API
  23277. // requests with the JSON null value. By default, fields with empty
  23278. // values are omitted from API requests. However, any field with an
  23279. // empty value appearing in NullFields will be sent to the server as
  23280. // null. It is an error if a field in this list has a non-empty value.
  23281. // This may be used to include null fields in Patch requests.
  23282. NullFields []string `json:"-"`
  23283. }
  23284. func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
  23285. type NoMethod ResourcePolicyListWarning
  23286. raw := NoMethod(*s)
  23287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23288. }
  23289. type ResourcePolicyListWarningData struct {
  23290. // Key: [Output Only] A key that provides more detail on the warning
  23291. // being returned. For example, for warnings where there are no results
  23292. // in a list request for a particular zone, this key might be scope and
  23293. // the key value might be the zone name. Other examples might be a key
  23294. // indicating a deprecated resource and a suggested replacement, or a
  23295. // warning about invalid network settings (for example, if an instance
  23296. // attempts to perform IP forwarding but is not enabled for IP
  23297. // forwarding).
  23298. Key string `json:"key,omitempty"`
  23299. // Value: [Output Only] A warning data value corresponding to the key.
  23300. Value string `json:"value,omitempty"`
  23301. // ForceSendFields is a list of field names (e.g. "Key") to
  23302. // unconditionally include in API requests. By default, fields with
  23303. // empty values are omitted from API requests. However, any non-pointer,
  23304. // non-interface field appearing in ForceSendFields will be sent to the
  23305. // server regardless of whether the field is empty or not. This may be
  23306. // used to include empty fields in Patch requests.
  23307. ForceSendFields []string `json:"-"`
  23308. // NullFields is a list of field names (e.g. "Key") to include in API
  23309. // requests with the JSON null value. By default, fields with empty
  23310. // values are omitted from API requests. However, any field with an
  23311. // empty value appearing in NullFields will be sent to the server as
  23312. // null. It is an error if a field in this list has a non-empty value.
  23313. // This may be used to include null fields in Patch requests.
  23314. NullFields []string `json:"-"`
  23315. }
  23316. func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
  23317. type NoMethod ResourcePolicyListWarningData
  23318. raw := NoMethod(*s)
  23319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23320. }
  23321. type ResourcePolicyVmMaintenancePolicy struct {
  23322. // MaintenanceWindow: Maintenance windows that are applied to VMs
  23323. // covered by this policy.
  23324. MaintenanceWindow *ResourcePolicyVmMaintenancePolicyMaintenanceWindow `json:"maintenanceWindow,omitempty"`
  23325. // ForceSendFields is a list of field names (e.g. "MaintenanceWindow")
  23326. // to unconditionally include in API requests. By default, fields with
  23327. // empty values are omitted from API requests. However, any non-pointer,
  23328. // non-interface field appearing in ForceSendFields will be sent to the
  23329. // server regardless of whether the field is empty or not. This may be
  23330. // used to include empty fields in Patch requests.
  23331. ForceSendFields []string `json:"-"`
  23332. // NullFields is a list of field names (e.g. "MaintenanceWindow") to
  23333. // include in API requests with the JSON null value. By default, fields
  23334. // with empty values are omitted from API requests. However, any field
  23335. // with an empty value appearing in NullFields will be sent to the
  23336. // server as null. It is an error if a field in this list has a
  23337. // non-empty value. This may be used to include null fields in Patch
  23338. // requests.
  23339. NullFields []string `json:"-"`
  23340. }
  23341. func (s *ResourcePolicyVmMaintenancePolicy) MarshalJSON() ([]byte, error) {
  23342. type NoMethod ResourcePolicyVmMaintenancePolicy
  23343. raw := NoMethod(*s)
  23344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23345. }
  23346. // ResourcePolicyVmMaintenancePolicyMaintenanceWindow: A maintenance
  23347. // window for VMs. When set, we restrict our maintenance operations to
  23348. // this window.
  23349. type ResourcePolicyVmMaintenancePolicyMaintenanceWindow struct {
  23350. DailyMaintenanceWindow *ResourcePolicyDailyCycle `json:"dailyMaintenanceWindow,omitempty"`
  23351. // ForceSendFields is a list of field names (e.g.
  23352. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  23353. // By default, fields with empty values are omitted from API requests.
  23354. // However, any non-pointer, non-interface field appearing in
  23355. // ForceSendFields will be sent to the server regardless of whether the
  23356. // field is empty or not. This may be used to include empty fields in
  23357. // Patch requests.
  23358. ForceSendFields []string `json:"-"`
  23359. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  23360. // to include in API requests with the JSON null value. By default,
  23361. // fields with empty values are omitted from API requests. However, any
  23362. // field with an empty value appearing in NullFields will be sent to the
  23363. // server as null. It is an error if a field in this list has a
  23364. // non-empty value. This may be used to include null fields in Patch
  23365. // requests.
  23366. NullFields []string `json:"-"`
  23367. }
  23368. func (s *ResourcePolicyVmMaintenancePolicyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  23369. type NoMethod ResourcePolicyVmMaintenancePolicyMaintenanceWindow
  23370. raw := NoMethod(*s)
  23371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23372. }
  23373. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  23374. // operations.
  23375. type ResourcePolicyWeeklyCycle struct {
  23376. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  23377. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  23378. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
  23379. // unconditionally include in API requests. By default, fields with
  23380. // empty values are omitted from API requests. However, any non-pointer,
  23381. // non-interface field appearing in ForceSendFields will be sent to the
  23382. // server regardless of whether the field is empty or not. This may be
  23383. // used to include empty fields in Patch requests.
  23384. ForceSendFields []string `json:"-"`
  23385. // NullFields is a list of field names (e.g. "DayOfWeeks") to include in
  23386. // API requests with the JSON null value. By default, fields with empty
  23387. // values are omitted from API requests. However, any field with an
  23388. // empty value appearing in NullFields will be sent to the server as
  23389. // null. It is an error if a field in this list has a non-empty value.
  23390. // This may be used to include null fields in Patch requests.
  23391. NullFields []string `json:"-"`
  23392. }
  23393. func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  23394. type NoMethod ResourcePolicyWeeklyCycle
  23395. raw := NoMethod(*s)
  23396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23397. }
  23398. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  23399. // Day: Allows to define schedule that runs specified day of the week.
  23400. //
  23401. // Possible values:
  23402. // "FRIDAY"
  23403. // "INVALID"
  23404. // "MONDAY"
  23405. // "SATURDAY"
  23406. // "SUNDAY"
  23407. // "THURSDAY"
  23408. // "TUESDAY"
  23409. // "WEDNESDAY"
  23410. Day string `json:"day,omitempty"`
  23411. // Duration: [Output only] Duration of the time window, automatically
  23412. // chosen to be smallest possible in the given scenario.
  23413. Duration string `json:"duration,omitempty"`
  23414. // StartTime: Time within the window to start the operations. It must be
  23415. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  23416. StartTime string `json:"startTime,omitempty"`
  23417. // ForceSendFields is a list of field names (e.g. "Day") to
  23418. // unconditionally include in API requests. By default, fields with
  23419. // empty values are omitted from API requests. However, any non-pointer,
  23420. // non-interface field appearing in ForceSendFields will be sent to the
  23421. // server regardless of whether the field is empty or not. This may be
  23422. // used to include empty fields in Patch requests.
  23423. ForceSendFields []string `json:"-"`
  23424. // NullFields is a list of field names (e.g. "Day") to include in API
  23425. // requests with the JSON null value. By default, fields with empty
  23426. // values are omitted from API requests. However, any field with an
  23427. // empty value appearing in NullFields will be sent to the server as
  23428. // null. It is an error if a field in this list has a non-empty value.
  23429. // This may be used to include null fields in Patch requests.
  23430. NullFields []string `json:"-"`
  23431. }
  23432. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  23433. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  23434. raw := NoMethod(*s)
  23435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23436. }
  23437. // Route: Represents a Route resource. A route specifies how certain
  23438. // packets should be handled by the network. Routes are associated with
  23439. // instances by tags and the set of routes for a particular instance is
  23440. // called its routing table.
  23441. //
  23442. // For each packet leaving an instance, the system searches that
  23443. // instance's routing table for a single best matching route. Routes
  23444. // match packets by destination IP address, preferring smaller or more
  23445. // specific ranges over larger ones. If there is a tie, the system
  23446. // selects the route with the smallest priority value. If there is still
  23447. // a tie, it uses the layer three and four packet headers to select just
  23448. // one of the remaining matching routes. The packet is then forwarded as
  23449. // specified by the nextHop field of the winning route - either to
  23450. // another instance destination, an instance gateway, or a Google
  23451. // Compute Engine-operated gateway.
  23452. //
  23453. // Packets that do not match any route in the sending instance's routing
  23454. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  23455. // v1.routes ==)
  23456. type Route struct {
  23457. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23458. // format.
  23459. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23460. // Description: An optional description of this resource. Provide this
  23461. // property when you create the resource.
  23462. Description string `json:"description,omitempty"`
  23463. // DestRange: The destination range of outgoing packets that this route
  23464. // applies to. Only IPv4 is supported.
  23465. DestRange string `json:"destRange,omitempty"`
  23466. // Id: [Output Only] The unique identifier for the resource. This
  23467. // identifier is defined by the server.
  23468. Id uint64 `json:"id,omitempty,string"`
  23469. // Kind: [Output Only] Type of this resource. Always compute#routes for
  23470. // Route resources.
  23471. Kind string `json:"kind,omitempty"`
  23472. // Name: Name of the resource. Provided by the client when the resource
  23473. // is created. The name must be 1-63 characters long, and comply with
  23474. // RFC1035. Specifically, the name must be 1-63 characters long and
  23475. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23476. // the first character must be a lowercase letter, and all following
  23477. // characters must be a dash, lowercase letter, or digit, except the
  23478. // last character, which cannot be a dash.
  23479. Name string `json:"name,omitempty"`
  23480. // Network: Fully-qualified URL of the network that this route applies
  23481. // to.
  23482. Network string `json:"network,omitempty"`
  23483. // NextHopGateway: The URL to a gateway that should handle matching
  23484. // packets. You can only specify the internet gateway using a full or
  23485. // partial valid URL:
  23486. // projects/<project-id>/global/gateways/default-internet-gateway
  23487. NextHopGateway string `json:"nextHopGateway,omitempty"`
  23488. // NextHopIlb: The URL to a forwarding rule of type
  23489. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  23490. // can only specify the forwarding rule as a partial or full URL. For
  23491. // example, the following are all valid URLs:
  23492. // -
  23493. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  23494. // - regions/region/forwardingRules/forwardingRule Note that this can
  23495. // only be used when the destination_range is a public (non-RFC 1918) IP
  23496. // CIDR range.
  23497. NextHopIlb string `json:"nextHopIlb,omitempty"`
  23498. // NextHopInstance: The URL to an instance that should handle matching
  23499. // packets. You can specify this as a full or partial URL. For
  23500. // example:
  23501. // https://www.googleapis.com/compute/v1/projects/project/zones/
  23502. // zone/instances/
  23503. NextHopInstance string `json:"nextHopInstance,omitempty"`
  23504. // NextHopIp: The network IP address of an instance that should handle
  23505. // matching packets. Only IPv4 is supported.
  23506. NextHopIp string `json:"nextHopIp,omitempty"`
  23507. // NextHopNetwork: The URL of the local network if it should handle
  23508. // matching packets.
  23509. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  23510. // NextHopPeering: [Output Only] The network peering name that should
  23511. // handle matching packets, which should conform to RFC1035.
  23512. NextHopPeering string `json:"nextHopPeering,omitempty"`
  23513. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  23514. // packets.
  23515. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  23516. // Priority: The priority of this route. Priority is used to break ties
  23517. // in cases where there is more than one matching route of equal prefix
  23518. // length. In the case of two routes with equal prefix length, the one
  23519. // with the lowest-numbered priority value wins. Default value is 1000.
  23520. // Valid range is 0 through 65535.
  23521. Priority int64 `json:"priority,omitempty"`
  23522. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  23523. // resource.
  23524. SelfLink string `json:"selfLink,omitempty"`
  23525. // Tags: A list of instance tags to which this route applies.
  23526. Tags []string `json:"tags,omitempty"`
  23527. // Warnings: [Output Only] If potential misconfigurations are detected
  23528. // for this route, this field will be populated with warning messages.
  23529. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  23530. // ServerResponse contains the HTTP response code and headers from the
  23531. // server.
  23532. googleapi.ServerResponse `json:"-"`
  23533. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23534. // to unconditionally include in API requests. By default, fields with
  23535. // empty values are omitted from API requests. However, any non-pointer,
  23536. // non-interface field appearing in ForceSendFields will be sent to the
  23537. // server regardless of whether the field is empty or not. This may be
  23538. // used to include empty fields in Patch requests.
  23539. ForceSendFields []string `json:"-"`
  23540. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23541. // include in API requests with the JSON null value. By default, fields
  23542. // with empty values are omitted from API requests. However, any field
  23543. // with an empty value appearing in NullFields will be sent to the
  23544. // server as null. It is an error if a field in this list has a
  23545. // non-empty value. This may be used to include null fields in Patch
  23546. // requests.
  23547. NullFields []string `json:"-"`
  23548. }
  23549. func (s *Route) MarshalJSON() ([]byte, error) {
  23550. type NoMethod Route
  23551. raw := NoMethod(*s)
  23552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23553. }
  23554. type RouteWarnings struct {
  23555. // Code: [Output Only] A warning code, if applicable. For example,
  23556. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23557. // the response.
  23558. //
  23559. // Possible values:
  23560. // "CLEANUP_FAILED"
  23561. // "DEPRECATED_RESOURCE_USED"
  23562. // "DEPRECATED_TYPE_USED"
  23563. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23564. // "EXPERIMENTAL_TYPE_USED"
  23565. // "EXTERNAL_API_WARNING"
  23566. // "FIELD_VALUE_OVERRIDEN"
  23567. // "INJECTED_KERNELS_DEPRECATED"
  23568. // "MISSING_TYPE_DEPENDENCY"
  23569. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23570. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23571. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23572. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23573. // "NEXT_HOP_NOT_RUNNING"
  23574. // "NOT_CRITICAL_ERROR"
  23575. // "NO_RESULTS_ON_PAGE"
  23576. // "REQUIRED_TOS_AGREEMENT"
  23577. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23578. // "RESOURCE_NOT_DELETED"
  23579. // "SCHEMA_VALIDATION_IGNORED"
  23580. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23581. // "UNDECLARED_PROPERTIES"
  23582. // "UNREACHABLE"
  23583. Code string `json:"code,omitempty"`
  23584. // Data: [Output Only] Metadata about this warning in key: value format.
  23585. // For example:
  23586. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23587. Data []*RouteWarningsData `json:"data,omitempty"`
  23588. // Message: [Output Only] A human-readable description of the warning
  23589. // code.
  23590. Message string `json:"message,omitempty"`
  23591. // ForceSendFields is a list of field names (e.g. "Code") to
  23592. // unconditionally include in API requests. By default, fields with
  23593. // empty values are omitted from API requests. However, any non-pointer,
  23594. // non-interface field appearing in ForceSendFields will be sent to the
  23595. // server regardless of whether the field is empty or not. This may be
  23596. // used to include empty fields in Patch requests.
  23597. ForceSendFields []string `json:"-"`
  23598. // NullFields is a list of field names (e.g. "Code") to include in API
  23599. // requests with the JSON null value. By default, fields with empty
  23600. // values are omitted from API requests. However, any field with an
  23601. // empty value appearing in NullFields will be sent to the server as
  23602. // null. It is an error if a field in this list has a non-empty value.
  23603. // This may be used to include null fields in Patch requests.
  23604. NullFields []string `json:"-"`
  23605. }
  23606. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  23607. type NoMethod RouteWarnings
  23608. raw := NoMethod(*s)
  23609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23610. }
  23611. type RouteWarningsData struct {
  23612. // Key: [Output Only] A key that provides more detail on the warning
  23613. // being returned. For example, for warnings where there are no results
  23614. // in a list request for a particular zone, this key might be scope and
  23615. // the key value might be the zone name. Other examples might be a key
  23616. // indicating a deprecated resource and a suggested replacement, or a
  23617. // warning about invalid network settings (for example, if an instance
  23618. // attempts to perform IP forwarding but is not enabled for IP
  23619. // forwarding).
  23620. Key string `json:"key,omitempty"`
  23621. // Value: [Output Only] A warning data value corresponding to the key.
  23622. Value string `json:"value,omitempty"`
  23623. // ForceSendFields is a list of field names (e.g. "Key") to
  23624. // unconditionally include in API requests. By default, fields with
  23625. // empty values are omitted from API requests. However, any non-pointer,
  23626. // non-interface field appearing in ForceSendFields will be sent to the
  23627. // server regardless of whether the field is empty or not. This may be
  23628. // used to include empty fields in Patch requests.
  23629. ForceSendFields []string `json:"-"`
  23630. // NullFields is a list of field names (e.g. "Key") to include in API
  23631. // requests with the JSON null value. By default, fields with empty
  23632. // values are omitted from API requests. However, any field with an
  23633. // empty value appearing in NullFields will be sent to the server as
  23634. // null. It is an error if a field in this list has a non-empty value.
  23635. // This may be used to include null fields in Patch requests.
  23636. NullFields []string `json:"-"`
  23637. }
  23638. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  23639. type NoMethod RouteWarningsData
  23640. raw := NoMethod(*s)
  23641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23642. }
  23643. // RouteList: Contains a list of Route resources.
  23644. type RouteList struct {
  23645. // Id: [Output Only] Unique identifier for the resource; defined by the
  23646. // server.
  23647. Id string `json:"id,omitempty"`
  23648. // Items: A list of Route resources.
  23649. Items []*Route `json:"items,omitempty"`
  23650. // Kind: Type of resource.
  23651. Kind string `json:"kind,omitempty"`
  23652. // NextPageToken: [Output Only] This token allows you to get the next
  23653. // page of results for list requests. If the number of results is larger
  23654. // than maxResults, use the nextPageToken as a value for the query
  23655. // parameter pageToken in the next list request. Subsequent list
  23656. // requests will have their own nextPageToken to continue paging through
  23657. // the results.
  23658. NextPageToken string `json:"nextPageToken,omitempty"`
  23659. // SelfLink: [Output Only] Server-defined URL for this resource.
  23660. SelfLink string `json:"selfLink,omitempty"`
  23661. // Warning: [Output Only] Informational warning message.
  23662. Warning *RouteListWarning `json:"warning,omitempty"`
  23663. // ServerResponse contains the HTTP response code and headers from the
  23664. // server.
  23665. googleapi.ServerResponse `json:"-"`
  23666. // ForceSendFields is a list of field names (e.g. "Id") to
  23667. // unconditionally include in API requests. By default, fields with
  23668. // empty values are omitted from API requests. However, any non-pointer,
  23669. // non-interface field appearing in ForceSendFields will be sent to the
  23670. // server regardless of whether the field is empty or not. This may be
  23671. // used to include empty fields in Patch requests.
  23672. ForceSendFields []string `json:"-"`
  23673. // NullFields is a list of field names (e.g. "Id") to include in API
  23674. // requests with the JSON null value. By default, fields with empty
  23675. // values are omitted from API requests. However, any field with an
  23676. // empty value appearing in NullFields will be sent to the server as
  23677. // null. It is an error if a field in this list has a non-empty value.
  23678. // This may be used to include null fields in Patch requests.
  23679. NullFields []string `json:"-"`
  23680. }
  23681. func (s *RouteList) MarshalJSON() ([]byte, error) {
  23682. type NoMethod RouteList
  23683. raw := NoMethod(*s)
  23684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23685. }
  23686. // RouteListWarning: [Output Only] Informational warning message.
  23687. type RouteListWarning struct {
  23688. // Code: [Output Only] A warning code, if applicable. For example,
  23689. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23690. // the response.
  23691. //
  23692. // Possible values:
  23693. // "CLEANUP_FAILED"
  23694. // "DEPRECATED_RESOURCE_USED"
  23695. // "DEPRECATED_TYPE_USED"
  23696. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23697. // "EXPERIMENTAL_TYPE_USED"
  23698. // "EXTERNAL_API_WARNING"
  23699. // "FIELD_VALUE_OVERRIDEN"
  23700. // "INJECTED_KERNELS_DEPRECATED"
  23701. // "MISSING_TYPE_DEPENDENCY"
  23702. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23703. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23704. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23705. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23706. // "NEXT_HOP_NOT_RUNNING"
  23707. // "NOT_CRITICAL_ERROR"
  23708. // "NO_RESULTS_ON_PAGE"
  23709. // "REQUIRED_TOS_AGREEMENT"
  23710. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23711. // "RESOURCE_NOT_DELETED"
  23712. // "SCHEMA_VALIDATION_IGNORED"
  23713. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23714. // "UNDECLARED_PROPERTIES"
  23715. // "UNREACHABLE"
  23716. Code string `json:"code,omitempty"`
  23717. // Data: [Output Only] Metadata about this warning in key: value format.
  23718. // For example:
  23719. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23720. Data []*RouteListWarningData `json:"data,omitempty"`
  23721. // Message: [Output Only] A human-readable description of the warning
  23722. // code.
  23723. Message string `json:"message,omitempty"`
  23724. // ForceSendFields is a list of field names (e.g. "Code") to
  23725. // unconditionally include in API requests. By default, fields with
  23726. // empty values are omitted from API requests. However, any non-pointer,
  23727. // non-interface field appearing in ForceSendFields will be sent to the
  23728. // server regardless of whether the field is empty or not. This may be
  23729. // used to include empty fields in Patch requests.
  23730. ForceSendFields []string `json:"-"`
  23731. // NullFields is a list of field names (e.g. "Code") to include in API
  23732. // requests with the JSON null value. By default, fields with empty
  23733. // values are omitted from API requests. However, any field with an
  23734. // empty value appearing in NullFields will be sent to the server as
  23735. // null. It is an error if a field in this list has a non-empty value.
  23736. // This may be used to include null fields in Patch requests.
  23737. NullFields []string `json:"-"`
  23738. }
  23739. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  23740. type NoMethod RouteListWarning
  23741. raw := NoMethod(*s)
  23742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23743. }
  23744. type RouteListWarningData struct {
  23745. // Key: [Output Only] A key that provides more detail on the warning
  23746. // being returned. For example, for warnings where there are no results
  23747. // in a list request for a particular zone, this key might be scope and
  23748. // the key value might be the zone name. Other examples might be a key
  23749. // indicating a deprecated resource and a suggested replacement, or a
  23750. // warning about invalid network settings (for example, if an instance
  23751. // attempts to perform IP forwarding but is not enabled for IP
  23752. // forwarding).
  23753. Key string `json:"key,omitempty"`
  23754. // Value: [Output Only] A warning data value corresponding to the key.
  23755. Value string `json:"value,omitempty"`
  23756. // ForceSendFields is a list of field names (e.g. "Key") to
  23757. // unconditionally include in API requests. By default, fields with
  23758. // empty values are omitted from API requests. However, any non-pointer,
  23759. // non-interface field appearing in ForceSendFields will be sent to the
  23760. // server regardless of whether the field is empty or not. This may be
  23761. // used to include empty fields in Patch requests.
  23762. ForceSendFields []string `json:"-"`
  23763. // NullFields is a list of field names (e.g. "Key") to include in API
  23764. // requests with the JSON null value. By default, fields with empty
  23765. // values are omitted from API requests. However, any field with an
  23766. // empty value appearing in NullFields will be sent to the server as
  23767. // null. It is an error if a field in this list has a non-empty value.
  23768. // This may be used to include null fields in Patch requests.
  23769. NullFields []string `json:"-"`
  23770. }
  23771. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  23772. type NoMethod RouteListWarningData
  23773. raw := NoMethod(*s)
  23774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23775. }
  23776. // Router: Router resource.
  23777. type Router struct {
  23778. // Bgp: BGP information specific to this router.
  23779. Bgp *RouterBgp `json:"bgp,omitempty"`
  23780. // BgpPeers: BGP information that needs to be configured into the
  23781. // routing stack to establish the BGP peering. It must specify peer ASN
  23782. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  23783. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  23784. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23785. // format.
  23786. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23787. // Description: An optional description of this resource. Provide this
  23788. // property when you create the resource.
  23789. Description string `json:"description,omitempty"`
  23790. // Id: [Output Only] The unique identifier for the resource. This
  23791. // identifier is defined by the server.
  23792. Id uint64 `json:"id,omitempty,string"`
  23793. // Interfaces: Router interfaces. Each interface requires either one
  23794. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  23795. // range (e.g. ipRange), or both.
  23796. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  23797. // Kind: [Output Only] Type of resource. Always compute#router for
  23798. // routers.
  23799. Kind string `json:"kind,omitempty"`
  23800. // Name: Name of the resource. Provided by the client when the resource
  23801. // is created. The name must be 1-63 characters long, and comply with
  23802. // RFC1035. Specifically, the name must be 1-63 characters long and
  23803. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23804. // the first character must be a lowercase letter, and all following
  23805. // characters must be a dash, lowercase letter, or digit, except the
  23806. // last character, which cannot be a dash.
  23807. Name string `json:"name,omitempty"`
  23808. // Nats: A list of Nat services created in this router.
  23809. Nats []*RouterNat `json:"nats,omitempty"`
  23810. // Network: URI of the network to which this router belongs.
  23811. Network string `json:"network,omitempty"`
  23812. // Region: [Output Only] URI of the region where the router resides. You
  23813. // must specify this field as part of the HTTP request URL. It is not
  23814. // settable as a field in the request body.
  23815. Region string `json:"region,omitempty"`
  23816. // SelfLink: [Output Only] Server-defined URL for the resource.
  23817. SelfLink string `json:"selfLink,omitempty"`
  23818. // ServerResponse contains the HTTP response code and headers from the
  23819. // server.
  23820. googleapi.ServerResponse `json:"-"`
  23821. // ForceSendFields is a list of field names (e.g. "Bgp") to
  23822. // unconditionally include in API requests. By default, fields with
  23823. // empty values are omitted from API requests. However, any non-pointer,
  23824. // non-interface field appearing in ForceSendFields will be sent to the
  23825. // server regardless of whether the field is empty or not. This may be
  23826. // used to include empty fields in Patch requests.
  23827. ForceSendFields []string `json:"-"`
  23828. // NullFields is a list of field names (e.g. "Bgp") to include in API
  23829. // requests with the JSON null value. By default, fields with empty
  23830. // values are omitted from API requests. However, any field with an
  23831. // empty value appearing in NullFields will be sent to the server as
  23832. // null. It is an error if a field in this list has a non-empty value.
  23833. // This may be used to include null fields in Patch requests.
  23834. NullFields []string `json:"-"`
  23835. }
  23836. func (s *Router) MarshalJSON() ([]byte, error) {
  23837. type NoMethod Router
  23838. raw := NoMethod(*s)
  23839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23840. }
  23841. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  23842. // to advertise.
  23843. type RouterAdvertisedIpRange struct {
  23844. // Description: User-specified description for the IP range.
  23845. Description string `json:"description,omitempty"`
  23846. // Range: The IP range to advertise. The value must be a CIDR-formatted
  23847. // string.
  23848. Range string `json:"range,omitempty"`
  23849. // ForceSendFields is a list of field names (e.g. "Description") to
  23850. // unconditionally include in API requests. By default, fields with
  23851. // empty values are omitted from API requests. However, any non-pointer,
  23852. // non-interface field appearing in ForceSendFields will be sent to the
  23853. // server regardless of whether the field is empty or not. This may be
  23854. // used to include empty fields in Patch requests.
  23855. ForceSendFields []string `json:"-"`
  23856. // NullFields is a list of field names (e.g. "Description") to include
  23857. // in API requests with the JSON null value. By default, fields with
  23858. // empty values are omitted from API requests. However, any field with
  23859. // an empty value appearing in NullFields will be sent to the server as
  23860. // null. It is an error if a field in this list has a non-empty value.
  23861. // This may be used to include null fields in Patch requests.
  23862. NullFields []string `json:"-"`
  23863. }
  23864. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  23865. type NoMethod RouterAdvertisedIpRange
  23866. raw := NoMethod(*s)
  23867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23868. }
  23869. // RouterAggregatedList: Contains a list of routers.
  23870. type RouterAggregatedList struct {
  23871. // Id: [Output Only] Unique identifier for the resource; defined by the
  23872. // server.
  23873. Id string `json:"id,omitempty"`
  23874. // Items: A list of Router resources.
  23875. Items map[string]RoutersScopedList `json:"items,omitempty"`
  23876. // Kind: Type of resource.
  23877. Kind string `json:"kind,omitempty"`
  23878. // NextPageToken: [Output Only] This token allows you to get the next
  23879. // page of results for list requests. If the number of results is larger
  23880. // than maxResults, use the nextPageToken as a value for the query
  23881. // parameter pageToken in the next list request. Subsequent list
  23882. // requests will have their own nextPageToken to continue paging through
  23883. // the results.
  23884. NextPageToken string `json:"nextPageToken,omitempty"`
  23885. // SelfLink: [Output Only] Server-defined URL for this resource.
  23886. SelfLink string `json:"selfLink,omitempty"`
  23887. // Warning: [Output Only] Informational warning message.
  23888. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  23889. // ServerResponse contains the HTTP response code and headers from the
  23890. // server.
  23891. googleapi.ServerResponse `json:"-"`
  23892. // ForceSendFields is a list of field names (e.g. "Id") to
  23893. // unconditionally include in API requests. By default, fields with
  23894. // empty values are omitted from API requests. However, any non-pointer,
  23895. // non-interface field appearing in ForceSendFields will be sent to the
  23896. // server regardless of whether the field is empty or not. This may be
  23897. // used to include empty fields in Patch requests.
  23898. ForceSendFields []string `json:"-"`
  23899. // NullFields is a list of field names (e.g. "Id") to include in API
  23900. // requests with the JSON null value. By default, fields with empty
  23901. // values are omitted from API requests. However, any field with an
  23902. // empty value appearing in NullFields will be sent to the server as
  23903. // null. It is an error if a field in this list has a non-empty value.
  23904. // This may be used to include null fields in Patch requests.
  23905. NullFields []string `json:"-"`
  23906. }
  23907. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  23908. type NoMethod RouterAggregatedList
  23909. raw := NoMethod(*s)
  23910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23911. }
  23912. // RouterAggregatedListWarning: [Output Only] Informational warning
  23913. // message.
  23914. type RouterAggregatedListWarning struct {
  23915. // Code: [Output Only] A warning code, if applicable. For example,
  23916. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23917. // the response.
  23918. //
  23919. // Possible values:
  23920. // "CLEANUP_FAILED"
  23921. // "DEPRECATED_RESOURCE_USED"
  23922. // "DEPRECATED_TYPE_USED"
  23923. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23924. // "EXPERIMENTAL_TYPE_USED"
  23925. // "EXTERNAL_API_WARNING"
  23926. // "FIELD_VALUE_OVERRIDEN"
  23927. // "INJECTED_KERNELS_DEPRECATED"
  23928. // "MISSING_TYPE_DEPENDENCY"
  23929. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23930. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23931. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23932. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23933. // "NEXT_HOP_NOT_RUNNING"
  23934. // "NOT_CRITICAL_ERROR"
  23935. // "NO_RESULTS_ON_PAGE"
  23936. // "REQUIRED_TOS_AGREEMENT"
  23937. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23938. // "RESOURCE_NOT_DELETED"
  23939. // "SCHEMA_VALIDATION_IGNORED"
  23940. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23941. // "UNDECLARED_PROPERTIES"
  23942. // "UNREACHABLE"
  23943. Code string `json:"code,omitempty"`
  23944. // Data: [Output Only] Metadata about this warning in key: value format.
  23945. // For example:
  23946. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23947. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  23948. // Message: [Output Only] A human-readable description of the warning
  23949. // code.
  23950. Message string `json:"message,omitempty"`
  23951. // ForceSendFields is a list of field names (e.g. "Code") to
  23952. // unconditionally include in API requests. By default, fields with
  23953. // empty values are omitted from API requests. However, any non-pointer,
  23954. // non-interface field appearing in ForceSendFields will be sent to the
  23955. // server regardless of whether the field is empty or not. This may be
  23956. // used to include empty fields in Patch requests.
  23957. ForceSendFields []string `json:"-"`
  23958. // NullFields is a list of field names (e.g. "Code") to include in API
  23959. // requests with the JSON null value. By default, fields with empty
  23960. // values are omitted from API requests. However, any field with an
  23961. // empty value appearing in NullFields will be sent to the server as
  23962. // null. It is an error if a field in this list has a non-empty value.
  23963. // This may be used to include null fields in Patch requests.
  23964. NullFields []string `json:"-"`
  23965. }
  23966. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23967. type NoMethod RouterAggregatedListWarning
  23968. raw := NoMethod(*s)
  23969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23970. }
  23971. type RouterAggregatedListWarningData struct {
  23972. // Key: [Output Only] A key that provides more detail on the warning
  23973. // being returned. For example, for warnings where there are no results
  23974. // in a list request for a particular zone, this key might be scope and
  23975. // the key value might be the zone name. Other examples might be a key
  23976. // indicating a deprecated resource and a suggested replacement, or a
  23977. // warning about invalid network settings (for example, if an instance
  23978. // attempts to perform IP forwarding but is not enabled for IP
  23979. // forwarding).
  23980. Key string `json:"key,omitempty"`
  23981. // Value: [Output Only] A warning data value corresponding to the key.
  23982. Value string `json:"value,omitempty"`
  23983. // ForceSendFields is a list of field names (e.g. "Key") to
  23984. // unconditionally include in API requests. By default, fields with
  23985. // empty values are omitted from API requests. However, any non-pointer,
  23986. // non-interface field appearing in ForceSendFields will be sent to the
  23987. // server regardless of whether the field is empty or not. This may be
  23988. // used to include empty fields in Patch requests.
  23989. ForceSendFields []string `json:"-"`
  23990. // NullFields is a list of field names (e.g. "Key") to include in API
  23991. // requests with the JSON null value. By default, fields with empty
  23992. // values are omitted from API requests. However, any field with an
  23993. // empty value appearing in NullFields will be sent to the server as
  23994. // null. It is an error if a field in this list has a non-empty value.
  23995. // This may be used to include null fields in Patch requests.
  23996. NullFields []string `json:"-"`
  23997. }
  23998. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23999. type NoMethod RouterAggregatedListWarningData
  24000. raw := NoMethod(*s)
  24001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24002. }
  24003. type RouterBgp struct {
  24004. // AdvertiseMode: User-specified flag to indicate which mode to use for
  24005. // advertisement.
  24006. //
  24007. // Possible values:
  24008. // "CUSTOM"
  24009. // "DEFAULT"
  24010. AdvertiseMode string `json:"advertiseMode,omitempty"`
  24011. // AdvertisedGroups: User-specified list of prefix groups to advertise
  24012. // in custom mode. This field can only be populated if advertise_mode is
  24013. // CUSTOM and is advertised to all peers of the router. These groups
  24014. // will be advertised in addition to any specified prefixes. Leave this
  24015. // field blank to advertise no custom groups.
  24016. //
  24017. // Possible values:
  24018. // "ALL_PEER_VPC_SUBNETS"
  24019. // "ALL_SUBNETS"
  24020. // "ALL_VPC_SUBNETS"
  24021. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  24022. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  24023. // advertise in custom mode. This field can only be populated if
  24024. // advertise_mode is CUSTOM and is advertised to all peers of the
  24025. // router. These IP ranges will be advertised in addition to any
  24026. // specified groups. Leave this field blank to advertise no custom IP
  24027. // ranges.
  24028. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  24029. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  24030. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  24031. // this router resource. All VPN tunnels that link to this router will
  24032. // have the same local ASN.
  24033. Asn int64 `json:"asn,omitempty"`
  24034. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  24035. // unconditionally include in API requests. By default, fields with
  24036. // empty values are omitted from API requests. However, any non-pointer,
  24037. // non-interface field appearing in ForceSendFields will be sent to the
  24038. // server regardless of whether the field is empty or not. This may be
  24039. // used to include empty fields in Patch requests.
  24040. ForceSendFields []string `json:"-"`
  24041. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  24042. // in API requests with the JSON null value. By default, fields with
  24043. // empty values are omitted from API requests. However, any field with
  24044. // an empty value appearing in NullFields will be sent to the server as
  24045. // null. It is an error if a field in this list has a non-empty value.
  24046. // This may be used to include null fields in Patch requests.
  24047. NullFields []string `json:"-"`
  24048. }
  24049. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  24050. type NoMethod RouterBgp
  24051. raw := NoMethod(*s)
  24052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24053. }
  24054. type RouterBgpPeer struct {
  24055. // AdvertiseMode: User-specified flag to indicate which mode to use for
  24056. // advertisement.
  24057. //
  24058. // Possible values:
  24059. // "CUSTOM"
  24060. // "DEFAULT"
  24061. AdvertiseMode string `json:"advertiseMode,omitempty"`
  24062. // AdvertisedGroups: User-specified list of prefix groups to advertise
  24063. // in custom mode. This field can only be populated if advertise_mode is
  24064. // CUSTOM and overrides the list defined for the router (in Bgp
  24065. // message). These groups will be advertised in addition to any
  24066. // specified prefixes. Leave this field blank to advertise no custom
  24067. // groups.
  24068. //
  24069. // Possible values:
  24070. // "ALL_PEER_VPC_SUBNETS"
  24071. // "ALL_SUBNETS"
  24072. // "ALL_VPC_SUBNETS"
  24073. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  24074. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  24075. // advertise in custom mode. This field can only be populated if
  24076. // advertise_mode is CUSTOM and overrides the list defined for the
  24077. // router (in Bgp message). These IP ranges will be advertised in
  24078. // addition to any specified groups. Leave this field blank to advertise
  24079. // no custom IP ranges.
  24080. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  24081. // AdvertisedRoutePriority: The priority of routes advertised to this
  24082. // BGP peer. In the case where there is more than one matching route of
  24083. // maximum length, the routes with lowest priority value win.
  24084. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  24085. // InterfaceName: Name of the interface the BGP peer is associated with.
  24086. InterfaceName string `json:"interfaceName,omitempty"`
  24087. // IpAddress: IP address of the interface inside Google Cloud Platform.
  24088. // Only IPv4 is supported.
  24089. IpAddress string `json:"ipAddress,omitempty"`
  24090. // ManagementType: [Output Only] The resource that configures and
  24091. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  24092. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  24093. // that is configured and managed by Cloud Interconnect, specifically by
  24094. // an InterconnectAttachment of type PARTNER. Google will automatically
  24095. // create, update, and delete this type of BGP peer when the PARTNER
  24096. // InterconnectAttachment is created, updated, or deleted.
  24097. //
  24098. // Possible values:
  24099. // "MANAGED_BY_ATTACHMENT"
  24100. // "MANAGED_BY_USER"
  24101. ManagementType string `json:"managementType,omitempty"`
  24102. // Name: Name of this BGP peer. The name must be 1-63 characters long
  24103. // and comply with RFC1035.
  24104. Name string `json:"name,omitempty"`
  24105. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  24106. // this value can be different for every tunnel.
  24107. PeerAsn int64 `json:"peerAsn,omitempty"`
  24108. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  24109. // Only IPv4 is supported.
  24110. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  24111. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  24112. // unconditionally include in API requests. By default, fields with
  24113. // empty values are omitted from API requests. However, any non-pointer,
  24114. // non-interface field appearing in ForceSendFields will be sent to the
  24115. // server regardless of whether the field is empty or not. This may be
  24116. // used to include empty fields in Patch requests.
  24117. ForceSendFields []string `json:"-"`
  24118. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  24119. // in API requests with the JSON null value. By default, fields with
  24120. // empty values are omitted from API requests. However, any field with
  24121. // an empty value appearing in NullFields will be sent to the server as
  24122. // null. It is an error if a field in this list has a non-empty value.
  24123. // This may be used to include null fields in Patch requests.
  24124. NullFields []string `json:"-"`
  24125. }
  24126. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  24127. type NoMethod RouterBgpPeer
  24128. raw := NoMethod(*s)
  24129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24130. }
  24131. type RouterInterface struct {
  24132. // IpRange: IP address and range of the interface. The IP range must be
  24133. // in the RFC3927 link-local IP space. The value must be a
  24134. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  24135. // truncate the address as it represents the IP address of the
  24136. // interface.
  24137. IpRange string `json:"ipRange,omitempty"`
  24138. // LinkedInterconnectAttachment: URI of the linked interconnect
  24139. // attachment. It must be in the same region as the router. Each
  24140. // interface can have at most one linked resource and it could either be
  24141. // a VPN Tunnel or an interconnect attachment.
  24142. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  24143. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  24144. // region as the router. Each interface can have at most one linked
  24145. // resource and it could either be a VPN Tunnel or an interconnect
  24146. // attachment.
  24147. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  24148. // ManagementType: [Output Only] The resource that configures and
  24149. // manages this interface. MANAGED_BY_USER is the default value and can
  24150. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  24151. // interface that is configured and managed by Cloud Interconnect,
  24152. // specifically by an InterconnectAttachment of type PARTNER. Google
  24153. // will automatically create, update, and delete this type of interface
  24154. // when the PARTNER InterconnectAttachment is created, updated, or
  24155. // deleted.
  24156. //
  24157. // Possible values:
  24158. // "MANAGED_BY_ATTACHMENT"
  24159. // "MANAGED_BY_USER"
  24160. ManagementType string `json:"managementType,omitempty"`
  24161. // Name: Name of this interface entry. The name must be 1-63 characters
  24162. // long and comply with RFC1035.
  24163. Name string `json:"name,omitempty"`
  24164. // ForceSendFields is a list of field names (e.g. "IpRange") to
  24165. // unconditionally include in API requests. By default, fields with
  24166. // empty values are omitted from API requests. However, any non-pointer,
  24167. // non-interface field appearing in ForceSendFields will be sent to the
  24168. // server regardless of whether the field is empty or not. This may be
  24169. // used to include empty fields in Patch requests.
  24170. ForceSendFields []string `json:"-"`
  24171. // NullFields is a list of field names (e.g. "IpRange") to include in
  24172. // API requests with the JSON null value. By default, fields with empty
  24173. // values are omitted from API requests. However, any field with an
  24174. // empty value appearing in NullFields will be sent to the server as
  24175. // null. It is an error if a field in this list has a non-empty value.
  24176. // This may be used to include null fields in Patch requests.
  24177. NullFields []string `json:"-"`
  24178. }
  24179. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  24180. type NoMethod RouterInterface
  24181. raw := NoMethod(*s)
  24182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24183. }
  24184. // RouterList: Contains a list of Router resources.
  24185. type RouterList struct {
  24186. // Id: [Output Only] Unique identifier for the resource; defined by the
  24187. // server.
  24188. Id string `json:"id,omitempty"`
  24189. // Items: A list of Router resources.
  24190. Items []*Router `json:"items,omitempty"`
  24191. // Kind: [Output Only] Type of resource. Always compute#router for
  24192. // routers.
  24193. Kind string `json:"kind,omitempty"`
  24194. // NextPageToken: [Output Only] This token allows you to get the next
  24195. // page of results for list requests. If the number of results is larger
  24196. // than maxResults, use the nextPageToken as a value for the query
  24197. // parameter pageToken in the next list request. Subsequent list
  24198. // requests will have their own nextPageToken to continue paging through
  24199. // the results.
  24200. NextPageToken string `json:"nextPageToken,omitempty"`
  24201. // SelfLink: [Output Only] Server-defined URL for this resource.
  24202. SelfLink string `json:"selfLink,omitempty"`
  24203. // Warning: [Output Only] Informational warning message.
  24204. Warning *RouterListWarning `json:"warning,omitempty"`
  24205. // ServerResponse contains the HTTP response code and headers from the
  24206. // server.
  24207. googleapi.ServerResponse `json:"-"`
  24208. // ForceSendFields is a list of field names (e.g. "Id") to
  24209. // unconditionally include in API requests. By default, fields with
  24210. // empty values are omitted from API requests. However, any non-pointer,
  24211. // non-interface field appearing in ForceSendFields will be sent to the
  24212. // server regardless of whether the field is empty or not. This may be
  24213. // used to include empty fields in Patch requests.
  24214. ForceSendFields []string `json:"-"`
  24215. // NullFields is a list of field names (e.g. "Id") to include in API
  24216. // requests with the JSON null value. By default, fields with empty
  24217. // values are omitted from API requests. However, any field with an
  24218. // empty value appearing in NullFields will be sent to the server as
  24219. // null. It is an error if a field in this list has a non-empty value.
  24220. // This may be used to include null fields in Patch requests.
  24221. NullFields []string `json:"-"`
  24222. }
  24223. func (s *RouterList) MarshalJSON() ([]byte, error) {
  24224. type NoMethod RouterList
  24225. raw := NoMethod(*s)
  24226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24227. }
  24228. // RouterListWarning: [Output Only] Informational warning message.
  24229. type RouterListWarning struct {
  24230. // Code: [Output Only] A warning code, if applicable. For example,
  24231. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24232. // the response.
  24233. //
  24234. // Possible values:
  24235. // "CLEANUP_FAILED"
  24236. // "DEPRECATED_RESOURCE_USED"
  24237. // "DEPRECATED_TYPE_USED"
  24238. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24239. // "EXPERIMENTAL_TYPE_USED"
  24240. // "EXTERNAL_API_WARNING"
  24241. // "FIELD_VALUE_OVERRIDEN"
  24242. // "INJECTED_KERNELS_DEPRECATED"
  24243. // "MISSING_TYPE_DEPENDENCY"
  24244. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24245. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24246. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24247. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24248. // "NEXT_HOP_NOT_RUNNING"
  24249. // "NOT_CRITICAL_ERROR"
  24250. // "NO_RESULTS_ON_PAGE"
  24251. // "REQUIRED_TOS_AGREEMENT"
  24252. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24253. // "RESOURCE_NOT_DELETED"
  24254. // "SCHEMA_VALIDATION_IGNORED"
  24255. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24256. // "UNDECLARED_PROPERTIES"
  24257. // "UNREACHABLE"
  24258. Code string `json:"code,omitempty"`
  24259. // Data: [Output Only] Metadata about this warning in key: value format.
  24260. // For example:
  24261. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24262. Data []*RouterListWarningData `json:"data,omitempty"`
  24263. // Message: [Output Only] A human-readable description of the warning
  24264. // code.
  24265. Message string `json:"message,omitempty"`
  24266. // ForceSendFields is a list of field names (e.g. "Code") to
  24267. // unconditionally include in API requests. By default, fields with
  24268. // empty values are omitted from API requests. However, any non-pointer,
  24269. // non-interface field appearing in ForceSendFields will be sent to the
  24270. // server regardless of whether the field is empty or not. This may be
  24271. // used to include empty fields in Patch requests.
  24272. ForceSendFields []string `json:"-"`
  24273. // NullFields is a list of field names (e.g. "Code") to include in API
  24274. // requests with the JSON null value. By default, fields with empty
  24275. // values are omitted from API requests. However, any field with an
  24276. // empty value appearing in NullFields will be sent to the server as
  24277. // null. It is an error if a field in this list has a non-empty value.
  24278. // This may be used to include null fields in Patch requests.
  24279. NullFields []string `json:"-"`
  24280. }
  24281. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  24282. type NoMethod RouterListWarning
  24283. raw := NoMethod(*s)
  24284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24285. }
  24286. type RouterListWarningData struct {
  24287. // Key: [Output Only] A key that provides more detail on the warning
  24288. // being returned. For example, for warnings where there are no results
  24289. // in a list request for a particular zone, this key might be scope and
  24290. // the key value might be the zone name. Other examples might be a key
  24291. // indicating a deprecated resource and a suggested replacement, or a
  24292. // warning about invalid network settings (for example, if an instance
  24293. // attempts to perform IP forwarding but is not enabled for IP
  24294. // forwarding).
  24295. Key string `json:"key,omitempty"`
  24296. // Value: [Output Only] A warning data value corresponding to the key.
  24297. Value string `json:"value,omitempty"`
  24298. // ForceSendFields is a list of field names (e.g. "Key") to
  24299. // unconditionally include in API requests. By default, fields with
  24300. // empty values are omitted from API requests. However, any non-pointer,
  24301. // non-interface field appearing in ForceSendFields will be sent to the
  24302. // server regardless of whether the field is empty or not. This may be
  24303. // used to include empty fields in Patch requests.
  24304. ForceSendFields []string `json:"-"`
  24305. // NullFields is a list of field names (e.g. "Key") to include in API
  24306. // requests with the JSON null value. By default, fields with empty
  24307. // values are omitted from API requests. However, any field with an
  24308. // empty value appearing in NullFields will be sent to the server as
  24309. // null. It is an error if a field in this list has a non-empty value.
  24310. // This may be used to include null fields in Patch requests.
  24311. NullFields []string `json:"-"`
  24312. }
  24313. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  24314. type NoMethod RouterListWarningData
  24315. raw := NoMethod(*s)
  24316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24317. }
  24318. // RouterNat: Represents a Nat resource. It enables the VMs within the
  24319. // specified subnetworks to access Internet without external IP
  24320. // addresses. It specifies a list of subnetworks (and the ranges within)
  24321. // that want to use NAT. Customers can also provide the external IPs
  24322. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  24323. // no external IPs are provided.
  24324. type RouterNat struct {
  24325. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  24326. // Defaults to 30s if not set.
  24327. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  24328. // LogConfig: Configure logging on this NAT.
  24329. LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
  24330. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  24331. // NAT config. If not set, a default number of ports is allocated to a
  24332. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  24333. // of this field is 50, at least 64 ports will be allocated to a VM.
  24334. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  24335. // Name: Unique name of this Nat service. The name must be 1-63
  24336. // characters long and comply with RFC1035.
  24337. Name string `json:"name,omitempty"`
  24338. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  24339. // AUTO_ONLY, then nat_ip should be empty.
  24340. //
  24341. // Possible values:
  24342. // "AUTO_ONLY"
  24343. // "MANUAL_ONLY"
  24344. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  24345. // NatIps: A list of URLs of the IP resources used for this Nat service.
  24346. // These IPs must be valid static external IP addresses assigned to the
  24347. // project. max_length is subject to change post alpha.
  24348. NatIps []string `json:"natIps,omitempty"`
  24349. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  24350. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  24351. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  24352. // other Router.Nat section in any Router for this network in this
  24353. // region.
  24354. //
  24355. // Possible values:
  24356. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  24357. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  24358. // "LIST_OF_SUBNETWORKS"
  24359. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  24360. // Subnetworks: A list of Subnetwork resources whose traffic should be
  24361. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  24362. // is selected for the SubnetworkIpRangeToNatOption above.
  24363. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  24364. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  24365. // established connections. Defaults to 1200s if not set.
  24366. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  24367. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  24368. // connections. Defaults to 30s if not set.
  24369. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  24370. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  24371. // to 30s if not set.
  24372. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  24373. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  24374. // to unconditionally include in API requests. By default, fields with
  24375. // empty values are omitted from API requests. However, any non-pointer,
  24376. // non-interface field appearing in ForceSendFields will be sent to the
  24377. // server regardless of whether the field is empty or not. This may be
  24378. // used to include empty fields in Patch requests.
  24379. ForceSendFields []string `json:"-"`
  24380. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  24381. // include in API requests with the JSON null value. By default, fields
  24382. // with empty values are omitted from API requests. However, any field
  24383. // with an empty value appearing in NullFields will be sent to the
  24384. // server as null. It is an error if a field in this list has a
  24385. // non-empty value. This may be used to include null fields in Patch
  24386. // requests.
  24387. NullFields []string `json:"-"`
  24388. }
  24389. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  24390. type NoMethod RouterNat
  24391. raw := NoMethod(*s)
  24392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24393. }
  24394. // RouterNatLogConfig: Configuration of logging on a NAT.
  24395. type RouterNatLogConfig struct {
  24396. // Enabled: Indicates whether or not to export logs. This is false by
  24397. // default.
  24398. Enabled bool `json:"enabled,omitempty"`
  24399. // Filter: Specifies the desired filtering of logs on this NAT. If
  24400. // unspecified, logs are exported for all connections handled by this
  24401. // NAT.
  24402. //
  24403. // Possible values:
  24404. // "ERRORS_ONLY"
  24405. // "TRANSLATIONS_ONLY"
  24406. Filter string `json:"filter,omitempty"`
  24407. // ForceSendFields is a list of field names (e.g. "Enabled") to
  24408. // unconditionally include in API requests. By default, fields with
  24409. // empty values are omitted from API requests. However, any non-pointer,
  24410. // non-interface field appearing in ForceSendFields will be sent to the
  24411. // server regardless of whether the field is empty or not. This may be
  24412. // used to include empty fields in Patch requests.
  24413. ForceSendFields []string `json:"-"`
  24414. // NullFields is a list of field names (e.g. "Enabled") to include in
  24415. // API requests with the JSON null value. By default, fields with empty
  24416. // values are omitted from API requests. However, any field with an
  24417. // empty value appearing in NullFields will be sent to the server as
  24418. // null. It is an error if a field in this list has a non-empty value.
  24419. // This may be used to include null fields in Patch requests.
  24420. NullFields []string `json:"-"`
  24421. }
  24422. func (s *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
  24423. type NoMethod RouterNatLogConfig
  24424. raw := NoMethod(*s)
  24425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24426. }
  24427. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  24428. // for a subnetwork.
  24429. type RouterNatSubnetworkToNat struct {
  24430. // Name: URL for the subnetwork resource to use NAT.
  24431. Name string `json:"name,omitempty"`
  24432. // SecondaryIpRangeNames: A list of the secondary ranges of the
  24433. // Subnetwork that are allowed to use NAT. This can be populated only if
  24434. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  24435. // source_ip_ranges_to_nat.
  24436. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  24437. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  24438. // Subnetwork. All usages of single value are valid except
  24439. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  24440. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  24441. // Default: [ALL_IP_RANGES]
  24442. //
  24443. // Possible values:
  24444. // "ALL_IP_RANGES"
  24445. // "LIST_OF_SECONDARY_IP_RANGES"
  24446. // "PRIMARY_IP_RANGE"
  24447. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  24448. // ForceSendFields is a list of field names (e.g. "Name") to
  24449. // unconditionally include in API requests. By default, fields with
  24450. // empty values are omitted from API requests. However, any non-pointer,
  24451. // non-interface field appearing in ForceSendFields will be sent to the
  24452. // server regardless of whether the field is empty or not. This may be
  24453. // used to include empty fields in Patch requests.
  24454. ForceSendFields []string `json:"-"`
  24455. // NullFields is a list of field names (e.g. "Name") to include in API
  24456. // requests with the JSON null value. By default, fields with empty
  24457. // values are omitted from API requests. However, any field with an
  24458. // empty value appearing in NullFields will be sent to the server as
  24459. // null. It is an error if a field in this list has a non-empty value.
  24460. // This may be used to include null fields in Patch requests.
  24461. NullFields []string `json:"-"`
  24462. }
  24463. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  24464. type NoMethod RouterNatSubnetworkToNat
  24465. raw := NoMethod(*s)
  24466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24467. }
  24468. type RouterStatus struct {
  24469. // BestRoutes: Best routes for this router's network.
  24470. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  24471. // BestRoutesForRouter: Best routes learned by this router.
  24472. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  24473. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  24474. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  24475. // Network: URI of the network to which this router belongs.
  24476. Network string `json:"network,omitempty"`
  24477. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  24478. // unconditionally include in API requests. By default, fields with
  24479. // empty values are omitted from API requests. However, any non-pointer,
  24480. // non-interface field appearing in ForceSendFields will be sent to the
  24481. // server regardless of whether the field is empty or not. This may be
  24482. // used to include empty fields in Patch requests.
  24483. ForceSendFields []string `json:"-"`
  24484. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  24485. // API requests with the JSON null value. By default, fields with empty
  24486. // values are omitted from API requests. However, any field with an
  24487. // empty value appearing in NullFields will be sent to the server as
  24488. // null. It is an error if a field in this list has a non-empty value.
  24489. // This may be used to include null fields in Patch requests.
  24490. NullFields []string `json:"-"`
  24491. }
  24492. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  24493. type NoMethod RouterStatus
  24494. raw := NoMethod(*s)
  24495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24496. }
  24497. type RouterStatusBgpPeerStatus struct {
  24498. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  24499. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  24500. // IpAddress: IP address of the local BGP interface.
  24501. IpAddress string `json:"ipAddress,omitempty"`
  24502. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  24503. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  24504. // Name: Name of this BGP peer. Unique within the Routers resource.
  24505. Name string `json:"name,omitempty"`
  24506. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  24507. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  24508. // PeerIpAddress: IP address of the remote BGP interface.
  24509. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  24510. // State: BGP state as specified in RFC1771.
  24511. State string `json:"state,omitempty"`
  24512. // Status: Status of the BGP peer: {UP, DOWN}
  24513. //
  24514. // Possible values:
  24515. // "DOWN"
  24516. // "UNKNOWN"
  24517. // "UP"
  24518. Status string `json:"status,omitempty"`
  24519. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  24520. // days, 23 hours, 59 minutes, 59 seconds
  24521. Uptime string `json:"uptime,omitempty"`
  24522. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  24523. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  24524. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  24525. // unconditionally include in API requests. By default, fields with
  24526. // empty values are omitted from API requests. However, any non-pointer,
  24527. // non-interface field appearing in ForceSendFields will be sent to the
  24528. // server regardless of whether the field is empty or not. This may be
  24529. // used to include empty fields in Patch requests.
  24530. ForceSendFields []string `json:"-"`
  24531. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  24532. // include in API requests with the JSON null value. By default, fields
  24533. // with empty values are omitted from API requests. However, any field
  24534. // with an empty value appearing in NullFields will be sent to the
  24535. // server as null. It is an error if a field in this list has a
  24536. // non-empty value. This may be used to include null fields in Patch
  24537. // requests.
  24538. NullFields []string `json:"-"`
  24539. }
  24540. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  24541. type NoMethod RouterStatusBgpPeerStatus
  24542. raw := NoMethod(*s)
  24543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24544. }
  24545. // RouterStatusNatStatus: Status of a NAT contained in this router.
  24546. type RouterStatusNatStatus struct {
  24547. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  24548. // ["1.1.1.1", "129.2.16.89"]
  24549. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  24550. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  24551. // be greater than 0 only if user-specified IPs are NOT enough to allow
  24552. // all configured VMs to use NAT. This value is meaningful only when
  24553. // auto-allocation of NAT IPs is *not* used.
  24554. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  24555. // Name: Unique name of this NAT.
  24556. Name string `json:"name,omitempty"`
  24557. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  24558. // that can use NAT.
  24559. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  24560. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  24561. // reserved IP address resources.
  24562. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  24563. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  24564. // be raw IP strings like "179.12.26.133".
  24565. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  24566. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  24567. // to unconditionally include in API requests. By default, fields with
  24568. // empty values are omitted from API requests. However, any non-pointer,
  24569. // non-interface field appearing in ForceSendFields will be sent to the
  24570. // server regardless of whether the field is empty or not. This may be
  24571. // used to include empty fields in Patch requests.
  24572. ForceSendFields []string `json:"-"`
  24573. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  24574. // include in API requests with the JSON null value. By default, fields
  24575. // with empty values are omitted from API requests. However, any field
  24576. // with an empty value appearing in NullFields will be sent to the
  24577. // server as null. It is an error if a field in this list has a
  24578. // non-empty value. This may be used to include null fields in Patch
  24579. // requests.
  24580. NullFields []string `json:"-"`
  24581. }
  24582. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  24583. type NoMethod RouterStatusNatStatus
  24584. raw := NoMethod(*s)
  24585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24586. }
  24587. type RouterStatusResponse struct {
  24588. // Kind: Type of resource.
  24589. Kind string `json:"kind,omitempty"`
  24590. Result *RouterStatus `json:"result,omitempty"`
  24591. // ServerResponse contains the HTTP response code and headers from the
  24592. // server.
  24593. googleapi.ServerResponse `json:"-"`
  24594. // ForceSendFields is a list of field names (e.g. "Kind") to
  24595. // unconditionally include in API requests. By default, fields with
  24596. // empty values are omitted from API requests. However, any non-pointer,
  24597. // non-interface field appearing in ForceSendFields will be sent to the
  24598. // server regardless of whether the field is empty or not. This may be
  24599. // used to include empty fields in Patch requests.
  24600. ForceSendFields []string `json:"-"`
  24601. // NullFields is a list of field names (e.g. "Kind") to include in API
  24602. // requests with the JSON null value. By default, fields with empty
  24603. // values are omitted from API requests. However, any field with an
  24604. // empty value appearing in NullFields will be sent to the server as
  24605. // null. It is an error if a field in this list has a non-empty value.
  24606. // This may be used to include null fields in Patch requests.
  24607. NullFields []string `json:"-"`
  24608. }
  24609. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  24610. type NoMethod RouterStatusResponse
  24611. raw := NoMethod(*s)
  24612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24613. }
  24614. type RoutersPreviewResponse struct {
  24615. // Resource: Preview of given router.
  24616. Resource *Router `json:"resource,omitempty"`
  24617. // ServerResponse contains the HTTP response code and headers from the
  24618. // server.
  24619. googleapi.ServerResponse `json:"-"`
  24620. // ForceSendFields is a list of field names (e.g. "Resource") to
  24621. // unconditionally include in API requests. By default, fields with
  24622. // empty values are omitted from API requests. However, any non-pointer,
  24623. // non-interface field appearing in ForceSendFields will be sent to the
  24624. // server regardless of whether the field is empty or not. This may be
  24625. // used to include empty fields in Patch requests.
  24626. ForceSendFields []string `json:"-"`
  24627. // NullFields is a list of field names (e.g. "Resource") to include in
  24628. // API requests with the JSON null value. By default, fields with empty
  24629. // values are omitted from API requests. However, any field with an
  24630. // empty value appearing in NullFields will be sent to the server as
  24631. // null. It is an error if a field in this list has a non-empty value.
  24632. // This may be used to include null fields in Patch requests.
  24633. NullFields []string `json:"-"`
  24634. }
  24635. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  24636. type NoMethod RoutersPreviewResponse
  24637. raw := NoMethod(*s)
  24638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24639. }
  24640. type RoutersScopedList struct {
  24641. // Routers: A list of routers contained in this scope.
  24642. Routers []*Router `json:"routers,omitempty"`
  24643. // Warning: Informational warning which replaces the list of routers
  24644. // when the list is empty.
  24645. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  24646. // ForceSendFields is a list of field names (e.g. "Routers") to
  24647. // unconditionally include in API requests. By default, fields with
  24648. // empty values are omitted from API requests. However, any non-pointer,
  24649. // non-interface field appearing in ForceSendFields will be sent to the
  24650. // server regardless of whether the field is empty or not. This may be
  24651. // used to include empty fields in Patch requests.
  24652. ForceSendFields []string `json:"-"`
  24653. // NullFields is a list of field names (e.g. "Routers") to include in
  24654. // API requests with the JSON null value. By default, fields with empty
  24655. // values are omitted from API requests. However, any field with an
  24656. // empty value appearing in NullFields will be sent to the server as
  24657. // null. It is an error if a field in this list has a non-empty value.
  24658. // This may be used to include null fields in Patch requests.
  24659. NullFields []string `json:"-"`
  24660. }
  24661. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  24662. type NoMethod RoutersScopedList
  24663. raw := NoMethod(*s)
  24664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24665. }
  24666. // RoutersScopedListWarning: Informational warning which replaces the
  24667. // list of routers when the list is empty.
  24668. type RoutersScopedListWarning struct {
  24669. // Code: [Output Only] A warning code, if applicable. For example,
  24670. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24671. // the response.
  24672. //
  24673. // Possible values:
  24674. // "CLEANUP_FAILED"
  24675. // "DEPRECATED_RESOURCE_USED"
  24676. // "DEPRECATED_TYPE_USED"
  24677. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24678. // "EXPERIMENTAL_TYPE_USED"
  24679. // "EXTERNAL_API_WARNING"
  24680. // "FIELD_VALUE_OVERRIDEN"
  24681. // "INJECTED_KERNELS_DEPRECATED"
  24682. // "MISSING_TYPE_DEPENDENCY"
  24683. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24684. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24685. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24686. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24687. // "NEXT_HOP_NOT_RUNNING"
  24688. // "NOT_CRITICAL_ERROR"
  24689. // "NO_RESULTS_ON_PAGE"
  24690. // "REQUIRED_TOS_AGREEMENT"
  24691. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24692. // "RESOURCE_NOT_DELETED"
  24693. // "SCHEMA_VALIDATION_IGNORED"
  24694. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24695. // "UNDECLARED_PROPERTIES"
  24696. // "UNREACHABLE"
  24697. Code string `json:"code,omitempty"`
  24698. // Data: [Output Only] Metadata about this warning in key: value format.
  24699. // For example:
  24700. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24701. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  24702. // Message: [Output Only] A human-readable description of the warning
  24703. // code.
  24704. Message string `json:"message,omitempty"`
  24705. // ForceSendFields is a list of field names (e.g. "Code") to
  24706. // unconditionally include in API requests. By default, fields with
  24707. // empty values are omitted from API requests. However, any non-pointer,
  24708. // non-interface field appearing in ForceSendFields will be sent to the
  24709. // server regardless of whether the field is empty or not. This may be
  24710. // used to include empty fields in Patch requests.
  24711. ForceSendFields []string `json:"-"`
  24712. // NullFields is a list of field names (e.g. "Code") to include in API
  24713. // requests with the JSON null value. By default, fields with empty
  24714. // values are omitted from API requests. However, any field with an
  24715. // empty value appearing in NullFields will be sent to the server as
  24716. // null. It is an error if a field in this list has a non-empty value.
  24717. // This may be used to include null fields in Patch requests.
  24718. NullFields []string `json:"-"`
  24719. }
  24720. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  24721. type NoMethod RoutersScopedListWarning
  24722. raw := NoMethod(*s)
  24723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24724. }
  24725. type RoutersScopedListWarningData struct {
  24726. // Key: [Output Only] A key that provides more detail on the warning
  24727. // being returned. For example, for warnings where there are no results
  24728. // in a list request for a particular zone, this key might be scope and
  24729. // the key value might be the zone name. Other examples might be a key
  24730. // indicating a deprecated resource and a suggested replacement, or a
  24731. // warning about invalid network settings (for example, if an instance
  24732. // attempts to perform IP forwarding but is not enabled for IP
  24733. // forwarding).
  24734. Key string `json:"key,omitempty"`
  24735. // Value: [Output Only] A warning data value corresponding to the key.
  24736. Value string `json:"value,omitempty"`
  24737. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  24745. // requests with the JSON null value. By default, fields with empty
  24746. // values are omitted from API requests. However, any field with an
  24747. // 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 *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  24753. type NoMethod RoutersScopedListWarningData
  24754. raw := NoMethod(*s)
  24755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24756. }
  24757. // Rule: A rule to be applied in a Policy.
  24758. type Rule struct {
  24759. // Action: Required
  24760. //
  24761. // Possible values:
  24762. // "ALLOW"
  24763. // "ALLOW_WITH_LOG"
  24764. // "DENY"
  24765. // "DENY_WITH_LOG"
  24766. // "LOG"
  24767. // "NO_ACTION"
  24768. Action string `json:"action,omitempty"`
  24769. // Conditions: Additional restrictions that must be met. All conditions
  24770. // must pass for the rule to match.
  24771. Conditions []*Condition `json:"conditions,omitempty"`
  24772. // Description: Human-readable description of the rule.
  24773. Description string `json:"description,omitempty"`
  24774. // Ins: If one or more 'in' clauses are specified, the rule matches if
  24775. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  24776. Ins []string `json:"ins,omitempty"`
  24777. // LogConfigs: The config returned to callers of
  24778. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  24779. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  24780. // NotIns: If one or more 'not_in' clauses are specified, the rule
  24781. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  24782. // entries.
  24783. NotIns []string `json:"notIns,omitempty"`
  24784. // Permissions: A permission is a string of form '..' (e.g.,
  24785. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  24786. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  24787. Permissions []string `json:"permissions,omitempty"`
  24788. // ForceSendFields is a list of field names (e.g. "Action") to
  24789. // unconditionally include in API requests. By default, fields with
  24790. // empty values are omitted from API requests. However, any non-pointer,
  24791. // non-interface field appearing in ForceSendFields will be sent to the
  24792. // server regardless of whether the field is empty or not. This may be
  24793. // used to include empty fields in Patch requests.
  24794. ForceSendFields []string `json:"-"`
  24795. // NullFields is a list of field names (e.g. "Action") to include in API
  24796. // requests with the JSON null value. By default, fields with empty
  24797. // values are omitted from API requests. However, any field with an
  24798. // empty value appearing in NullFields will be sent to the server as
  24799. // null. It is an error if a field in this list has a non-empty value.
  24800. // This may be used to include null fields in Patch requests.
  24801. NullFields []string `json:"-"`
  24802. }
  24803. func (s *Rule) MarshalJSON() ([]byte, error) {
  24804. type NoMethod Rule
  24805. raw := NoMethod(*s)
  24806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24807. }
  24808. type SSLHealthCheck struct {
  24809. // Port: The TCP port number for the health check request. The default
  24810. // value is 443. Valid values are 1 through 65535.
  24811. Port int64 `json:"port,omitempty"`
  24812. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  24813. // both port and port_name are defined, port takes precedence.
  24814. PortName string `json:"portName,omitempty"`
  24815. // PortSpecification: Specifies how port is selected for health
  24816. // checking, can be one of following values:
  24817. // USE_FIXED_PORT: The port number in
  24818. // port
  24819. // is used for health checking.
  24820. // USE_NAMED_PORT: The
  24821. // portName
  24822. // is used for health checking.
  24823. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  24824. // each network endpoint is used for health checking. For other
  24825. // backends, the port or named port specified in the Backend Service is
  24826. // used for health checking.
  24827. //
  24828. //
  24829. // If not specified, SSL health check follows behavior specified
  24830. // in
  24831. // port
  24832. // and
  24833. // portName
  24834. // fields.
  24835. //
  24836. // Possible values:
  24837. // "USE_FIXED_PORT"
  24838. // "USE_NAMED_PORT"
  24839. // "USE_SERVING_PORT"
  24840. PortSpecification string `json:"portSpecification,omitempty"`
  24841. // ProxyHeader: Specifies the type of proxy header to append before
  24842. // sending data to the backend, either NONE or PROXY_V1. The default is
  24843. // NONE.
  24844. //
  24845. // Possible values:
  24846. // "NONE"
  24847. // "PROXY_V1"
  24848. ProxyHeader string `json:"proxyHeader,omitempty"`
  24849. // Request: The application data to send once the SSL connection has
  24850. // been established (default value is empty). If both request and
  24851. // response are empty, the connection establishment alone will indicate
  24852. // health. The request data can only be ASCII.
  24853. Request string `json:"request,omitempty"`
  24854. // Response: The bytes to match against the beginning of the response
  24855. // data. If left empty (the default value), any response will indicate
  24856. // health. The response data can only be ASCII.
  24857. Response string `json:"response,omitempty"`
  24858. // ForceSendFields is a list of field names (e.g. "Port") to
  24859. // unconditionally include in API requests. By default, fields with
  24860. // empty values are omitted from API requests. However, any non-pointer,
  24861. // non-interface field appearing in ForceSendFields will be sent to the
  24862. // server regardless of whether the field is empty or not. This may be
  24863. // used to include empty fields in Patch requests.
  24864. ForceSendFields []string `json:"-"`
  24865. // NullFields is a list of field names (e.g. "Port") to include in API
  24866. // requests with the JSON null value. By default, fields with empty
  24867. // values are omitted from API requests. However, any field with an
  24868. // empty value appearing in NullFields will be sent to the server as
  24869. // null. It is an error if a field in this list has a non-empty value.
  24870. // This may be used to include null fields in Patch requests.
  24871. NullFields []string `json:"-"`
  24872. }
  24873. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  24874. type NoMethod SSLHealthCheck
  24875. raw := NoMethod(*s)
  24876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24877. }
  24878. // SavedAttachedDisk: An instance-attached disk resource.
  24879. type SavedAttachedDisk struct {
  24880. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  24881. // instance is deleted (but not when the disk is detached from the
  24882. // instance).
  24883. AutoDelete bool `json:"autoDelete,omitempty"`
  24884. // Boot: Indicates that this is a boot disk. The virtual machine will
  24885. // use the first partition of the disk for its root filesystem.
  24886. Boot bool `json:"boot,omitempty"`
  24887. // DeviceName: Specifies a unique device name of your choice that is
  24888. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  24889. // system running within the instance. This name can be used to
  24890. // reference the device for mounting, resizing, and so on, from within
  24891. // the instance.
  24892. //
  24893. // If not specified, the server chooses a default device name to apply
  24894. // to this disk, in the form persistent-disks-x, where x is a number
  24895. // assigned by Google Compute Engine. This field is only applicable for
  24896. // persistent disks.
  24897. DeviceName string `json:"deviceName,omitempty"`
  24898. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  24899. // customer-supplied encryption key.
  24900. //
  24901. // If you are creating a new disk, this field encrypts the new disk
  24902. // using an encryption key that you provide. If you are attaching an
  24903. // existing disk that is already encrypted, this field decrypts the disk
  24904. // using the customer-supplied encryption key.
  24905. //
  24906. // If you encrypt a disk using a customer-supplied key, you must provide
  24907. // the same key again when you attempt to use this resource at a later
  24908. // time. For example, you must provide the key when you create a
  24909. // snapshot or an image from the disk or when you attach the disk to a
  24910. // virtual machine instance.
  24911. //
  24912. // If you do not provide an encryption key, then the disk will be
  24913. // encrypted using an automatically generated key and you do not need to
  24914. // provide a key to use the disk later.
  24915. //
  24916. // Machine Images do not store customer-supplied encryption keys, so you
  24917. // cannot use your own keys to encrypt disks in a managed instance
  24918. // group.
  24919. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  24920. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  24921. // disk_size_gb in InitializeParams.
  24922. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  24923. // GuestOsFeatures: A list of features to enable on the guest operating
  24924. // system. Applicable only for bootable images. Read Enabling guest
  24925. // operating system features to see a list of available options.
  24926. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  24927. // Index: [Output Only] A zero-based index to this disk, where 0 is
  24928. // reserved for the boot disk. If you have many disks attached to an
  24929. // instance, each disk would have a unique index number.
  24930. Index int64 `json:"index,omitempty"`
  24931. // InitializeParams: [Input Only] Specifies the parameters for a new
  24932. // disk that will be created alongside the new instance. Use
  24933. // initialization parameters to create boot disks or local SSDs attached
  24934. // to the new instance.
  24935. //
  24936. // This property is mutually exclusive with the source property; you can
  24937. // only define one or the other, but not both.
  24938. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  24939. // Interface: Specifies the disk interface to use for attaching this
  24940. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  24941. // disks must always use SCSI and the request will fail if you attempt
  24942. // to attach a persistent disk in any other format than SCSI. Local SSDs
  24943. // can use either NVME or SCSI. For performance characteristics of SCSI
  24944. // over NVMe, see Local SSD performance.
  24945. //
  24946. // Possible values:
  24947. // "NVDIMM"
  24948. // "NVME"
  24949. // "SCSI"
  24950. Interface string `json:"interface,omitempty"`
  24951. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  24952. // for attached disks.
  24953. Kind string `json:"kind,omitempty"`
  24954. // Licenses: [Output Only] Any valid publicly visible licenses.
  24955. Licenses []string `json:"licenses,omitempty"`
  24956. // Mode: The mode in which to attach this disk, either READ_WRITE or
  24957. // READ_ONLY. If not specified, the default is to attach the disk in
  24958. // READ_WRITE mode.
  24959. //
  24960. // Possible values:
  24961. // "READ_ONLY"
  24962. // "READ_WRITE"
  24963. Mode string `json:"mode,omitempty"`
  24964. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  24965. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  24966. // has been saved to a persistent location by customer request. (see the
  24967. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  24968. //
  24969. // Possible values:
  24970. // "DISK_SAVED_STATE_UNSPECIFIED"
  24971. // "PRESERVED"
  24972. SavedState string `json:"savedState,omitempty"`
  24973. // Source: Specifies a valid partial or full URL to an existing
  24974. // Persistent Disk resource. When creating a new instance, one of
  24975. // initializeParams.sourceImage or disks.source is required except for
  24976. // local SSD.
  24977. //
  24978. // If desired, you can also attach existing non-root persistent disks
  24979. // using this property. This field is only applicable for persistent
  24980. // disks.
  24981. //
  24982. // Note that for sourceMachineImage, specify the disk name, not the URL
  24983. // for the disk.
  24984. Source string `json:"source,omitempty"`
  24985. // StorageBytes: [Output Only] A size of the storage used by the disk's
  24986. // snapshot.
  24987. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  24988. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  24989. // is in a stable state or it is being adjusted as a result of shared
  24990. // storage reallocation. This status can either be UPDATING, meaning the
  24991. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  24992. // size of the snapshot is up-to-date.
  24993. //
  24994. // Possible values:
  24995. // "UPDATING"
  24996. // "UP_TO_DATE"
  24997. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  24998. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  24999. // If not specified, the default is PERSISTENT.
  25000. //
  25001. // Possible values:
  25002. // "PERSISTENT"
  25003. // "SCRATCH"
  25004. Type string `json:"type,omitempty"`
  25005. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  25006. // unconditionally include in API requests. By default, fields with
  25007. // empty values are omitted from API requests. However, any non-pointer,
  25008. // non-interface field appearing in ForceSendFields will be sent to the
  25009. // server regardless of whether the field is empty or not. This may be
  25010. // used to include empty fields in Patch requests.
  25011. ForceSendFields []string `json:"-"`
  25012. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  25013. // API requests with the JSON null value. By default, fields with empty
  25014. // values are omitted from API requests. However, any field with an
  25015. // empty value appearing in NullFields will be sent to the server as
  25016. // null. It is an error if a field in this list has a non-empty value.
  25017. // This may be used to include null fields in Patch requests.
  25018. NullFields []string `json:"-"`
  25019. }
  25020. func (s *SavedAttachedDisk) MarshalJSON() ([]byte, error) {
  25021. type NoMethod SavedAttachedDisk
  25022. raw := NoMethod(*s)
  25023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25024. }
  25025. // Scheduling: Sets the scheduling options for an Instance.
  25026. type Scheduling struct {
  25027. // AutomaticRestart: Specifies whether the instance should be
  25028. // automatically restarted if it is terminated by Compute Engine (not
  25029. // terminated by a user). You can only set the automatic restart option
  25030. // for standard instances. Preemptible instances cannot be automatically
  25031. // restarted.
  25032. //
  25033. // By default, this is set to true so an instance is automatically
  25034. // restarted if it is terminated by Compute Engine.
  25035. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  25036. // MinNodeCpus: The minimum number of virtual CPUs this instance will
  25037. // consume when running on a sole-tenant node.
  25038. MinNodeCpus int64 `json:"minNodeCpus,omitempty"`
  25039. // NodeAffinities: A set of node affinity and anti-affinity.
  25040. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  25041. // OnHostMaintenance: Defines the maintenance behavior for this
  25042. // instance. For standard instances, the default behavior is MIGRATE.
  25043. // For preemptible instances, the default and only possible behavior is
  25044. // TERMINATE. For more information, see Setting Instance Scheduling
  25045. // Options.
  25046. //
  25047. // Possible values:
  25048. // "MIGRATE"
  25049. // "TERMINATE"
  25050. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  25051. // Preemptible: Defines whether the instance is preemptible. This can
  25052. // only be set during instance creation, it cannot be set or changed
  25053. // after the instance has been created.
  25054. Preemptible bool `json:"preemptible,omitempty"`
  25055. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  25056. // unconditionally include in API requests. By default, fields with
  25057. // empty values are omitted from API requests. However, any non-pointer,
  25058. // non-interface field appearing in ForceSendFields will be sent to the
  25059. // server regardless of whether the field is empty or not. This may be
  25060. // used to include empty fields in Patch requests.
  25061. ForceSendFields []string `json:"-"`
  25062. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  25063. // include in API requests with the JSON null value. By default, fields
  25064. // with empty values are omitted from API requests. However, any field
  25065. // with an empty value appearing in NullFields will be sent to the
  25066. // server as null. It is an error if a field in this list has a
  25067. // non-empty value. This may be used to include null fields in Patch
  25068. // requests.
  25069. NullFields []string `json:"-"`
  25070. }
  25071. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  25072. type NoMethod Scheduling
  25073. raw := NoMethod(*s)
  25074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25075. }
  25076. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  25077. // nodes onto which this Instance could be scheduled.
  25078. type SchedulingNodeAffinity struct {
  25079. // Key: Corresponds to the label key of Node resource.
  25080. Key string `json:"key,omitempty"`
  25081. // Operator: Defines the operation of node selection.
  25082. //
  25083. // Possible values:
  25084. // "IN"
  25085. // "NOT_IN"
  25086. // "OPERATOR_UNSPECIFIED"
  25087. Operator string `json:"operator,omitempty"`
  25088. // Values: Corresponds to the label values of Node resource.
  25089. Values []string `json:"values,omitempty"`
  25090. // ForceSendFields is a list of field names (e.g. "Key") to
  25091. // unconditionally include in API requests. By default, fields with
  25092. // empty values are omitted from API requests. However, any non-pointer,
  25093. // non-interface field appearing in ForceSendFields will be sent to the
  25094. // server regardless of whether the field is empty or not. This may be
  25095. // used to include empty fields in Patch requests.
  25096. ForceSendFields []string `json:"-"`
  25097. // NullFields is a list of field names (e.g. "Key") to include in API
  25098. // requests with the JSON null value. By default, fields with empty
  25099. // values are omitted from API requests. However, any field with an
  25100. // empty value appearing in NullFields will be sent to the server as
  25101. // null. It is an error if a field in this list has a non-empty value.
  25102. // This may be used to include null fields in Patch requests.
  25103. NullFields []string `json:"-"`
  25104. }
  25105. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  25106. type NoMethod SchedulingNodeAffinity
  25107. raw := NoMethod(*s)
  25108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25109. }
  25110. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  25111. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  25112. // ServerResponse contains the HTTP response code and headers from the
  25113. // server.
  25114. googleapi.ServerResponse `json:"-"`
  25115. // ForceSendFields is a list of field names (e.g.
  25116. // "PreconfiguredExpressionSets") to unconditionally include in API
  25117. // requests. By default, fields with empty values are omitted from API
  25118. // requests. However, any non-pointer, non-interface field appearing in
  25119. // ForceSendFields will be sent to the server regardless of whether the
  25120. // field is empty or not. This may be used to include empty fields in
  25121. // Patch requests.
  25122. ForceSendFields []string `json:"-"`
  25123. // NullFields is a list of field names (e.g.
  25124. // "PreconfiguredExpressionSets") to include in API requests with the
  25125. // JSON null value. By default, fields with empty values are omitted
  25126. // from API requests. However, any field with an empty value appearing
  25127. // in NullFields will be sent to the server as null. It is an error if a
  25128. // field in this list has a non-empty value. This may be used to include
  25129. // null fields in Patch requests.
  25130. NullFields []string `json:"-"`
  25131. }
  25132. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  25133. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  25134. raw := NoMethod(*s)
  25135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25136. }
  25137. type SecurityPoliciesWafConfig struct {
  25138. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  25139. // ForceSendFields is a list of field names (e.g. "WafRules") to
  25140. // unconditionally include in API requests. By default, fields with
  25141. // empty values are omitted from API requests. However, any non-pointer,
  25142. // non-interface field appearing in ForceSendFields will be sent to the
  25143. // server regardless of whether the field is empty or not. This may be
  25144. // used to include empty fields in Patch requests.
  25145. ForceSendFields []string `json:"-"`
  25146. // NullFields is a list of field names (e.g. "WafRules") to include in
  25147. // API requests with the JSON null value. By default, fields with empty
  25148. // values are omitted from API requests. However, any field with an
  25149. // empty value appearing in NullFields will be sent to the server as
  25150. // null. It is an error if a field in this list has a non-empty value.
  25151. // This may be used to include null fields in Patch requests.
  25152. NullFields []string `json:"-"`
  25153. }
  25154. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  25155. type NoMethod SecurityPoliciesWafConfig
  25156. raw := NoMethod(*s)
  25157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25158. }
  25159. // SecurityPolicy: A security policy is comprised of one or more rules.
  25160. // It can also be associated with one or more 'targets'. (==
  25161. // resource_for v1.securityPolicies ==) (== resource_for
  25162. // beta.securityPolicies ==)
  25163. type SecurityPolicy struct {
  25164. // Associations: A list of assocations that belong to this policy.
  25165. Associations []*SecurityPolicyAssociation `json:"associations,omitempty"`
  25166. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25167. // format.
  25168. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25169. // Description: An optional description of this resource. Provide this
  25170. // property when you create the resource.
  25171. Description string `json:"description,omitempty"`
  25172. // Fingerprint: Specifies a fingerprint for this resource, which is
  25173. // essentially a hash of the metadata's contents and used for optimistic
  25174. // locking. The fingerprint is initially generated by Compute Engine and
  25175. // changes after every request to modify or update metadata. You must
  25176. // always provide an up-to-date fingerprint hash in order to update or
  25177. // change metadata, otherwise the request will fail with error 412
  25178. // conditionNotMet.
  25179. //
  25180. // To see the latest fingerprint, make get() request to the security
  25181. // policy.
  25182. Fingerprint string `json:"fingerprint,omitempty"`
  25183. // Id: [Output Only] The unique identifier for the resource. This
  25184. // identifier is defined by the server.
  25185. Id uint64 `json:"id,omitempty,string"`
  25186. // Kind: [Output only] Type of the resource. Always
  25187. // compute#securityPolicyfor security policies
  25188. Kind string `json:"kind,omitempty"`
  25189. // LabelFingerprint: A fingerprint for the labels being applied to this
  25190. // security policy, which is essentially a hash of the labels set used
  25191. // for optimistic locking. The fingerprint is initially generated by
  25192. // Compute Engine and changes after every request to modify or update
  25193. // labels. You must always provide an up-to-date fingerprint hash in
  25194. // order to update or change labels.
  25195. //
  25196. // To see the latest fingerprint, make get() request to the security
  25197. // policy.
  25198. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25199. // Labels: Labels to apply to this security policy resource. These can
  25200. // be later modified by the setLabels method. Each label key/value must
  25201. // comply with RFC1035. Label values may be empty.
  25202. Labels map[string]string `json:"labels,omitempty"`
  25203. // Name: Name of the resource. Provided by the client when the resource
  25204. // is created. The name must be 1-63 characters long, and comply with
  25205. // RFC1035. Specifically, the name must be 1-63 characters long and
  25206. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25207. // the first character must be a lowercase letter, and all following
  25208. // characters must be a dash, lowercase letter, or digit, except the
  25209. // last character, which cannot be a dash.
  25210. Name string `json:"name,omitempty"`
  25211. // Rules: A list of rules that belong to this policy. There must always
  25212. // be a default rule (rule with priority 2147483647 and match "*"). If
  25213. // no rules are provided when creating a security policy, a default rule
  25214. // with action "allow" will be added.
  25215. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  25216. // SelfLink: [Output Only] Server-defined URL for the resource.
  25217. SelfLink string `json:"selfLink,omitempty"`
  25218. // Type: The type indicates the intended use of the security policy.
  25219. // CLOUD_ARMOR policies apply to backend services. FIREWALL policies
  25220. // apply to organizations.
  25221. //
  25222. // Possible values:
  25223. // "CLOUD_ARMOR"
  25224. // "FIREWALL"
  25225. Type string `json:"type,omitempty"`
  25226. // ServerResponse contains the HTTP response code and headers from the
  25227. // server.
  25228. googleapi.ServerResponse `json:"-"`
  25229. // ForceSendFields is a list of field names (e.g. "Associations") to
  25230. // unconditionally include in API requests. By default, fields with
  25231. // empty values are omitted from API requests. However, any non-pointer,
  25232. // non-interface field appearing in ForceSendFields will be sent to the
  25233. // server regardless of whether the field is empty or not. This may be
  25234. // used to include empty fields in Patch requests.
  25235. ForceSendFields []string `json:"-"`
  25236. // NullFields is a list of field names (e.g. "Associations") to include
  25237. // in API requests with the JSON null value. By default, fields with
  25238. // empty values are omitted from API requests. However, any field with
  25239. // an empty value appearing in NullFields will be sent to the server as
  25240. // null. It is an error if a field in this list has a non-empty value.
  25241. // This may be used to include null fields in Patch requests.
  25242. NullFields []string `json:"-"`
  25243. }
  25244. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  25245. type NoMethod SecurityPolicy
  25246. raw := NoMethod(*s)
  25247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25248. }
  25249. type SecurityPolicyAssociation struct {
  25250. // AttachmentId: The resource that the security policy is attached to.
  25251. AttachmentId string `json:"attachmentId,omitempty"`
  25252. // Name: The name for an association.
  25253. Name string `json:"name,omitempty"`
  25254. // ServerResponse contains the HTTP response code and headers from the
  25255. // server.
  25256. googleapi.ServerResponse `json:"-"`
  25257. // ForceSendFields is a list of field names (e.g. "AttachmentId") to
  25258. // unconditionally include in API requests. By default, fields with
  25259. // empty values are omitted from API requests. However, any non-pointer,
  25260. // non-interface field appearing in ForceSendFields will be sent to the
  25261. // server regardless of whether the field is empty or not. This may be
  25262. // used to include empty fields in Patch requests.
  25263. ForceSendFields []string `json:"-"`
  25264. // NullFields is a list of field names (e.g. "AttachmentId") to include
  25265. // in API requests with the JSON null value. By default, fields with
  25266. // empty values are omitted from API requests. However, any field with
  25267. // an empty value appearing in NullFields will be sent to the server as
  25268. // null. It is an error if a field in this list has a non-empty value.
  25269. // This may be used to include null fields in Patch requests.
  25270. NullFields []string `json:"-"`
  25271. }
  25272. func (s *SecurityPolicyAssociation) MarshalJSON() ([]byte, error) {
  25273. type NoMethod SecurityPolicyAssociation
  25274. raw := NoMethod(*s)
  25275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25276. }
  25277. type SecurityPolicyList struct {
  25278. // Id: [Output Only] Unique identifier for the resource; defined by the
  25279. // server.
  25280. Id string `json:"id,omitempty"`
  25281. // Items: A list of SecurityPolicy resources.
  25282. Items []*SecurityPolicy `json:"items,omitempty"`
  25283. // Kind: [Output Only] Type of resource. Always
  25284. // compute#securityPolicyList for listsof securityPolicies
  25285. Kind string `json:"kind,omitempty"`
  25286. // NextPageToken: [Output Only] This token allows you to get the next
  25287. // page of results for list requests. If the number of results is larger
  25288. // than maxResults, use the nextPageToken as a value for the query
  25289. // parameter pageToken in the next list request. Subsequent list
  25290. // requests will have their own nextPageToken to continue paging through
  25291. // the results.
  25292. NextPageToken string `json:"nextPageToken,omitempty"`
  25293. // Warning: [Output Only] Informational warning message.
  25294. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  25295. // ServerResponse contains the HTTP response code and headers from the
  25296. // server.
  25297. googleapi.ServerResponse `json:"-"`
  25298. // ForceSendFields is a list of field names (e.g. "Id") to
  25299. // unconditionally include in API requests. By default, fields with
  25300. // empty values are omitted from API requests. However, any non-pointer,
  25301. // non-interface field appearing in ForceSendFields will be sent to the
  25302. // server regardless of whether the field is empty or not. This may be
  25303. // used to include empty fields in Patch requests.
  25304. ForceSendFields []string `json:"-"`
  25305. // NullFields is a list of field names (e.g. "Id") to include in API
  25306. // requests with the JSON null value. By default, fields with empty
  25307. // values are omitted from API requests. However, any field with an
  25308. // empty value appearing in NullFields will be sent to the server as
  25309. // null. It is an error if a field in this list has a non-empty value.
  25310. // This may be used to include null fields in Patch requests.
  25311. NullFields []string `json:"-"`
  25312. }
  25313. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  25314. type NoMethod SecurityPolicyList
  25315. raw := NoMethod(*s)
  25316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25317. }
  25318. // SecurityPolicyListWarning: [Output Only] Informational warning
  25319. // message.
  25320. type SecurityPolicyListWarning struct {
  25321. // Code: [Output Only] A warning code, if applicable. For example,
  25322. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25323. // the response.
  25324. //
  25325. // Possible values:
  25326. // "CLEANUP_FAILED"
  25327. // "DEPRECATED_RESOURCE_USED"
  25328. // "DEPRECATED_TYPE_USED"
  25329. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25330. // "EXPERIMENTAL_TYPE_USED"
  25331. // "EXTERNAL_API_WARNING"
  25332. // "FIELD_VALUE_OVERRIDEN"
  25333. // "INJECTED_KERNELS_DEPRECATED"
  25334. // "MISSING_TYPE_DEPENDENCY"
  25335. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25336. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25337. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25338. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25339. // "NEXT_HOP_NOT_RUNNING"
  25340. // "NOT_CRITICAL_ERROR"
  25341. // "NO_RESULTS_ON_PAGE"
  25342. // "REQUIRED_TOS_AGREEMENT"
  25343. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25344. // "RESOURCE_NOT_DELETED"
  25345. // "SCHEMA_VALIDATION_IGNORED"
  25346. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25347. // "UNDECLARED_PROPERTIES"
  25348. // "UNREACHABLE"
  25349. Code string `json:"code,omitempty"`
  25350. // Data: [Output Only] Metadata about this warning in key: value format.
  25351. // For example:
  25352. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25353. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  25354. // Message: [Output Only] A human-readable description of the warning
  25355. // code.
  25356. Message string `json:"message,omitempty"`
  25357. // ForceSendFields is a list of field names (e.g. "Code") to
  25358. // unconditionally include in API requests. By default, fields with
  25359. // empty values are omitted from API requests. However, any non-pointer,
  25360. // non-interface field appearing in ForceSendFields will be sent to the
  25361. // server regardless of whether the field is empty or not. This may be
  25362. // used to include empty fields in Patch requests.
  25363. ForceSendFields []string `json:"-"`
  25364. // NullFields is a list of field names (e.g. "Code") to include in API
  25365. // requests with the JSON null value. By default, fields with empty
  25366. // values are omitted from API requests. However, any field with an
  25367. // empty value appearing in NullFields will be sent to the server as
  25368. // null. It is an error if a field in this list has a non-empty value.
  25369. // This may be used to include null fields in Patch requests.
  25370. NullFields []string `json:"-"`
  25371. }
  25372. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  25373. type NoMethod SecurityPolicyListWarning
  25374. raw := NoMethod(*s)
  25375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25376. }
  25377. type SecurityPolicyListWarningData struct {
  25378. // Key: [Output Only] A key that provides more detail on the warning
  25379. // being returned. For example, for warnings where there are no results
  25380. // in a list request for a particular zone, this key might be scope and
  25381. // the key value might be the zone name. Other examples might be a key
  25382. // indicating a deprecated resource and a suggested replacement, or a
  25383. // warning about invalid network settings (for example, if an instance
  25384. // attempts to perform IP forwarding but is not enabled for IP
  25385. // forwarding).
  25386. Key string `json:"key,omitempty"`
  25387. // Value: [Output Only] A warning data value corresponding to the key.
  25388. Value string `json:"value,omitempty"`
  25389. // ForceSendFields is a list of field names (e.g. "Key") to
  25390. // unconditionally include in API requests. By default, fields with
  25391. // empty values are omitted from API requests. However, any non-pointer,
  25392. // non-interface field appearing in ForceSendFields will be sent to the
  25393. // server regardless of whether the field is empty or not. This may be
  25394. // used to include empty fields in Patch requests.
  25395. ForceSendFields []string `json:"-"`
  25396. // NullFields is a list of field names (e.g. "Key") to include in API
  25397. // requests with the JSON null value. By default, fields with empty
  25398. // values are omitted from API requests. However, any field with an
  25399. // empty value appearing in NullFields will be sent to the server as
  25400. // null. It is an error if a field in this list has a non-empty value.
  25401. // This may be used to include null fields in Patch requests.
  25402. NullFields []string `json:"-"`
  25403. }
  25404. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  25405. type NoMethod SecurityPolicyListWarningData
  25406. raw := NoMethod(*s)
  25407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25408. }
  25409. type SecurityPolicyReference struct {
  25410. SecurityPolicy string `json:"securityPolicy,omitempty"`
  25411. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  25412. // unconditionally include in API requests. By default, fields with
  25413. // empty values are omitted from API requests. However, any non-pointer,
  25414. // non-interface field appearing in ForceSendFields will be sent to the
  25415. // server regardless of whether the field is empty or not. This may be
  25416. // used to include empty fields in Patch requests.
  25417. ForceSendFields []string `json:"-"`
  25418. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  25419. // include in API requests with the JSON null value. By default, fields
  25420. // with empty values are omitted from API requests. However, any field
  25421. // with an empty value appearing in NullFields will be sent to the
  25422. // server as null. It is an error if a field in this list has a
  25423. // non-empty value. This may be used to include null fields in Patch
  25424. // requests.
  25425. NullFields []string `json:"-"`
  25426. }
  25427. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  25428. type NoMethod SecurityPolicyReference
  25429. raw := NoMethod(*s)
  25430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25431. }
  25432. // SecurityPolicyRule: Represents a rule that describes one or more
  25433. // match conditions along with the action to be taken when traffic
  25434. // matches this condition (allow or deny).
  25435. type SecurityPolicyRule struct {
  25436. // Action: The Action to preform when the client connection triggers the
  25437. // rule. Can currently be either "allow" or "deny()" where valid values
  25438. // for status are 403, 404, and 502.
  25439. Action string `json:"action,omitempty"`
  25440. // Description: An optional description of this resource. Provide this
  25441. // property when you create the resource.
  25442. Description string `json:"description,omitempty"`
  25443. // Direction: The direction in which this rule applies. This field may
  25444. // only be specified when versioned_expr is set to FIREWALL.
  25445. //
  25446. // Possible values:
  25447. // "EGRESS"
  25448. // "INGRESS"
  25449. Direction string `json:"direction,omitempty"`
  25450. // EnableLogging: Denotes whether to enable logging for a particular
  25451. // rule. If logging is enabled, logs will be exported to the configured
  25452. // export destination in Stackdriver. Logs may be exported to BigQuery
  25453. // or Pub/Sub. Note: you cannot enable logging on "goto_next"
  25454. // rules.
  25455. //
  25456. // This field may only be specified when the versioned_expr is set to
  25457. // FIREWALL.
  25458. EnableLogging bool `json:"enableLogging,omitempty"`
  25459. // Kind: [Output only] Type of the resource. Always
  25460. // compute#securityPolicyRule for security policy rules
  25461. Kind string `json:"kind,omitempty"`
  25462. // Match: A match condition that incoming traffic is evaluated against.
  25463. // If it evaluates to true, the corresponding ?action? is enforced.
  25464. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  25465. // Preview: If set to true, the specified action is not enforced.
  25466. Preview bool `json:"preview,omitempty"`
  25467. // Priority: An integer indicating the priority of a rule in the list.
  25468. // The priority must be a positive value between 0 and 2147483647. Rules
  25469. // are evaluated from highest to lowest priority where 0 is the highest
  25470. // priority and 2147483647 is the lowest prority.
  25471. Priority int64 `json:"priority,omitempty"`
  25472. // TargetResources: A list of network resource URLs to which this rule
  25473. // applies. This field allows you to control which network?s VMs get
  25474. // this rule. If this field is left blank, all VMs within the
  25475. // organization will receive the rule.
  25476. //
  25477. // This field may only be specified when versioned_expr is set to
  25478. // FIREWALL.
  25479. TargetResources []string `json:"targetResources,omitempty"`
  25480. // ServerResponse contains the HTTP response code and headers from the
  25481. // server.
  25482. googleapi.ServerResponse `json:"-"`
  25483. // ForceSendFields is a list of field names (e.g. "Action") to
  25484. // unconditionally include in API requests. By default, fields with
  25485. // empty values are omitted from API requests. However, any non-pointer,
  25486. // non-interface field appearing in ForceSendFields will be sent to the
  25487. // server regardless of whether the field is empty or not. This may be
  25488. // used to include empty fields in Patch requests.
  25489. ForceSendFields []string `json:"-"`
  25490. // NullFields is a list of field names (e.g. "Action") to include in API
  25491. // requests with the JSON null value. By default, fields with empty
  25492. // values are omitted from API requests. However, any field with an
  25493. // empty value appearing in NullFields will be sent to the server as
  25494. // null. It is an error if a field in this list has a non-empty value.
  25495. // This may be used to include null fields in Patch requests.
  25496. NullFields []string `json:"-"`
  25497. }
  25498. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  25499. type NoMethod SecurityPolicyRule
  25500. raw := NoMethod(*s)
  25501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25502. }
  25503. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  25504. // traffic is evaluated against. Exactly one field must be specified.
  25505. type SecurityPolicyRuleMatcher struct {
  25506. // Config: The configuration options available when specifying
  25507. // versioned_expr. This field must be specified if versioned_expr is
  25508. // specified and cannot be specified if versioned_expr is not specified.
  25509. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  25510. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  25511. // specify match criteria such as origin.ip, source.region_code and
  25512. // contents in the request header.
  25513. Expr *Expr `json:"expr,omitempty"`
  25514. // VersionedExpr: Preconfigured versioned expression. If this field is
  25515. // specified, config must also be specified. Available preconfigured
  25516. // expressions along with their requirements are: SRC_IPS_V1 - must
  25517. // specify the corresponding src_ip_range field in config.
  25518. //
  25519. // Possible values:
  25520. // "FIREWALL"
  25521. // "SRC_IPS_V1"
  25522. VersionedExpr string `json:"versionedExpr,omitempty"`
  25523. // ForceSendFields is a list of field names (e.g. "Config") to
  25524. // unconditionally include in API requests. By default, fields with
  25525. // empty values are omitted from API requests. However, any non-pointer,
  25526. // non-interface field appearing in ForceSendFields will be sent to the
  25527. // server regardless of whether the field is empty or not. This may be
  25528. // used to include empty fields in Patch requests.
  25529. ForceSendFields []string `json:"-"`
  25530. // NullFields is a list of field names (e.g. "Config") to include in API
  25531. // requests with the JSON null value. By default, fields with empty
  25532. // values are omitted from API requests. However, any field with an
  25533. // empty value appearing in NullFields will be sent to the server as
  25534. // null. It is an error if a field in this list has a non-empty value.
  25535. // This may be used to include null fields in Patch requests.
  25536. NullFields []string `json:"-"`
  25537. }
  25538. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  25539. type NoMethod SecurityPolicyRuleMatcher
  25540. raw := NoMethod(*s)
  25541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25542. }
  25543. type SecurityPolicyRuleMatcherConfig struct {
  25544. // DestIpRanges: CIDR IP address range.
  25545. //
  25546. // This field may only be specified when versioned_expr is set to
  25547. // FIREWALL.
  25548. DestIpRanges []string `json:"destIpRanges,omitempty"`
  25549. // DestPorts: Pairs of IP protocols and ports that the rule should
  25550. // match.
  25551. //
  25552. // This field may only be specified when versioned_expr is set to
  25553. // FIREWALL.
  25554. DestPorts []*SecurityPolicyRuleMatcherConfigDestinationPort `json:"destPorts,omitempty"`
  25555. // SrcIpRanges: CIDR IP address range.
  25556. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  25557. // ForceSendFields is a list of field names (e.g. "DestIpRanges") to
  25558. // unconditionally include in API requests. By default, fields with
  25559. // empty values are omitted from API requests. However, any non-pointer,
  25560. // non-interface field appearing in ForceSendFields will be sent to the
  25561. // server regardless of whether the field is empty or not. This may be
  25562. // used to include empty fields in Patch requests.
  25563. ForceSendFields []string `json:"-"`
  25564. // NullFields is a list of field names (e.g. "DestIpRanges") to include
  25565. // in API requests with the JSON null value. By default, fields with
  25566. // empty values are omitted from API requests. However, any field with
  25567. // an empty value appearing in NullFields will be sent to the server as
  25568. // null. It is an error if a field in this list has a non-empty value.
  25569. // This may be used to include null fields in Patch requests.
  25570. NullFields []string `json:"-"`
  25571. }
  25572. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  25573. type NoMethod SecurityPolicyRuleMatcherConfig
  25574. raw := NoMethod(*s)
  25575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25576. }
  25577. type SecurityPolicyRuleMatcherConfigDestinationPort struct {
  25578. // IpProtocol: The IP protocol to which this rule applies. The protocol
  25579. // type is required when creating a firewall rule. This value can either
  25580. // be one of the following well known protocol strings (tcp, udp, icmp,
  25581. // esp, ah, ipip, sctp), or the IP protocol number.
  25582. IpProtocol string `json:"ipProtocol,omitempty"`
  25583. // Ports: An optional list of ports to which this rule applies. This
  25584. // field is only applicable for UDP or TCP protocol. Each entry must be
  25585. // either an integer or a range. If not specified, this rule applies to
  25586. // connections through any port.
  25587. //
  25588. // Example inputs include: ["22"], ["80","443"], and
  25589. // ["12345-12349"].
  25590. //
  25591. // This field may only be specified when versioned_expr is set to
  25592. // FIREWALL.
  25593. Ports []string `json:"ports,omitempty"`
  25594. // ForceSendFields is a list of field names (e.g. "IpProtocol") to
  25595. // unconditionally include in API requests. By default, fields with
  25596. // empty values are omitted from API requests. However, any non-pointer,
  25597. // non-interface field appearing in ForceSendFields will be sent to the
  25598. // server regardless of whether the field is empty or not. This may be
  25599. // used to include empty fields in Patch requests.
  25600. ForceSendFields []string `json:"-"`
  25601. // NullFields is a list of field names (e.g. "IpProtocol") to include in
  25602. // API requests with the JSON null value. By default, fields with empty
  25603. // values are omitted from API requests. However, any field with an
  25604. // empty value appearing in NullFields will be sent to the server as
  25605. // null. It is an error if a field in this list has a non-empty value.
  25606. // This may be used to include null fields in Patch requests.
  25607. NullFields []string `json:"-"`
  25608. }
  25609. func (s *SecurityPolicyRuleMatcherConfigDestinationPort) MarshalJSON() ([]byte, error) {
  25610. type NoMethod SecurityPolicyRuleMatcherConfigDestinationPort
  25611. raw := NoMethod(*s)
  25612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25613. }
  25614. // SerialPortOutput: An instance's serial console output.
  25615. type SerialPortOutput struct {
  25616. // Contents: [Output Only] The contents of the console output.
  25617. Contents string `json:"contents,omitempty"`
  25618. // Kind: [Output Only] Type of the resource. Always
  25619. // compute#serialPortOutput for serial port output.
  25620. Kind string `json:"kind,omitempty"`
  25621. // Next: [Output Only] The position of the next byte of content from the
  25622. // serial console output. Use this value in the next request as the
  25623. // start parameter.
  25624. Next int64 `json:"next,omitempty,string"`
  25625. // SelfLink: [Output Only] Server-defined URL for this resource.
  25626. SelfLink string `json:"selfLink,omitempty"`
  25627. // Start: The starting byte position of the output that was returned.
  25628. // This should match the start parameter sent with the request. If the
  25629. // serial console output exceeds the size of the buffer, older output
  25630. // will be overwritten by newer content and the start values will be
  25631. // mismatched.
  25632. Start int64 `json:"start,omitempty,string"`
  25633. // ServerResponse contains the HTTP response code and headers from the
  25634. // server.
  25635. googleapi.ServerResponse `json:"-"`
  25636. // ForceSendFields is a list of field names (e.g. "Contents") to
  25637. // unconditionally include in API requests. By default, fields with
  25638. // empty values are omitted from API requests. However, any non-pointer,
  25639. // non-interface field appearing in ForceSendFields will be sent to the
  25640. // server regardless of whether the field is empty or not. This may be
  25641. // used to include empty fields in Patch requests.
  25642. ForceSendFields []string `json:"-"`
  25643. // NullFields is a list of field names (e.g. "Contents") to include in
  25644. // API requests with the JSON null value. By default, fields with empty
  25645. // values are omitted from API requests. However, any field with an
  25646. // empty value appearing in NullFields will be sent to the server as
  25647. // null. It is an error if a field in this list has a non-empty value.
  25648. // This may be used to include null fields in Patch requests.
  25649. NullFields []string `json:"-"`
  25650. }
  25651. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  25652. type NoMethod SerialPortOutput
  25653. raw := NoMethod(*s)
  25654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25655. }
  25656. type ServerBinding struct {
  25657. // Possible values:
  25658. // "RESTART_NODE_ON_ANY_SERVER"
  25659. // "RESTART_NODE_ON_MINIMAL_SERVERS"
  25660. // "SERVER_BINDING_TYPE_UNSPECIFIED"
  25661. Type string `json:"type,omitempty"`
  25662. // ForceSendFields is a list of field names (e.g. "Type") to
  25663. // unconditionally include in API requests. By default, fields with
  25664. // empty values are omitted from API requests. However, any non-pointer,
  25665. // non-interface field appearing in ForceSendFields will be sent to the
  25666. // server regardless of whether the field is empty or not. This may be
  25667. // used to include empty fields in Patch requests.
  25668. ForceSendFields []string `json:"-"`
  25669. // NullFields is a list of field names (e.g. "Type") to include in API
  25670. // requests with the JSON null value. By default, fields with empty
  25671. // values are omitted from API requests. However, any field with an
  25672. // empty value appearing in NullFields will be sent to the server as
  25673. // null. It is an error if a field in this list has a non-empty value.
  25674. // This may be used to include null fields in Patch requests.
  25675. NullFields []string `json:"-"`
  25676. }
  25677. func (s *ServerBinding) MarshalJSON() ([]byte, error) {
  25678. type NoMethod ServerBinding
  25679. raw := NoMethod(*s)
  25680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25681. }
  25682. // ServiceAccount: A service account.
  25683. type ServiceAccount struct {
  25684. // Email: Email address of the service account.
  25685. Email string `json:"email,omitempty"`
  25686. // Scopes: The list of scopes to be made available for this service
  25687. // account.
  25688. Scopes []string `json:"scopes,omitempty"`
  25689. // ForceSendFields is a list of field names (e.g. "Email") to
  25690. // unconditionally include in API requests. By default, fields with
  25691. // empty values are omitted from API requests. However, any non-pointer,
  25692. // non-interface field appearing in ForceSendFields will be sent to the
  25693. // server regardless of whether the field is empty or not. This may be
  25694. // used to include empty fields in Patch requests.
  25695. ForceSendFields []string `json:"-"`
  25696. // NullFields is a list of field names (e.g. "Email") to include in API
  25697. // requests with the JSON null value. By default, fields with empty
  25698. // values are omitted from API requests. However, any field with an
  25699. // empty value appearing in NullFields will be sent to the server as
  25700. // null. It is an error if a field in this list has a non-empty value.
  25701. // This may be used to include null fields in Patch requests.
  25702. NullFields []string `json:"-"`
  25703. }
  25704. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  25705. type NoMethod ServiceAccount
  25706. raw := NoMethod(*s)
  25707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25708. }
  25709. // ShieldedVmConfig: A set of Shielded VM options.
  25710. type ShieldedVmConfig struct {
  25711. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  25712. // monitoring enabled.
  25713. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  25714. // EnableSecureBoot: Defines whether the instance has Secure Boot
  25715. // enabled.
  25716. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  25717. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  25718. EnableVtpm bool `json:"enableVtpm,omitempty"`
  25719. // ForceSendFields is a list of field names (e.g.
  25720. // "EnableIntegrityMonitoring") to unconditionally include in API
  25721. // requests. By default, fields with empty values are omitted from API
  25722. // requests. However, any non-pointer, non-interface field appearing in
  25723. // ForceSendFields will be sent to the server regardless of whether the
  25724. // field is empty or not. This may be used to include empty fields in
  25725. // Patch requests.
  25726. ForceSendFields []string `json:"-"`
  25727. // NullFields is a list of field names (e.g.
  25728. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  25729. // null value. By default, fields with empty values are omitted from API
  25730. // requests. However, any field with an empty value appearing in
  25731. // NullFields will be sent to the server as null. It is an error if a
  25732. // field in this list has a non-empty value. This may be used to include
  25733. // null fields in Patch requests.
  25734. NullFields []string `json:"-"`
  25735. }
  25736. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  25737. type NoMethod ShieldedVmConfig
  25738. raw := NoMethod(*s)
  25739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25740. }
  25741. // ShieldedVmIdentity: A shielded VM identity entry.
  25742. type ShieldedVmIdentity struct {
  25743. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded VM's
  25744. // vTPM.
  25745. EncryptionKey *ShieldedVmIdentityEntry `json:"encryptionKey,omitempty"`
  25746. // Kind: [Output Only] Type of the resource. Always
  25747. // compute#shieldedVmIdentity for shielded VM identity entry.
  25748. Kind string `json:"kind,omitempty"`
  25749. // SigningKey: An Attestation Key (AK) issued to the Shielded VM's vTPM.
  25750. SigningKey *ShieldedVmIdentityEntry `json:"signingKey,omitempty"`
  25751. // ServerResponse contains the HTTP response code and headers from the
  25752. // server.
  25753. googleapi.ServerResponse `json:"-"`
  25754. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  25755. // unconditionally include in API requests. By default, fields with
  25756. // empty values are omitted from API requests. However, any non-pointer,
  25757. // non-interface field appearing in ForceSendFields will be sent to the
  25758. // server regardless of whether the field is empty or not. This may be
  25759. // used to include empty fields in Patch requests.
  25760. ForceSendFields []string `json:"-"`
  25761. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  25762. // in API requests with the JSON null value. By default, fields with
  25763. // empty values are omitted from API requests. However, any field with
  25764. // an empty value appearing in NullFields will be sent to the server as
  25765. // null. It is an error if a field in this list has a non-empty value.
  25766. // This may be used to include null fields in Patch requests.
  25767. NullFields []string `json:"-"`
  25768. }
  25769. func (s *ShieldedVmIdentity) MarshalJSON() ([]byte, error) {
  25770. type NoMethod ShieldedVmIdentity
  25771. raw := NoMethod(*s)
  25772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25773. }
  25774. // ShieldedVmIdentityEntry: A Shielded VM Identity Entry.
  25775. type ShieldedVmIdentityEntry struct {
  25776. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  25777. EkCert string `json:"ekCert,omitempty"`
  25778. // EkPub: A PEM-encoded public key.
  25779. EkPub string `json:"ekPub,omitempty"`
  25780. // ForceSendFields is a list of field names (e.g. "EkCert") to
  25781. // unconditionally include in API requests. By default, fields with
  25782. // empty values are omitted from API requests. However, any non-pointer,
  25783. // non-interface field appearing in ForceSendFields will be sent to the
  25784. // server regardless of whether the field is empty or not. This may be
  25785. // used to include empty fields in Patch requests.
  25786. ForceSendFields []string `json:"-"`
  25787. // NullFields is a list of field names (e.g. "EkCert") to include in API
  25788. // requests with the JSON null value. By default, fields with empty
  25789. // values are omitted from API requests. However, any field with an
  25790. // empty value appearing in NullFields will be sent to the server as
  25791. // null. It is an error if a field in this list has a non-empty value.
  25792. // This may be used to include null fields in Patch requests.
  25793. NullFields []string `json:"-"`
  25794. }
  25795. func (s *ShieldedVmIdentityEntry) MarshalJSON() ([]byte, error) {
  25796. type NoMethod ShieldedVmIdentityEntry
  25797. raw := NoMethod(*s)
  25798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25799. }
  25800. // ShieldedVmIntegrityPolicy: The policy describes the baseline against
  25801. // which VM instance boot integrity is measured.
  25802. type ShieldedVmIntegrityPolicy struct {
  25803. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  25804. // the measurements from the VM instance's most recent boot.
  25805. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  25806. // ForceSendFields is a list of field names (e.g.
  25807. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  25808. // By default, fields with empty values are omitted from API requests.
  25809. // However, any non-pointer, non-interface field appearing in
  25810. // ForceSendFields will be sent to the server regardless of whether the
  25811. // field is empty or not. This may be used to include empty fields in
  25812. // Patch requests.
  25813. ForceSendFields []string `json:"-"`
  25814. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  25815. // include in API requests with the JSON null value. By default, fields
  25816. // with empty values are omitted from API requests. However, any field
  25817. // with an empty value appearing in NullFields will be sent to the
  25818. // server as null. It is an error if a field in this list has a
  25819. // non-empty value. This may be used to include null fields in Patch
  25820. // requests.
  25821. NullFields []string `json:"-"`
  25822. }
  25823. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  25824. type NoMethod ShieldedVmIntegrityPolicy
  25825. raw := NoMethod(*s)
  25826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25827. }
  25828. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  25829. // Cloud CDN Signed URLs
  25830. type SignedUrlKey struct {
  25831. // KeyName: Name of the key. The name must be 1-63 characters long, and
  25832. // comply with RFC1035. Specifically, the name must be 1-63 characters
  25833. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  25834. // which means the first character must be a lowercase letter, and all
  25835. // following characters must be a dash, lowercase letter, or digit,
  25836. // except the last character, which cannot be a dash.
  25837. KeyName string `json:"keyName,omitempty"`
  25838. // KeyValue: 128-bit key value used for signing the URL. The key value
  25839. // must be a valid RFC 4648 Section 5 base64url encoded string.
  25840. KeyValue string `json:"keyValue,omitempty"`
  25841. // ForceSendFields is a list of field names (e.g. "KeyName") to
  25842. // unconditionally include in API requests. By default, fields with
  25843. // empty values are omitted from API requests. However, any non-pointer,
  25844. // non-interface field appearing in ForceSendFields will be sent to the
  25845. // server regardless of whether the field is empty or not. This may be
  25846. // used to include empty fields in Patch requests.
  25847. ForceSendFields []string `json:"-"`
  25848. // NullFields is a list of field names (e.g. "KeyName") to include in
  25849. // API requests with the JSON null value. By default, fields with empty
  25850. // values are omitted from API requests. However, any field with an
  25851. // empty value appearing in NullFields will be sent to the server as
  25852. // null. It is an error if a field in this list has a non-empty value.
  25853. // This may be used to include null fields in Patch requests.
  25854. NullFields []string `json:"-"`
  25855. }
  25856. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  25857. type NoMethod SignedUrlKey
  25858. raw := NoMethod(*s)
  25859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25860. }
  25861. // Snapshot: A persistent disk snapshot resource. (== resource_for
  25862. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  25863. type Snapshot struct {
  25864. // AutoCreated: [Output Only] Set to true if snapshots are automatically
  25865. // by applying resource policy on the target disk.
  25866. AutoCreated bool `json:"autoCreated,omitempty"`
  25867. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25868. // format.
  25869. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25870. // Description: An optional description of this resource. Provide this
  25871. // property when you create the resource.
  25872. Description string `json:"description,omitempty"`
  25873. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  25874. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  25875. // GuestOsFeatures: [Output Only] A list of features to enable on the
  25876. // guest operating system. Applicable only for bootable images. Read
  25877. // Enabling guest operating system features to see a list of available
  25878. // options.
  25879. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  25880. // Id: [Output Only] The unique identifier for the resource. This
  25881. // identifier is defined by the server.
  25882. Id uint64 `json:"id,omitempty,string"`
  25883. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  25884. // Snapshot resources.
  25885. Kind string `json:"kind,omitempty"`
  25886. // LabelFingerprint: A fingerprint for the labels being applied to this
  25887. // snapshot, which is essentially a hash of the labels set used for
  25888. // optimistic locking. The fingerprint is initially generated by Compute
  25889. // Engine and changes after every request to modify or update labels.
  25890. // You must always provide an up-to-date fingerprint hash in order to
  25891. // update or change labels, otherwise the request will fail with error
  25892. // 412 conditionNotMet.
  25893. //
  25894. // To see the latest fingerprint, make a get() request to retrieve a
  25895. // snapshot.
  25896. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25897. // Labels: Labels to apply to this snapshot. These can be later modified
  25898. // by the setLabels method. Label values may be empty.
  25899. Labels map[string]string `json:"labels,omitempty"`
  25900. // LicenseCodes: [Output Only] Integer license codes indicating which
  25901. // licenses are attached to this snapshot.
  25902. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  25903. // Licenses: [Output Only] A list of public visible licenses that apply
  25904. // to this snapshot. This can be because the original image had licenses
  25905. // attached (such as a Windows image).
  25906. Licenses []string `json:"licenses,omitempty"`
  25907. // Name: Name of the resource; provided by the client when the resource
  25908. // is created. The name must be 1-63 characters long, and comply with
  25909. // RFC1035. Specifically, the name must be 1-63 characters long and
  25910. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25911. // the first character must be a lowercase letter, and all following
  25912. // characters must be a dash, lowercase letter, or digit, except the
  25913. // last character, which cannot be a dash.
  25914. Name string `json:"name,omitempty"`
  25915. // SelfLink: [Output Only] Server-defined URL for the resource.
  25916. SelfLink string `json:"selfLink,omitempty"`
  25917. // SnapshotEncryptionKey: Encrypts the snapshot using a
  25918. // customer-supplied encryption key.
  25919. //
  25920. // After you encrypt a snapshot using a customer-supplied key, you must
  25921. // provide the same key if you use the image later For example, you must
  25922. // provide the encryption key when you create a disk from the encrypted
  25923. // snapshot in a future request.
  25924. //
  25925. // Customer-supplied encryption keys do not protect access to metadata
  25926. // of the disk.
  25927. //
  25928. // If you do not provide an encryption key when creating the snapshot,
  25929. // then the snapshot will be encrypted using an automatically generated
  25930. // key and you do not need to provide a key to use the snapshot later.
  25931. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  25932. // SourceDisk: [Output Only] The source disk used to create this
  25933. // snapshot.
  25934. SourceDisk string `json:"sourceDisk,omitempty"`
  25935. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  25936. // source disk. Required if the source disk is protected by a
  25937. // customer-supplied encryption key.
  25938. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  25939. // SourceDiskId: [Output Only] The ID value of the disk used to create
  25940. // this snapshot. This value may be used to determine whether the
  25941. // snapshot was taken from the current or a previous instance of a given
  25942. // disk name.
  25943. SourceDiskId string `json:"sourceDiskId,omitempty"`
  25944. // Status: [Output Only] The status of the snapshot. This can be
  25945. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  25946. //
  25947. // Possible values:
  25948. // "CREATING"
  25949. // "DELETING"
  25950. // "FAILED"
  25951. // "READY"
  25952. // "UPLOADING"
  25953. Status string `json:"status,omitempty"`
  25954. // StorageBytes: [Output Only] A size of the storage used by the
  25955. // snapshot. As snapshots share storage, this number is expected to
  25956. // change with snapshot creation/deletion.
  25957. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  25958. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  25959. // is in a stable state or it is being adjusted as a result of shared
  25960. // storage reallocation. This status can either be UPDATING, meaning the
  25961. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  25962. // size of the snapshot is up-to-date.
  25963. //
  25964. // Possible values:
  25965. // "UPDATING"
  25966. // "UP_TO_DATE"
  25967. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  25968. // StorageLocations: GCS bucket storage location of the snapshot
  25969. // (regional or multi-regional).
  25970. StorageLocations []string `json:"storageLocations,omitempty"`
  25971. // ServerResponse contains the HTTP response code and headers from the
  25972. // server.
  25973. googleapi.ServerResponse `json:"-"`
  25974. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  25975. // unconditionally include in API requests. By default, fields with
  25976. // empty values are omitted from API requests. However, any non-pointer,
  25977. // non-interface field appearing in ForceSendFields will be sent to the
  25978. // server regardless of whether the field is empty or not. This may be
  25979. // used to include empty fields in Patch requests.
  25980. ForceSendFields []string `json:"-"`
  25981. // NullFields is a list of field names (e.g. "AutoCreated") to include
  25982. // in API requests with the JSON null value. By default, fields with
  25983. // empty values are omitted from API requests. However, any field with
  25984. // an empty value appearing in NullFields will be sent to the server as
  25985. // null. It is an error if a field in this list has a non-empty value.
  25986. // This may be used to include null fields in Patch requests.
  25987. NullFields []string `json:"-"`
  25988. }
  25989. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  25990. type NoMethod Snapshot
  25991. raw := NoMethod(*s)
  25992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25993. }
  25994. // SnapshotList: Contains a list of Snapshot resources.
  25995. type SnapshotList struct {
  25996. // Id: [Output Only] Unique identifier for the resource; defined by the
  25997. // server.
  25998. Id string `json:"id,omitempty"`
  25999. // Items: A list of Snapshot resources.
  26000. Items []*Snapshot `json:"items,omitempty"`
  26001. // Kind: Type of resource.
  26002. Kind string `json:"kind,omitempty"`
  26003. // NextPageToken: [Output Only] This token allows you to get the next
  26004. // page of results for list requests. If the number of results is larger
  26005. // than maxResults, use the nextPageToken as a value for the query
  26006. // parameter pageToken in the next list request. Subsequent list
  26007. // requests will have their own nextPageToken to continue paging through
  26008. // the results.
  26009. NextPageToken string `json:"nextPageToken,omitempty"`
  26010. // SelfLink: [Output Only] Server-defined URL for this resource.
  26011. SelfLink string `json:"selfLink,omitempty"`
  26012. // Warning: [Output Only] Informational warning message.
  26013. Warning *SnapshotListWarning `json:"warning,omitempty"`
  26014. // ServerResponse contains the HTTP response code and headers from the
  26015. // server.
  26016. googleapi.ServerResponse `json:"-"`
  26017. // ForceSendFields is a list of field names (e.g. "Id") to
  26018. // unconditionally include in API requests. By default, fields with
  26019. // empty values are omitted from API requests. However, any non-pointer,
  26020. // non-interface field appearing in ForceSendFields will be sent to the
  26021. // server regardless of whether the field is empty or not. This may be
  26022. // used to include empty fields in Patch requests.
  26023. ForceSendFields []string `json:"-"`
  26024. // NullFields is a list of field names (e.g. "Id") to include in API
  26025. // requests with the JSON null value. By default, fields with empty
  26026. // values are omitted from API requests. However, any field with an
  26027. // empty value appearing in NullFields will be sent to the server as
  26028. // null. It is an error if a field in this list has a non-empty value.
  26029. // This may be used to include null fields in Patch requests.
  26030. NullFields []string `json:"-"`
  26031. }
  26032. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  26033. type NoMethod SnapshotList
  26034. raw := NoMethod(*s)
  26035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26036. }
  26037. // SnapshotListWarning: [Output Only] Informational warning message.
  26038. type SnapshotListWarning struct {
  26039. // Code: [Output Only] A warning code, if applicable. For example,
  26040. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26041. // the response.
  26042. //
  26043. // Possible values:
  26044. // "CLEANUP_FAILED"
  26045. // "DEPRECATED_RESOURCE_USED"
  26046. // "DEPRECATED_TYPE_USED"
  26047. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26048. // "EXPERIMENTAL_TYPE_USED"
  26049. // "EXTERNAL_API_WARNING"
  26050. // "FIELD_VALUE_OVERRIDEN"
  26051. // "INJECTED_KERNELS_DEPRECATED"
  26052. // "MISSING_TYPE_DEPENDENCY"
  26053. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26054. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26055. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26056. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26057. // "NEXT_HOP_NOT_RUNNING"
  26058. // "NOT_CRITICAL_ERROR"
  26059. // "NO_RESULTS_ON_PAGE"
  26060. // "REQUIRED_TOS_AGREEMENT"
  26061. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26062. // "RESOURCE_NOT_DELETED"
  26063. // "SCHEMA_VALIDATION_IGNORED"
  26064. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26065. // "UNDECLARED_PROPERTIES"
  26066. // "UNREACHABLE"
  26067. Code string `json:"code,omitempty"`
  26068. // Data: [Output Only] Metadata about this warning in key: value format.
  26069. // For example:
  26070. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26071. Data []*SnapshotListWarningData `json:"data,omitempty"`
  26072. // Message: [Output Only] A human-readable description of the warning
  26073. // code.
  26074. Message string `json:"message,omitempty"`
  26075. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  26091. type NoMethod SnapshotListWarning
  26092. raw := NoMethod(*s)
  26093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26094. }
  26095. type SnapshotListWarningData struct {
  26096. // Key: [Output Only] A key that provides more detail on the warning
  26097. // being returned. For example, for warnings where there are no results
  26098. // in a list request for a particular zone, this key might be scope and
  26099. // the key value might be the zone name. Other examples might be a key
  26100. // indicating a deprecated resource and a suggested replacement, or a
  26101. // warning about invalid network settings (for example, if an instance
  26102. // attempts to perform IP forwarding but is not enabled for IP
  26103. // forwarding).
  26104. Key string `json:"key,omitempty"`
  26105. // Value: [Output Only] A warning data value corresponding to the key.
  26106. Value string `json:"value,omitempty"`
  26107. // ForceSendFields is a list of field names (e.g. "Key") to
  26108. // unconditionally include in API requests. By default, fields with
  26109. // empty values are omitted from API requests. However, any non-pointer,
  26110. // non-interface field appearing in ForceSendFields will be sent to the
  26111. // server regardless of whether the field is empty or not. This may be
  26112. // used to include empty fields in Patch requests.
  26113. ForceSendFields []string `json:"-"`
  26114. // NullFields is a list of field names (e.g. "Key") to include in API
  26115. // requests with the JSON null value. By default, fields with empty
  26116. // values are omitted from API requests. However, any field with an
  26117. // empty value appearing in NullFields will be sent to the server as
  26118. // null. It is an error if a field in this list has a non-empty value.
  26119. // This may be used to include null fields in Patch requests.
  26120. NullFields []string `json:"-"`
  26121. }
  26122. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  26123. type NoMethod SnapshotListWarningData
  26124. raw := NoMethod(*s)
  26125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26126. }
  26127. // SourceInstanceParams: A specification of the parameters to use when
  26128. // creating the instance template from a source instance.
  26129. type SourceInstanceParams struct {
  26130. // DiskConfigs: Attached disks configuration. If not provided, defaults
  26131. // are applied: For boot disk and any other R/W disks, new custom images
  26132. // will be created from each disk. For read-only disks, they will be
  26133. // attached in read-only mode. Local SSD disks will be created as blank
  26134. // volumes.
  26135. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  26136. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  26137. // unconditionally include in API requests. By default, fields with
  26138. // empty values are omitted from API requests. However, any non-pointer,
  26139. // non-interface field appearing in ForceSendFields will be sent to the
  26140. // server regardless of whether the field is empty or not. This may be
  26141. // used to include empty fields in Patch requests.
  26142. ForceSendFields []string `json:"-"`
  26143. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  26144. // in API requests with the JSON null value. By default, fields with
  26145. // empty values are omitted from API requests. However, any field with
  26146. // an empty value appearing in NullFields will be sent to the server as
  26147. // null. It is an error if a field in this list has a non-empty value.
  26148. // This may be used to include null fields in Patch requests.
  26149. NullFields []string `json:"-"`
  26150. }
  26151. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  26152. type NoMethod SourceInstanceParams
  26153. raw := NoMethod(*s)
  26154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26155. }
  26156. type SourceInstanceProperties struct {
  26157. // CanIpForward: Enables instances created based on this machine image
  26158. // to send packets with source IP addresses other than their own and
  26159. // receive packets with destination IP addresses other than their own.
  26160. // If these instances will be used as an IP gateway or it will be set as
  26161. // the next-hop in a Route resource, specify true. If unsure, leave this
  26162. // set to false. See the Enable IP forwarding documentation for more
  26163. // information.
  26164. CanIpForward bool `json:"canIpForward,omitempty"`
  26165. // DeletionProtection: Whether the instance created from the machine
  26166. // image should be protected against deletion.
  26167. DeletionProtection bool `json:"deletionProtection,omitempty"`
  26168. // Description: An optional text description for the instances that are
  26169. // created from this machine image.
  26170. Description string `json:"description,omitempty"`
  26171. // Disks: An array of disks that are associated with the instances that
  26172. // are created from this machine image.
  26173. Disks []*SavedAttachedDisk `json:"disks,omitempty"`
  26174. // GuestAccelerators: A list of guest accelerator cards' type and count
  26175. // to use for instances created from the machine image.
  26176. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  26177. // Labels: Labels to apply to instances that are created from this
  26178. // machine image.
  26179. Labels map[string]string `json:"labels,omitempty"`
  26180. // MachineType: The machine type to use for instances that are created
  26181. // from this machine image.
  26182. MachineType string `json:"machineType,omitempty"`
  26183. // Metadata: The metadata key/value pairs to assign to instances that
  26184. // are created from this machine image. These pairs can consist of
  26185. // custom metadata or predefined keys. See Project and instance metadata
  26186. // for more information.
  26187. Metadata *Metadata `json:"metadata,omitempty"`
  26188. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  26189. // instance may be scheduled on the specified or newer cpu/platform.
  26190. // Applicable values are the friendly names of CPU platforms, such as
  26191. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  26192. // Bridge". For more information, read Specifying a Minimum CPU
  26193. // Platform.
  26194. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  26195. // NetworkInterfaces: An array of network access configurations for this
  26196. // interface.
  26197. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  26198. // Scheduling: Specifies the scheduling options for the instances that
  26199. // are created from this machine image.
  26200. Scheduling *Scheduling `json:"scheduling,omitempty"`
  26201. // ServiceAccounts: A list of service accounts with specified scopes.
  26202. // Access tokens for these service accounts are available to the
  26203. // instances that are created from this machine image. Use metadata
  26204. // queries to obtain the access tokens for these instances.
  26205. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  26206. // Tags: A list of tags to apply to the instances that are created from
  26207. // this machine image. The tags identify valid sources or targets for
  26208. // network firewalls. The setTags method can modify this list of tags.
  26209. // Each tag within the list must comply with RFC1035.
  26210. Tags *Tags `json:"tags,omitempty"`
  26211. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  26212. // unconditionally include in API requests. By default, fields with
  26213. // empty values are omitted from API requests. However, any non-pointer,
  26214. // non-interface field appearing in ForceSendFields will be sent to the
  26215. // server regardless of whether the field is empty or not. This may be
  26216. // used to include empty fields in Patch requests.
  26217. ForceSendFields []string `json:"-"`
  26218. // NullFields is a list of field names (e.g. "CanIpForward") to include
  26219. // in API requests with the JSON null value. By default, fields with
  26220. // empty values are omitted from API requests. However, any field with
  26221. // an empty value appearing in NullFields will be sent to the server as
  26222. // null. It is an error if a field in this list has a non-empty value.
  26223. // This may be used to include null fields in Patch requests.
  26224. NullFields []string `json:"-"`
  26225. }
  26226. func (s *SourceInstanceProperties) MarshalJSON() ([]byte, error) {
  26227. type NoMethod SourceInstanceProperties
  26228. raw := NoMethod(*s)
  26229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26230. }
  26231. // SslCertificate: An SslCertificate resource. This resource provides a
  26232. // mechanism to upload an SSL key and certificate to the load balancer
  26233. // to serve secure connections from the user. (== resource_for
  26234. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  26235. type SslCertificate struct {
  26236. // Certificate: A local certificate file. The certificate must be in PEM
  26237. // format. The certificate chain must be no greater than 5 certs long.
  26238. // The chain must include at least one intermediate cert.
  26239. Certificate string `json:"certificate,omitempty"`
  26240. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26241. // format.
  26242. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26243. // Description: An optional description of this resource. Provide this
  26244. // property when you create the resource.
  26245. Description string `json:"description,omitempty"`
  26246. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  26247. ExpireTime string `json:"expireTime,omitempty"`
  26248. // Id: [Output Only] The unique identifier for the resource. This
  26249. // identifier is defined by the server.
  26250. Id uint64 `json:"id,omitempty,string"`
  26251. // Kind: [Output Only] Type of the resource. Always
  26252. // compute#sslCertificate for SSL certificates.
  26253. Kind string `json:"kind,omitempty"`
  26254. // Managed: Configuration and status of a managed SSL certificate.
  26255. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  26256. // Name: Name of the resource. Provided by the client when the resource
  26257. // is created. The name must be 1-63 characters long, and comply with
  26258. // RFC1035. Specifically, the name must be 1-63 characters long and
  26259. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26260. // the first character must be a lowercase letter, and all following
  26261. // characters must be a dash, lowercase letter, or digit, except the
  26262. // last character, which cannot be a dash.
  26263. Name string `json:"name,omitempty"`
  26264. // PrivateKey: A write-only private key in PEM format. Only insert
  26265. // requests will include this field.
  26266. PrivateKey string `json:"privateKey,omitempty"`
  26267. // Region: [Output Only] URL of the region where the regional SSL
  26268. // Certificate resides. This field is not applicable to global SSL
  26269. // Certificate.
  26270. Region string `json:"region,omitempty"`
  26271. // SelfLink: [Output only] Server-defined URL for the resource.
  26272. SelfLink string `json:"selfLink,omitempty"`
  26273. // SelfManaged: Configuration and status of a self-managed SSL
  26274. // certificate.
  26275. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  26276. // SubjectAlternativeNames: [Output Only] Domains associated with the
  26277. // certificate via Subject Alternative Name.
  26278. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  26279. // Type: (Optional) Specifies the type of SSL certificate, either
  26280. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  26281. // self-managed and the fields certificate and private_key are used.
  26282. //
  26283. // Possible values:
  26284. // "MANAGED"
  26285. // "SELF_MANAGED"
  26286. // "TYPE_UNSPECIFIED"
  26287. Type string `json:"type,omitempty"`
  26288. // ServerResponse contains the HTTP response code and headers from the
  26289. // server.
  26290. googleapi.ServerResponse `json:"-"`
  26291. // ForceSendFields is a list of field names (e.g. "Certificate") to
  26292. // unconditionally include in API requests. By default, fields with
  26293. // empty values are omitted from API requests. However, any non-pointer,
  26294. // non-interface field appearing in ForceSendFields will be sent to the
  26295. // server regardless of whether the field is empty or not. This may be
  26296. // used to include empty fields in Patch requests.
  26297. ForceSendFields []string `json:"-"`
  26298. // NullFields is a list of field names (e.g. "Certificate") to include
  26299. // in API requests with the JSON null value. By default, fields with
  26300. // empty values are omitted from API requests. However, any field with
  26301. // an empty value appearing in NullFields will be sent to the server as
  26302. // null. It is an error if a field in this list has a non-empty value.
  26303. // This may be used to include null fields in Patch requests.
  26304. NullFields []string `json:"-"`
  26305. }
  26306. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  26307. type NoMethod SslCertificate
  26308. raw := NoMethod(*s)
  26309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26310. }
  26311. type SslCertificateAggregatedList struct {
  26312. // Id: [Output Only] Unique identifier for the resource; defined by the
  26313. // server.
  26314. Id string `json:"id,omitempty"`
  26315. // Items: A list of SslCertificatesScopedList resources.
  26316. Items map[string]SslCertificatesScopedList `json:"items,omitempty"`
  26317. // Kind: [Output Only] Type of resource. Always
  26318. // compute#sslCertificateAggregatedList for lists of SSL Certificates.
  26319. Kind string `json:"kind,omitempty"`
  26320. // NextPageToken: [Output Only] This token allows you to get the next
  26321. // page of results for list requests. If the number of results is larger
  26322. // than maxResults, use the nextPageToken as a value for the query
  26323. // parameter pageToken in the next list request. Subsequent list
  26324. // requests will have their own nextPageToken to continue paging through
  26325. // the results.
  26326. NextPageToken string `json:"nextPageToken,omitempty"`
  26327. // SelfLink: [Output Only] Server-defined URL for this resource.
  26328. SelfLink string `json:"selfLink,omitempty"`
  26329. // Warning: [Output Only] Informational warning message.
  26330. Warning *SslCertificateAggregatedListWarning `json:"warning,omitempty"`
  26331. // ServerResponse contains the HTTP response code and headers from the
  26332. // server.
  26333. googleapi.ServerResponse `json:"-"`
  26334. // ForceSendFields is a list of field names (e.g. "Id") to
  26335. // unconditionally include in API requests. By default, fields with
  26336. // empty values are omitted from API requests. However, any non-pointer,
  26337. // non-interface field appearing in ForceSendFields will be sent to the
  26338. // server regardless of whether the field is empty or not. This may be
  26339. // used to include empty fields in Patch requests.
  26340. ForceSendFields []string `json:"-"`
  26341. // NullFields is a list of field names (e.g. "Id") to include in API
  26342. // requests with the JSON null value. By default, fields with empty
  26343. // values are omitted from API requests. However, any field with an
  26344. // empty value appearing in NullFields will be sent to the server as
  26345. // null. It is an error if a field in this list has a non-empty value.
  26346. // This may be used to include null fields in Patch requests.
  26347. NullFields []string `json:"-"`
  26348. }
  26349. func (s *SslCertificateAggregatedList) MarshalJSON() ([]byte, error) {
  26350. type NoMethod SslCertificateAggregatedList
  26351. raw := NoMethod(*s)
  26352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26353. }
  26354. // SslCertificateAggregatedListWarning: [Output Only] Informational
  26355. // warning message.
  26356. type SslCertificateAggregatedListWarning struct {
  26357. // Code: [Output Only] A warning code, if applicable. For example,
  26358. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26359. // the response.
  26360. //
  26361. // Possible values:
  26362. // "CLEANUP_FAILED"
  26363. // "DEPRECATED_RESOURCE_USED"
  26364. // "DEPRECATED_TYPE_USED"
  26365. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26366. // "EXPERIMENTAL_TYPE_USED"
  26367. // "EXTERNAL_API_WARNING"
  26368. // "FIELD_VALUE_OVERRIDEN"
  26369. // "INJECTED_KERNELS_DEPRECATED"
  26370. // "MISSING_TYPE_DEPENDENCY"
  26371. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26372. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26373. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26374. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26375. // "NEXT_HOP_NOT_RUNNING"
  26376. // "NOT_CRITICAL_ERROR"
  26377. // "NO_RESULTS_ON_PAGE"
  26378. // "REQUIRED_TOS_AGREEMENT"
  26379. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26380. // "RESOURCE_NOT_DELETED"
  26381. // "SCHEMA_VALIDATION_IGNORED"
  26382. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26383. // "UNDECLARED_PROPERTIES"
  26384. // "UNREACHABLE"
  26385. Code string `json:"code,omitempty"`
  26386. // Data: [Output Only] Metadata about this warning in key: value format.
  26387. // For example:
  26388. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26389. Data []*SslCertificateAggregatedListWarningData `json:"data,omitempty"`
  26390. // Message: [Output Only] A human-readable description of the warning
  26391. // code.
  26392. Message string `json:"message,omitempty"`
  26393. // ForceSendFields is a list of field names (e.g. "Code") to
  26394. // unconditionally include in API requests. By default, fields with
  26395. // empty values are omitted from API requests. However, any non-pointer,
  26396. // non-interface field appearing in ForceSendFields will be sent to the
  26397. // server regardless of whether the field is empty or not. This may be
  26398. // used to include empty fields in Patch requests.
  26399. ForceSendFields []string `json:"-"`
  26400. // NullFields is a list of field names (e.g. "Code") to include in API
  26401. // requests with the JSON null value. By default, fields with empty
  26402. // values are omitted from API requests. However, any field with an
  26403. // empty value appearing in NullFields will be sent to the server as
  26404. // null. It is an error if a field in this list has a non-empty value.
  26405. // This may be used to include null fields in Patch requests.
  26406. NullFields []string `json:"-"`
  26407. }
  26408. func (s *SslCertificateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26409. type NoMethod SslCertificateAggregatedListWarning
  26410. raw := NoMethod(*s)
  26411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26412. }
  26413. type SslCertificateAggregatedListWarningData struct {
  26414. // Key: [Output Only] A key that provides more detail on the warning
  26415. // being returned. For example, for warnings where there are no results
  26416. // in a list request for a particular zone, this key might be scope and
  26417. // the key value might be the zone name. Other examples might be a key
  26418. // indicating a deprecated resource and a suggested replacement, or a
  26419. // warning about invalid network settings (for example, if an instance
  26420. // attempts to perform IP forwarding but is not enabled for IP
  26421. // forwarding).
  26422. Key string `json:"key,omitempty"`
  26423. // Value: [Output Only] A warning data value corresponding to the key.
  26424. Value string `json:"value,omitempty"`
  26425. // ForceSendFields is a list of field names (e.g. "Key") to
  26426. // unconditionally include in API requests. By default, fields with
  26427. // empty values are omitted from API requests. However, any non-pointer,
  26428. // non-interface field appearing in ForceSendFields will be sent to the
  26429. // server regardless of whether the field is empty or not. This may be
  26430. // used to include empty fields in Patch requests.
  26431. ForceSendFields []string `json:"-"`
  26432. // NullFields is a list of field names (e.g. "Key") to include in API
  26433. // requests with the JSON null value. By default, fields with empty
  26434. // values are omitted from API requests. However, any field with an
  26435. // empty value appearing in NullFields will be sent to the server as
  26436. // null. It is an error if a field in this list has a non-empty value.
  26437. // This may be used to include null fields in Patch requests.
  26438. NullFields []string `json:"-"`
  26439. }
  26440. func (s *SslCertificateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26441. type NoMethod SslCertificateAggregatedListWarningData
  26442. raw := NoMethod(*s)
  26443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26444. }
  26445. // SslCertificateList: Contains a list of SslCertificate resources.
  26446. type SslCertificateList struct {
  26447. // Id: [Output Only] Unique identifier for the resource; defined by the
  26448. // server.
  26449. Id string `json:"id,omitempty"`
  26450. // Items: A list of SslCertificate resources.
  26451. Items []*SslCertificate `json:"items,omitempty"`
  26452. // Kind: Type of resource.
  26453. Kind string `json:"kind,omitempty"`
  26454. // NextPageToken: [Output Only] This token allows you to get the next
  26455. // page of results for list requests. If the number of results is larger
  26456. // than maxResults, use the nextPageToken as a value for the query
  26457. // parameter pageToken in the next list request. Subsequent list
  26458. // requests will have their own nextPageToken to continue paging through
  26459. // the results.
  26460. NextPageToken string `json:"nextPageToken,omitempty"`
  26461. // SelfLink: [Output Only] Server-defined URL for this resource.
  26462. SelfLink string `json:"selfLink,omitempty"`
  26463. // Warning: [Output Only] Informational warning message.
  26464. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  26465. // ServerResponse contains the HTTP response code and headers from the
  26466. // server.
  26467. googleapi.ServerResponse `json:"-"`
  26468. // ForceSendFields is a list of field names (e.g. "Id") to
  26469. // unconditionally include in API requests. By default, fields with
  26470. // empty values are omitted from API requests. However, any non-pointer,
  26471. // non-interface field appearing in ForceSendFields will be sent to the
  26472. // server regardless of whether the field is empty or not. This may be
  26473. // used to include empty fields in Patch requests.
  26474. ForceSendFields []string `json:"-"`
  26475. // NullFields is a list of field names (e.g. "Id") to include in API
  26476. // requests with the JSON null value. By default, fields with empty
  26477. // values are omitted from API requests. However, any field with an
  26478. // empty value appearing in NullFields will be sent to the server as
  26479. // null. It is an error if a field in this list has a non-empty value.
  26480. // This may be used to include null fields in Patch requests.
  26481. NullFields []string `json:"-"`
  26482. }
  26483. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  26484. type NoMethod SslCertificateList
  26485. raw := NoMethod(*s)
  26486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26487. }
  26488. // SslCertificateListWarning: [Output Only] Informational warning
  26489. // message.
  26490. type SslCertificateListWarning struct {
  26491. // Code: [Output Only] A warning code, if applicable. For example,
  26492. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26493. // the response.
  26494. //
  26495. // Possible values:
  26496. // "CLEANUP_FAILED"
  26497. // "DEPRECATED_RESOURCE_USED"
  26498. // "DEPRECATED_TYPE_USED"
  26499. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26500. // "EXPERIMENTAL_TYPE_USED"
  26501. // "EXTERNAL_API_WARNING"
  26502. // "FIELD_VALUE_OVERRIDEN"
  26503. // "INJECTED_KERNELS_DEPRECATED"
  26504. // "MISSING_TYPE_DEPENDENCY"
  26505. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26506. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26507. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26508. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26509. // "NEXT_HOP_NOT_RUNNING"
  26510. // "NOT_CRITICAL_ERROR"
  26511. // "NO_RESULTS_ON_PAGE"
  26512. // "REQUIRED_TOS_AGREEMENT"
  26513. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26514. // "RESOURCE_NOT_DELETED"
  26515. // "SCHEMA_VALIDATION_IGNORED"
  26516. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26517. // "UNDECLARED_PROPERTIES"
  26518. // "UNREACHABLE"
  26519. Code string `json:"code,omitempty"`
  26520. // Data: [Output Only] Metadata about this warning in key: value format.
  26521. // For example:
  26522. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26523. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  26524. // Message: [Output Only] A human-readable description of the warning
  26525. // code.
  26526. Message string `json:"message,omitempty"`
  26527. // ForceSendFields is a list of field names (e.g. "Code") to
  26528. // unconditionally include in API requests. By default, fields with
  26529. // empty values are omitted from API requests. However, any non-pointer,
  26530. // non-interface field appearing in ForceSendFields will be sent to the
  26531. // server regardless of whether the field is empty or not. This may be
  26532. // used to include empty fields in Patch requests.
  26533. ForceSendFields []string `json:"-"`
  26534. // NullFields is a list of field names (e.g. "Code") to include in API
  26535. // requests with the JSON null value. By default, fields with empty
  26536. // values are omitted from API requests. However, any field with an
  26537. // empty value appearing in NullFields will be sent to the server as
  26538. // null. It is an error if a field in this list has a non-empty value.
  26539. // This may be used to include null fields in Patch requests.
  26540. NullFields []string `json:"-"`
  26541. }
  26542. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  26543. type NoMethod SslCertificateListWarning
  26544. raw := NoMethod(*s)
  26545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26546. }
  26547. type SslCertificateListWarningData struct {
  26548. // Key: [Output Only] A key that provides more detail on the warning
  26549. // being returned. For example, for warnings where there are no results
  26550. // in a list request for a particular zone, this key might be scope and
  26551. // the key value might be the zone name. Other examples might be a key
  26552. // indicating a deprecated resource and a suggested replacement, or a
  26553. // warning about invalid network settings (for example, if an instance
  26554. // attempts to perform IP forwarding but is not enabled for IP
  26555. // forwarding).
  26556. Key string `json:"key,omitempty"`
  26557. // Value: [Output Only] A warning data value corresponding to the key.
  26558. Value string `json:"value,omitempty"`
  26559. // ForceSendFields is a list of field names (e.g. "Key") to
  26560. // unconditionally include in API requests. By default, fields with
  26561. // empty values are omitted from API requests. However, any non-pointer,
  26562. // non-interface field appearing in ForceSendFields will be sent to the
  26563. // server regardless of whether the field is empty or not. This may be
  26564. // used to include empty fields in Patch requests.
  26565. ForceSendFields []string `json:"-"`
  26566. // NullFields is a list of field names (e.g. "Key") to include in API
  26567. // requests with the JSON null value. By default, fields with empty
  26568. // values are omitted from API requests. However, any field with an
  26569. // empty value appearing in NullFields will be sent to the server as
  26570. // null. It is an error if a field in this list has a non-empty value.
  26571. // This may be used to include null fields in Patch requests.
  26572. NullFields []string `json:"-"`
  26573. }
  26574. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  26575. type NoMethod SslCertificateListWarningData
  26576. raw := NoMethod(*s)
  26577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26578. }
  26579. // SslCertificateManagedSslCertificate: Configuration and status of a
  26580. // managed SSL certificate.
  26581. type SslCertificateManagedSslCertificate struct {
  26582. // DomainStatus: [Output only] Detailed statuses of the domains
  26583. // specified for managed certificate resource.
  26584. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  26585. // Domains: The domains for which a managed SSL certificate will be
  26586. // generated. Currently only single-domain certs are supported.
  26587. Domains []string `json:"domains,omitempty"`
  26588. // Status: [Output only] Status of the managed certificate resource.
  26589. //
  26590. // Possible values:
  26591. // "ACTIVE"
  26592. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  26593. // "PROVISIONING"
  26594. // "PROVISIONING_FAILED"
  26595. // "PROVISIONING_FAILED_PERMANENTLY"
  26596. // "RENEWAL_FAILED"
  26597. Status string `json:"status,omitempty"`
  26598. // ForceSendFields is a list of field names (e.g. "DomainStatus") 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. "DomainStatus") to include
  26606. // in API requests with the JSON null value. By default, fields with
  26607. // empty values are omitted from API requests. However, any field with
  26608. // an 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 *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  26614. type NoMethod SslCertificateManagedSslCertificate
  26615. raw := NoMethod(*s)
  26616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26617. }
  26618. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  26619. // a self-managed SSL certificate.
  26620. type SslCertificateSelfManagedSslCertificate struct {
  26621. // Certificate: A local certificate file. The certificate must be in PEM
  26622. // format. The certificate chain must be no greater than 5 certs long.
  26623. // The chain must include at least one intermediate cert.
  26624. Certificate string `json:"certificate,omitempty"`
  26625. // PrivateKey: A write-only private key in PEM format. Only insert
  26626. // requests will include this field.
  26627. PrivateKey string `json:"privateKey,omitempty"`
  26628. // ForceSendFields is a list of field names (e.g. "Certificate") to
  26629. // unconditionally include in API requests. By default, fields with
  26630. // empty values are omitted from API requests. However, any non-pointer,
  26631. // non-interface field appearing in ForceSendFields will be sent to the
  26632. // server regardless of whether the field is empty or not. This may be
  26633. // used to include empty fields in Patch requests.
  26634. ForceSendFields []string `json:"-"`
  26635. // NullFields is a list of field names (e.g. "Certificate") to include
  26636. // in API requests with the JSON null value. By default, fields with
  26637. // empty values are omitted from API requests. However, any field with
  26638. // an empty value appearing in NullFields will be sent to the server as
  26639. // null. It is an error if a field in this list has a non-empty value.
  26640. // This may be used to include null fields in Patch requests.
  26641. NullFields []string `json:"-"`
  26642. }
  26643. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  26644. type NoMethod SslCertificateSelfManagedSslCertificate
  26645. raw := NoMethod(*s)
  26646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26647. }
  26648. type SslCertificatesScopedList struct {
  26649. // SslCertificates: List of SslCertificates contained in this scope.
  26650. SslCertificates []*SslCertificate `json:"sslCertificates,omitempty"`
  26651. // Warning: Informational warning which replaces the list of backend
  26652. // services when the list is empty.
  26653. Warning *SslCertificatesScopedListWarning `json:"warning,omitempty"`
  26654. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  26655. // unconditionally include in API requests. By default, fields with
  26656. // empty values are omitted from API requests. However, any non-pointer,
  26657. // non-interface field appearing in ForceSendFields will be sent to the
  26658. // server regardless of whether the field is empty or not. This may be
  26659. // used to include empty fields in Patch requests.
  26660. ForceSendFields []string `json:"-"`
  26661. // NullFields is a list of field names (e.g. "SslCertificates") to
  26662. // include in API requests with the JSON null value. By default, fields
  26663. // with empty values are omitted from API requests. However, any field
  26664. // with an empty value appearing in NullFields will be sent to the
  26665. // server as null. It is an error if a field in this list has a
  26666. // non-empty value. This may be used to include null fields in Patch
  26667. // requests.
  26668. NullFields []string `json:"-"`
  26669. }
  26670. func (s *SslCertificatesScopedList) MarshalJSON() ([]byte, error) {
  26671. type NoMethod SslCertificatesScopedList
  26672. raw := NoMethod(*s)
  26673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26674. }
  26675. // SslCertificatesScopedListWarning: Informational warning which
  26676. // replaces the list of backend services when the list is empty.
  26677. type SslCertificatesScopedListWarning struct {
  26678. // Code: [Output Only] A warning code, if applicable. For example,
  26679. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26680. // the response.
  26681. //
  26682. // Possible values:
  26683. // "CLEANUP_FAILED"
  26684. // "DEPRECATED_RESOURCE_USED"
  26685. // "DEPRECATED_TYPE_USED"
  26686. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26687. // "EXPERIMENTAL_TYPE_USED"
  26688. // "EXTERNAL_API_WARNING"
  26689. // "FIELD_VALUE_OVERRIDEN"
  26690. // "INJECTED_KERNELS_DEPRECATED"
  26691. // "MISSING_TYPE_DEPENDENCY"
  26692. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26693. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26694. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26695. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26696. // "NEXT_HOP_NOT_RUNNING"
  26697. // "NOT_CRITICAL_ERROR"
  26698. // "NO_RESULTS_ON_PAGE"
  26699. // "REQUIRED_TOS_AGREEMENT"
  26700. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26701. // "RESOURCE_NOT_DELETED"
  26702. // "SCHEMA_VALIDATION_IGNORED"
  26703. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26704. // "UNDECLARED_PROPERTIES"
  26705. // "UNREACHABLE"
  26706. Code string `json:"code,omitempty"`
  26707. // Data: [Output Only] Metadata about this warning in key: value format.
  26708. // For example:
  26709. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26710. Data []*SslCertificatesScopedListWarningData `json:"data,omitempty"`
  26711. // Message: [Output Only] A human-readable description of the warning
  26712. // code.
  26713. Message string `json:"message,omitempty"`
  26714. // ForceSendFields is a list of field names (e.g. "Code") to
  26715. // unconditionally include in API requests. By default, fields with
  26716. // empty values are omitted from API requests. However, any non-pointer,
  26717. // non-interface field appearing in ForceSendFields will be sent to the
  26718. // server regardless of whether the field is empty or not. This may be
  26719. // used to include empty fields in Patch requests.
  26720. ForceSendFields []string `json:"-"`
  26721. // NullFields is a list of field names (e.g. "Code") to include in API
  26722. // requests with the JSON null value. By default, fields with empty
  26723. // values are omitted from API requests. However, any field with an
  26724. // empty value appearing in NullFields will be sent to the server as
  26725. // null. It is an error if a field in this list has a non-empty value.
  26726. // This may be used to include null fields in Patch requests.
  26727. NullFields []string `json:"-"`
  26728. }
  26729. func (s *SslCertificatesScopedListWarning) MarshalJSON() ([]byte, error) {
  26730. type NoMethod SslCertificatesScopedListWarning
  26731. raw := NoMethod(*s)
  26732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26733. }
  26734. type SslCertificatesScopedListWarningData struct {
  26735. // Key: [Output Only] A key that provides more detail on the warning
  26736. // being returned. For example, for warnings where there are no results
  26737. // in a list request for a particular zone, this key might be scope and
  26738. // the key value might be the zone name. Other examples might be a key
  26739. // indicating a deprecated resource and a suggested replacement, or a
  26740. // warning about invalid network settings (for example, if an instance
  26741. // attempts to perform IP forwarding but is not enabled for IP
  26742. // forwarding).
  26743. Key string `json:"key,omitempty"`
  26744. // Value: [Output Only] A warning data value corresponding to the key.
  26745. Value string `json:"value,omitempty"`
  26746. // ForceSendFields is a list of field names (e.g. "Key") to
  26747. // unconditionally include in API requests. By default, fields with
  26748. // empty values are omitted from API requests. However, any non-pointer,
  26749. // non-interface field appearing in ForceSendFields will be sent to the
  26750. // server regardless of whether the field is empty or not. This may be
  26751. // used to include empty fields in Patch requests.
  26752. ForceSendFields []string `json:"-"`
  26753. // NullFields is a list of field names (e.g. "Key") to include in API
  26754. // requests with the JSON null value. By default, fields with empty
  26755. // values are omitted from API requests. However, any field with an
  26756. // empty value appearing in NullFields will be sent to the server as
  26757. // null. It is an error if a field in this list has a non-empty value.
  26758. // This may be used to include null fields in Patch requests.
  26759. NullFields []string `json:"-"`
  26760. }
  26761. func (s *SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  26762. type NoMethod SslCertificatesScopedListWarningData
  26763. raw := NoMethod(*s)
  26764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26765. }
  26766. type SslPoliciesList struct {
  26767. // Id: [Output Only] Unique identifier for the resource; defined by the
  26768. // server.
  26769. Id string `json:"id,omitempty"`
  26770. // Items: A list of SslPolicy resources.
  26771. Items []*SslPolicy `json:"items,omitempty"`
  26772. // Kind: [Output Only] Type of the resource. Always
  26773. // compute#sslPoliciesList for lists of sslPolicies.
  26774. Kind string `json:"kind,omitempty"`
  26775. // NextPageToken: [Output Only] This token allows you to get the next
  26776. // page of results for list requests. If the number of results is larger
  26777. // than maxResults, use the nextPageToken as a value for the query
  26778. // parameter pageToken in the next list request. Subsequent list
  26779. // requests will have their own nextPageToken to continue paging through
  26780. // the results.
  26781. NextPageToken string `json:"nextPageToken,omitempty"`
  26782. // SelfLink: [Output Only] Server-defined URL for this resource.
  26783. SelfLink string `json:"selfLink,omitempty"`
  26784. // Warning: [Output Only] Informational warning message.
  26785. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  26786. // ServerResponse contains the HTTP response code and headers from the
  26787. // server.
  26788. googleapi.ServerResponse `json:"-"`
  26789. // ForceSendFields is a list of field names (e.g. "Id") to
  26790. // unconditionally include in API requests. By default, fields with
  26791. // empty values are omitted from API requests. However, any non-pointer,
  26792. // non-interface field appearing in ForceSendFields will be sent to the
  26793. // server regardless of whether the field is empty or not. This may be
  26794. // used to include empty fields in Patch requests.
  26795. ForceSendFields []string `json:"-"`
  26796. // NullFields is a list of field names (e.g. "Id") to include in API
  26797. // requests with the JSON null value. By default, fields with empty
  26798. // values are omitted from API requests. However, any field with an
  26799. // empty value appearing in NullFields will be sent to the server as
  26800. // null. It is an error if a field in this list has a non-empty value.
  26801. // This may be used to include null fields in Patch requests.
  26802. NullFields []string `json:"-"`
  26803. }
  26804. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  26805. type NoMethod SslPoliciesList
  26806. raw := NoMethod(*s)
  26807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26808. }
  26809. // SslPoliciesListWarning: [Output Only] Informational warning message.
  26810. type SslPoliciesListWarning struct {
  26811. // Code: [Output Only] A warning code, if applicable. For example,
  26812. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26813. // the response.
  26814. //
  26815. // Possible values:
  26816. // "CLEANUP_FAILED"
  26817. // "DEPRECATED_RESOURCE_USED"
  26818. // "DEPRECATED_TYPE_USED"
  26819. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26820. // "EXPERIMENTAL_TYPE_USED"
  26821. // "EXTERNAL_API_WARNING"
  26822. // "FIELD_VALUE_OVERRIDEN"
  26823. // "INJECTED_KERNELS_DEPRECATED"
  26824. // "MISSING_TYPE_DEPENDENCY"
  26825. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26826. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26827. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26828. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26829. // "NEXT_HOP_NOT_RUNNING"
  26830. // "NOT_CRITICAL_ERROR"
  26831. // "NO_RESULTS_ON_PAGE"
  26832. // "REQUIRED_TOS_AGREEMENT"
  26833. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26834. // "RESOURCE_NOT_DELETED"
  26835. // "SCHEMA_VALIDATION_IGNORED"
  26836. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26837. // "UNDECLARED_PROPERTIES"
  26838. // "UNREACHABLE"
  26839. Code string `json:"code,omitempty"`
  26840. // Data: [Output Only] Metadata about this warning in key: value format.
  26841. // For example:
  26842. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26843. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  26844. // Message: [Output Only] A human-readable description of the warning
  26845. // code.
  26846. Message string `json:"message,omitempty"`
  26847. // ForceSendFields is a list of field names (e.g. "Code") to
  26848. // unconditionally include in API requests. By default, fields with
  26849. // empty values are omitted from API requests. However, any non-pointer,
  26850. // non-interface field appearing in ForceSendFields will be sent to the
  26851. // server regardless of whether the field is empty or not. This may be
  26852. // used to include empty fields in Patch requests.
  26853. ForceSendFields []string `json:"-"`
  26854. // NullFields is a list of field names (e.g. "Code") to include in API
  26855. // requests with the JSON null value. By default, fields with empty
  26856. // values are omitted from API requests. However, any field with an
  26857. // empty value appearing in NullFields will be sent to the server as
  26858. // null. It is an error if a field in this list has a non-empty value.
  26859. // This may be used to include null fields in Patch requests.
  26860. NullFields []string `json:"-"`
  26861. }
  26862. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  26863. type NoMethod SslPoliciesListWarning
  26864. raw := NoMethod(*s)
  26865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26866. }
  26867. type SslPoliciesListWarningData struct {
  26868. // Key: [Output Only] A key that provides more detail on the warning
  26869. // being returned. For example, for warnings where there are no results
  26870. // in a list request for a particular zone, this key might be scope and
  26871. // the key value might be the zone name. Other examples might be a key
  26872. // indicating a deprecated resource and a suggested replacement, or a
  26873. // warning about invalid network settings (for example, if an instance
  26874. // attempts to perform IP forwarding but is not enabled for IP
  26875. // forwarding).
  26876. Key string `json:"key,omitempty"`
  26877. // Value: [Output Only] A warning data value corresponding to the key.
  26878. Value string `json:"value,omitempty"`
  26879. // ForceSendFields is a list of field names (e.g. "Key") to
  26880. // unconditionally include in API requests. By default, fields with
  26881. // empty values are omitted from API requests. However, any non-pointer,
  26882. // non-interface field appearing in ForceSendFields will be sent to the
  26883. // server regardless of whether the field is empty or not. This may be
  26884. // used to include empty fields in Patch requests.
  26885. ForceSendFields []string `json:"-"`
  26886. // NullFields is a list of field names (e.g. "Key") to include in API
  26887. // requests with the JSON null value. By default, fields with empty
  26888. // values are omitted from API requests. However, any field with an
  26889. // empty value appearing in NullFields will be sent to the server as
  26890. // null. It is an error if a field in this list has a non-empty value.
  26891. // This may be used to include null fields in Patch requests.
  26892. NullFields []string `json:"-"`
  26893. }
  26894. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  26895. type NoMethod SslPoliciesListWarningData
  26896. raw := NoMethod(*s)
  26897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26898. }
  26899. type SslPoliciesListAvailableFeaturesResponse struct {
  26900. Features []string `json:"features,omitempty"`
  26901. // ServerResponse contains the HTTP response code and headers from the
  26902. // server.
  26903. googleapi.ServerResponse `json:"-"`
  26904. // ForceSendFields is a list of field names (e.g. "Features") to
  26905. // unconditionally include in API requests. By default, fields with
  26906. // empty values are omitted from API requests. However, any non-pointer,
  26907. // non-interface field appearing in ForceSendFields will be sent to the
  26908. // server regardless of whether the field is empty or not. This may be
  26909. // used to include empty fields in Patch requests.
  26910. ForceSendFields []string `json:"-"`
  26911. // NullFields is a list of field names (e.g. "Features") to include in
  26912. // API requests with the JSON null value. By default, fields with empty
  26913. // values are omitted from API requests. However, any field with an
  26914. // empty value appearing in NullFields will be sent to the server as
  26915. // null. It is an error if a field in this list has a non-empty value.
  26916. // This may be used to include null fields in Patch requests.
  26917. NullFields []string `json:"-"`
  26918. }
  26919. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  26920. type NoMethod SslPoliciesListAvailableFeaturesResponse
  26921. raw := NoMethod(*s)
  26922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26923. }
  26924. // SslPolicy: A SSL policy specifies the server-side support for SSL
  26925. // features. This can be attached to a TargetHttpsProxy or a
  26926. // TargetSslProxy. This affects connections between clients and the
  26927. // HTTPS or SSL proxy load balancer. They do not affect the connection
  26928. // between the load balancers and the backends.
  26929. type SslPolicy struct {
  26930. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26931. // format.
  26932. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26933. // CustomFeatures: A list of features enabled when the selected profile
  26934. // is CUSTOM. The
  26935. // - method returns the set of features that can be specified in this
  26936. // list. This field must be empty if the profile is not CUSTOM.
  26937. CustomFeatures []string `json:"customFeatures,omitempty"`
  26938. // Description: An optional description of this resource. Provide this
  26939. // property when you create the resource.
  26940. Description string `json:"description,omitempty"`
  26941. // EnabledFeatures: [Output Only] The list of features enabled in the
  26942. // SSL policy.
  26943. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  26944. // Fingerprint: Fingerprint of this resource. A hash of the contents
  26945. // stored in this object. This field is used in optimistic locking. This
  26946. // field will be ignored when inserting a SslPolicy. An up-to-date
  26947. // fingerprint must be provided in order to update the SslPolicy,
  26948. // otherwise the request will fail with error 412 conditionNotMet.
  26949. //
  26950. // To see the latest fingerprint, make a get() request to retrieve an
  26951. // SslPolicy.
  26952. Fingerprint string `json:"fingerprint,omitempty"`
  26953. // Id: [Output Only] The unique identifier for the resource. This
  26954. // identifier is defined by the server.
  26955. Id uint64 `json:"id,omitempty,string"`
  26956. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  26957. // SSL policies.
  26958. Kind string `json:"kind,omitempty"`
  26959. // MinTlsVersion: The minimum version of SSL protocol that can be used
  26960. // by the clients to establish a connection with the load balancer. This
  26961. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  26962. //
  26963. // Possible values:
  26964. // "TLS_1_0"
  26965. // "TLS_1_1"
  26966. // "TLS_1_2"
  26967. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  26968. // Name: Name of the resource. The name must be 1-63 characters long,
  26969. // and comply with RFC1035. Specifically, the name must be 1-63
  26970. // characters long and match the regular expression
  26971. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  26972. // a lowercase letter, and all following characters must be a dash,
  26973. // lowercase letter, or digit, except the last character, which cannot
  26974. // be a dash.
  26975. Name string `json:"name,omitempty"`
  26976. // Profile: Profile specifies the set of SSL features that can be used
  26977. // by the load balancer when negotiating SSL with clients. This can be
  26978. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  26979. // the set of SSL features to enable must be specified in the
  26980. // customFeatures field.
  26981. //
  26982. // Possible values:
  26983. // "COMPATIBLE"
  26984. // "CUSTOM"
  26985. // "MODERN"
  26986. // "RESTRICTED"
  26987. Profile string `json:"profile,omitempty"`
  26988. // SelfLink: [Output Only] Server-defined URL for the resource.
  26989. SelfLink string `json:"selfLink,omitempty"`
  26990. // Warnings: [Output Only] If potential misconfigurations are detected
  26991. // for this SSL policy, this field will be populated with warning
  26992. // messages.
  26993. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  26994. // ServerResponse contains the HTTP response code and headers from the
  26995. // server.
  26996. googleapi.ServerResponse `json:"-"`
  26997. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26998. // to unconditionally include in API requests. By default, fields with
  26999. // empty values are omitted from API requests. However, any non-pointer,
  27000. // non-interface field appearing in ForceSendFields will be sent to the
  27001. // server regardless of whether the field is empty or not. This may be
  27002. // used to include empty fields in Patch requests.
  27003. ForceSendFields []string `json:"-"`
  27004. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27005. // include in API requests with the JSON null value. By default, fields
  27006. // with empty values are omitted from API requests. However, any field
  27007. // with an empty value appearing in NullFields will be sent to the
  27008. // server as null. It is an error if a field in this list has a
  27009. // non-empty value. This may be used to include null fields in Patch
  27010. // requests.
  27011. NullFields []string `json:"-"`
  27012. }
  27013. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  27014. type NoMethod SslPolicy
  27015. raw := NoMethod(*s)
  27016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27017. }
  27018. type SslPolicyWarnings struct {
  27019. // Code: [Output Only] A warning code, if applicable. For example,
  27020. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27021. // the response.
  27022. //
  27023. // Possible values:
  27024. // "CLEANUP_FAILED"
  27025. // "DEPRECATED_RESOURCE_USED"
  27026. // "DEPRECATED_TYPE_USED"
  27027. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27028. // "EXPERIMENTAL_TYPE_USED"
  27029. // "EXTERNAL_API_WARNING"
  27030. // "FIELD_VALUE_OVERRIDEN"
  27031. // "INJECTED_KERNELS_DEPRECATED"
  27032. // "MISSING_TYPE_DEPENDENCY"
  27033. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27034. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27035. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27036. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27037. // "NEXT_HOP_NOT_RUNNING"
  27038. // "NOT_CRITICAL_ERROR"
  27039. // "NO_RESULTS_ON_PAGE"
  27040. // "REQUIRED_TOS_AGREEMENT"
  27041. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27042. // "RESOURCE_NOT_DELETED"
  27043. // "SCHEMA_VALIDATION_IGNORED"
  27044. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27045. // "UNDECLARED_PROPERTIES"
  27046. // "UNREACHABLE"
  27047. Code string `json:"code,omitempty"`
  27048. // Data: [Output Only] Metadata about this warning in key: value format.
  27049. // For example:
  27050. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27051. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  27052. // Message: [Output Only] A human-readable description of the warning
  27053. // code.
  27054. Message string `json:"message,omitempty"`
  27055. // ForceSendFields is a list of field names (e.g. "Code") to
  27056. // unconditionally include in API requests. By default, fields with
  27057. // empty values are omitted from API requests. However, any non-pointer,
  27058. // non-interface field appearing in ForceSendFields will be sent to the
  27059. // server regardless of whether the field is empty or not. This may be
  27060. // used to include empty fields in Patch requests.
  27061. ForceSendFields []string `json:"-"`
  27062. // NullFields is a list of field names (e.g. "Code") to include in API
  27063. // requests with the JSON null value. By default, fields with empty
  27064. // values are omitted from API requests. However, any field with an
  27065. // empty value appearing in NullFields will be sent to the server as
  27066. // null. It is an error if a field in this list has a non-empty value.
  27067. // This may be used to include null fields in Patch requests.
  27068. NullFields []string `json:"-"`
  27069. }
  27070. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  27071. type NoMethod SslPolicyWarnings
  27072. raw := NoMethod(*s)
  27073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27074. }
  27075. type SslPolicyWarningsData struct {
  27076. // Key: [Output Only] A key that provides more detail on the warning
  27077. // being returned. For example, for warnings where there are no results
  27078. // in a list request for a particular zone, this key might be scope and
  27079. // the key value might be the zone name. Other examples might be a key
  27080. // indicating a deprecated resource and a suggested replacement, or a
  27081. // warning about invalid network settings (for example, if an instance
  27082. // attempts to perform IP forwarding but is not enabled for IP
  27083. // forwarding).
  27084. Key string `json:"key,omitempty"`
  27085. // Value: [Output Only] A warning data value corresponding to the key.
  27086. Value string `json:"value,omitempty"`
  27087. // ForceSendFields is a list of field names (e.g. "Key") to
  27088. // unconditionally include in API requests. By default, fields with
  27089. // empty values are omitted from API requests. However, any non-pointer,
  27090. // non-interface field appearing in ForceSendFields will be sent to the
  27091. // server regardless of whether the field is empty or not. This may be
  27092. // used to include empty fields in Patch requests.
  27093. ForceSendFields []string `json:"-"`
  27094. // NullFields is a list of field names (e.g. "Key") to include in API
  27095. // requests with the JSON null value. By default, fields with empty
  27096. // values are omitted from API requests. However, any field with an
  27097. // empty value appearing in NullFields will be sent to the server as
  27098. // null. It is an error if a field in this list has a non-empty value.
  27099. // This may be used to include null fields in Patch requests.
  27100. NullFields []string `json:"-"`
  27101. }
  27102. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  27103. type NoMethod SslPolicyWarningsData
  27104. raw := NoMethod(*s)
  27105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27106. }
  27107. type SslPolicyReference struct {
  27108. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  27109. // to clear any existing SSL policy associated with the target proxy
  27110. // resource.
  27111. SslPolicy string `json:"sslPolicy,omitempty"`
  27112. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  27113. // unconditionally include in API requests. By default, fields with
  27114. // empty values are omitted from API requests. However, any non-pointer,
  27115. // non-interface field appearing in ForceSendFields will be sent to the
  27116. // server regardless of whether the field is empty or not. This may be
  27117. // used to include empty fields in Patch requests.
  27118. ForceSendFields []string `json:"-"`
  27119. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  27120. // API requests with the JSON null value. By default, fields with empty
  27121. // values are omitted from API requests. However, any field with an
  27122. // empty value appearing in NullFields will be sent to the server as
  27123. // null. It is an error if a field in this list has a non-empty value.
  27124. // This may be used to include null fields in Patch requests.
  27125. NullFields []string `json:"-"`
  27126. }
  27127. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  27128. type NoMethod SslPolicyReference
  27129. raw := NoMethod(*s)
  27130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27131. }
  27132. type StatefulPolicy struct {
  27133. PreservedResources *StatefulPolicyPreservedResources `json:"preservedResources,omitempty"`
  27134. PreservedState *StatefulPolicyPreservedState `json:"preservedState,omitempty"`
  27135. // ForceSendFields is a list of field names (e.g. "PreservedResources")
  27136. // to unconditionally include in API requests. By default, fields with
  27137. // empty values are omitted from API requests. However, any non-pointer,
  27138. // non-interface field appearing in ForceSendFields will be sent to the
  27139. // server regardless of whether the field is empty or not. This may be
  27140. // used to include empty fields in Patch requests.
  27141. ForceSendFields []string `json:"-"`
  27142. // NullFields is a list of field names (e.g. "PreservedResources") to
  27143. // include in API requests with the JSON null value. By default, fields
  27144. // with empty values are omitted from API requests. However, any field
  27145. // with an empty value appearing in NullFields will be sent to the
  27146. // server as null. It is an error if a field in this list has a
  27147. // non-empty value. This may be used to include null fields in Patch
  27148. // requests.
  27149. NullFields []string `json:"-"`
  27150. }
  27151. func (s *StatefulPolicy) MarshalJSON() ([]byte, error) {
  27152. type NoMethod StatefulPolicy
  27153. raw := NoMethod(*s)
  27154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27155. }
  27156. type StatefulPolicyPreservedDisk struct {
  27157. // DeviceName: Device name of the disk to be preserved
  27158. DeviceName string `json:"deviceName,omitempty"`
  27159. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  27160. // unconditionally include in API requests. By default, fields with
  27161. // empty values are omitted from API requests. However, any non-pointer,
  27162. // non-interface field appearing in ForceSendFields will be sent to the
  27163. // server regardless of whether the field is empty or not. This may be
  27164. // used to include empty fields in Patch requests.
  27165. ForceSendFields []string `json:"-"`
  27166. // NullFields is a list of field names (e.g. "DeviceName") to include in
  27167. // API requests with the JSON null value. By default, fields with empty
  27168. // values are omitted from API requests. However, any field with an
  27169. // empty value appearing in NullFields will be sent to the server as
  27170. // null. It is an error if a field in this list has a non-empty value.
  27171. // This may be used to include null fields in Patch requests.
  27172. NullFields []string `json:"-"`
  27173. }
  27174. func (s *StatefulPolicyPreservedDisk) MarshalJSON() ([]byte, error) {
  27175. type NoMethod StatefulPolicyPreservedDisk
  27176. raw := NoMethod(*s)
  27177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27178. }
  27179. // StatefulPolicyPreservedResources: Configuration of all preserved
  27180. // resources.
  27181. type StatefulPolicyPreservedResources struct {
  27182. // Disks: Disks created on the instances that will be preserved on
  27183. // instance delete, resize down, etc.
  27184. Disks []*StatefulPolicyPreservedDisk `json:"disks,omitempty"`
  27185. // ForceSendFields is a list of field names (e.g. "Disks") to
  27186. // unconditionally include in API requests. By default, fields with
  27187. // empty values are omitted from API requests. However, any non-pointer,
  27188. // non-interface field appearing in ForceSendFields will be sent to the
  27189. // server regardless of whether the field is empty or not. This may be
  27190. // used to include empty fields in Patch requests.
  27191. ForceSendFields []string `json:"-"`
  27192. // NullFields is a list of field names (e.g. "Disks") to include in API
  27193. // requests with the JSON null value. By default, fields with empty
  27194. // values are omitted from API requests. However, any field with an
  27195. // empty value appearing in NullFields will be sent to the server as
  27196. // null. It is an error if a field in this list has a non-empty value.
  27197. // This may be used to include null fields in Patch requests.
  27198. NullFields []string `json:"-"`
  27199. }
  27200. func (s *StatefulPolicyPreservedResources) MarshalJSON() ([]byte, error) {
  27201. type NoMethod StatefulPolicyPreservedResources
  27202. raw := NoMethod(*s)
  27203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27204. }
  27205. // StatefulPolicyPreservedState: Configuration of preserved resources.
  27206. type StatefulPolicyPreservedState struct {
  27207. // Disks: Disks created on the instances that will be preserved on
  27208. // instance delete, resize down, etc. This map is keyed with the device
  27209. // names of the disks.
  27210. Disks map[string]StatefulPolicyPreservedStateDiskDevice `json:"disks,omitempty"`
  27211. // ForceSendFields is a list of field names (e.g. "Disks") to
  27212. // unconditionally include in API requests. By default, fields with
  27213. // empty values are omitted from API requests. However, any non-pointer,
  27214. // non-interface field appearing in ForceSendFields will be sent to the
  27215. // server regardless of whether the field is empty or not. This may be
  27216. // used to include empty fields in Patch requests.
  27217. ForceSendFields []string `json:"-"`
  27218. // NullFields is a list of field names (e.g. "Disks") to include in API
  27219. // requests with the JSON null value. By default, fields with empty
  27220. // values are omitted from API requests. However, any field with an
  27221. // empty value appearing in NullFields will be sent to the server as
  27222. // null. It is an error if a field in this list has a non-empty value.
  27223. // This may be used to include null fields in Patch requests.
  27224. NullFields []string `json:"-"`
  27225. }
  27226. func (s *StatefulPolicyPreservedState) MarshalJSON() ([]byte, error) {
  27227. type NoMethod StatefulPolicyPreservedState
  27228. raw := NoMethod(*s)
  27229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27230. }
  27231. type StatefulPolicyPreservedStateDiskDevice struct {
  27232. // AutoDelete: These stateful disks will never be deleted during
  27233. // autohealing, update or VM instance recreate operations. This flag is
  27234. // used to configure if the disk should be deleted after it is no longer
  27235. // used by the group, e.g. when the given instance or the whole group is
  27236. // deleted. Note: disks attached in READ_ONLY mode cannot be
  27237. // auto-deleted.
  27238. //
  27239. // Possible values:
  27240. // "NEVER"
  27241. // "WHEN_NOT_IN_USE"
  27242. AutoDelete string `json:"autoDelete,omitempty"`
  27243. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  27244. // unconditionally include in API requests. By default, fields with
  27245. // empty values are omitted from API requests. However, any non-pointer,
  27246. // non-interface field appearing in ForceSendFields will be sent to the
  27247. // server regardless of whether the field is empty or not. This may be
  27248. // used to include empty fields in Patch requests.
  27249. ForceSendFields []string `json:"-"`
  27250. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  27251. // API requests with the JSON null value. By default, fields with empty
  27252. // values are omitted from API requests. However, any field with an
  27253. // empty value appearing in NullFields will be sent to the server as
  27254. // null. It is an error if a field in this list has a non-empty value.
  27255. // This may be used to include null fields in Patch requests.
  27256. NullFields []string `json:"-"`
  27257. }
  27258. func (s *StatefulPolicyPreservedStateDiskDevice) MarshalJSON() ([]byte, error) {
  27259. type NoMethod StatefulPolicyPreservedStateDiskDevice
  27260. raw := NoMethod(*s)
  27261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27262. }
  27263. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  27264. // ==) (== resource_for v1.subnetworks ==)
  27265. type Subnetwork struct {
  27266. // AggregationInterval: Can only be specified if VPC flow logging for
  27267. // this subnetwork is enabled. Toggles the aggregation interval for
  27268. // collecting flow logs. Increasing the interval time will reduce the
  27269. // amount of generated flow logs for long lasting connections. Default
  27270. // is an interval of 5 seconds per connection.
  27271. //
  27272. // Possible values:
  27273. // "INTERVAL_10_MIN"
  27274. // "INTERVAL_15_MIN"
  27275. // "INTERVAL_1_MIN"
  27276. // "INTERVAL_30_SEC"
  27277. // "INTERVAL_5_MIN"
  27278. // "INTERVAL_5_SEC"
  27279. AggregationInterval string `json:"aggregationInterval,omitempty"`
  27280. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  27281. // with static routes. Setting this to true allows this subnetwork's
  27282. // primary and secondary ranges to conflict with routes that have
  27283. // already been configured on the corresponding network. Static routes
  27284. // will take precedence over the subnetwork route if the route prefix
  27285. // length is at least as large as the subnetwork prefix length.
  27286. //
  27287. // Also, packets destined to IPs within subnetwork may contain
  27288. // private/sensitive data and are prevented from leaving the virtual
  27289. // network. Setting this field to true will disable this feature.
  27290. //
  27291. // The default value is false and applies to all existing subnetworks
  27292. // and automatically created subnetworks.
  27293. //
  27294. // This field cannot be set to true at resource creation time.
  27295. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  27296. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27297. // format.
  27298. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27299. // Description: An optional description of this resource. Provide this
  27300. // property when you create the resource. This field can be set only at
  27301. // resource creation time.
  27302. Description string `json:"description,omitempty"`
  27303. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  27304. // If this field is not explicitly set, it will not appear in get
  27305. // listings. If not set the default behavior is to disable flow logging.
  27306. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  27307. // EnablePrivateV6Access: Whether the VMs in this subnet can directly
  27308. // access Google services via internal IPv6 addresses. This field can be
  27309. // both set at resource creation time and updated using patch.
  27310. EnablePrivateV6Access bool `json:"enablePrivateV6Access,omitempty"`
  27311. // Fingerprint: Fingerprint of this resource. A hash of the contents
  27312. // stored in this object. This field is used in optimistic locking. This
  27313. // field will be ignored when inserting a Subnetwork. An up-to-date
  27314. // fingerprint must be provided in order to update the Subnetwork,
  27315. // otherwise the request will fail with error 412 conditionNotMet.
  27316. //
  27317. // To see the latest fingerprint, make a get() request to retrieve a
  27318. // Subnetwork.
  27319. Fingerprint string `json:"fingerprint,omitempty"`
  27320. // FlowSampling: Can only be specified if VPC flow logging for this
  27321. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  27322. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  27323. // means all collected logs are reported and 0.0 means no logs are
  27324. // reported. Default is 0.5 which means half of all collected logs are
  27325. // reported.
  27326. FlowSampling float64 `json:"flowSampling,omitempty"`
  27327. // GatewayAddress: [Output Only] The gateway address for default routes
  27328. // to reach destination addresses outside this subnetwork.
  27329. GatewayAddress string `json:"gatewayAddress,omitempty"`
  27330. // Id: [Output Only] The unique identifier for the resource. This
  27331. // identifier is defined by the server.
  27332. Id uint64 `json:"id,omitempty,string"`
  27333. // IpCidrRange: The range of internal addresses that are owned by this
  27334. // subnetwork. Provide this property when you create the subnetwork. For
  27335. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  27336. // non-overlapping within a network. Only IPv4 is supported. This field
  27337. // can be set only at resource creation time.
  27338. IpCidrRange string `json:"ipCidrRange,omitempty"`
  27339. // Ipv6CidrRange: [Output Only] The range of internal IPv6 addresses
  27340. // that are owned by this subnetwork.
  27341. Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
  27342. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  27343. // for Subnetwork resources.
  27344. Kind string `json:"kind,omitempty"`
  27345. // LogConfig: This field denotes the logging options for the load
  27346. // balancer traffic served by this backend service. If logging is
  27347. // enabled, logs will be exported to Stackdriver.
  27348. LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
  27349. // Metadata: Can only be specified if VPC flow logging for this
  27350. // subnetwork is enabled. Configures whether metadata fields should be
  27351. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  27352. //
  27353. // Possible values:
  27354. // "EXCLUDE_ALL_METADATA"
  27355. // "INCLUDE_ALL_METADATA"
  27356. Metadata string `json:"metadata,omitempty"`
  27357. // Name: The name of the resource, provided by the client when initially
  27358. // creating the resource. The name must be 1-63 characters long, and
  27359. // comply with RFC1035. Specifically, the name must be 1-63 characters
  27360. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  27361. // which means the first character must be a lowercase letter, and all
  27362. // following characters must be a dash, lowercase letter, or digit,
  27363. // except the last character, which cannot be a dash.
  27364. Name string `json:"name,omitempty"`
  27365. // Network: The URL of the network to which this subnetwork belongs,
  27366. // provided by the client when initially creating the subnetwork. Only
  27367. // networks that are in the distributed mode can have subnetworks. This
  27368. // field can be set only at resource creation time.
  27369. Network string `json:"network,omitempty"`
  27370. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  27371. // Google services without assigned external IP addresses. This field
  27372. // can be both set at resource creation time and updated using
  27373. // setPrivateIpGoogleAccess.
  27374. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  27375. // Purpose: The purpose of the resource. This field can be either
  27376. // PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with
  27377. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created
  27378. // subnetwork that is reserved for Internal HTTP(S) Load Balancing. If
  27379. // unspecified, the purpose defaults to PRIVATE_RFC_1918.
  27380. //
  27381. // Possible values:
  27382. // "INTERNAL_HTTPS_LOAD_BALANCER"
  27383. // "PRIVATE"
  27384. // "PRIVATE_RFC_1918"
  27385. Purpose string `json:"purpose,omitempty"`
  27386. // Region: URL of the region where the Subnetwork resides. This field
  27387. // can be set only at resource creation time.
  27388. Region string `json:"region,omitempty"`
  27389. // Role: The role of subnetwork. Currenly, this field is only used when
  27390. // purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to
  27391. // ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being
  27392. // used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one
  27393. // that is ready to be promoted to ACTIVE or is currently draining. This
  27394. // field can be updated with a patch request.
  27395. //
  27396. // Possible values:
  27397. // "ACTIVE"
  27398. // "BACKUP"
  27399. Role string `json:"role,omitempty"`
  27400. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  27401. // for VM instances contained in this subnetwork. The primary IP of such
  27402. // VM must belong to the primary ipCidrRange of the subnetwork. The
  27403. // alias IPs may belong to either primary or secondary ranges. This
  27404. // field can be updated with a patch request.
  27405. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  27406. // SelfLink: [Output Only] Server-defined URL for the resource.
  27407. SelfLink string `json:"selfLink,omitempty"`
  27408. // State: [Output Only] The state of the subnetwork, which can be one of
  27409. // READY or DRAINING. A subnetwork that is READY is ready to be used.
  27410. // The state of DRAINING is only applicable to subnetworks that have the
  27411. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that
  27412. // connections to the load balancer are being drained. A subnetwork that
  27413. // is draining cannot be used or modified until it reaches a status of
  27414. // READY.
  27415. //
  27416. // Possible values:
  27417. // "DRAINING"
  27418. // "READY"
  27419. State string `json:"state,omitempty"`
  27420. // ServerResponse contains the HTTP response code and headers from the
  27421. // server.
  27422. googleapi.ServerResponse `json:"-"`
  27423. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  27424. // to unconditionally include in API requests. By default, fields with
  27425. // empty values are omitted from API requests. However, any non-pointer,
  27426. // non-interface field appearing in ForceSendFields will be sent to the
  27427. // server regardless of whether the field is empty or not. This may be
  27428. // used to include empty fields in Patch requests.
  27429. ForceSendFields []string `json:"-"`
  27430. // NullFields is a list of field names (e.g. "AggregationInterval") to
  27431. // include in API requests with the JSON null value. By default, fields
  27432. // with empty values are omitted from API requests. However, any field
  27433. // with an empty value appearing in NullFields will be sent to the
  27434. // server as null. It is an error if a field in this list has a
  27435. // non-empty value. This may be used to include null fields in Patch
  27436. // requests.
  27437. NullFields []string `json:"-"`
  27438. }
  27439. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  27440. type NoMethod Subnetwork
  27441. raw := NoMethod(*s)
  27442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27443. }
  27444. func (s *Subnetwork) UnmarshalJSON(data []byte) error {
  27445. type NoMethod Subnetwork
  27446. var s1 struct {
  27447. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  27448. *NoMethod
  27449. }
  27450. s1.NoMethod = (*NoMethod)(s)
  27451. if err := json.Unmarshal(data, &s1); err != nil {
  27452. return err
  27453. }
  27454. s.FlowSampling = float64(s1.FlowSampling)
  27455. return nil
  27456. }
  27457. type SubnetworkAggregatedList struct {
  27458. // Id: [Output Only] Unique identifier for the resource; defined by the
  27459. // server.
  27460. Id string `json:"id,omitempty"`
  27461. // Items: A list of SubnetworksScopedList resources.
  27462. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  27463. // Kind: [Output Only] Type of resource. Always
  27464. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  27465. Kind string `json:"kind,omitempty"`
  27466. // NextPageToken: [Output Only] This token allows you to get the next
  27467. // page of results for list requests. If the number of results is larger
  27468. // than maxResults, use the nextPageToken as a value for the query
  27469. // parameter pageToken in the next list request. Subsequent list
  27470. // requests will have their own nextPageToken to continue paging through
  27471. // the results.
  27472. NextPageToken string `json:"nextPageToken,omitempty"`
  27473. // SelfLink: [Output Only] Server-defined URL for this resource.
  27474. SelfLink string `json:"selfLink,omitempty"`
  27475. // Warning: [Output Only] Informational warning message.
  27476. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  27477. // ServerResponse contains the HTTP response code and headers from the
  27478. // server.
  27479. googleapi.ServerResponse `json:"-"`
  27480. // ForceSendFields is a list of field names (e.g. "Id") to
  27481. // unconditionally include in API requests. By default, fields with
  27482. // empty values are omitted from API requests. However, any non-pointer,
  27483. // non-interface field appearing in ForceSendFields will be sent to the
  27484. // server regardless of whether the field is empty or not. This may be
  27485. // used to include empty fields in Patch requests.
  27486. ForceSendFields []string `json:"-"`
  27487. // NullFields is a list of field names (e.g. "Id") to include in API
  27488. // requests with the JSON null value. By default, fields with empty
  27489. // values are omitted from API requests. However, any field with an
  27490. // empty value appearing in NullFields will be sent to the server as
  27491. // null. It is an error if a field in this list has a non-empty value.
  27492. // This may be used to include null fields in Patch requests.
  27493. NullFields []string `json:"-"`
  27494. }
  27495. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  27496. type NoMethod SubnetworkAggregatedList
  27497. raw := NoMethod(*s)
  27498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27499. }
  27500. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  27501. // message.
  27502. type SubnetworkAggregatedListWarning struct {
  27503. // Code: [Output Only] A warning code, if applicable. For example,
  27504. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27505. // the response.
  27506. //
  27507. // Possible values:
  27508. // "CLEANUP_FAILED"
  27509. // "DEPRECATED_RESOURCE_USED"
  27510. // "DEPRECATED_TYPE_USED"
  27511. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27512. // "EXPERIMENTAL_TYPE_USED"
  27513. // "EXTERNAL_API_WARNING"
  27514. // "FIELD_VALUE_OVERRIDEN"
  27515. // "INJECTED_KERNELS_DEPRECATED"
  27516. // "MISSING_TYPE_DEPENDENCY"
  27517. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27518. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27519. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27520. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27521. // "NEXT_HOP_NOT_RUNNING"
  27522. // "NOT_CRITICAL_ERROR"
  27523. // "NO_RESULTS_ON_PAGE"
  27524. // "REQUIRED_TOS_AGREEMENT"
  27525. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27526. // "RESOURCE_NOT_DELETED"
  27527. // "SCHEMA_VALIDATION_IGNORED"
  27528. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27529. // "UNDECLARED_PROPERTIES"
  27530. // "UNREACHABLE"
  27531. Code string `json:"code,omitempty"`
  27532. // Data: [Output Only] Metadata about this warning in key: value format.
  27533. // For example:
  27534. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27535. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  27536. // Message: [Output Only] A human-readable description of the warning
  27537. // code.
  27538. Message string `json:"message,omitempty"`
  27539. // ForceSendFields is a list of field names (e.g. "Code") to
  27540. // unconditionally include in API requests. By default, fields with
  27541. // empty values are omitted from API requests. However, any non-pointer,
  27542. // non-interface field appearing in ForceSendFields will be sent to the
  27543. // server regardless of whether the field is empty or not. This may be
  27544. // used to include empty fields in Patch requests.
  27545. ForceSendFields []string `json:"-"`
  27546. // NullFields is a list of field names (e.g. "Code") to include in API
  27547. // requests with the JSON null value. By default, fields with empty
  27548. // values are omitted from API requests. However, any field with an
  27549. // empty value appearing in NullFields will be sent to the server as
  27550. // null. It is an error if a field in this list has a non-empty value.
  27551. // This may be used to include null fields in Patch requests.
  27552. NullFields []string `json:"-"`
  27553. }
  27554. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27555. type NoMethod SubnetworkAggregatedListWarning
  27556. raw := NoMethod(*s)
  27557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27558. }
  27559. type SubnetworkAggregatedListWarningData struct {
  27560. // Key: [Output Only] A key that provides more detail on the warning
  27561. // being returned. For example, for warnings where there are no results
  27562. // in a list request for a particular zone, this key might be scope and
  27563. // the key value might be the zone name. Other examples might be a key
  27564. // indicating a deprecated resource and a suggested replacement, or a
  27565. // warning about invalid network settings (for example, if an instance
  27566. // attempts to perform IP forwarding but is not enabled for IP
  27567. // forwarding).
  27568. Key string `json:"key,omitempty"`
  27569. // Value: [Output Only] A warning data value corresponding to the key.
  27570. Value string `json:"value,omitempty"`
  27571. // ForceSendFields is a list of field names (e.g. "Key") to
  27572. // unconditionally include in API requests. By default, fields with
  27573. // empty values are omitted from API requests. However, any non-pointer,
  27574. // non-interface field appearing in ForceSendFields will be sent to the
  27575. // server regardless of whether the field is empty or not. This may be
  27576. // used to include empty fields in Patch requests.
  27577. ForceSendFields []string `json:"-"`
  27578. // NullFields is a list of field names (e.g. "Key") to include in API
  27579. // requests with the JSON null value. By default, fields with empty
  27580. // values are omitted from API requests. However, any field with an
  27581. // empty value appearing in NullFields will be sent to the server as
  27582. // null. It is an error if a field in this list has a non-empty value.
  27583. // This may be used to include null fields in Patch requests.
  27584. NullFields []string `json:"-"`
  27585. }
  27586. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27587. type NoMethod SubnetworkAggregatedListWarningData
  27588. raw := NoMethod(*s)
  27589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27590. }
  27591. // SubnetworkList: Contains a list of Subnetwork resources.
  27592. type SubnetworkList struct {
  27593. // Id: [Output Only] Unique identifier for the resource; defined by the
  27594. // server.
  27595. Id string `json:"id,omitempty"`
  27596. // Items: A list of Subnetwork resources.
  27597. Items []*Subnetwork `json:"items,omitempty"`
  27598. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  27599. // for lists of subnetworks.
  27600. Kind string `json:"kind,omitempty"`
  27601. // NextPageToken: [Output Only] This token allows you to get the next
  27602. // page of results for list requests. If the number of results is larger
  27603. // than maxResults, use the nextPageToken as a value for the query
  27604. // parameter pageToken in the next list request. Subsequent list
  27605. // requests will have their own nextPageToken to continue paging through
  27606. // the results.
  27607. NextPageToken string `json:"nextPageToken,omitempty"`
  27608. // SelfLink: [Output Only] Server-defined URL for this resource.
  27609. SelfLink string `json:"selfLink,omitempty"`
  27610. // Warning: [Output Only] Informational warning message.
  27611. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  27612. // ServerResponse contains the HTTP response code and headers from the
  27613. // server.
  27614. googleapi.ServerResponse `json:"-"`
  27615. // ForceSendFields is a list of field names (e.g. "Id") to
  27616. // unconditionally include in API requests. By default, fields with
  27617. // empty values are omitted from API requests. However, any non-pointer,
  27618. // non-interface field appearing in ForceSendFields will be sent to the
  27619. // server regardless of whether the field is empty or not. This may be
  27620. // used to include empty fields in Patch requests.
  27621. ForceSendFields []string `json:"-"`
  27622. // NullFields is a list of field names (e.g. "Id") to include in API
  27623. // requests with the JSON null value. By default, fields with empty
  27624. // values are omitted from API requests. However, any field with an
  27625. // empty value appearing in NullFields will be sent to the server as
  27626. // null. It is an error if a field in this list has a non-empty value.
  27627. // This may be used to include null fields in Patch requests.
  27628. NullFields []string `json:"-"`
  27629. }
  27630. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  27631. type NoMethod SubnetworkList
  27632. raw := NoMethod(*s)
  27633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27634. }
  27635. // SubnetworkListWarning: [Output Only] Informational warning message.
  27636. type SubnetworkListWarning struct {
  27637. // Code: [Output Only] A warning code, if applicable. For example,
  27638. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27639. // the response.
  27640. //
  27641. // Possible values:
  27642. // "CLEANUP_FAILED"
  27643. // "DEPRECATED_RESOURCE_USED"
  27644. // "DEPRECATED_TYPE_USED"
  27645. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27646. // "EXPERIMENTAL_TYPE_USED"
  27647. // "EXTERNAL_API_WARNING"
  27648. // "FIELD_VALUE_OVERRIDEN"
  27649. // "INJECTED_KERNELS_DEPRECATED"
  27650. // "MISSING_TYPE_DEPENDENCY"
  27651. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27652. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27653. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27654. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27655. // "NEXT_HOP_NOT_RUNNING"
  27656. // "NOT_CRITICAL_ERROR"
  27657. // "NO_RESULTS_ON_PAGE"
  27658. // "REQUIRED_TOS_AGREEMENT"
  27659. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27660. // "RESOURCE_NOT_DELETED"
  27661. // "SCHEMA_VALIDATION_IGNORED"
  27662. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27663. // "UNDECLARED_PROPERTIES"
  27664. // "UNREACHABLE"
  27665. Code string `json:"code,omitempty"`
  27666. // Data: [Output Only] Metadata about this warning in key: value format.
  27667. // For example:
  27668. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27669. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  27670. // Message: [Output Only] A human-readable description of the warning
  27671. // code.
  27672. Message string `json:"message,omitempty"`
  27673. // ForceSendFields is a list of field names (e.g. "Code") to
  27674. // unconditionally include in API requests. By default, fields with
  27675. // empty values are omitted from API requests. However, any non-pointer,
  27676. // non-interface field appearing in ForceSendFields will be sent to the
  27677. // server regardless of whether the field is empty or not. This may be
  27678. // used to include empty fields in Patch requests.
  27679. ForceSendFields []string `json:"-"`
  27680. // NullFields is a list of field names (e.g. "Code") to include in API
  27681. // requests with the JSON null value. By default, fields with empty
  27682. // values are omitted from API requests. However, any field with an
  27683. // empty value appearing in NullFields will be sent to the server as
  27684. // null. It is an error if a field in this list has a non-empty value.
  27685. // This may be used to include null fields in Patch requests.
  27686. NullFields []string `json:"-"`
  27687. }
  27688. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  27689. type NoMethod SubnetworkListWarning
  27690. raw := NoMethod(*s)
  27691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27692. }
  27693. type SubnetworkListWarningData struct {
  27694. // Key: [Output Only] A key that provides more detail on the warning
  27695. // being returned. For example, for warnings where there are no results
  27696. // in a list request for a particular zone, this key might be scope and
  27697. // the key value might be the zone name. Other examples might be a key
  27698. // indicating a deprecated resource and a suggested replacement, or a
  27699. // warning about invalid network settings (for example, if an instance
  27700. // attempts to perform IP forwarding but is not enabled for IP
  27701. // forwarding).
  27702. Key string `json:"key,omitempty"`
  27703. // Value: [Output Only] A warning data value corresponding to the key.
  27704. Value string `json:"value,omitempty"`
  27705. // ForceSendFields is a list of field names (e.g. "Key") to
  27706. // unconditionally include in API requests. By default, fields with
  27707. // empty values are omitted from API requests. However, any non-pointer,
  27708. // non-interface field appearing in ForceSendFields will be sent to the
  27709. // server regardless of whether the field is empty or not. This may be
  27710. // used to include empty fields in Patch requests.
  27711. ForceSendFields []string `json:"-"`
  27712. // NullFields is a list of field names (e.g. "Key") to include in API
  27713. // requests with the JSON null value. By default, fields with empty
  27714. // values are omitted from API requests. However, any field with an
  27715. // empty value appearing in NullFields will be sent to the server as
  27716. // null. It is an error if a field in this list has a non-empty value.
  27717. // This may be used to include null fields in Patch requests.
  27718. NullFields []string `json:"-"`
  27719. }
  27720. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  27721. type NoMethod SubnetworkListWarningData
  27722. raw := NoMethod(*s)
  27723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27724. }
  27725. // SubnetworkLogConfig: The available logging options for this
  27726. // subnetwork.
  27727. type SubnetworkLogConfig struct {
  27728. // AggregationInterval: Can only be specified if VPC flow logging for
  27729. // this subnetwork is enabled. Toggles the aggregation interval for
  27730. // collecting flow logs. Increasing the interval time will reduce the
  27731. // amount of generated flow logs for long lasting connections. Default
  27732. // is an interval of 5 seconds per connection.
  27733. //
  27734. // Possible values:
  27735. // "INTERVAL_10_MIN"
  27736. // "INTERVAL_15_MIN"
  27737. // "INTERVAL_1_MIN"
  27738. // "INTERVAL_30_SEC"
  27739. // "INTERVAL_5_MIN"
  27740. // "INTERVAL_5_SEC"
  27741. AggregationInterval string `json:"aggregationInterval,omitempty"`
  27742. // Enable: Whether to enable flow logging for this subnetwork. If this
  27743. // field is not explicitly set, it will not appear in get listings. If
  27744. // not set the default behavior is to disable flow logging.
  27745. Enable bool `json:"enable,omitempty"`
  27746. // FlowSampling: Can only be specified if VPC flow logging for this
  27747. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  27748. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  27749. // means all collected logs are reported and 0.0 means no logs are
  27750. // reported. Default is 0.5 which means half of all collected logs are
  27751. // reported.
  27752. FlowSampling float64 `json:"flowSampling,omitempty"`
  27753. // Metadata: Can only be specified if VPC flow logging for this
  27754. // subnetwork is enabled. Configures whether metadata fields should be
  27755. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  27756. //
  27757. // Possible values:
  27758. // "EXCLUDE_ALL_METADATA"
  27759. // "INCLUDE_ALL_METADATA"
  27760. Metadata string `json:"metadata,omitempty"`
  27761. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  27762. // to unconditionally include in API requests. By default, fields with
  27763. // empty values are omitted from API requests. However, any non-pointer,
  27764. // non-interface field appearing in ForceSendFields will be sent to the
  27765. // server regardless of whether the field is empty or not. This may be
  27766. // used to include empty fields in Patch requests.
  27767. ForceSendFields []string `json:"-"`
  27768. // NullFields is a list of field names (e.g. "AggregationInterval") to
  27769. // include in API requests with the JSON null value. By default, fields
  27770. // with empty values are omitted from API requests. However, any field
  27771. // with an empty value appearing in NullFields will be sent to the
  27772. // server as null. It is an error if a field in this list has a
  27773. // non-empty value. This may be used to include null fields in Patch
  27774. // requests.
  27775. NullFields []string `json:"-"`
  27776. }
  27777. func (s *SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
  27778. type NoMethod SubnetworkLogConfig
  27779. raw := NoMethod(*s)
  27780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27781. }
  27782. func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
  27783. type NoMethod SubnetworkLogConfig
  27784. var s1 struct {
  27785. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  27786. *NoMethod
  27787. }
  27788. s1.NoMethod = (*NoMethod)(s)
  27789. if err := json.Unmarshal(data, &s1); err != nil {
  27790. return err
  27791. }
  27792. s.FlowSampling = float64(s1.FlowSampling)
  27793. return nil
  27794. }
  27795. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  27796. // subnetwork.
  27797. type SubnetworkSecondaryRange struct {
  27798. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  27799. // secondary range. Provide this property when you create the
  27800. // subnetwork. Ranges must be unique and non-overlapping with all
  27801. // primary and secondary IP ranges within a network. Only IPv4 is
  27802. // supported.
  27803. IpCidrRange string `json:"ipCidrRange,omitempty"`
  27804. // RangeName: The name associated with this subnetwork secondary range,
  27805. // used when adding an alias IP range to a VM instance. The name must be
  27806. // 1-63 characters long, and comply with RFC1035. The name must be
  27807. // unique within the subnetwork.
  27808. RangeName string `json:"rangeName,omitempty"`
  27809. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  27810. // unconditionally include in API requests. By default, fields with
  27811. // empty values are omitted from API requests. However, any non-pointer,
  27812. // non-interface field appearing in ForceSendFields will be sent to the
  27813. // server regardless of whether the field is empty or not. This may be
  27814. // used to include empty fields in Patch requests.
  27815. ForceSendFields []string `json:"-"`
  27816. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  27817. // in API requests with the JSON null value. By default, fields with
  27818. // empty values are omitted from API requests. However, any field with
  27819. // an empty value appearing in NullFields will be sent to the server as
  27820. // null. It is an error if a field in this list has a non-empty value.
  27821. // This may be used to include null fields in Patch requests.
  27822. NullFields []string `json:"-"`
  27823. }
  27824. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  27825. type NoMethod SubnetworkSecondaryRange
  27826. raw := NoMethod(*s)
  27827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27828. }
  27829. type SubnetworksExpandIpCidrRangeRequest struct {
  27830. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  27831. // that are legal on this Subnetwork. This range should be disjoint from
  27832. // other subnetworks within this network. This range can only be larger
  27833. // than (i.e. a superset of) the range previously defined before the
  27834. // update.
  27835. IpCidrRange string `json:"ipCidrRange,omitempty"`
  27836. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  27837. // unconditionally include in API requests. By default, fields with
  27838. // empty values are omitted from API requests. However, any non-pointer,
  27839. // non-interface field appearing in ForceSendFields will be sent to the
  27840. // server regardless of whether the field is empty or not. This may be
  27841. // used to include empty fields in Patch requests.
  27842. ForceSendFields []string `json:"-"`
  27843. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  27844. // in API requests with the JSON null value. By default, fields with
  27845. // empty values are omitted from API requests. However, any field with
  27846. // an empty value appearing in NullFields will be sent to the server as
  27847. // null. It is an error if a field in this list has a non-empty value.
  27848. // This may be used to include null fields in Patch requests.
  27849. NullFields []string `json:"-"`
  27850. }
  27851. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  27852. type NoMethod SubnetworksExpandIpCidrRangeRequest
  27853. raw := NoMethod(*s)
  27854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27855. }
  27856. type SubnetworksScopedList struct {
  27857. // Subnetworks: A list of subnetworks contained in this scope.
  27858. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  27859. // Warning: An informational warning that appears when the list of
  27860. // addresses is empty.
  27861. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  27862. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  27863. // unconditionally include in API requests. By default, fields with
  27864. // empty values are omitted from API requests. However, any non-pointer,
  27865. // non-interface field appearing in ForceSendFields will be sent to the
  27866. // server regardless of whether the field is empty or not. This may be
  27867. // used to include empty fields in Patch requests.
  27868. ForceSendFields []string `json:"-"`
  27869. // NullFields is a list of field names (e.g. "Subnetworks") to include
  27870. // in API requests with the JSON null value. By default, fields with
  27871. // empty values are omitted from API requests. However, any field with
  27872. // an empty value appearing in NullFields will be sent to the server as
  27873. // null. It is an error if a field in this list has a non-empty value.
  27874. // This may be used to include null fields in Patch requests.
  27875. NullFields []string `json:"-"`
  27876. }
  27877. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  27878. type NoMethod SubnetworksScopedList
  27879. raw := NoMethod(*s)
  27880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27881. }
  27882. // SubnetworksScopedListWarning: An informational warning that appears
  27883. // when the list of addresses is empty.
  27884. type SubnetworksScopedListWarning struct {
  27885. // Code: [Output Only] A warning code, if applicable. For example,
  27886. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27887. // the response.
  27888. //
  27889. // Possible values:
  27890. // "CLEANUP_FAILED"
  27891. // "DEPRECATED_RESOURCE_USED"
  27892. // "DEPRECATED_TYPE_USED"
  27893. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27894. // "EXPERIMENTAL_TYPE_USED"
  27895. // "EXTERNAL_API_WARNING"
  27896. // "FIELD_VALUE_OVERRIDEN"
  27897. // "INJECTED_KERNELS_DEPRECATED"
  27898. // "MISSING_TYPE_DEPENDENCY"
  27899. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27900. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27901. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27902. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27903. // "NEXT_HOP_NOT_RUNNING"
  27904. // "NOT_CRITICAL_ERROR"
  27905. // "NO_RESULTS_ON_PAGE"
  27906. // "REQUIRED_TOS_AGREEMENT"
  27907. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27908. // "RESOURCE_NOT_DELETED"
  27909. // "SCHEMA_VALIDATION_IGNORED"
  27910. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27911. // "UNDECLARED_PROPERTIES"
  27912. // "UNREACHABLE"
  27913. Code string `json:"code,omitempty"`
  27914. // Data: [Output Only] Metadata about this warning in key: value format.
  27915. // For example:
  27916. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27917. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  27918. // Message: [Output Only] A human-readable description of the warning
  27919. // code.
  27920. Message string `json:"message,omitempty"`
  27921. // ForceSendFields is a list of field names (e.g. "Code") to
  27922. // unconditionally include in API requests. By default, fields with
  27923. // empty values are omitted from API requests. However, any non-pointer,
  27924. // non-interface field appearing in ForceSendFields will be sent to the
  27925. // server regardless of whether the field is empty or not. This may be
  27926. // used to include empty fields in Patch requests.
  27927. ForceSendFields []string `json:"-"`
  27928. // NullFields is a list of field names (e.g. "Code") to include in API
  27929. // requests with the JSON null value. By default, fields with empty
  27930. // values are omitted from API requests. However, any field with an
  27931. // empty value appearing in NullFields will be sent to the server as
  27932. // null. It is an error if a field in this list has a non-empty value.
  27933. // This may be used to include null fields in Patch requests.
  27934. NullFields []string `json:"-"`
  27935. }
  27936. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  27937. type NoMethod SubnetworksScopedListWarning
  27938. raw := NoMethod(*s)
  27939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27940. }
  27941. type SubnetworksScopedListWarningData struct {
  27942. // Key: [Output Only] A key that provides more detail on the warning
  27943. // being returned. For example, for warnings where there are no results
  27944. // in a list request for a particular zone, this key might be scope and
  27945. // the key value might be the zone name. Other examples might be a key
  27946. // indicating a deprecated resource and a suggested replacement, or a
  27947. // warning about invalid network settings (for example, if an instance
  27948. // attempts to perform IP forwarding but is not enabled for IP
  27949. // forwarding).
  27950. Key string `json:"key,omitempty"`
  27951. // Value: [Output Only] A warning data value corresponding to the key.
  27952. Value string `json:"value,omitempty"`
  27953. // ForceSendFields is a list of field names (e.g. "Key") to
  27954. // unconditionally include in API requests. By default, fields with
  27955. // empty values are omitted from API requests. However, any non-pointer,
  27956. // non-interface field appearing in ForceSendFields will be sent to the
  27957. // server regardless of whether the field is empty or not. This may be
  27958. // used to include empty fields in Patch requests.
  27959. ForceSendFields []string `json:"-"`
  27960. // NullFields is a list of field names (e.g. "Key") to include in API
  27961. // requests with the JSON null value. By default, fields with empty
  27962. // values are omitted from API requests. However, any field with an
  27963. // empty value appearing in NullFields will be sent to the server as
  27964. // null. It is an error if a field in this list has a non-empty value.
  27965. // This may be used to include null fields in Patch requests.
  27966. NullFields []string `json:"-"`
  27967. }
  27968. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  27969. type NoMethod SubnetworksScopedListWarningData
  27970. raw := NoMethod(*s)
  27971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27972. }
  27973. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  27974. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  27975. // ForceSendFields is a list of field names (e.g.
  27976. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  27977. // By default, fields with empty values are omitted from API requests.
  27978. // However, any non-pointer, non-interface field appearing in
  27979. // ForceSendFields will be sent to the server regardless of whether the
  27980. // field is empty or not. This may be used to include empty fields in
  27981. // Patch requests.
  27982. ForceSendFields []string `json:"-"`
  27983. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  27984. // include in API requests with the JSON null value. By default, fields
  27985. // with empty values are omitted from API requests. However, any field
  27986. // with an empty value appearing in NullFields will be sent to the
  27987. // server as null. It is an error if a field in this list has a
  27988. // non-empty value. This may be used to include null fields in Patch
  27989. // requests.
  27990. NullFields []string `json:"-"`
  27991. }
  27992. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  27993. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  27994. raw := NoMethod(*s)
  27995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27996. }
  27997. type TCPHealthCheck struct {
  27998. // Port: The TCP port number for the health check request. The default
  27999. // value is 80. Valid values are 1 through 65535.
  28000. Port int64 `json:"port,omitempty"`
  28001. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  28002. // both port and port_name are defined, port takes precedence.
  28003. PortName string `json:"portName,omitempty"`
  28004. // PortSpecification: Specifies how port is selected for health
  28005. // checking, can be one of following values:
  28006. // USE_FIXED_PORT: The port number in
  28007. // port
  28008. // is used for health checking.
  28009. // USE_NAMED_PORT: The
  28010. // portName
  28011. // is used for health checking.
  28012. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  28013. // each network endpoint is used for health checking. For other
  28014. // backends, the port or named port specified in the Backend Service is
  28015. // used for health checking.
  28016. //
  28017. //
  28018. // If not specified, TCP health check follows behavior specified
  28019. // in
  28020. // port
  28021. // and
  28022. // portName
  28023. // fields.
  28024. //
  28025. // Possible values:
  28026. // "USE_FIXED_PORT"
  28027. // "USE_NAMED_PORT"
  28028. // "USE_SERVING_PORT"
  28029. PortSpecification string `json:"portSpecification,omitempty"`
  28030. // ProxyHeader: Specifies the type of proxy header to append before
  28031. // sending data to the backend, either NONE or PROXY_V1. The default is
  28032. // NONE.
  28033. //
  28034. // Possible values:
  28035. // "NONE"
  28036. // "PROXY_V1"
  28037. ProxyHeader string `json:"proxyHeader,omitempty"`
  28038. // Request: The application data to send once the TCP connection has
  28039. // been established (default value is empty). If both request and
  28040. // response are empty, the connection establishment alone will indicate
  28041. // health. The request data can only be ASCII.
  28042. Request string `json:"request,omitempty"`
  28043. // Response: The bytes to match against the beginning of the response
  28044. // data. If left empty (the default value), any response will indicate
  28045. // health. The response data can only be ASCII.
  28046. Response string `json:"response,omitempty"`
  28047. // ForceSendFields is a list of field names (e.g. "Port") to
  28048. // unconditionally include in API requests. By default, fields with
  28049. // empty values are omitted from API requests. However, any non-pointer,
  28050. // non-interface field appearing in ForceSendFields will be sent to the
  28051. // server regardless of whether the field is empty or not. This may be
  28052. // used to include empty fields in Patch requests.
  28053. ForceSendFields []string `json:"-"`
  28054. // NullFields is a list of field names (e.g. "Port") to include in API
  28055. // requests with the JSON null value. By default, fields with empty
  28056. // values are omitted from API requests. However, any field with an
  28057. // empty value appearing in NullFields will be sent to the server as
  28058. // null. It is an error if a field in this list has a non-empty value.
  28059. // This may be used to include null fields in Patch requests.
  28060. NullFields []string `json:"-"`
  28061. }
  28062. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  28063. type NoMethod TCPHealthCheck
  28064. raw := NoMethod(*s)
  28065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28066. }
  28067. // Tags: A set of instance tags.
  28068. type Tags struct {
  28069. // Fingerprint: Specifies a fingerprint for this request, which is
  28070. // essentially a hash of the tags' contents and used for optimistic
  28071. // locking. The fingerprint is initially generated by Compute Engine and
  28072. // changes after every request to modify or update tags. You must always
  28073. // provide an up-to-date fingerprint hash in order to update or change
  28074. // tags.
  28075. //
  28076. // To see the latest fingerprint, make get() request to the instance.
  28077. Fingerprint string `json:"fingerprint,omitempty"`
  28078. // Items: An array of tags. Each tag must be 1-63 characters long, and
  28079. // comply with RFC1035.
  28080. Items []string `json:"items,omitempty"`
  28081. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  28082. // unconditionally include in API requests. By default, fields with
  28083. // empty values are omitted from API requests. However, any non-pointer,
  28084. // non-interface field appearing in ForceSendFields will be sent to the
  28085. // server regardless of whether the field is empty or not. This may be
  28086. // used to include empty fields in Patch requests.
  28087. ForceSendFields []string `json:"-"`
  28088. // NullFields is a list of field names (e.g. "Fingerprint") to include
  28089. // in API requests with the JSON null value. By default, fields with
  28090. // empty values are omitted from API requests. However, any field with
  28091. // an empty value appearing in NullFields will be sent to the server as
  28092. // null. It is an error if a field in this list has a non-empty value.
  28093. // This may be used to include null fields in Patch requests.
  28094. NullFields []string `json:"-"`
  28095. }
  28096. func (s *Tags) MarshalJSON() ([]byte, error) {
  28097. type NoMethod Tags
  28098. raw := NoMethod(*s)
  28099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28100. }
  28101. type TargetHttpProxiesScopedList struct {
  28102. // TargetHttpProxies: A list of TargetHttpProxies contained in this
  28103. // scope.
  28104. TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
  28105. // Warning: Informational warning which replaces the list of backend
  28106. // services when the list is empty.
  28107. Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
  28108. // ForceSendFields is a list of field names (e.g. "TargetHttpProxies")
  28109. // to unconditionally include in API requests. By default, fields with
  28110. // empty values are omitted from API requests. However, any non-pointer,
  28111. // non-interface field appearing in ForceSendFields will be sent to the
  28112. // server regardless of whether the field is empty or not. This may be
  28113. // used to include empty fields in Patch requests.
  28114. ForceSendFields []string `json:"-"`
  28115. // NullFields is a list of field names (e.g. "TargetHttpProxies") to
  28116. // include in API requests with the JSON null value. By default, fields
  28117. // with empty values are omitted from API requests. However, any field
  28118. // with an empty value appearing in NullFields will be sent to the
  28119. // server as null. It is an error if a field in this list has a
  28120. // non-empty value. This may be used to include null fields in Patch
  28121. // requests.
  28122. NullFields []string `json:"-"`
  28123. }
  28124. func (s *TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
  28125. type NoMethod TargetHttpProxiesScopedList
  28126. raw := NoMethod(*s)
  28127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28128. }
  28129. // TargetHttpProxiesScopedListWarning: Informational warning which
  28130. // replaces the list of backend services when the list is empty.
  28131. type TargetHttpProxiesScopedListWarning struct {
  28132. // Code: [Output Only] A warning code, if applicable. For example,
  28133. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28134. // the response.
  28135. //
  28136. // Possible values:
  28137. // "CLEANUP_FAILED"
  28138. // "DEPRECATED_RESOURCE_USED"
  28139. // "DEPRECATED_TYPE_USED"
  28140. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28141. // "EXPERIMENTAL_TYPE_USED"
  28142. // "EXTERNAL_API_WARNING"
  28143. // "FIELD_VALUE_OVERRIDEN"
  28144. // "INJECTED_KERNELS_DEPRECATED"
  28145. // "MISSING_TYPE_DEPENDENCY"
  28146. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28147. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28148. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28149. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28150. // "NEXT_HOP_NOT_RUNNING"
  28151. // "NOT_CRITICAL_ERROR"
  28152. // "NO_RESULTS_ON_PAGE"
  28153. // "REQUIRED_TOS_AGREEMENT"
  28154. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28155. // "RESOURCE_NOT_DELETED"
  28156. // "SCHEMA_VALIDATION_IGNORED"
  28157. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28158. // "UNDECLARED_PROPERTIES"
  28159. // "UNREACHABLE"
  28160. Code string `json:"code,omitempty"`
  28161. // Data: [Output Only] Metadata about this warning in key: value format.
  28162. // For example:
  28163. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28164. Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
  28165. // Message: [Output Only] A human-readable description of the warning
  28166. // code.
  28167. Message string `json:"message,omitempty"`
  28168. // ForceSendFields is a list of field names (e.g. "Code") to
  28169. // unconditionally include in API requests. By default, fields with
  28170. // empty values are omitted from API requests. However, any non-pointer,
  28171. // non-interface field appearing in ForceSendFields will be sent to the
  28172. // server regardless of whether the field is empty or not. This may be
  28173. // used to include empty fields in Patch requests.
  28174. ForceSendFields []string `json:"-"`
  28175. // NullFields is a list of field names (e.g. "Code") to include in API
  28176. // requests with the JSON null value. By default, fields with empty
  28177. // values are omitted from API requests. However, any field with an
  28178. // empty value appearing in NullFields will be sent to the server as
  28179. // null. It is an error if a field in this list has a non-empty value.
  28180. // This may be used to include null fields in Patch requests.
  28181. NullFields []string `json:"-"`
  28182. }
  28183. func (s *TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  28184. type NoMethod TargetHttpProxiesScopedListWarning
  28185. raw := NoMethod(*s)
  28186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28187. }
  28188. type TargetHttpProxiesScopedListWarningData struct {
  28189. // Key: [Output Only] A key that provides more detail on the warning
  28190. // being returned. For example, for warnings where there are no results
  28191. // in a list request for a particular zone, this key might be scope and
  28192. // the key value might be the zone name. Other examples might be a key
  28193. // indicating a deprecated resource and a suggested replacement, or a
  28194. // warning about invalid network settings (for example, if an instance
  28195. // attempts to perform IP forwarding but is not enabled for IP
  28196. // forwarding).
  28197. Key string `json:"key,omitempty"`
  28198. // Value: [Output Only] A warning data value corresponding to the key.
  28199. Value string `json:"value,omitempty"`
  28200. // ForceSendFields is a list of field names (e.g. "Key") to
  28201. // unconditionally include in API requests. By default, fields with
  28202. // empty values are omitted from API requests. However, any non-pointer,
  28203. // non-interface field appearing in ForceSendFields will be sent to the
  28204. // server regardless of whether the field is empty or not. This may be
  28205. // used to include empty fields in Patch requests.
  28206. ForceSendFields []string `json:"-"`
  28207. // NullFields is a list of field names (e.g. "Key") to include in API
  28208. // requests with the JSON null value. By default, fields with empty
  28209. // values are omitted from API requests. However, any field with an
  28210. // empty value appearing in NullFields will be sent to the server as
  28211. // null. It is an error if a field in this list has a non-empty value.
  28212. // This may be used to include null fields in Patch requests.
  28213. NullFields []string `json:"-"`
  28214. }
  28215. func (s *TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  28216. type NoMethod TargetHttpProxiesScopedListWarningData
  28217. raw := NoMethod(*s)
  28218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28219. }
  28220. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  28221. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  28222. // resource_for v1.targetHttpProxies ==)
  28223. type TargetHttpProxy struct {
  28224. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28225. // format.
  28226. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28227. // Description: An optional description of this resource. Provide this
  28228. // property when you create the resource.
  28229. Description string `json:"description,omitempty"`
  28230. // Id: [Output Only] The unique identifier for the resource. This
  28231. // identifier is defined by the server.
  28232. Id uint64 `json:"id,omitempty,string"`
  28233. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  28234. // for target HTTP proxies.
  28235. Kind string `json:"kind,omitempty"`
  28236. // Name: Name of the resource. Provided by the client when the resource
  28237. // is created. The name must be 1-63 characters long, and comply with
  28238. // RFC1035. Specifically, the name must be 1-63 characters long and
  28239. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28240. // the first character must be a lowercase letter, and all following
  28241. // characters must be a dash, lowercase letter, or digit, except the
  28242. // last character, which cannot be a dash.
  28243. Name string `json:"name,omitempty"`
  28244. // Region: [Output Only] URL of the region where the regional Target
  28245. // HTTP Proxy resides. This field is not applicable to global Target
  28246. // HTTP Proxies.
  28247. Region string `json:"region,omitempty"`
  28248. // SelfLink: [Output Only] Server-defined URL for the resource.
  28249. SelfLink string `json:"selfLink,omitempty"`
  28250. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  28251. // to the BackendService.
  28252. UrlMap string `json:"urlMap,omitempty"`
  28253. // ServerResponse contains the HTTP response code and headers from the
  28254. // server.
  28255. googleapi.ServerResponse `json:"-"`
  28256. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28257. // to unconditionally include in API requests. By default, fields with
  28258. // empty values are omitted from API requests. However, any non-pointer,
  28259. // non-interface field appearing in ForceSendFields will be sent to the
  28260. // server regardless of whether the field is empty or not. This may be
  28261. // used to include empty fields in Patch requests.
  28262. ForceSendFields []string `json:"-"`
  28263. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28264. // include in API requests with the JSON null value. By default, fields
  28265. // with empty values are omitted from API requests. However, any field
  28266. // with an empty value appearing in NullFields will be sent to the
  28267. // server as null. It is an error if a field in this list has a
  28268. // non-empty value. This may be used to include null fields in Patch
  28269. // requests.
  28270. NullFields []string `json:"-"`
  28271. }
  28272. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  28273. type NoMethod TargetHttpProxy
  28274. raw := NoMethod(*s)
  28275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28276. }
  28277. type TargetHttpProxyAggregatedList struct {
  28278. // Id: [Output Only] Unique identifier for the resource; defined by the
  28279. // server.
  28280. Id string `json:"id,omitempty"`
  28281. // Items: A list of TargetHttpProxiesScopedList resources.
  28282. Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
  28283. // Kind: [Output Only] Type of resource. Always
  28284. // compute#targetHttpProxyAggregatedList for lists of Target HTTP
  28285. // Proxies.
  28286. Kind string `json:"kind,omitempty"`
  28287. // NextPageToken: [Output Only] This token allows you to get the next
  28288. // page of results for list requests. If the number of results is larger
  28289. // than maxResults, use the nextPageToken as a value for the query
  28290. // parameter pageToken in the next list request. Subsequent list
  28291. // requests will have their own nextPageToken to continue paging through
  28292. // the results.
  28293. NextPageToken string `json:"nextPageToken,omitempty"`
  28294. // SelfLink: [Output Only] Server-defined URL for this resource.
  28295. SelfLink string `json:"selfLink,omitempty"`
  28296. // Warning: [Output Only] Informational warning message.
  28297. Warning *TargetHttpProxyAggregatedListWarning `json:"warning,omitempty"`
  28298. // ServerResponse contains the HTTP response code and headers from the
  28299. // server.
  28300. googleapi.ServerResponse `json:"-"`
  28301. // ForceSendFields is a list of field names (e.g. "Id") to
  28302. // unconditionally include in API requests. By default, fields with
  28303. // empty values are omitted from API requests. However, any non-pointer,
  28304. // non-interface field appearing in ForceSendFields will be sent to the
  28305. // server regardless of whether the field is empty or not. This may be
  28306. // used to include empty fields in Patch requests.
  28307. ForceSendFields []string `json:"-"`
  28308. // NullFields is a list of field names (e.g. "Id") to include in API
  28309. // requests with the JSON null value. By default, fields with empty
  28310. // values are omitted from API requests. However, any field with an
  28311. // empty value appearing in NullFields will be sent to the server as
  28312. // null. It is an error if a field in this list has a non-empty value.
  28313. // This may be used to include null fields in Patch requests.
  28314. NullFields []string `json:"-"`
  28315. }
  28316. func (s *TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
  28317. type NoMethod TargetHttpProxyAggregatedList
  28318. raw := NoMethod(*s)
  28319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28320. }
  28321. // TargetHttpProxyAggregatedListWarning: [Output Only] Informational
  28322. // warning message.
  28323. type TargetHttpProxyAggregatedListWarning struct {
  28324. // Code: [Output Only] A warning code, if applicable. For example,
  28325. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28326. // the response.
  28327. //
  28328. // Possible values:
  28329. // "CLEANUP_FAILED"
  28330. // "DEPRECATED_RESOURCE_USED"
  28331. // "DEPRECATED_TYPE_USED"
  28332. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28333. // "EXPERIMENTAL_TYPE_USED"
  28334. // "EXTERNAL_API_WARNING"
  28335. // "FIELD_VALUE_OVERRIDEN"
  28336. // "INJECTED_KERNELS_DEPRECATED"
  28337. // "MISSING_TYPE_DEPENDENCY"
  28338. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28339. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28340. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28341. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28342. // "NEXT_HOP_NOT_RUNNING"
  28343. // "NOT_CRITICAL_ERROR"
  28344. // "NO_RESULTS_ON_PAGE"
  28345. // "REQUIRED_TOS_AGREEMENT"
  28346. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28347. // "RESOURCE_NOT_DELETED"
  28348. // "SCHEMA_VALIDATION_IGNORED"
  28349. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28350. // "UNDECLARED_PROPERTIES"
  28351. // "UNREACHABLE"
  28352. Code string `json:"code,omitempty"`
  28353. // Data: [Output Only] Metadata about this warning in key: value format.
  28354. // For example:
  28355. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28356. Data []*TargetHttpProxyAggregatedListWarningData `json:"data,omitempty"`
  28357. // Message: [Output Only] A human-readable description of the warning
  28358. // code.
  28359. Message string `json:"message,omitempty"`
  28360. // ForceSendFields is a list of field names (e.g. "Code") to
  28361. // unconditionally include in API requests. By default, fields with
  28362. // empty values are omitted from API requests. However, any non-pointer,
  28363. // non-interface field appearing in ForceSendFields will be sent to the
  28364. // server regardless of whether the field is empty or not. This may be
  28365. // used to include empty fields in Patch requests.
  28366. ForceSendFields []string `json:"-"`
  28367. // NullFields is a list of field names (e.g. "Code") to include in API
  28368. // requests with the JSON null value. By default, fields with empty
  28369. // values are omitted from API requests. However, any field with an
  28370. // empty value appearing in NullFields will be sent to the server as
  28371. // null. It is an error if a field in this list has a non-empty value.
  28372. // This may be used to include null fields in Patch requests.
  28373. NullFields []string `json:"-"`
  28374. }
  28375. func (s *TargetHttpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  28376. type NoMethod TargetHttpProxyAggregatedListWarning
  28377. raw := NoMethod(*s)
  28378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28379. }
  28380. type TargetHttpProxyAggregatedListWarningData struct {
  28381. // Key: [Output Only] A key that provides more detail on the warning
  28382. // being returned. For example, for warnings where there are no results
  28383. // in a list request for a particular zone, this key might be scope and
  28384. // the key value might be the zone name. Other examples might be a key
  28385. // indicating a deprecated resource and a suggested replacement, or a
  28386. // warning about invalid network settings (for example, if an instance
  28387. // attempts to perform IP forwarding but is not enabled for IP
  28388. // forwarding).
  28389. Key string `json:"key,omitempty"`
  28390. // Value: [Output Only] A warning data value corresponding to the key.
  28391. Value string `json:"value,omitempty"`
  28392. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *TargetHttpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  28408. type NoMethod TargetHttpProxyAggregatedListWarningData
  28409. raw := NoMethod(*s)
  28410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28411. }
  28412. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  28413. type TargetHttpProxyList struct {
  28414. // Id: [Output Only] Unique identifier for the resource; defined by the
  28415. // server.
  28416. Id string `json:"id,omitempty"`
  28417. // Items: A list of TargetHttpProxy resources.
  28418. Items []*TargetHttpProxy `json:"items,omitempty"`
  28419. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  28420. // of target HTTP proxies.
  28421. Kind string `json:"kind,omitempty"`
  28422. // NextPageToken: [Output Only] This token allows you to get the next
  28423. // page of results for list requests. If the number of results is larger
  28424. // than maxResults, use the nextPageToken as a value for the query
  28425. // parameter pageToken in the next list request. Subsequent list
  28426. // requests will have their own nextPageToken to continue paging through
  28427. // the results.
  28428. NextPageToken string `json:"nextPageToken,omitempty"`
  28429. // SelfLink: [Output Only] Server-defined URL for this resource.
  28430. SelfLink string `json:"selfLink,omitempty"`
  28431. // Warning: [Output Only] Informational warning message.
  28432. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  28433. // ServerResponse contains the HTTP response code and headers from the
  28434. // server.
  28435. googleapi.ServerResponse `json:"-"`
  28436. // ForceSendFields is a list of field names (e.g. "Id") to
  28437. // unconditionally include in API requests. By default, fields with
  28438. // empty values are omitted from API requests. However, any non-pointer,
  28439. // non-interface field appearing in ForceSendFields will be sent to the
  28440. // server regardless of whether the field is empty or not. This may be
  28441. // used to include empty fields in Patch requests.
  28442. ForceSendFields []string `json:"-"`
  28443. // NullFields is a list of field names (e.g. "Id") to include in API
  28444. // requests with the JSON null value. By default, fields with empty
  28445. // values are omitted from API requests. However, any field with an
  28446. // empty value appearing in NullFields will be sent to the server as
  28447. // null. It is an error if a field in this list has a non-empty value.
  28448. // This may be used to include null fields in Patch requests.
  28449. NullFields []string `json:"-"`
  28450. }
  28451. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  28452. type NoMethod TargetHttpProxyList
  28453. raw := NoMethod(*s)
  28454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28455. }
  28456. // TargetHttpProxyListWarning: [Output Only] Informational warning
  28457. // message.
  28458. type TargetHttpProxyListWarning struct {
  28459. // Code: [Output Only] A warning code, if applicable. For example,
  28460. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28461. // the response.
  28462. //
  28463. // Possible values:
  28464. // "CLEANUP_FAILED"
  28465. // "DEPRECATED_RESOURCE_USED"
  28466. // "DEPRECATED_TYPE_USED"
  28467. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28468. // "EXPERIMENTAL_TYPE_USED"
  28469. // "EXTERNAL_API_WARNING"
  28470. // "FIELD_VALUE_OVERRIDEN"
  28471. // "INJECTED_KERNELS_DEPRECATED"
  28472. // "MISSING_TYPE_DEPENDENCY"
  28473. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28474. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28475. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28476. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28477. // "NEXT_HOP_NOT_RUNNING"
  28478. // "NOT_CRITICAL_ERROR"
  28479. // "NO_RESULTS_ON_PAGE"
  28480. // "REQUIRED_TOS_AGREEMENT"
  28481. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28482. // "RESOURCE_NOT_DELETED"
  28483. // "SCHEMA_VALIDATION_IGNORED"
  28484. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28485. // "UNDECLARED_PROPERTIES"
  28486. // "UNREACHABLE"
  28487. Code string `json:"code,omitempty"`
  28488. // Data: [Output Only] Metadata about this warning in key: value format.
  28489. // For example:
  28490. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28491. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  28492. // Message: [Output Only] A human-readable description of the warning
  28493. // code.
  28494. Message string `json:"message,omitempty"`
  28495. // ForceSendFields is a list of field names (e.g. "Code") to
  28496. // unconditionally include in API requests. By default, fields with
  28497. // empty values are omitted from API requests. However, any non-pointer,
  28498. // non-interface field appearing in ForceSendFields will be sent to the
  28499. // server regardless of whether the field is empty or not. This may be
  28500. // used to include empty fields in Patch requests.
  28501. ForceSendFields []string `json:"-"`
  28502. // NullFields is a list of field names (e.g. "Code") to include in API
  28503. // requests with the JSON null value. By default, fields with empty
  28504. // values are omitted from API requests. However, any field with an
  28505. // empty value appearing in NullFields will be sent to the server as
  28506. // null. It is an error if a field in this list has a non-empty value.
  28507. // This may be used to include null fields in Patch requests.
  28508. NullFields []string `json:"-"`
  28509. }
  28510. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  28511. type NoMethod TargetHttpProxyListWarning
  28512. raw := NoMethod(*s)
  28513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28514. }
  28515. type TargetHttpProxyListWarningData struct {
  28516. // Key: [Output Only] A key that provides more detail on the warning
  28517. // being returned. For example, for warnings where there are no results
  28518. // in a list request for a particular zone, this key might be scope and
  28519. // the key value might be the zone name. Other examples might be a key
  28520. // indicating a deprecated resource and a suggested replacement, or a
  28521. // warning about invalid network settings (for example, if an instance
  28522. // attempts to perform IP forwarding but is not enabled for IP
  28523. // forwarding).
  28524. Key string `json:"key,omitempty"`
  28525. // Value: [Output Only] A warning data value corresponding to the key.
  28526. Value string `json:"value,omitempty"`
  28527. // ForceSendFields is a list of field names (e.g. "Key") to
  28528. // unconditionally include in API requests. By default, fields with
  28529. // empty values are omitted from API requests. However, any non-pointer,
  28530. // non-interface field appearing in ForceSendFields will be sent to the
  28531. // server regardless of whether the field is empty or not. This may be
  28532. // used to include empty fields in Patch requests.
  28533. ForceSendFields []string `json:"-"`
  28534. // NullFields is a list of field names (e.g. "Key") to include in API
  28535. // requests with the JSON null value. By default, fields with empty
  28536. // values are omitted from API requests. However, any field with an
  28537. // empty value appearing in NullFields will be sent to the server as
  28538. // null. It is an error if a field in this list has a non-empty value.
  28539. // This may be used to include null fields in Patch requests.
  28540. NullFields []string `json:"-"`
  28541. }
  28542. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  28543. type NoMethod TargetHttpProxyListWarningData
  28544. raw := NoMethod(*s)
  28545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28546. }
  28547. type TargetHttpsProxiesScopedList struct {
  28548. // TargetHttpsProxies: A list of TargetHttpsProxies contained in this
  28549. // scope.
  28550. TargetHttpsProxies []*TargetHttpsProxy `json:"targetHttpsProxies,omitempty"`
  28551. // Warning: Informational warning which replaces the list of backend
  28552. // services when the list is empty.
  28553. Warning *TargetHttpsProxiesScopedListWarning `json:"warning,omitempty"`
  28554. // ForceSendFields is a list of field names (e.g. "TargetHttpsProxies")
  28555. // to unconditionally include in API requests. By default, fields with
  28556. // empty values are omitted from API requests. However, any non-pointer,
  28557. // non-interface field appearing in ForceSendFields will be sent to the
  28558. // server regardless of whether the field is empty or not. This may be
  28559. // used to include empty fields in Patch requests.
  28560. ForceSendFields []string `json:"-"`
  28561. // NullFields is a list of field names (e.g. "TargetHttpsProxies") to
  28562. // include in API requests with the JSON null value. By default, fields
  28563. // with empty values are omitted from API requests. However, any field
  28564. // with an empty value appearing in NullFields will be sent to the
  28565. // server as null. It is an error if a field in this list has a
  28566. // non-empty value. This may be used to include null fields in Patch
  28567. // requests.
  28568. NullFields []string `json:"-"`
  28569. }
  28570. func (s *TargetHttpsProxiesScopedList) MarshalJSON() ([]byte, error) {
  28571. type NoMethod TargetHttpsProxiesScopedList
  28572. raw := NoMethod(*s)
  28573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28574. }
  28575. // TargetHttpsProxiesScopedListWarning: Informational warning which
  28576. // replaces the list of backend services when the list is empty.
  28577. type TargetHttpsProxiesScopedListWarning struct {
  28578. // Code: [Output Only] A warning code, if applicable. For example,
  28579. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28580. // the response.
  28581. //
  28582. // Possible values:
  28583. // "CLEANUP_FAILED"
  28584. // "DEPRECATED_RESOURCE_USED"
  28585. // "DEPRECATED_TYPE_USED"
  28586. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28587. // "EXPERIMENTAL_TYPE_USED"
  28588. // "EXTERNAL_API_WARNING"
  28589. // "FIELD_VALUE_OVERRIDEN"
  28590. // "INJECTED_KERNELS_DEPRECATED"
  28591. // "MISSING_TYPE_DEPENDENCY"
  28592. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28593. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28594. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28595. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28596. // "NEXT_HOP_NOT_RUNNING"
  28597. // "NOT_CRITICAL_ERROR"
  28598. // "NO_RESULTS_ON_PAGE"
  28599. // "REQUIRED_TOS_AGREEMENT"
  28600. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28601. // "RESOURCE_NOT_DELETED"
  28602. // "SCHEMA_VALIDATION_IGNORED"
  28603. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28604. // "UNDECLARED_PROPERTIES"
  28605. // "UNREACHABLE"
  28606. Code string `json:"code,omitempty"`
  28607. // Data: [Output Only] Metadata about this warning in key: value format.
  28608. // For example:
  28609. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28610. Data []*TargetHttpsProxiesScopedListWarningData `json:"data,omitempty"`
  28611. // Message: [Output Only] A human-readable description of the warning
  28612. // code.
  28613. Message string `json:"message,omitempty"`
  28614. // ForceSendFields is a list of field names (e.g. "Code") to
  28615. // unconditionally include in API requests. By default, fields with
  28616. // empty values are omitted from API requests. However, any non-pointer,
  28617. // non-interface field appearing in ForceSendFields will be sent to the
  28618. // server regardless of whether the field is empty or not. This may be
  28619. // used to include empty fields in Patch requests.
  28620. ForceSendFields []string `json:"-"`
  28621. // NullFields is a list of field names (e.g. "Code") to include in API
  28622. // requests with the JSON null value. By default, fields with empty
  28623. // values are omitted from API requests. However, any field with an
  28624. // empty value appearing in NullFields will be sent to the server as
  28625. // null. It is an error if a field in this list has a non-empty value.
  28626. // This may be used to include null fields in Patch requests.
  28627. NullFields []string `json:"-"`
  28628. }
  28629. func (s *TargetHttpsProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  28630. type NoMethod TargetHttpsProxiesScopedListWarning
  28631. raw := NoMethod(*s)
  28632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28633. }
  28634. type TargetHttpsProxiesScopedListWarningData struct {
  28635. // Key: [Output Only] A key that provides more detail on the warning
  28636. // being returned. For example, for warnings where there are no results
  28637. // in a list request for a particular zone, this key might be scope and
  28638. // the key value might be the zone name. Other examples might be a key
  28639. // indicating a deprecated resource and a suggested replacement, or a
  28640. // warning about invalid network settings (for example, if an instance
  28641. // attempts to perform IP forwarding but is not enabled for IP
  28642. // forwarding).
  28643. Key string `json:"key,omitempty"`
  28644. // Value: [Output Only] A warning data value corresponding to the key.
  28645. Value string `json:"value,omitempty"`
  28646. // ForceSendFields is a list of field names (e.g. "Key") to
  28647. // unconditionally include in API requests. By default, fields with
  28648. // empty values are omitted from API requests. However, any non-pointer,
  28649. // non-interface field appearing in ForceSendFields will be sent to the
  28650. // server regardless of whether the field is empty or not. This may be
  28651. // used to include empty fields in Patch requests.
  28652. ForceSendFields []string `json:"-"`
  28653. // NullFields is a list of field names (e.g. "Key") to include in API
  28654. // requests with the JSON null value. By default, fields with empty
  28655. // values are omitted from API requests. However, any field with an
  28656. // empty value appearing in NullFields will be sent to the server as
  28657. // null. It is an error if a field in this list has a non-empty value.
  28658. // This may be used to include null fields in Patch requests.
  28659. NullFields []string `json:"-"`
  28660. }
  28661. func (s *TargetHttpsProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  28662. type NoMethod TargetHttpsProxiesScopedListWarningData
  28663. raw := NoMethod(*s)
  28664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28665. }
  28666. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  28667. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  28668. //
  28669. // Possible values:
  28670. // "DISABLE"
  28671. // "ENABLE"
  28672. // "NONE"
  28673. QuicOverride string `json:"quicOverride,omitempty"`
  28674. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  28675. // unconditionally include in API requests. By default, fields with
  28676. // empty values are omitted from API requests. However, any non-pointer,
  28677. // non-interface field appearing in ForceSendFields will be sent to the
  28678. // server regardless of whether the field is empty or not. This may be
  28679. // used to include empty fields in Patch requests.
  28680. ForceSendFields []string `json:"-"`
  28681. // NullFields is a list of field names (e.g. "QuicOverride") to include
  28682. // in API requests with the JSON null value. By default, fields with
  28683. // empty values are omitted from API requests. However, any field with
  28684. // an empty value appearing in NullFields will be sent to the server as
  28685. // null. It is an error if a field in this list has a non-empty value.
  28686. // This may be used to include null fields in Patch requests.
  28687. NullFields []string `json:"-"`
  28688. }
  28689. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  28690. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  28691. raw := NoMethod(*s)
  28692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28693. }
  28694. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  28695. // SslCertificates: New set of SslCertificate resources to associate
  28696. // with this TargetHttpsProxy resource. Currently exactly one
  28697. // SslCertificate resource must be specified.
  28698. SslCertificates []string `json:"sslCertificates,omitempty"`
  28699. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  28700. // unconditionally include in API requests. By default, fields with
  28701. // empty values are omitted from API requests. However, any non-pointer,
  28702. // non-interface field appearing in ForceSendFields will be sent to the
  28703. // server regardless of whether the field is empty or not. This may be
  28704. // used to include empty fields in Patch requests.
  28705. ForceSendFields []string `json:"-"`
  28706. // NullFields is a list of field names (e.g. "SslCertificates") to
  28707. // include in API requests with the JSON null value. By default, fields
  28708. // with empty values are omitted from API requests. However, any field
  28709. // with an empty value appearing in NullFields will be sent to the
  28710. // server as null. It is an error if a field in this list has a
  28711. // non-empty value. This may be used to include null fields in Patch
  28712. // requests.
  28713. NullFields []string `json:"-"`
  28714. }
  28715. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  28716. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  28717. raw := NoMethod(*s)
  28718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28719. }
  28720. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  28721. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  28722. // resource_for v1.targetHttpsProxies ==)
  28723. type TargetHttpsProxy struct {
  28724. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28725. // format.
  28726. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28727. // Description: An optional description of this resource. Provide this
  28728. // property when you create the resource.
  28729. Description string `json:"description,omitempty"`
  28730. // Id: [Output Only] The unique identifier for the resource. This
  28731. // identifier is defined by the server.
  28732. Id uint64 `json:"id,omitempty,string"`
  28733. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  28734. // for target HTTPS proxies.
  28735. Kind string `json:"kind,omitempty"`
  28736. // Name: Name of the resource. Provided by the client when the resource
  28737. // is created. The name must be 1-63 characters long, and comply with
  28738. // RFC1035. Specifically, the name must be 1-63 characters long and
  28739. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28740. // the first character must be a lowercase letter, and all following
  28741. // characters must be a dash, lowercase letter, or digit, except the
  28742. // last character, which cannot be a dash.
  28743. Name string `json:"name,omitempty"`
  28744. // QuicOverride: Specifies the QUIC override policy for this
  28745. // TargetHttpsProxy resource. This determines whether the load balancer
  28746. // will attempt to negotiate QUIC with clients or not. Can specify one
  28747. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  28748. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  28749. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  28750. // overrides, which is equivalent to DISABLE. Not specifying this field
  28751. // is equivalent to specifying NONE.
  28752. //
  28753. // Possible values:
  28754. // "DISABLE"
  28755. // "ENABLE"
  28756. // "NONE"
  28757. QuicOverride string `json:"quicOverride,omitempty"`
  28758. // Region: [Output Only] URL of the region where the regional
  28759. // TargetHttpsProxy resides. This field is not applicable to global
  28760. // TargetHttpsProxies.
  28761. Region string `json:"region,omitempty"`
  28762. // SelfLink: [Output Only] Server-defined URL for the resource.
  28763. SelfLink string `json:"selfLink,omitempty"`
  28764. // SslCertificates: URLs to SslCertificate resources that are used to
  28765. // authenticate connections between users and the load balancer. At
  28766. // least one SSL certificate must be specified. Currently, you may
  28767. // specify up to 15 SSL certificates.
  28768. SslCertificates []string `json:"sslCertificates,omitempty"`
  28769. // SslPolicy: URL of SslPolicy resource that will be associated with the
  28770. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  28771. // will not have any SSL policy configured.
  28772. SslPolicy string `json:"sslPolicy,omitempty"`
  28773. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  28774. // that defines the mapping from URL to the BackendService. For example,
  28775. // the following are all valid URLs for specifying a URL map:
  28776. // -
  28777. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  28778. // - projects/project/global/urlMaps/url-map
  28779. // - global/urlMaps/url-map
  28780. UrlMap string `json:"urlMap,omitempty"`
  28781. // ServerResponse contains the HTTP response code and headers from the
  28782. // server.
  28783. googleapi.ServerResponse `json:"-"`
  28784. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28785. // to unconditionally include in API requests. By default, fields with
  28786. // empty values are omitted from API requests. However, any non-pointer,
  28787. // non-interface field appearing in ForceSendFields will be sent to the
  28788. // server regardless of whether the field is empty or not. This may be
  28789. // used to include empty fields in Patch requests.
  28790. ForceSendFields []string `json:"-"`
  28791. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28792. // include in API requests with the JSON null value. By default, fields
  28793. // with empty values are omitted from API requests. However, any field
  28794. // with an empty value appearing in NullFields will be sent to the
  28795. // server as null. It is an error if a field in this list has a
  28796. // non-empty value. This may be used to include null fields in Patch
  28797. // requests.
  28798. NullFields []string `json:"-"`
  28799. }
  28800. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  28801. type NoMethod TargetHttpsProxy
  28802. raw := NoMethod(*s)
  28803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28804. }
  28805. type TargetHttpsProxyAggregatedList struct {
  28806. // Id: [Output Only] Unique identifier for the resource; defined by the
  28807. // server.
  28808. Id string `json:"id,omitempty"`
  28809. // Items: A list of TargetHttpsProxiesScopedList resources.
  28810. Items map[string]TargetHttpsProxiesScopedList `json:"items,omitempty"`
  28811. // Kind: [Output Only] Type of resource. Always
  28812. // compute#targetHttpsProxyAggregatedList for lists of Target HTTP
  28813. // Proxies.
  28814. Kind string `json:"kind,omitempty"`
  28815. // NextPageToken: [Output Only] This token allows you to get the next
  28816. // page of results for list requests. If the number of results is larger
  28817. // than maxResults, use the nextPageToken as a value for the query
  28818. // parameter pageToken in the next list request. Subsequent list
  28819. // requests will have their own nextPageToken to continue paging through
  28820. // the results.
  28821. NextPageToken string `json:"nextPageToken,omitempty"`
  28822. // SelfLink: [Output Only] Server-defined URL for this resource.
  28823. SelfLink string `json:"selfLink,omitempty"`
  28824. // Warning: [Output Only] Informational warning message.
  28825. Warning *TargetHttpsProxyAggregatedListWarning `json:"warning,omitempty"`
  28826. // ServerResponse contains the HTTP response code and headers from the
  28827. // server.
  28828. googleapi.ServerResponse `json:"-"`
  28829. // ForceSendFields is a list of field names (e.g. "Id") to
  28830. // unconditionally include in API requests. By default, fields with
  28831. // empty values are omitted from API requests. However, any non-pointer,
  28832. // non-interface field appearing in ForceSendFields will be sent to the
  28833. // server regardless of whether the field is empty or not. This may be
  28834. // used to include empty fields in Patch requests.
  28835. ForceSendFields []string `json:"-"`
  28836. // NullFields is a list of field names (e.g. "Id") to include in API
  28837. // requests with the JSON null value. By default, fields with empty
  28838. // values are omitted from API requests. However, any field with an
  28839. // empty value appearing in NullFields will be sent to the server as
  28840. // null. It is an error if a field in this list has a non-empty value.
  28841. // This may be used to include null fields in Patch requests.
  28842. NullFields []string `json:"-"`
  28843. }
  28844. func (s *TargetHttpsProxyAggregatedList) MarshalJSON() ([]byte, error) {
  28845. type NoMethod TargetHttpsProxyAggregatedList
  28846. raw := NoMethod(*s)
  28847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28848. }
  28849. // TargetHttpsProxyAggregatedListWarning: [Output Only] Informational
  28850. // warning message.
  28851. type TargetHttpsProxyAggregatedListWarning struct {
  28852. // Code: [Output Only] A warning code, if applicable. For example,
  28853. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28854. // the response.
  28855. //
  28856. // Possible values:
  28857. // "CLEANUP_FAILED"
  28858. // "DEPRECATED_RESOURCE_USED"
  28859. // "DEPRECATED_TYPE_USED"
  28860. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28861. // "EXPERIMENTAL_TYPE_USED"
  28862. // "EXTERNAL_API_WARNING"
  28863. // "FIELD_VALUE_OVERRIDEN"
  28864. // "INJECTED_KERNELS_DEPRECATED"
  28865. // "MISSING_TYPE_DEPENDENCY"
  28866. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28867. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28868. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28869. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28870. // "NEXT_HOP_NOT_RUNNING"
  28871. // "NOT_CRITICAL_ERROR"
  28872. // "NO_RESULTS_ON_PAGE"
  28873. // "REQUIRED_TOS_AGREEMENT"
  28874. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28875. // "RESOURCE_NOT_DELETED"
  28876. // "SCHEMA_VALIDATION_IGNORED"
  28877. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28878. // "UNDECLARED_PROPERTIES"
  28879. // "UNREACHABLE"
  28880. Code string `json:"code,omitempty"`
  28881. // Data: [Output Only] Metadata about this warning in key: value format.
  28882. // For example:
  28883. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28884. Data []*TargetHttpsProxyAggregatedListWarningData `json:"data,omitempty"`
  28885. // Message: [Output Only] A human-readable description of the warning
  28886. // code.
  28887. Message string `json:"message,omitempty"`
  28888. // ForceSendFields is a list of field names (e.g. "Code") to
  28889. // unconditionally include in API requests. By default, fields with
  28890. // empty values are omitted from API requests. However, any non-pointer,
  28891. // non-interface field appearing in ForceSendFields will be sent to the
  28892. // server regardless of whether the field is empty or not. This may be
  28893. // used to include empty fields in Patch requests.
  28894. ForceSendFields []string `json:"-"`
  28895. // NullFields is a list of field names (e.g. "Code") to include in API
  28896. // requests with the JSON null value. By default, fields with empty
  28897. // values are omitted from API requests. However, any field with an
  28898. // empty value appearing in NullFields will be sent to the server as
  28899. // null. It is an error if a field in this list has a non-empty value.
  28900. // This may be used to include null fields in Patch requests.
  28901. NullFields []string `json:"-"`
  28902. }
  28903. func (s *TargetHttpsProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  28904. type NoMethod TargetHttpsProxyAggregatedListWarning
  28905. raw := NoMethod(*s)
  28906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28907. }
  28908. type TargetHttpsProxyAggregatedListWarningData struct {
  28909. // Key: [Output Only] A key that provides more detail on the warning
  28910. // being returned. For example, for warnings where there are no results
  28911. // in a list request for a particular zone, this key might be scope and
  28912. // the key value might be the zone name. Other examples might be a key
  28913. // indicating a deprecated resource and a suggested replacement, or a
  28914. // warning about invalid network settings (for example, if an instance
  28915. // attempts to perform IP forwarding but is not enabled for IP
  28916. // forwarding).
  28917. Key string `json:"key,omitempty"`
  28918. // Value: [Output Only] A warning data value corresponding to the key.
  28919. Value string `json:"value,omitempty"`
  28920. // ForceSendFields is a list of field names (e.g. "Key") to
  28921. // unconditionally include in API requests. By default, fields with
  28922. // empty values are omitted from API requests. However, any non-pointer,
  28923. // non-interface field appearing in ForceSendFields will be sent to the
  28924. // server regardless of whether the field is empty or not. This may be
  28925. // used to include empty fields in Patch requests.
  28926. ForceSendFields []string `json:"-"`
  28927. // NullFields is a list of field names (e.g. "Key") to include in API
  28928. // requests with the JSON null value. By default, fields with empty
  28929. // values are omitted from API requests. However, any field with an
  28930. // empty value appearing in NullFields will be sent to the server as
  28931. // null. It is an error if a field in this list has a non-empty value.
  28932. // This may be used to include null fields in Patch requests.
  28933. NullFields []string `json:"-"`
  28934. }
  28935. func (s *TargetHttpsProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  28936. type NoMethod TargetHttpsProxyAggregatedListWarningData
  28937. raw := NoMethod(*s)
  28938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28939. }
  28940. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  28941. type TargetHttpsProxyList struct {
  28942. // Id: [Output Only] Unique identifier for the resource; defined by the
  28943. // server.
  28944. Id string `json:"id,omitempty"`
  28945. // Items: A list of TargetHttpsProxy resources.
  28946. Items []*TargetHttpsProxy `json:"items,omitempty"`
  28947. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  28948. // of target HTTPS proxies.
  28949. Kind string `json:"kind,omitempty"`
  28950. // NextPageToken: [Output Only] This token allows you to get the next
  28951. // page of results for list requests. If the number of results is larger
  28952. // than maxResults, use the nextPageToken as a value for the query
  28953. // parameter pageToken in the next list request. Subsequent list
  28954. // requests will have their own nextPageToken to continue paging through
  28955. // the results.
  28956. NextPageToken string `json:"nextPageToken,omitempty"`
  28957. // SelfLink: [Output Only] Server-defined URL for this resource.
  28958. SelfLink string `json:"selfLink,omitempty"`
  28959. // Warning: [Output Only] Informational warning message.
  28960. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  28961. // ServerResponse contains the HTTP response code and headers from the
  28962. // server.
  28963. googleapi.ServerResponse `json:"-"`
  28964. // ForceSendFields is a list of field names (e.g. "Id") to
  28965. // unconditionally include in API requests. By default, fields with
  28966. // empty values are omitted from API requests. However, any non-pointer,
  28967. // non-interface field appearing in ForceSendFields will be sent to the
  28968. // server regardless of whether the field is empty or not. This may be
  28969. // used to include empty fields in Patch requests.
  28970. ForceSendFields []string `json:"-"`
  28971. // NullFields is a list of field names (e.g. "Id") to include in API
  28972. // requests with the JSON null value. By default, fields with empty
  28973. // values are omitted from API requests. However, any field with an
  28974. // empty value appearing in NullFields will be sent to the server as
  28975. // null. It is an error if a field in this list has a non-empty value.
  28976. // This may be used to include null fields in Patch requests.
  28977. NullFields []string `json:"-"`
  28978. }
  28979. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  28980. type NoMethod TargetHttpsProxyList
  28981. raw := NoMethod(*s)
  28982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28983. }
  28984. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  28985. // message.
  28986. type TargetHttpsProxyListWarning struct {
  28987. // Code: [Output Only] A warning code, if applicable. For example,
  28988. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28989. // the response.
  28990. //
  28991. // Possible values:
  28992. // "CLEANUP_FAILED"
  28993. // "DEPRECATED_RESOURCE_USED"
  28994. // "DEPRECATED_TYPE_USED"
  28995. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28996. // "EXPERIMENTAL_TYPE_USED"
  28997. // "EXTERNAL_API_WARNING"
  28998. // "FIELD_VALUE_OVERRIDEN"
  28999. // "INJECTED_KERNELS_DEPRECATED"
  29000. // "MISSING_TYPE_DEPENDENCY"
  29001. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29002. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29003. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29004. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29005. // "NEXT_HOP_NOT_RUNNING"
  29006. // "NOT_CRITICAL_ERROR"
  29007. // "NO_RESULTS_ON_PAGE"
  29008. // "REQUIRED_TOS_AGREEMENT"
  29009. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29010. // "RESOURCE_NOT_DELETED"
  29011. // "SCHEMA_VALIDATION_IGNORED"
  29012. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29013. // "UNDECLARED_PROPERTIES"
  29014. // "UNREACHABLE"
  29015. Code string `json:"code,omitempty"`
  29016. // Data: [Output Only] Metadata about this warning in key: value format.
  29017. // For example:
  29018. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29019. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  29020. // Message: [Output Only] A human-readable description of the warning
  29021. // code.
  29022. Message string `json:"message,omitempty"`
  29023. // ForceSendFields is a list of field names (e.g. "Code") to
  29024. // unconditionally include in API requests. By default, fields with
  29025. // empty values are omitted from API requests. However, any non-pointer,
  29026. // non-interface field appearing in ForceSendFields will be sent to the
  29027. // server regardless of whether the field is empty or not. This may be
  29028. // used to include empty fields in Patch requests.
  29029. ForceSendFields []string `json:"-"`
  29030. // NullFields is a list of field names (e.g. "Code") to include in API
  29031. // requests with the JSON null value. By default, fields with empty
  29032. // values are omitted from API requests. However, any field with an
  29033. // empty value appearing in NullFields will be sent to the server as
  29034. // null. It is an error if a field in this list has a non-empty value.
  29035. // This may be used to include null fields in Patch requests.
  29036. NullFields []string `json:"-"`
  29037. }
  29038. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  29039. type NoMethod TargetHttpsProxyListWarning
  29040. raw := NoMethod(*s)
  29041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29042. }
  29043. type TargetHttpsProxyListWarningData struct {
  29044. // Key: [Output Only] A key that provides more detail on the warning
  29045. // being returned. For example, for warnings where there are no results
  29046. // in a list request for a particular zone, this key might be scope and
  29047. // the key value might be the zone name. Other examples might be a key
  29048. // indicating a deprecated resource and a suggested replacement, or a
  29049. // warning about invalid network settings (for example, if an instance
  29050. // attempts to perform IP forwarding but is not enabled for IP
  29051. // forwarding).
  29052. Key string `json:"key,omitempty"`
  29053. // Value: [Output Only] A warning data value corresponding to the key.
  29054. Value string `json:"value,omitempty"`
  29055. // ForceSendFields is a list of field names (e.g. "Key") to
  29056. // unconditionally include in API requests. By default, fields with
  29057. // empty values are omitted from API requests. However, any non-pointer,
  29058. // non-interface field appearing in ForceSendFields will be sent to the
  29059. // server regardless of whether the field is empty or not. This may be
  29060. // used to include empty fields in Patch requests.
  29061. ForceSendFields []string `json:"-"`
  29062. // NullFields is a list of field names (e.g. "Key") to include in API
  29063. // requests with the JSON null value. By default, fields with empty
  29064. // values are omitted from API requests. However, any field with an
  29065. // empty value appearing in NullFields will be sent to the server as
  29066. // null. It is an error if a field in this list has a non-empty value.
  29067. // This may be used to include null fields in Patch requests.
  29068. NullFields []string `json:"-"`
  29069. }
  29070. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  29071. type NoMethod TargetHttpsProxyListWarningData
  29072. raw := NoMethod(*s)
  29073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29074. }
  29075. // TargetInstance: A TargetInstance resource. This resource defines an
  29076. // endpoint instance that terminates traffic of certain protocols. (==
  29077. // resource_for beta.targetInstances ==) (== resource_for
  29078. // v1.targetInstances ==)
  29079. type TargetInstance struct {
  29080. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29081. // format.
  29082. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29083. // Description: An optional description of this resource. Provide this
  29084. // property when you create the resource.
  29085. Description string `json:"description,omitempty"`
  29086. // Id: [Output Only] The unique identifier for the resource. This
  29087. // identifier is defined by the server.
  29088. Id uint64 `json:"id,omitempty,string"`
  29089. // Instance: A URL to the virtual machine instance that handles traffic
  29090. // for this target instance. When creating a target instance, you can
  29091. // provide the fully-qualified URL or a valid partial URL to the desired
  29092. // virtual machine. For example, the following are all valid URLs:
  29093. // -
  29094. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  29095. // - projects/project/zones/zone/instances/instance
  29096. // - zones/zone/instances/instance
  29097. Instance string `json:"instance,omitempty"`
  29098. // Kind: [Output Only] The type of the resource. Always
  29099. // compute#targetInstance for target instances.
  29100. Kind string `json:"kind,omitempty"`
  29101. // Name: Name of the resource. Provided by the client when the resource
  29102. // is created. The name must be 1-63 characters long, and comply with
  29103. // RFC1035. Specifically, the name must be 1-63 characters long and
  29104. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29105. // the first character must be a lowercase letter, and all following
  29106. // characters must be a dash, lowercase letter, or digit, except the
  29107. // last character, which cannot be a dash.
  29108. Name string `json:"name,omitempty"`
  29109. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  29110. // Currently only NO_NAT (default value) is supported.
  29111. //
  29112. // Possible values:
  29113. // "NO_NAT"
  29114. NatPolicy string `json:"natPolicy,omitempty"`
  29115. // SelfLink: [Output Only] Server-defined URL for the resource.
  29116. SelfLink string `json:"selfLink,omitempty"`
  29117. // Zone: [Output Only] URL of the zone where the target instance
  29118. // resides. You must specify this field as part of the HTTP request URL.
  29119. // It is not settable as a field in the request body.
  29120. Zone string `json:"zone,omitempty"`
  29121. // ServerResponse contains the HTTP response code and headers from the
  29122. // server.
  29123. googleapi.ServerResponse `json:"-"`
  29124. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  29125. // to unconditionally include in API requests. By default, fields with
  29126. // empty values are omitted from API requests. However, any non-pointer,
  29127. // non-interface field appearing in ForceSendFields will be sent to the
  29128. // server regardless of whether the field is empty or not. This may be
  29129. // used to include empty fields in Patch requests.
  29130. ForceSendFields []string `json:"-"`
  29131. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  29132. // include in API requests with the JSON null value. By default, fields
  29133. // with empty values are omitted from API requests. However, any field
  29134. // with an empty value appearing in NullFields will be sent to the
  29135. // server as null. It is an error if a field in this list has a
  29136. // non-empty value. This may be used to include null fields in Patch
  29137. // requests.
  29138. NullFields []string `json:"-"`
  29139. }
  29140. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  29141. type NoMethod TargetInstance
  29142. raw := NoMethod(*s)
  29143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29144. }
  29145. type TargetInstanceAggregatedList struct {
  29146. // Id: [Output Only] Unique identifier for the resource; defined by the
  29147. // server.
  29148. Id string `json:"id,omitempty"`
  29149. // Items: A list of TargetInstance resources.
  29150. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  29151. // Kind: Type of resource.
  29152. Kind string `json:"kind,omitempty"`
  29153. // NextPageToken: [Output Only] This token allows you to get the next
  29154. // page of results for list requests. If the number of results is larger
  29155. // than maxResults, use the nextPageToken as a value for the query
  29156. // parameter pageToken in the next list request. Subsequent list
  29157. // requests will have their own nextPageToken to continue paging through
  29158. // the results.
  29159. NextPageToken string `json:"nextPageToken,omitempty"`
  29160. // SelfLink: [Output Only] Server-defined URL for this resource.
  29161. SelfLink string `json:"selfLink,omitempty"`
  29162. // Warning: [Output Only] Informational warning message.
  29163. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  29164. // ServerResponse contains the HTTP response code and headers from the
  29165. // server.
  29166. googleapi.ServerResponse `json:"-"`
  29167. // ForceSendFields is a list of field names (e.g. "Id") to
  29168. // unconditionally include in API requests. By default, fields with
  29169. // empty values are omitted from API requests. However, any non-pointer,
  29170. // non-interface field appearing in ForceSendFields will be sent to the
  29171. // server regardless of whether the field is empty or not. This may be
  29172. // used to include empty fields in Patch requests.
  29173. ForceSendFields []string `json:"-"`
  29174. // NullFields is a list of field names (e.g. "Id") to include in API
  29175. // requests with the JSON null value. By default, fields with empty
  29176. // values are omitted from API requests. However, any field with an
  29177. // empty value appearing in NullFields will be sent to the server as
  29178. // null. It is an error if a field in this list has a non-empty value.
  29179. // This may be used to include null fields in Patch requests.
  29180. NullFields []string `json:"-"`
  29181. }
  29182. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  29183. type NoMethod TargetInstanceAggregatedList
  29184. raw := NoMethod(*s)
  29185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29186. }
  29187. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  29188. // warning message.
  29189. type TargetInstanceAggregatedListWarning struct {
  29190. // Code: [Output Only] A warning code, if applicable. For example,
  29191. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29192. // the response.
  29193. //
  29194. // Possible values:
  29195. // "CLEANUP_FAILED"
  29196. // "DEPRECATED_RESOURCE_USED"
  29197. // "DEPRECATED_TYPE_USED"
  29198. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29199. // "EXPERIMENTAL_TYPE_USED"
  29200. // "EXTERNAL_API_WARNING"
  29201. // "FIELD_VALUE_OVERRIDEN"
  29202. // "INJECTED_KERNELS_DEPRECATED"
  29203. // "MISSING_TYPE_DEPENDENCY"
  29204. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29205. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29206. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29207. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29208. // "NEXT_HOP_NOT_RUNNING"
  29209. // "NOT_CRITICAL_ERROR"
  29210. // "NO_RESULTS_ON_PAGE"
  29211. // "REQUIRED_TOS_AGREEMENT"
  29212. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29213. // "RESOURCE_NOT_DELETED"
  29214. // "SCHEMA_VALIDATION_IGNORED"
  29215. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29216. // "UNDECLARED_PROPERTIES"
  29217. // "UNREACHABLE"
  29218. Code string `json:"code,omitempty"`
  29219. // Data: [Output Only] Metadata about this warning in key: value format.
  29220. // For example:
  29221. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29222. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  29223. // Message: [Output Only] A human-readable description of the warning
  29224. // code.
  29225. Message string `json:"message,omitempty"`
  29226. // ForceSendFields is a list of field names (e.g. "Code") to
  29227. // unconditionally include in API requests. By default, fields with
  29228. // empty values are omitted from API requests. However, any non-pointer,
  29229. // non-interface field appearing in ForceSendFields will be sent to the
  29230. // server regardless of whether the field is empty or not. This may be
  29231. // used to include empty fields in Patch requests.
  29232. ForceSendFields []string `json:"-"`
  29233. // NullFields is a list of field names (e.g. "Code") to include in API
  29234. // requests with the JSON null value. By default, fields with empty
  29235. // values are omitted from API requests. However, any field with an
  29236. // empty value appearing in NullFields will be sent to the server as
  29237. // null. It is an error if a field in this list has a non-empty value.
  29238. // This may be used to include null fields in Patch requests.
  29239. NullFields []string `json:"-"`
  29240. }
  29241. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29242. type NoMethod TargetInstanceAggregatedListWarning
  29243. raw := NoMethod(*s)
  29244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29245. }
  29246. type TargetInstanceAggregatedListWarningData struct {
  29247. // Key: [Output Only] A key that provides more detail on the warning
  29248. // being returned. For example, for warnings where there are no results
  29249. // in a list request for a particular zone, this key might be scope and
  29250. // the key value might be the zone name. Other examples might be a key
  29251. // indicating a deprecated resource and a suggested replacement, or a
  29252. // warning about invalid network settings (for example, if an instance
  29253. // attempts to perform IP forwarding but is not enabled for IP
  29254. // forwarding).
  29255. Key string `json:"key,omitempty"`
  29256. // Value: [Output Only] A warning data value corresponding to the key.
  29257. Value string `json:"value,omitempty"`
  29258. // ForceSendFields is a list of field names (e.g. "Key") to
  29259. // unconditionally include in API requests. By default, fields with
  29260. // empty values are omitted from API requests. However, any non-pointer,
  29261. // non-interface field appearing in ForceSendFields will be sent to the
  29262. // server regardless of whether the field is empty or not. This may be
  29263. // used to include empty fields in Patch requests.
  29264. ForceSendFields []string `json:"-"`
  29265. // NullFields is a list of field names (e.g. "Key") to include in API
  29266. // requests with the JSON null value. By default, fields with empty
  29267. // values are omitted from API requests. However, any field with an
  29268. // empty value appearing in NullFields will be sent to the server as
  29269. // null. It is an error if a field in this list has a non-empty value.
  29270. // This may be used to include null fields in Patch requests.
  29271. NullFields []string `json:"-"`
  29272. }
  29273. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29274. type NoMethod TargetInstanceAggregatedListWarningData
  29275. raw := NoMethod(*s)
  29276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29277. }
  29278. // TargetInstanceList: Contains a list of TargetInstance resources.
  29279. type TargetInstanceList struct {
  29280. // Id: [Output Only] Unique identifier for the resource; defined by the
  29281. // server.
  29282. Id string `json:"id,omitempty"`
  29283. // Items: A list of TargetInstance resources.
  29284. Items []*TargetInstance `json:"items,omitempty"`
  29285. // Kind: Type of resource.
  29286. Kind string `json:"kind,omitempty"`
  29287. // NextPageToken: [Output Only] This token allows you to get the next
  29288. // page of results for list requests. If the number of results is larger
  29289. // than maxResults, use the nextPageToken as a value for the query
  29290. // parameter pageToken in the next list request. Subsequent list
  29291. // requests will have their own nextPageToken to continue paging through
  29292. // the results.
  29293. NextPageToken string `json:"nextPageToken,omitempty"`
  29294. // SelfLink: [Output Only] Server-defined URL for this resource.
  29295. SelfLink string `json:"selfLink,omitempty"`
  29296. // Warning: [Output Only] Informational warning message.
  29297. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  29298. // ServerResponse contains the HTTP response code and headers from the
  29299. // server.
  29300. googleapi.ServerResponse `json:"-"`
  29301. // ForceSendFields is a list of field names (e.g. "Id") to
  29302. // unconditionally include in API requests. By default, fields with
  29303. // empty values are omitted from API requests. However, any non-pointer,
  29304. // non-interface field appearing in ForceSendFields will be sent to the
  29305. // server regardless of whether the field is empty or not. This may be
  29306. // used to include empty fields in Patch requests.
  29307. ForceSendFields []string `json:"-"`
  29308. // NullFields is a list of field names (e.g. "Id") to include in API
  29309. // requests with the JSON null value. By default, fields with empty
  29310. // values are omitted from API requests. However, any field with an
  29311. // empty value appearing in NullFields will be sent to the server as
  29312. // null. It is an error if a field in this list has a non-empty value.
  29313. // This may be used to include null fields in Patch requests.
  29314. NullFields []string `json:"-"`
  29315. }
  29316. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  29317. type NoMethod TargetInstanceList
  29318. raw := NoMethod(*s)
  29319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29320. }
  29321. // TargetInstanceListWarning: [Output Only] Informational warning
  29322. // message.
  29323. type TargetInstanceListWarning struct {
  29324. // Code: [Output Only] A warning code, if applicable. For example,
  29325. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29326. // the response.
  29327. //
  29328. // Possible values:
  29329. // "CLEANUP_FAILED"
  29330. // "DEPRECATED_RESOURCE_USED"
  29331. // "DEPRECATED_TYPE_USED"
  29332. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29333. // "EXPERIMENTAL_TYPE_USED"
  29334. // "EXTERNAL_API_WARNING"
  29335. // "FIELD_VALUE_OVERRIDEN"
  29336. // "INJECTED_KERNELS_DEPRECATED"
  29337. // "MISSING_TYPE_DEPENDENCY"
  29338. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29339. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29340. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29341. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29342. // "NEXT_HOP_NOT_RUNNING"
  29343. // "NOT_CRITICAL_ERROR"
  29344. // "NO_RESULTS_ON_PAGE"
  29345. // "REQUIRED_TOS_AGREEMENT"
  29346. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29347. // "RESOURCE_NOT_DELETED"
  29348. // "SCHEMA_VALIDATION_IGNORED"
  29349. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29350. // "UNDECLARED_PROPERTIES"
  29351. // "UNREACHABLE"
  29352. Code string `json:"code,omitempty"`
  29353. // Data: [Output Only] Metadata about this warning in key: value format.
  29354. // For example:
  29355. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29356. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  29357. // Message: [Output Only] A human-readable description of the warning
  29358. // code.
  29359. Message string `json:"message,omitempty"`
  29360. // ForceSendFields is a list of field names (e.g. "Code") to
  29361. // unconditionally include in API requests. By default, fields with
  29362. // empty values are omitted from API requests. However, any non-pointer,
  29363. // non-interface field appearing in ForceSendFields will be sent to the
  29364. // server regardless of whether the field is empty or not. This may be
  29365. // used to include empty fields in Patch requests.
  29366. ForceSendFields []string `json:"-"`
  29367. // NullFields is a list of field names (e.g. "Code") to include in API
  29368. // requests with the JSON null value. By default, fields with empty
  29369. // values are omitted from API requests. However, any field with an
  29370. // empty value appearing in NullFields will be sent to the server as
  29371. // null. It is an error if a field in this list has a non-empty value.
  29372. // This may be used to include null fields in Patch requests.
  29373. NullFields []string `json:"-"`
  29374. }
  29375. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  29376. type NoMethod TargetInstanceListWarning
  29377. raw := NoMethod(*s)
  29378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29379. }
  29380. type TargetInstanceListWarningData struct {
  29381. // Key: [Output Only] A key that provides more detail on the warning
  29382. // being returned. For example, for warnings where there are no results
  29383. // in a list request for a particular zone, this key might be scope and
  29384. // the key value might be the zone name. Other examples might be a key
  29385. // indicating a deprecated resource and a suggested replacement, or a
  29386. // warning about invalid network settings (for example, if an instance
  29387. // attempts to perform IP forwarding but is not enabled for IP
  29388. // forwarding).
  29389. Key string `json:"key,omitempty"`
  29390. // Value: [Output Only] A warning data value corresponding to the key.
  29391. Value string `json:"value,omitempty"`
  29392. // ForceSendFields is a list of field names (e.g. "Key") to
  29393. // unconditionally include in API requests. By default, fields with
  29394. // empty values are omitted from API requests. However, any non-pointer,
  29395. // non-interface field appearing in ForceSendFields will be sent to the
  29396. // server regardless of whether the field is empty or not. This may be
  29397. // used to include empty fields in Patch requests.
  29398. ForceSendFields []string `json:"-"`
  29399. // NullFields is a list of field names (e.g. "Key") to include in API
  29400. // requests with the JSON null value. By default, fields with empty
  29401. // values are omitted from API requests. However, any field with an
  29402. // empty value appearing in NullFields will be sent to the server as
  29403. // null. It is an error if a field in this list has a non-empty value.
  29404. // This may be used to include null fields in Patch requests.
  29405. NullFields []string `json:"-"`
  29406. }
  29407. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  29408. type NoMethod TargetInstanceListWarningData
  29409. raw := NoMethod(*s)
  29410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29411. }
  29412. type TargetInstancesScopedList struct {
  29413. // TargetInstances: A list of target instances contained in this scope.
  29414. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  29415. // Warning: Informational warning which replaces the list of addresses
  29416. // when the list is empty.
  29417. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  29418. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  29419. // unconditionally include in API requests. By default, fields with
  29420. // empty values are omitted from API requests. However, any non-pointer,
  29421. // non-interface field appearing in ForceSendFields will be sent to the
  29422. // server regardless of whether the field is empty or not. This may be
  29423. // used to include empty fields in Patch requests.
  29424. ForceSendFields []string `json:"-"`
  29425. // NullFields is a list of field names (e.g. "TargetInstances") to
  29426. // include in API requests with the JSON null value. By default, fields
  29427. // with empty values are omitted from API requests. However, any field
  29428. // with an empty value appearing in NullFields will be sent to the
  29429. // server as null. It is an error if a field in this list has a
  29430. // non-empty value. This may be used to include null fields in Patch
  29431. // requests.
  29432. NullFields []string `json:"-"`
  29433. }
  29434. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  29435. type NoMethod TargetInstancesScopedList
  29436. raw := NoMethod(*s)
  29437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29438. }
  29439. // TargetInstancesScopedListWarning: Informational warning which
  29440. // replaces the list of addresses when the list is empty.
  29441. type TargetInstancesScopedListWarning struct {
  29442. // Code: [Output Only] A warning code, if applicable. For example,
  29443. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29444. // the response.
  29445. //
  29446. // Possible values:
  29447. // "CLEANUP_FAILED"
  29448. // "DEPRECATED_RESOURCE_USED"
  29449. // "DEPRECATED_TYPE_USED"
  29450. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29451. // "EXPERIMENTAL_TYPE_USED"
  29452. // "EXTERNAL_API_WARNING"
  29453. // "FIELD_VALUE_OVERRIDEN"
  29454. // "INJECTED_KERNELS_DEPRECATED"
  29455. // "MISSING_TYPE_DEPENDENCY"
  29456. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29457. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29458. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29459. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29460. // "NEXT_HOP_NOT_RUNNING"
  29461. // "NOT_CRITICAL_ERROR"
  29462. // "NO_RESULTS_ON_PAGE"
  29463. // "REQUIRED_TOS_AGREEMENT"
  29464. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29465. // "RESOURCE_NOT_DELETED"
  29466. // "SCHEMA_VALIDATION_IGNORED"
  29467. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29468. // "UNDECLARED_PROPERTIES"
  29469. // "UNREACHABLE"
  29470. Code string `json:"code,omitempty"`
  29471. // Data: [Output Only] Metadata about this warning in key: value format.
  29472. // For example:
  29473. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29474. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  29475. // Message: [Output Only] A human-readable description of the warning
  29476. // code.
  29477. Message string `json:"message,omitempty"`
  29478. // ForceSendFields is a list of field names (e.g. "Code") to
  29479. // unconditionally include in API requests. By default, fields with
  29480. // empty values are omitted from API requests. However, any non-pointer,
  29481. // non-interface field appearing in ForceSendFields will be sent to the
  29482. // server regardless of whether the field is empty or not. This may be
  29483. // used to include empty fields in Patch requests.
  29484. ForceSendFields []string `json:"-"`
  29485. // NullFields is a list of field names (e.g. "Code") to include in API
  29486. // requests with the JSON null value. By default, fields with empty
  29487. // values are omitted from API requests. However, any field with an
  29488. // empty value appearing in NullFields will be sent to the server as
  29489. // null. It is an error if a field in this list has a non-empty value.
  29490. // This may be used to include null fields in Patch requests.
  29491. NullFields []string `json:"-"`
  29492. }
  29493. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  29494. type NoMethod TargetInstancesScopedListWarning
  29495. raw := NoMethod(*s)
  29496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29497. }
  29498. type TargetInstancesScopedListWarningData struct {
  29499. // Key: [Output Only] A key that provides more detail on the warning
  29500. // being returned. For example, for warnings where there are no results
  29501. // in a list request for a particular zone, this key might be scope and
  29502. // the key value might be the zone name. Other examples might be a key
  29503. // indicating a deprecated resource and a suggested replacement, or a
  29504. // warning about invalid network settings (for example, if an instance
  29505. // attempts to perform IP forwarding but is not enabled for IP
  29506. // forwarding).
  29507. Key string `json:"key,omitempty"`
  29508. // Value: [Output Only] A warning data value corresponding to the key.
  29509. Value string `json:"value,omitempty"`
  29510. // ForceSendFields is a list of field names (e.g. "Key") to
  29511. // unconditionally include in API requests. By default, fields with
  29512. // empty values are omitted from API requests. However, any non-pointer,
  29513. // non-interface field appearing in ForceSendFields will be sent to the
  29514. // server regardless of whether the field is empty or not. This may be
  29515. // used to include empty fields in Patch requests.
  29516. ForceSendFields []string `json:"-"`
  29517. // NullFields is a list of field names (e.g. "Key") to include in API
  29518. // requests with the JSON null value. By default, fields with empty
  29519. // values are omitted from API requests. However, any field with an
  29520. // empty value appearing in NullFields will be sent to the server as
  29521. // null. It is an error if a field in this list has a non-empty value.
  29522. // This may be used to include null fields in Patch requests.
  29523. NullFields []string `json:"-"`
  29524. }
  29525. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  29526. type NoMethod TargetInstancesScopedListWarningData
  29527. raw := NoMethod(*s)
  29528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29529. }
  29530. // TargetPool: A TargetPool resource. This resource defines a pool of
  29531. // instances, an associated HttpHealthCheck resource, and the fallback
  29532. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  29533. // v1.targetPools ==)
  29534. type TargetPool struct {
  29535. // BackupPool: This field is applicable only when the containing target
  29536. // pool is serving a forwarding rule as the primary pool, and its
  29537. // failoverRatio field is properly set to a value between [0,
  29538. // 1].
  29539. //
  29540. // backupPool and failoverRatio together define the fallback behavior of
  29541. // the primary target pool: if the ratio of the healthy instances in the
  29542. // primary pool is at or below failoverRatio, traffic arriving at the
  29543. // load-balanced IP will be directed to the backup pool.
  29544. //
  29545. // In case where failoverRatio and backupPool are not set, or all the
  29546. // instances in the backup pool are unhealthy, the traffic will be
  29547. // directed back to the primary pool in the "force" mode, where traffic
  29548. // will be spread to the healthy instances with the best effort, or to
  29549. // all instances when no instance is healthy.
  29550. BackupPool string `json:"backupPool,omitempty"`
  29551. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29552. // format.
  29553. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29554. // Description: An optional description of this resource. Provide this
  29555. // property when you create the resource.
  29556. Description string `json:"description,omitempty"`
  29557. // FailoverRatio: This field is applicable only when the containing
  29558. // target pool is serving a forwarding rule as the primary pool (i.e.,
  29559. // not as a backup pool to some other target pool). The value of the
  29560. // field must be in [0, 1].
  29561. //
  29562. // If set, backupPool must also be set. They together define the
  29563. // fallback behavior of the primary target pool: if the ratio of the
  29564. // healthy instances in the primary pool is at or below this number,
  29565. // traffic arriving at the load-balanced IP will be directed to the
  29566. // backup pool.
  29567. //
  29568. // In case where failoverRatio is not set or all the instances in the
  29569. // backup pool are unhealthy, the traffic will be directed back to the
  29570. // primary pool in the "force" mode, where traffic will be spread to the
  29571. // healthy instances with the best effort, or to all instances when no
  29572. // instance is healthy.
  29573. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  29574. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  29575. // instance in this pool is considered healthy if and only if the health
  29576. // checks pass. An empty list means all member instances will be
  29577. // considered healthy at all times. Only HttpHealthChecks are supported.
  29578. // Only one health check may be specified.
  29579. HealthChecks []string `json:"healthChecks,omitempty"`
  29580. // Id: [Output Only] The unique identifier for the resource. This
  29581. // identifier is defined by the server.
  29582. Id uint64 `json:"id,omitempty,string"`
  29583. // Instances: A list of resource URLs to the virtual machine instances
  29584. // serving this pool. They must live in zones contained in the same
  29585. // region as this pool.
  29586. Instances []string `json:"instances,omitempty"`
  29587. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  29588. // for target pools.
  29589. Kind string `json:"kind,omitempty"`
  29590. // Name: Name of the resource. Provided by the client when the resource
  29591. // is created. The name must be 1-63 characters long, and comply with
  29592. // RFC1035. Specifically, the name must be 1-63 characters long and
  29593. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29594. // the first character must be a lowercase letter, and all following
  29595. // characters must be a dash, lowercase letter, or digit, except the
  29596. // last character, which cannot be a dash.
  29597. Name string `json:"name,omitempty"`
  29598. // Region: [Output Only] URL of the region where the target pool
  29599. // resides.
  29600. Region string `json:"region,omitempty"`
  29601. // SelfLink: [Output Only] Server-defined URL for the resource.
  29602. SelfLink string `json:"selfLink,omitempty"`
  29603. // SessionAffinity: Session affinity option, must be one of the
  29604. // following values:
  29605. // NONE: Connections from the same client IP may go to any instance in
  29606. // the pool.
  29607. // CLIENT_IP: Connections from the same client IP will go to the same
  29608. // instance in the pool while that instance remains
  29609. // healthy.
  29610. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  29611. // protocol will go to the same instance in the pool while that instance
  29612. // remains healthy.
  29613. //
  29614. // Possible values:
  29615. // "CLIENT_IP"
  29616. // "CLIENT_IP_PORT_PROTO"
  29617. // "CLIENT_IP_PROTO"
  29618. // "GENERATED_COOKIE"
  29619. // "NONE"
  29620. SessionAffinity string `json:"sessionAffinity,omitempty"`
  29621. // ServerResponse contains the HTTP response code and headers from the
  29622. // server.
  29623. googleapi.ServerResponse `json:"-"`
  29624. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  29625. // unconditionally include in API requests. By default, fields with
  29626. // empty values are omitted from API requests. However, any non-pointer,
  29627. // non-interface field appearing in ForceSendFields will be sent to the
  29628. // server regardless of whether the field is empty or not. This may be
  29629. // used to include empty fields in Patch requests.
  29630. ForceSendFields []string `json:"-"`
  29631. // NullFields is a list of field names (e.g. "BackupPool") to include in
  29632. // API requests with the JSON null value. By default, fields with empty
  29633. // values are omitted from API requests. However, any field with an
  29634. // empty value appearing in NullFields will be sent to the server as
  29635. // null. It is an error if a field in this list has a non-empty value.
  29636. // This may be used to include null fields in Patch requests.
  29637. NullFields []string `json:"-"`
  29638. }
  29639. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  29640. type NoMethod TargetPool
  29641. raw := NoMethod(*s)
  29642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29643. }
  29644. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  29645. type NoMethod TargetPool
  29646. var s1 struct {
  29647. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  29648. *NoMethod
  29649. }
  29650. s1.NoMethod = (*NoMethod)(s)
  29651. if err := json.Unmarshal(data, &s1); err != nil {
  29652. return err
  29653. }
  29654. s.FailoverRatio = float64(s1.FailoverRatio)
  29655. return nil
  29656. }
  29657. type TargetPoolAggregatedList struct {
  29658. // Id: [Output Only] Unique identifier for the resource; defined by the
  29659. // server.
  29660. Id string `json:"id,omitempty"`
  29661. // Items: A list of TargetPool resources.
  29662. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  29663. // Kind: [Output Only] Type of resource. Always
  29664. // compute#targetPoolAggregatedList for aggregated lists of target
  29665. // pools.
  29666. Kind string `json:"kind,omitempty"`
  29667. // NextPageToken: [Output Only] This token allows you to get the next
  29668. // page of results for list requests. If the number of results is larger
  29669. // than maxResults, use the nextPageToken as a value for the query
  29670. // parameter pageToken in the next list request. Subsequent list
  29671. // requests will have their own nextPageToken to continue paging through
  29672. // the results.
  29673. NextPageToken string `json:"nextPageToken,omitempty"`
  29674. // SelfLink: [Output Only] Server-defined URL for this resource.
  29675. SelfLink string `json:"selfLink,omitempty"`
  29676. // Warning: [Output Only] Informational warning message.
  29677. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  29678. // ServerResponse contains the HTTP response code and headers from the
  29679. // server.
  29680. googleapi.ServerResponse `json:"-"`
  29681. // ForceSendFields is a list of field names (e.g. "Id") to
  29682. // unconditionally include in API requests. By default, fields with
  29683. // empty values are omitted from API requests. However, any non-pointer,
  29684. // non-interface field appearing in ForceSendFields will be sent to the
  29685. // server regardless of whether the field is empty or not. This may be
  29686. // used to include empty fields in Patch requests.
  29687. ForceSendFields []string `json:"-"`
  29688. // NullFields is a list of field names (e.g. "Id") to include in API
  29689. // requests with the JSON null value. By default, fields with empty
  29690. // values are omitted from API requests. However, any field with an
  29691. // empty value appearing in NullFields will be sent to the server as
  29692. // null. It is an error if a field in this list has a non-empty value.
  29693. // This may be used to include null fields in Patch requests.
  29694. NullFields []string `json:"-"`
  29695. }
  29696. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  29697. type NoMethod TargetPoolAggregatedList
  29698. raw := NoMethod(*s)
  29699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29700. }
  29701. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  29702. // message.
  29703. type TargetPoolAggregatedListWarning struct {
  29704. // Code: [Output Only] A warning code, if applicable. For example,
  29705. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29706. // the response.
  29707. //
  29708. // Possible values:
  29709. // "CLEANUP_FAILED"
  29710. // "DEPRECATED_RESOURCE_USED"
  29711. // "DEPRECATED_TYPE_USED"
  29712. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29713. // "EXPERIMENTAL_TYPE_USED"
  29714. // "EXTERNAL_API_WARNING"
  29715. // "FIELD_VALUE_OVERRIDEN"
  29716. // "INJECTED_KERNELS_DEPRECATED"
  29717. // "MISSING_TYPE_DEPENDENCY"
  29718. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29719. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29720. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29721. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29722. // "NEXT_HOP_NOT_RUNNING"
  29723. // "NOT_CRITICAL_ERROR"
  29724. // "NO_RESULTS_ON_PAGE"
  29725. // "REQUIRED_TOS_AGREEMENT"
  29726. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29727. // "RESOURCE_NOT_DELETED"
  29728. // "SCHEMA_VALIDATION_IGNORED"
  29729. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29730. // "UNDECLARED_PROPERTIES"
  29731. // "UNREACHABLE"
  29732. Code string `json:"code,omitempty"`
  29733. // Data: [Output Only] Metadata about this warning in key: value format.
  29734. // For example:
  29735. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29736. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  29737. // Message: [Output Only] A human-readable description of the warning
  29738. // code.
  29739. Message string `json:"message,omitempty"`
  29740. // ForceSendFields is a list of field names (e.g. "Code") to
  29741. // unconditionally include in API requests. By default, fields with
  29742. // empty values are omitted from API requests. However, any non-pointer,
  29743. // non-interface field appearing in ForceSendFields will be sent to the
  29744. // server regardless of whether the field is empty or not. This may be
  29745. // used to include empty fields in Patch requests.
  29746. ForceSendFields []string `json:"-"`
  29747. // NullFields is a list of field names (e.g. "Code") to include in API
  29748. // requests with the JSON null value. By default, fields with empty
  29749. // values are omitted from API requests. However, any field with an
  29750. // empty value appearing in NullFields will be sent to the server as
  29751. // null. It is an error if a field in this list has a non-empty value.
  29752. // This may be used to include null fields in Patch requests.
  29753. NullFields []string `json:"-"`
  29754. }
  29755. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29756. type NoMethod TargetPoolAggregatedListWarning
  29757. raw := NoMethod(*s)
  29758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29759. }
  29760. type TargetPoolAggregatedListWarningData struct {
  29761. // Key: [Output Only] A key that provides more detail on the warning
  29762. // being returned. For example, for warnings where there are no results
  29763. // in a list request for a particular zone, this key might be scope and
  29764. // the key value might be the zone name. Other examples might be a key
  29765. // indicating a deprecated resource and a suggested replacement, or a
  29766. // warning about invalid network settings (for example, if an instance
  29767. // attempts to perform IP forwarding but is not enabled for IP
  29768. // forwarding).
  29769. Key string `json:"key,omitempty"`
  29770. // Value: [Output Only] A warning data value corresponding to the key.
  29771. Value string `json:"value,omitempty"`
  29772. // ForceSendFields is a list of field names (e.g. "Key") to
  29773. // unconditionally include in API requests. By default, fields with
  29774. // empty values are omitted from API requests. However, any non-pointer,
  29775. // non-interface field appearing in ForceSendFields will be sent to the
  29776. // server regardless of whether the field is empty or not. This may be
  29777. // used to include empty fields in Patch requests.
  29778. ForceSendFields []string `json:"-"`
  29779. // NullFields is a list of field names (e.g. "Key") to include in API
  29780. // requests with the JSON null value. By default, fields with empty
  29781. // values are omitted from API requests. However, any field with an
  29782. // empty value appearing in NullFields will be sent to the server as
  29783. // null. It is an error if a field in this list has a non-empty value.
  29784. // This may be used to include null fields in Patch requests.
  29785. NullFields []string `json:"-"`
  29786. }
  29787. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29788. type NoMethod TargetPoolAggregatedListWarningData
  29789. raw := NoMethod(*s)
  29790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29791. }
  29792. type TargetPoolInstanceHealth struct {
  29793. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  29794. // Kind: [Output Only] Type of resource. Always
  29795. // compute#targetPoolInstanceHealth when checking the health of an
  29796. // instance.
  29797. Kind string `json:"kind,omitempty"`
  29798. // ServerResponse contains the HTTP response code and headers from the
  29799. // server.
  29800. googleapi.ServerResponse `json:"-"`
  29801. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  29802. // unconditionally include in API requests. By default, fields with
  29803. // empty values are omitted from API requests. However, any non-pointer,
  29804. // non-interface field appearing in ForceSendFields will be sent to the
  29805. // server regardless of whether the field is empty or not. This may be
  29806. // used to include empty fields in Patch requests.
  29807. ForceSendFields []string `json:"-"`
  29808. // NullFields is a list of field names (e.g. "HealthStatus") to include
  29809. // in API requests with the JSON null value. By default, fields with
  29810. // empty values are omitted from API requests. However, any field with
  29811. // an empty value appearing in NullFields will be sent to the server as
  29812. // null. It is an error if a field in this list has a non-empty value.
  29813. // This may be used to include null fields in Patch requests.
  29814. NullFields []string `json:"-"`
  29815. }
  29816. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  29817. type NoMethod TargetPoolInstanceHealth
  29818. raw := NoMethod(*s)
  29819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29820. }
  29821. // TargetPoolList: Contains a list of TargetPool resources.
  29822. type TargetPoolList struct {
  29823. // Id: [Output Only] Unique identifier for the resource; defined by the
  29824. // server.
  29825. Id string `json:"id,omitempty"`
  29826. // Items: A list of TargetPool resources.
  29827. Items []*TargetPool `json:"items,omitempty"`
  29828. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  29829. // for lists of target pools.
  29830. Kind string `json:"kind,omitempty"`
  29831. // NextPageToken: [Output Only] This token allows you to get the next
  29832. // page of results for list requests. If the number of results is larger
  29833. // than maxResults, use the nextPageToken as a value for the query
  29834. // parameter pageToken in the next list request. Subsequent list
  29835. // requests will have their own nextPageToken to continue paging through
  29836. // the results.
  29837. NextPageToken string `json:"nextPageToken,omitempty"`
  29838. // SelfLink: [Output Only] Server-defined URL for this resource.
  29839. SelfLink string `json:"selfLink,omitempty"`
  29840. // Warning: [Output Only] Informational warning message.
  29841. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  29842. // ServerResponse contains the HTTP response code and headers from the
  29843. // server.
  29844. googleapi.ServerResponse `json:"-"`
  29845. // ForceSendFields is a list of field names (e.g. "Id") to
  29846. // unconditionally include in API requests. By default, fields with
  29847. // empty values are omitted from API requests. However, any non-pointer,
  29848. // non-interface field appearing in ForceSendFields will be sent to the
  29849. // server regardless of whether the field is empty or not. This may be
  29850. // used to include empty fields in Patch requests.
  29851. ForceSendFields []string `json:"-"`
  29852. // NullFields is a list of field names (e.g. "Id") to include in API
  29853. // requests with the JSON null value. By default, fields with empty
  29854. // values are omitted from API requests. However, any field with an
  29855. // empty value appearing in NullFields will be sent to the server as
  29856. // null. It is an error if a field in this list has a non-empty value.
  29857. // This may be used to include null fields in Patch requests.
  29858. NullFields []string `json:"-"`
  29859. }
  29860. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  29861. type NoMethod TargetPoolList
  29862. raw := NoMethod(*s)
  29863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29864. }
  29865. // TargetPoolListWarning: [Output Only] Informational warning message.
  29866. type TargetPoolListWarning struct {
  29867. // Code: [Output Only] A warning code, if applicable. For example,
  29868. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29869. // the response.
  29870. //
  29871. // Possible values:
  29872. // "CLEANUP_FAILED"
  29873. // "DEPRECATED_RESOURCE_USED"
  29874. // "DEPRECATED_TYPE_USED"
  29875. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29876. // "EXPERIMENTAL_TYPE_USED"
  29877. // "EXTERNAL_API_WARNING"
  29878. // "FIELD_VALUE_OVERRIDEN"
  29879. // "INJECTED_KERNELS_DEPRECATED"
  29880. // "MISSING_TYPE_DEPENDENCY"
  29881. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29882. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29883. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29884. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29885. // "NEXT_HOP_NOT_RUNNING"
  29886. // "NOT_CRITICAL_ERROR"
  29887. // "NO_RESULTS_ON_PAGE"
  29888. // "REQUIRED_TOS_AGREEMENT"
  29889. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29890. // "RESOURCE_NOT_DELETED"
  29891. // "SCHEMA_VALIDATION_IGNORED"
  29892. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29893. // "UNDECLARED_PROPERTIES"
  29894. // "UNREACHABLE"
  29895. Code string `json:"code,omitempty"`
  29896. // Data: [Output Only] Metadata about this warning in key: value format.
  29897. // For example:
  29898. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29899. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  29900. // Message: [Output Only] A human-readable description of the warning
  29901. // code.
  29902. Message string `json:"message,omitempty"`
  29903. // ForceSendFields is a list of field names (e.g. "Code") to
  29904. // unconditionally include in API requests. By default, fields with
  29905. // empty values are omitted from API requests. However, any non-pointer,
  29906. // non-interface field appearing in ForceSendFields will be sent to the
  29907. // server regardless of whether the field is empty or not. This may be
  29908. // used to include empty fields in Patch requests.
  29909. ForceSendFields []string `json:"-"`
  29910. // NullFields is a list of field names (e.g. "Code") to include in API
  29911. // requests with the JSON null value. By default, fields with empty
  29912. // values are omitted from API requests. However, any field with an
  29913. // empty value appearing in NullFields will be sent to the server as
  29914. // null. It is an error if a field in this list has a non-empty value.
  29915. // This may be used to include null fields in Patch requests.
  29916. NullFields []string `json:"-"`
  29917. }
  29918. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  29919. type NoMethod TargetPoolListWarning
  29920. raw := NoMethod(*s)
  29921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29922. }
  29923. type TargetPoolListWarningData struct {
  29924. // Key: [Output Only] A key that provides more detail on the warning
  29925. // being returned. For example, for warnings where there are no results
  29926. // in a list request for a particular zone, this key might be scope and
  29927. // the key value might be the zone name. Other examples might be a key
  29928. // indicating a deprecated resource and a suggested replacement, or a
  29929. // warning about invalid network settings (for example, if an instance
  29930. // attempts to perform IP forwarding but is not enabled for IP
  29931. // forwarding).
  29932. Key string `json:"key,omitempty"`
  29933. // Value: [Output Only] A warning data value corresponding to the key.
  29934. Value string `json:"value,omitempty"`
  29935. // ForceSendFields is a list of field names (e.g. "Key") to
  29936. // unconditionally include in API requests. By default, fields with
  29937. // empty values are omitted from API requests. However, any non-pointer,
  29938. // non-interface field appearing in ForceSendFields will be sent to the
  29939. // server regardless of whether the field is empty or not. This may be
  29940. // used to include empty fields in Patch requests.
  29941. ForceSendFields []string `json:"-"`
  29942. // NullFields is a list of field names (e.g. "Key") to include in API
  29943. // requests with the JSON null value. By default, fields with empty
  29944. // values are omitted from API requests. However, any field with an
  29945. // empty value appearing in NullFields will be sent to the server as
  29946. // null. It is an error if a field in this list has a non-empty value.
  29947. // This may be used to include null fields in Patch requests.
  29948. NullFields []string `json:"-"`
  29949. }
  29950. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  29951. type NoMethod TargetPoolListWarningData
  29952. raw := NoMethod(*s)
  29953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29954. }
  29955. type TargetPoolsAddHealthCheckRequest struct {
  29956. // HealthChecks: The HttpHealthCheck to add to the target pool.
  29957. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  29958. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  29959. // unconditionally include in API requests. By default, fields with
  29960. // empty values are omitted from API requests. However, any non-pointer,
  29961. // non-interface field appearing in ForceSendFields will be sent to the
  29962. // server regardless of whether the field is empty or not. This may be
  29963. // used to include empty fields in Patch requests.
  29964. ForceSendFields []string `json:"-"`
  29965. // NullFields is a list of field names (e.g. "HealthChecks") to include
  29966. // in API requests with the JSON null value. By default, fields with
  29967. // empty values are omitted from API requests. However, any field with
  29968. // an empty value appearing in NullFields will be sent to the server as
  29969. // null. It is an error if a field in this list has a non-empty value.
  29970. // This may be used to include null fields in Patch requests.
  29971. NullFields []string `json:"-"`
  29972. }
  29973. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  29974. type NoMethod TargetPoolsAddHealthCheckRequest
  29975. raw := NoMethod(*s)
  29976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29977. }
  29978. type TargetPoolsAddInstanceRequest struct {
  29979. // Instances: A full or partial URL to an instance to add to this target
  29980. // pool. This can be a full or partial URL. For example, the following
  29981. // are valid URLs:
  29982. // -
  29983. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  29984. // - projects/project-id/zones/zone/instances/instance-name
  29985. // - zones/zone/instances/instance-name
  29986. Instances []*InstanceReference `json:"instances,omitempty"`
  29987. // ForceSendFields is a list of field names (e.g. "Instances") to
  29988. // unconditionally include in API requests. By default, fields with
  29989. // empty values are omitted from API requests. However, any non-pointer,
  29990. // non-interface field appearing in ForceSendFields will be sent to the
  29991. // server regardless of whether the field is empty or not. This may be
  29992. // used to include empty fields in Patch requests.
  29993. ForceSendFields []string `json:"-"`
  29994. // NullFields is a list of field names (e.g. "Instances") to include in
  29995. // API requests with the JSON null value. By default, fields with empty
  29996. // values are omitted from API requests. However, any field with an
  29997. // empty value appearing in NullFields will be sent to the server as
  29998. // null. It is an error if a field in this list has a non-empty value.
  29999. // This may be used to include null fields in Patch requests.
  30000. NullFields []string `json:"-"`
  30001. }
  30002. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  30003. type NoMethod TargetPoolsAddInstanceRequest
  30004. raw := NoMethod(*s)
  30005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30006. }
  30007. type TargetPoolsRemoveHealthCheckRequest struct {
  30008. // HealthChecks: Health check URL to be removed. This can be a full or
  30009. // valid partial URL. For example, the following are valid URLs:
  30010. // -
  30011. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  30012. // - projects/project/global/httpHealthChecks/health-check
  30013. // - global/httpHealthChecks/health-check
  30014. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  30015. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  30016. // unconditionally include in API requests. By default, fields with
  30017. // empty values are omitted from API requests. However, any non-pointer,
  30018. // non-interface field appearing in ForceSendFields will be sent to the
  30019. // server regardless of whether the field is empty or not. This may be
  30020. // used to include empty fields in Patch requests.
  30021. ForceSendFields []string `json:"-"`
  30022. // NullFields is a list of field names (e.g. "HealthChecks") to include
  30023. // in API requests with the JSON null value. By default, fields with
  30024. // empty values are omitted from API requests. However, any field with
  30025. // an empty value appearing in NullFields will be sent to the server as
  30026. // null. It is an error if a field in this list has a non-empty value.
  30027. // This may be used to include null fields in Patch requests.
  30028. NullFields []string `json:"-"`
  30029. }
  30030. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  30031. type NoMethod TargetPoolsRemoveHealthCheckRequest
  30032. raw := NoMethod(*s)
  30033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30034. }
  30035. type TargetPoolsRemoveInstanceRequest struct {
  30036. // Instances: URLs of the instances to be removed from target pool.
  30037. Instances []*InstanceReference `json:"instances,omitempty"`
  30038. // ForceSendFields is a list of field names (e.g. "Instances") to
  30039. // unconditionally include in API requests. By default, fields with
  30040. // empty values are omitted from API requests. However, any non-pointer,
  30041. // non-interface field appearing in ForceSendFields will be sent to the
  30042. // server regardless of whether the field is empty or not. This may be
  30043. // used to include empty fields in Patch requests.
  30044. ForceSendFields []string `json:"-"`
  30045. // NullFields is a list of field names (e.g. "Instances") to include in
  30046. // API requests with the JSON null value. By default, fields with empty
  30047. // values are omitted from API requests. However, any field with an
  30048. // empty value appearing in NullFields will be sent to the server as
  30049. // null. It is an error if a field in this list has a non-empty value.
  30050. // This may be used to include null fields in Patch requests.
  30051. NullFields []string `json:"-"`
  30052. }
  30053. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  30054. type NoMethod TargetPoolsRemoveInstanceRequest
  30055. raw := NoMethod(*s)
  30056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30057. }
  30058. type TargetPoolsScopedList struct {
  30059. // TargetPools: A list of target pools contained in this scope.
  30060. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  30061. // Warning: Informational warning which replaces the list of addresses
  30062. // when the list is empty.
  30063. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  30064. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  30065. // unconditionally include in API requests. By default, fields with
  30066. // empty values are omitted from API requests. However, any non-pointer,
  30067. // non-interface field appearing in ForceSendFields will be sent to the
  30068. // server regardless of whether the field is empty or not. This may be
  30069. // used to include empty fields in Patch requests.
  30070. ForceSendFields []string `json:"-"`
  30071. // NullFields is a list of field names (e.g. "TargetPools") to include
  30072. // in API requests with the JSON null value. By default, fields with
  30073. // empty values are omitted from API requests. However, any field with
  30074. // an empty value appearing in NullFields will be sent to the server as
  30075. // null. It is an error if a field in this list has a non-empty value.
  30076. // This may be used to include null fields in Patch requests.
  30077. NullFields []string `json:"-"`
  30078. }
  30079. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  30080. type NoMethod TargetPoolsScopedList
  30081. raw := NoMethod(*s)
  30082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30083. }
  30084. // TargetPoolsScopedListWarning: Informational warning which replaces
  30085. // the list of addresses when the list is empty.
  30086. type TargetPoolsScopedListWarning struct {
  30087. // Code: [Output Only] A warning code, if applicable. For example,
  30088. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30089. // the response.
  30090. //
  30091. // Possible values:
  30092. // "CLEANUP_FAILED"
  30093. // "DEPRECATED_RESOURCE_USED"
  30094. // "DEPRECATED_TYPE_USED"
  30095. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30096. // "EXPERIMENTAL_TYPE_USED"
  30097. // "EXTERNAL_API_WARNING"
  30098. // "FIELD_VALUE_OVERRIDEN"
  30099. // "INJECTED_KERNELS_DEPRECATED"
  30100. // "MISSING_TYPE_DEPENDENCY"
  30101. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30102. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30103. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30104. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30105. // "NEXT_HOP_NOT_RUNNING"
  30106. // "NOT_CRITICAL_ERROR"
  30107. // "NO_RESULTS_ON_PAGE"
  30108. // "REQUIRED_TOS_AGREEMENT"
  30109. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30110. // "RESOURCE_NOT_DELETED"
  30111. // "SCHEMA_VALIDATION_IGNORED"
  30112. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30113. // "UNDECLARED_PROPERTIES"
  30114. // "UNREACHABLE"
  30115. Code string `json:"code,omitempty"`
  30116. // Data: [Output Only] Metadata about this warning in key: value format.
  30117. // For example:
  30118. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30119. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  30120. // Message: [Output Only] A human-readable description of the warning
  30121. // code.
  30122. Message string `json:"message,omitempty"`
  30123. // ForceSendFields is a list of field names (e.g. "Code") to
  30124. // unconditionally include in API requests. By default, fields with
  30125. // empty values are omitted from API requests. However, any non-pointer,
  30126. // non-interface field appearing in ForceSendFields will be sent to the
  30127. // server regardless of whether the field is empty or not. This may be
  30128. // used to include empty fields in Patch requests.
  30129. ForceSendFields []string `json:"-"`
  30130. // NullFields is a list of field names (e.g. "Code") to include in API
  30131. // requests with the JSON null value. By default, fields with empty
  30132. // values are omitted from API requests. However, any field with an
  30133. // empty value appearing in NullFields will be sent to the server as
  30134. // null. It is an error if a field in this list has a non-empty value.
  30135. // This may be used to include null fields in Patch requests.
  30136. NullFields []string `json:"-"`
  30137. }
  30138. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  30139. type NoMethod TargetPoolsScopedListWarning
  30140. raw := NoMethod(*s)
  30141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30142. }
  30143. type TargetPoolsScopedListWarningData struct {
  30144. // Key: [Output Only] A key that provides more detail on the warning
  30145. // being returned. For example, for warnings where there are no results
  30146. // in a list request for a particular zone, this key might be scope and
  30147. // the key value might be the zone name. Other examples might be a key
  30148. // indicating a deprecated resource and a suggested replacement, or a
  30149. // warning about invalid network settings (for example, if an instance
  30150. // attempts to perform IP forwarding but is not enabled for IP
  30151. // forwarding).
  30152. Key string `json:"key,omitempty"`
  30153. // Value: [Output Only] A warning data value corresponding to the key.
  30154. Value string `json:"value,omitempty"`
  30155. // ForceSendFields is a list of field names (e.g. "Key") to
  30156. // unconditionally include in API requests. By default, fields with
  30157. // empty values are omitted from API requests. However, any non-pointer,
  30158. // non-interface field appearing in ForceSendFields will be sent to the
  30159. // server regardless of whether the field is empty or not. This may be
  30160. // used to include empty fields in Patch requests.
  30161. ForceSendFields []string `json:"-"`
  30162. // NullFields is a list of field names (e.g. "Key") to include in API
  30163. // requests with the JSON null value. By default, fields with empty
  30164. // values are omitted from API requests. However, any field with an
  30165. // empty value appearing in NullFields will be sent to the server as
  30166. // null. It is an error if a field in this list has a non-empty value.
  30167. // This may be used to include null fields in Patch requests.
  30168. NullFields []string `json:"-"`
  30169. }
  30170. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  30171. type NoMethod TargetPoolsScopedListWarningData
  30172. raw := NoMethod(*s)
  30173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30174. }
  30175. type TargetReference struct {
  30176. Target string `json:"target,omitempty"`
  30177. // ForceSendFields is a list of field names (e.g. "Target") to
  30178. // unconditionally include in API requests. By default, fields with
  30179. // empty values are omitted from API requests. However, any non-pointer,
  30180. // non-interface field appearing in ForceSendFields will be sent to the
  30181. // server regardless of whether the field is empty or not. This may be
  30182. // used to include empty fields in Patch requests.
  30183. ForceSendFields []string `json:"-"`
  30184. // NullFields is a list of field names (e.g. "Target") to include in API
  30185. // requests with the JSON null value. By default, fields with empty
  30186. // values are omitted from API requests. However, any field with an
  30187. // empty value appearing in NullFields will be sent to the server as
  30188. // null. It is an error if a field in this list has a non-empty value.
  30189. // This may be used to include null fields in Patch requests.
  30190. NullFields []string `json:"-"`
  30191. }
  30192. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  30193. type NoMethod TargetReference
  30194. raw := NoMethod(*s)
  30195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30196. }
  30197. type TargetSslProxiesSetBackendServiceRequest struct {
  30198. // Service: The URL of the new BackendService resource for the
  30199. // targetSslProxy.
  30200. Service string `json:"service,omitempty"`
  30201. // ForceSendFields is a list of field names (e.g. "Service") to
  30202. // unconditionally include in API requests. By default, fields with
  30203. // empty values are omitted from API requests. However, any non-pointer,
  30204. // non-interface field appearing in ForceSendFields will be sent to the
  30205. // server regardless of whether the field is empty or not. This may be
  30206. // used to include empty fields in Patch requests.
  30207. ForceSendFields []string `json:"-"`
  30208. // NullFields is a list of field names (e.g. "Service") to include in
  30209. // API requests with the JSON null value. By default, fields with empty
  30210. // values are omitted from API requests. However, any field with an
  30211. // empty value appearing in NullFields will be sent to the server as
  30212. // null. It is an error if a field in this list has a non-empty value.
  30213. // This may be used to include null fields in Patch requests.
  30214. NullFields []string `json:"-"`
  30215. }
  30216. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  30217. type NoMethod TargetSslProxiesSetBackendServiceRequest
  30218. raw := NoMethod(*s)
  30219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30220. }
  30221. type TargetSslProxiesSetProxyHeaderRequest struct {
  30222. // ProxyHeader: The new type of proxy header to append before sending
  30223. // data to the backend. NONE or PROXY_V1 are allowed.
  30224. //
  30225. // Possible values:
  30226. // "NONE"
  30227. // "PROXY_V1"
  30228. ProxyHeader string `json:"proxyHeader,omitempty"`
  30229. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  30230. // unconditionally include in API requests. By default, fields with
  30231. // empty values are omitted from API requests. However, any non-pointer,
  30232. // non-interface field appearing in ForceSendFields will be sent to the
  30233. // server regardless of whether the field is empty or not. This may be
  30234. // used to include empty fields in Patch requests.
  30235. ForceSendFields []string `json:"-"`
  30236. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  30237. // in API requests with the JSON null value. By default, fields with
  30238. // empty values are omitted from API requests. However, any field with
  30239. // an empty value appearing in NullFields will be sent to the server as
  30240. // null. It is an error if a field in this list has a non-empty value.
  30241. // This may be used to include null fields in Patch requests.
  30242. NullFields []string `json:"-"`
  30243. }
  30244. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  30245. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  30246. raw := NoMethod(*s)
  30247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30248. }
  30249. type TargetSslProxiesSetSslCertificatesRequest struct {
  30250. // SslCertificates: New set of URLs to SslCertificate resources to
  30251. // associate with this TargetSslProxy. Currently exactly one ssl
  30252. // certificate must be specified.
  30253. SslCertificates []string `json:"sslCertificates,omitempty"`
  30254. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  30255. // unconditionally include in API requests. By default, fields with
  30256. // empty values are omitted from API requests. However, any non-pointer,
  30257. // non-interface field appearing in ForceSendFields will be sent to the
  30258. // server regardless of whether the field is empty or not. This may be
  30259. // used to include empty fields in Patch requests.
  30260. ForceSendFields []string `json:"-"`
  30261. // NullFields is a list of field names (e.g. "SslCertificates") to
  30262. // include in API requests with the JSON null value. By default, fields
  30263. // with empty values are omitted from API requests. However, any field
  30264. // with an empty value appearing in NullFields will be sent to the
  30265. // server as null. It is an error if a field in this list has a
  30266. // non-empty value. This may be used to include null fields in Patch
  30267. // requests.
  30268. NullFields []string `json:"-"`
  30269. }
  30270. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  30271. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  30272. raw := NoMethod(*s)
  30273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30274. }
  30275. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  30276. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  30277. // resource_for v1.targetSslProxies ==)
  30278. type TargetSslProxy struct {
  30279. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30280. // format.
  30281. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30282. // Description: An optional description of this resource. Provide this
  30283. // property when you create the resource.
  30284. Description string `json:"description,omitempty"`
  30285. // Id: [Output Only] The unique identifier for the resource. This
  30286. // identifier is defined by the server.
  30287. Id uint64 `json:"id,omitempty,string"`
  30288. // Kind: [Output Only] Type of the resource. Always
  30289. // compute#targetSslProxy for target SSL proxies.
  30290. Kind string `json:"kind,omitempty"`
  30291. // Name: Name of the resource. Provided by the client when the resource
  30292. // is created. The name must be 1-63 characters long, and comply with
  30293. // RFC1035. Specifically, the name must be 1-63 characters long and
  30294. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  30295. // the first character must be a lowercase letter, and all following
  30296. // characters must be a dash, lowercase letter, or digit, except the
  30297. // last character, which cannot be a dash.
  30298. Name string `json:"name,omitempty"`
  30299. // ProxyHeader: Specifies the type of proxy header to append before
  30300. // sending data to the backend, either NONE or PROXY_V1. The default is
  30301. // NONE.
  30302. //
  30303. // Possible values:
  30304. // "NONE"
  30305. // "PROXY_V1"
  30306. ProxyHeader string `json:"proxyHeader,omitempty"`
  30307. // SelfLink: [Output Only] Server-defined URL for the resource.
  30308. SelfLink string `json:"selfLink,omitempty"`
  30309. // Service: URL to the BackendService resource.
  30310. Service string `json:"service,omitempty"`
  30311. // SslCertificates: URLs to SslCertificate resources that are used to
  30312. // authenticate connections to Backends. At least one SSL certificate
  30313. // must be specified. Currently, you may specify up to 15 SSL
  30314. // certificates.
  30315. SslCertificates []string `json:"sslCertificates,omitempty"`
  30316. // SslPolicy: URL of SslPolicy resource that will be associated with the
  30317. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  30318. // not have any SSL policy configured.
  30319. SslPolicy string `json:"sslPolicy,omitempty"`
  30320. // ServerResponse contains the HTTP response code and headers from the
  30321. // server.
  30322. googleapi.ServerResponse `json:"-"`
  30323. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30324. // to unconditionally include in API requests. By default, fields with
  30325. // empty values are omitted from API requests. However, any non-pointer,
  30326. // non-interface field appearing in ForceSendFields will be sent to the
  30327. // server regardless of whether the field is empty or not. This may be
  30328. // used to include empty fields in Patch requests.
  30329. ForceSendFields []string `json:"-"`
  30330. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30331. // include in API requests with the JSON null value. By default, fields
  30332. // with empty values are omitted from API requests. However, any field
  30333. // with an empty value appearing in NullFields will be sent to the
  30334. // server as null. It is an error if a field in this list has a
  30335. // non-empty value. This may be used to include null fields in Patch
  30336. // requests.
  30337. NullFields []string `json:"-"`
  30338. }
  30339. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  30340. type NoMethod TargetSslProxy
  30341. raw := NoMethod(*s)
  30342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30343. }
  30344. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  30345. type TargetSslProxyList struct {
  30346. // Id: [Output Only] Unique identifier for the resource; defined by the
  30347. // server.
  30348. Id string `json:"id,omitempty"`
  30349. // Items: A list of TargetSslProxy resources.
  30350. Items []*TargetSslProxy `json:"items,omitempty"`
  30351. // Kind: Type of resource.
  30352. Kind string `json:"kind,omitempty"`
  30353. // NextPageToken: [Output Only] This token allows you to get the next
  30354. // page of results for list requests. If the number of results is larger
  30355. // than maxResults, use the nextPageToken as a value for the query
  30356. // parameter pageToken in the next list request. Subsequent list
  30357. // requests will have their own nextPageToken to continue paging through
  30358. // the results.
  30359. NextPageToken string `json:"nextPageToken,omitempty"`
  30360. // SelfLink: [Output Only] Server-defined URL for this resource.
  30361. SelfLink string `json:"selfLink,omitempty"`
  30362. // Warning: [Output Only] Informational warning message.
  30363. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  30364. // ServerResponse contains the HTTP response code and headers from the
  30365. // server.
  30366. googleapi.ServerResponse `json:"-"`
  30367. // ForceSendFields is a list of field names (e.g. "Id") to
  30368. // unconditionally include in API requests. By default, fields with
  30369. // empty values are omitted from API requests. However, any non-pointer,
  30370. // non-interface field appearing in ForceSendFields will be sent to the
  30371. // server regardless of whether the field is empty or not. This may be
  30372. // used to include empty fields in Patch requests.
  30373. ForceSendFields []string `json:"-"`
  30374. // NullFields is a list of field names (e.g. "Id") to include in API
  30375. // requests with the JSON null value. By default, fields with empty
  30376. // values are omitted from API requests. However, any field with an
  30377. // empty value appearing in NullFields will be sent to the server as
  30378. // null. It is an error if a field in this list has a non-empty value.
  30379. // This may be used to include null fields in Patch requests.
  30380. NullFields []string `json:"-"`
  30381. }
  30382. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  30383. type NoMethod TargetSslProxyList
  30384. raw := NoMethod(*s)
  30385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30386. }
  30387. // TargetSslProxyListWarning: [Output Only] Informational warning
  30388. // message.
  30389. type TargetSslProxyListWarning struct {
  30390. // Code: [Output Only] A warning code, if applicable. For example,
  30391. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30392. // the response.
  30393. //
  30394. // Possible values:
  30395. // "CLEANUP_FAILED"
  30396. // "DEPRECATED_RESOURCE_USED"
  30397. // "DEPRECATED_TYPE_USED"
  30398. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30399. // "EXPERIMENTAL_TYPE_USED"
  30400. // "EXTERNAL_API_WARNING"
  30401. // "FIELD_VALUE_OVERRIDEN"
  30402. // "INJECTED_KERNELS_DEPRECATED"
  30403. // "MISSING_TYPE_DEPENDENCY"
  30404. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30405. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30406. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30407. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30408. // "NEXT_HOP_NOT_RUNNING"
  30409. // "NOT_CRITICAL_ERROR"
  30410. // "NO_RESULTS_ON_PAGE"
  30411. // "REQUIRED_TOS_AGREEMENT"
  30412. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30413. // "RESOURCE_NOT_DELETED"
  30414. // "SCHEMA_VALIDATION_IGNORED"
  30415. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30416. // "UNDECLARED_PROPERTIES"
  30417. // "UNREACHABLE"
  30418. Code string `json:"code,omitempty"`
  30419. // Data: [Output Only] Metadata about this warning in key: value format.
  30420. // For example:
  30421. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30422. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  30423. // Message: [Output Only] A human-readable description of the warning
  30424. // code.
  30425. Message string `json:"message,omitempty"`
  30426. // ForceSendFields is a list of field names (e.g. "Code") to
  30427. // unconditionally include in API requests. By default, fields with
  30428. // empty values are omitted from API requests. However, any non-pointer,
  30429. // non-interface field appearing in ForceSendFields will be sent to the
  30430. // server regardless of whether the field is empty or not. This may be
  30431. // used to include empty fields in Patch requests.
  30432. ForceSendFields []string `json:"-"`
  30433. // NullFields is a list of field names (e.g. "Code") to include in API
  30434. // requests with the JSON null value. By default, fields with empty
  30435. // values are omitted from API requests. However, any field with an
  30436. // empty value appearing in NullFields will be sent to the server as
  30437. // null. It is an error if a field in this list has a non-empty value.
  30438. // This may be used to include null fields in Patch requests.
  30439. NullFields []string `json:"-"`
  30440. }
  30441. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  30442. type NoMethod TargetSslProxyListWarning
  30443. raw := NoMethod(*s)
  30444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30445. }
  30446. type TargetSslProxyListWarningData struct {
  30447. // Key: [Output Only] A key that provides more detail on the warning
  30448. // being returned. For example, for warnings where there are no results
  30449. // in a list request for a particular zone, this key might be scope and
  30450. // the key value might be the zone name. Other examples might be a key
  30451. // indicating a deprecated resource and a suggested replacement, or a
  30452. // warning about invalid network settings (for example, if an instance
  30453. // attempts to perform IP forwarding but is not enabled for IP
  30454. // forwarding).
  30455. Key string `json:"key,omitempty"`
  30456. // Value: [Output Only] A warning data value corresponding to the key.
  30457. Value string `json:"value,omitempty"`
  30458. // ForceSendFields is a list of field names (e.g. "Key") to
  30459. // unconditionally include in API requests. By default, fields with
  30460. // empty values are omitted from API requests. However, any non-pointer,
  30461. // non-interface field appearing in ForceSendFields will be sent to the
  30462. // server regardless of whether the field is empty or not. This may be
  30463. // used to include empty fields in Patch requests.
  30464. ForceSendFields []string `json:"-"`
  30465. // NullFields is a list of field names (e.g. "Key") to include in API
  30466. // requests with the JSON null value. By default, fields with empty
  30467. // values are omitted from API requests. However, any field with an
  30468. // empty value appearing in NullFields will be sent to the server as
  30469. // null. It is an error if a field in this list has a non-empty value.
  30470. // This may be used to include null fields in Patch requests.
  30471. NullFields []string `json:"-"`
  30472. }
  30473. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  30474. type NoMethod TargetSslProxyListWarningData
  30475. raw := NoMethod(*s)
  30476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30477. }
  30478. type TargetTcpProxiesSetBackendServiceRequest struct {
  30479. // Service: The URL of the new BackendService resource for the
  30480. // targetTcpProxy.
  30481. Service string `json:"service,omitempty"`
  30482. // ForceSendFields is a list of field names (e.g. "Service") to
  30483. // unconditionally include in API requests. By default, fields with
  30484. // empty values are omitted from API requests. However, any non-pointer,
  30485. // non-interface field appearing in ForceSendFields will be sent to the
  30486. // server regardless of whether the field is empty or not. This may be
  30487. // used to include empty fields in Patch requests.
  30488. ForceSendFields []string `json:"-"`
  30489. // NullFields is a list of field names (e.g. "Service") to include in
  30490. // API requests with the JSON null value. By default, fields with empty
  30491. // values are omitted from API requests. However, any field with an
  30492. // empty value appearing in NullFields will be sent to the server as
  30493. // null. It is an error if a field in this list has a non-empty value.
  30494. // This may be used to include null fields in Patch requests.
  30495. NullFields []string `json:"-"`
  30496. }
  30497. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  30498. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  30499. raw := NoMethod(*s)
  30500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30501. }
  30502. type TargetTcpProxiesSetProxyHeaderRequest struct {
  30503. // ProxyHeader: The new type of proxy header to append before sending
  30504. // data to the backend. NONE or PROXY_V1 are allowed.
  30505. //
  30506. // Possible values:
  30507. // "NONE"
  30508. // "PROXY_V1"
  30509. ProxyHeader string `json:"proxyHeader,omitempty"`
  30510. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  30511. // unconditionally include in API requests. By default, fields with
  30512. // empty values are omitted from API requests. However, any non-pointer,
  30513. // non-interface field appearing in ForceSendFields will be sent to the
  30514. // server regardless of whether the field is empty or not. This may be
  30515. // used to include empty fields in Patch requests.
  30516. ForceSendFields []string `json:"-"`
  30517. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  30518. // in API requests with the JSON null value. By default, fields with
  30519. // empty values are omitted from API requests. However, any field with
  30520. // an empty value appearing in NullFields will be sent to the server as
  30521. // null. It is an error if a field in this list has a non-empty value.
  30522. // This may be used to include null fields in Patch requests.
  30523. NullFields []string `json:"-"`
  30524. }
  30525. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  30526. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  30527. raw := NoMethod(*s)
  30528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30529. }
  30530. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  30531. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  30532. // resource_for v1.targetTcpProxies ==)
  30533. type TargetTcpProxy struct {
  30534. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30535. // format.
  30536. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30537. // Description: An optional description of this resource. Provide this
  30538. // property when you create the resource.
  30539. Description string `json:"description,omitempty"`
  30540. // Id: [Output Only] The unique identifier for the resource. This
  30541. // identifier is defined by the server.
  30542. Id uint64 `json:"id,omitempty,string"`
  30543. // Kind: [Output Only] Type of the resource. Always
  30544. // compute#targetTcpProxy for target TCP proxies.
  30545. Kind string `json:"kind,omitempty"`
  30546. // Name: Name of the resource. Provided by the client when the resource
  30547. // is created. The name must be 1-63 characters long, and comply with
  30548. // RFC1035. Specifically, the name must be 1-63 characters long and
  30549. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  30550. // the first character must be a lowercase letter, and all following
  30551. // characters must be a dash, lowercase letter, or digit, except the
  30552. // last character, which cannot be a dash.
  30553. Name string `json:"name,omitempty"`
  30554. // ProxyHeader: Specifies the type of proxy header to append before
  30555. // sending data to the backend, either NONE or PROXY_V1. The default is
  30556. // NONE.
  30557. //
  30558. // Possible values:
  30559. // "NONE"
  30560. // "PROXY_V1"
  30561. ProxyHeader string `json:"proxyHeader,omitempty"`
  30562. // SelfLink: [Output Only] Server-defined URL for the resource.
  30563. SelfLink string `json:"selfLink,omitempty"`
  30564. // Service: URL to the BackendService resource.
  30565. Service string `json:"service,omitempty"`
  30566. // ServerResponse contains the HTTP response code and headers from the
  30567. // server.
  30568. googleapi.ServerResponse `json:"-"`
  30569. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30570. // to unconditionally include in API requests. By default, fields with
  30571. // empty values are omitted from API requests. However, any non-pointer,
  30572. // non-interface field appearing in ForceSendFields will be sent to the
  30573. // server regardless of whether the field is empty or not. This may be
  30574. // used to include empty fields in Patch requests.
  30575. ForceSendFields []string `json:"-"`
  30576. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30577. // include in API requests with the JSON null value. By default, fields
  30578. // with empty values are omitted from API requests. However, any field
  30579. // with an empty value appearing in NullFields will be sent to the
  30580. // server as null. It is an error if a field in this list has a
  30581. // non-empty value. This may be used to include null fields in Patch
  30582. // requests.
  30583. NullFields []string `json:"-"`
  30584. }
  30585. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  30586. type NoMethod TargetTcpProxy
  30587. raw := NoMethod(*s)
  30588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30589. }
  30590. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  30591. type TargetTcpProxyList struct {
  30592. // Id: [Output Only] Unique identifier for the resource; defined by the
  30593. // server.
  30594. Id string `json:"id,omitempty"`
  30595. // Items: A list of TargetTcpProxy resources.
  30596. Items []*TargetTcpProxy `json:"items,omitempty"`
  30597. // Kind: Type of resource.
  30598. Kind string `json:"kind,omitempty"`
  30599. // NextPageToken: [Output Only] This token allows you to get the next
  30600. // page of results for list requests. If the number of results is larger
  30601. // than maxResults, use the nextPageToken as a value for the query
  30602. // parameter pageToken in the next list request. Subsequent list
  30603. // requests will have their own nextPageToken to continue paging through
  30604. // the results.
  30605. NextPageToken string `json:"nextPageToken,omitempty"`
  30606. // SelfLink: [Output Only] Server-defined URL for this resource.
  30607. SelfLink string `json:"selfLink,omitempty"`
  30608. // Warning: [Output Only] Informational warning message.
  30609. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  30610. // ServerResponse contains the HTTP response code and headers from the
  30611. // server.
  30612. googleapi.ServerResponse `json:"-"`
  30613. // ForceSendFields is a list of field names (e.g. "Id") to
  30614. // unconditionally include in API requests. By default, fields with
  30615. // empty values are omitted from API requests. However, any non-pointer,
  30616. // non-interface field appearing in ForceSendFields will be sent to the
  30617. // server regardless of whether the field is empty or not. This may be
  30618. // used to include empty fields in Patch requests.
  30619. ForceSendFields []string `json:"-"`
  30620. // NullFields is a list of field names (e.g. "Id") to include in API
  30621. // requests with the JSON null value. By default, fields with empty
  30622. // values are omitted from API requests. However, any field with an
  30623. // empty value appearing in NullFields will be sent to the server as
  30624. // null. It is an error if a field in this list has a non-empty value.
  30625. // This may be used to include null fields in Patch requests.
  30626. NullFields []string `json:"-"`
  30627. }
  30628. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  30629. type NoMethod TargetTcpProxyList
  30630. raw := NoMethod(*s)
  30631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30632. }
  30633. // TargetTcpProxyListWarning: [Output Only] Informational warning
  30634. // message.
  30635. type TargetTcpProxyListWarning struct {
  30636. // Code: [Output Only] A warning code, if applicable. For example,
  30637. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30638. // the response.
  30639. //
  30640. // Possible values:
  30641. // "CLEANUP_FAILED"
  30642. // "DEPRECATED_RESOURCE_USED"
  30643. // "DEPRECATED_TYPE_USED"
  30644. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30645. // "EXPERIMENTAL_TYPE_USED"
  30646. // "EXTERNAL_API_WARNING"
  30647. // "FIELD_VALUE_OVERRIDEN"
  30648. // "INJECTED_KERNELS_DEPRECATED"
  30649. // "MISSING_TYPE_DEPENDENCY"
  30650. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30651. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30652. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30653. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30654. // "NEXT_HOP_NOT_RUNNING"
  30655. // "NOT_CRITICAL_ERROR"
  30656. // "NO_RESULTS_ON_PAGE"
  30657. // "REQUIRED_TOS_AGREEMENT"
  30658. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30659. // "RESOURCE_NOT_DELETED"
  30660. // "SCHEMA_VALIDATION_IGNORED"
  30661. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30662. // "UNDECLARED_PROPERTIES"
  30663. // "UNREACHABLE"
  30664. Code string `json:"code,omitempty"`
  30665. // Data: [Output Only] Metadata about this warning in key: value format.
  30666. // For example:
  30667. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30668. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  30669. // Message: [Output Only] A human-readable description of the warning
  30670. // code.
  30671. Message string `json:"message,omitempty"`
  30672. // ForceSendFields is a list of field names (e.g. "Code") to
  30673. // unconditionally include in API requests. By default, fields with
  30674. // empty values are omitted from API requests. However, any non-pointer,
  30675. // non-interface field appearing in ForceSendFields will be sent to the
  30676. // server regardless of whether the field is empty or not. This may be
  30677. // used to include empty fields in Patch requests.
  30678. ForceSendFields []string `json:"-"`
  30679. // NullFields is a list of field names (e.g. "Code") to include in API
  30680. // requests with the JSON null value. By default, fields with empty
  30681. // values are omitted from API requests. However, any field with an
  30682. // empty value appearing in NullFields will be sent to the server as
  30683. // null. It is an error if a field in this list has a non-empty value.
  30684. // This may be used to include null fields in Patch requests.
  30685. NullFields []string `json:"-"`
  30686. }
  30687. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  30688. type NoMethod TargetTcpProxyListWarning
  30689. raw := NoMethod(*s)
  30690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30691. }
  30692. type TargetTcpProxyListWarningData struct {
  30693. // Key: [Output Only] A key that provides more detail on the warning
  30694. // being returned. For example, for warnings where there are no results
  30695. // in a list request for a particular zone, this key might be scope and
  30696. // the key value might be the zone name. Other examples might be a key
  30697. // indicating a deprecated resource and a suggested replacement, or a
  30698. // warning about invalid network settings (for example, if an instance
  30699. // attempts to perform IP forwarding but is not enabled for IP
  30700. // forwarding).
  30701. Key string `json:"key,omitempty"`
  30702. // Value: [Output Only] A warning data value corresponding to the key.
  30703. Value string `json:"value,omitempty"`
  30704. // ForceSendFields is a list of field names (e.g. "Key") to
  30705. // unconditionally include in API requests. By default, fields with
  30706. // empty values are omitted from API requests. However, any non-pointer,
  30707. // non-interface field appearing in ForceSendFields will be sent to the
  30708. // server regardless of whether the field is empty or not. This may be
  30709. // used to include empty fields in Patch requests.
  30710. ForceSendFields []string `json:"-"`
  30711. // NullFields is a list of field names (e.g. "Key") to include in API
  30712. // requests with the JSON null value. By default, fields with empty
  30713. // values are omitted from API requests. However, any field with an
  30714. // empty value appearing in NullFields will be sent to the server as
  30715. // null. It is an error if a field in this list has a non-empty value.
  30716. // This may be used to include null fields in Patch requests.
  30717. NullFields []string `json:"-"`
  30718. }
  30719. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  30720. type NoMethod TargetTcpProxyListWarningData
  30721. raw := NoMethod(*s)
  30722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30723. }
  30724. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  30725. // resource_for beta.targetVpnGateways ==) (== resource_for
  30726. // v1.targetVpnGateways ==)
  30727. type TargetVpnGateway struct {
  30728. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30729. // format.
  30730. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30731. // Description: An optional description of this resource. Provide this
  30732. // property when you create the resource.
  30733. Description string `json:"description,omitempty"`
  30734. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  30735. // resources. ForwardingRules are created using
  30736. // compute.forwardingRules.insert and associated to a VPN gateway.
  30737. ForwardingRules []string `json:"forwardingRules,omitempty"`
  30738. // Id: [Output Only] The unique identifier for the resource. This
  30739. // identifier is defined by the server.
  30740. Id uint64 `json:"id,omitempty,string"`
  30741. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  30742. // for target VPN gateways.
  30743. Kind string `json:"kind,omitempty"`
  30744. // LabelFingerprint: A fingerprint for the labels being applied to this
  30745. // TargetVpnGateway, which is essentially a hash of the labels set used
  30746. // for optimistic locking. The fingerprint is initially generated by
  30747. // Compute Engine and changes after every request to modify or update
  30748. // labels. You must always provide an up-to-date fingerprint hash in
  30749. // order to update or change labels, otherwise the request will fail
  30750. // with error 412 conditionNotMet.
  30751. //
  30752. // To see the latest fingerprint, make a get() request to retrieve a
  30753. // TargetVpnGateway.
  30754. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  30755. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  30756. // be later modified by the setLabels method. Each label key/value must
  30757. // comply with RFC1035. Label values may be empty.
  30758. Labels map[string]string `json:"labels,omitempty"`
  30759. // Name: Name of the resource. Provided by the client when the resource
  30760. // is created. The name must be 1-63 characters long, and comply with
  30761. // RFC1035. Specifically, the name must be 1-63 characters long and
  30762. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  30763. // the first character must be a lowercase letter, and all following
  30764. // characters must be a dash, lowercase letter, or digit, except the
  30765. // last character, which cannot be a dash.
  30766. Name string `json:"name,omitempty"`
  30767. // Network: URL of the network to which this VPN gateway is attached.
  30768. // Provided by the client when the VPN gateway is created.
  30769. Network string `json:"network,omitempty"`
  30770. // Region: [Output Only] URL of the region where the target VPN gateway
  30771. // resides. You must specify this field as part of the HTTP request URL.
  30772. // It is not settable as a field in the request body.
  30773. Region string `json:"region,omitempty"`
  30774. // SelfLink: [Output Only] Server-defined URL for the resource.
  30775. SelfLink string `json:"selfLink,omitempty"`
  30776. // Status: [Output Only] The status of the VPN gateway.
  30777. //
  30778. // Possible values:
  30779. // "CREATING"
  30780. // "DELETING"
  30781. // "FAILED"
  30782. // "READY"
  30783. Status string `json:"status,omitempty"`
  30784. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  30785. // VpnTunnels are created using compute.vpntunnels.insert method and
  30786. // associated to a VPN gateway.
  30787. Tunnels []string `json:"tunnels,omitempty"`
  30788. // ServerResponse contains the HTTP response code and headers from the
  30789. // server.
  30790. googleapi.ServerResponse `json:"-"`
  30791. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30792. // to unconditionally include in API requests. By default, fields with
  30793. // empty values are omitted from API requests. However, any non-pointer,
  30794. // non-interface field appearing in ForceSendFields will be sent to the
  30795. // server regardless of whether the field is empty or not. This may be
  30796. // used to include empty fields in Patch requests.
  30797. ForceSendFields []string `json:"-"`
  30798. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30799. // include in API requests with the JSON null value. By default, fields
  30800. // with empty values are omitted from API requests. However, any field
  30801. // with an empty value appearing in NullFields will be sent to the
  30802. // server as null. It is an error if a field in this list has a
  30803. // non-empty value. This may be used to include null fields in Patch
  30804. // requests.
  30805. NullFields []string `json:"-"`
  30806. }
  30807. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  30808. type NoMethod TargetVpnGateway
  30809. raw := NoMethod(*s)
  30810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30811. }
  30812. type TargetVpnGatewayAggregatedList struct {
  30813. // Id: [Output Only] Unique identifier for the resource; defined by the
  30814. // server.
  30815. Id string `json:"id,omitempty"`
  30816. // Items: A list of TargetVpnGateway resources.
  30817. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  30818. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  30819. // for target VPN gateways.
  30820. Kind string `json:"kind,omitempty"`
  30821. // NextPageToken: [Output Only] This token allows you to get the next
  30822. // page of results for list requests. If the number of results is larger
  30823. // than maxResults, use the nextPageToken as a value for the query
  30824. // parameter pageToken in the next list request. Subsequent list
  30825. // requests will have their own nextPageToken to continue paging through
  30826. // the results.
  30827. NextPageToken string `json:"nextPageToken,omitempty"`
  30828. // SelfLink: [Output Only] Server-defined URL for this resource.
  30829. SelfLink string `json:"selfLink,omitempty"`
  30830. // Warning: [Output Only] Informational warning message.
  30831. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  30832. // ServerResponse contains the HTTP response code and headers from the
  30833. // server.
  30834. googleapi.ServerResponse `json:"-"`
  30835. // ForceSendFields is a list of field names (e.g. "Id") to
  30836. // unconditionally include in API requests. By default, fields with
  30837. // empty values are omitted from API requests. However, any non-pointer,
  30838. // non-interface field appearing in ForceSendFields will be sent to the
  30839. // server regardless of whether the field is empty or not. This may be
  30840. // used to include empty fields in Patch requests.
  30841. ForceSendFields []string `json:"-"`
  30842. // NullFields is a list of field names (e.g. "Id") to include in API
  30843. // requests with the JSON null value. By default, fields with empty
  30844. // values are omitted from API requests. However, any field with an
  30845. // empty value appearing in NullFields will be sent to the server as
  30846. // null. It is an error if a field in this list has a non-empty value.
  30847. // This may be used to include null fields in Patch requests.
  30848. NullFields []string `json:"-"`
  30849. }
  30850. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  30851. type NoMethod TargetVpnGatewayAggregatedList
  30852. raw := NoMethod(*s)
  30853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30854. }
  30855. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  30856. // warning message.
  30857. type TargetVpnGatewayAggregatedListWarning struct {
  30858. // Code: [Output Only] A warning code, if applicable. For example,
  30859. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30860. // the response.
  30861. //
  30862. // Possible values:
  30863. // "CLEANUP_FAILED"
  30864. // "DEPRECATED_RESOURCE_USED"
  30865. // "DEPRECATED_TYPE_USED"
  30866. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30867. // "EXPERIMENTAL_TYPE_USED"
  30868. // "EXTERNAL_API_WARNING"
  30869. // "FIELD_VALUE_OVERRIDEN"
  30870. // "INJECTED_KERNELS_DEPRECATED"
  30871. // "MISSING_TYPE_DEPENDENCY"
  30872. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30873. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30874. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30875. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30876. // "NEXT_HOP_NOT_RUNNING"
  30877. // "NOT_CRITICAL_ERROR"
  30878. // "NO_RESULTS_ON_PAGE"
  30879. // "REQUIRED_TOS_AGREEMENT"
  30880. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30881. // "RESOURCE_NOT_DELETED"
  30882. // "SCHEMA_VALIDATION_IGNORED"
  30883. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30884. // "UNDECLARED_PROPERTIES"
  30885. // "UNREACHABLE"
  30886. Code string `json:"code,omitempty"`
  30887. // Data: [Output Only] Metadata about this warning in key: value format.
  30888. // For example:
  30889. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30890. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  30891. // Message: [Output Only] A human-readable description of the warning
  30892. // code.
  30893. Message string `json:"message,omitempty"`
  30894. // ForceSendFields is a list of field names (e.g. "Code") to
  30895. // unconditionally include in API requests. By default, fields with
  30896. // empty values are omitted from API requests. However, any non-pointer,
  30897. // non-interface field appearing in ForceSendFields will be sent to the
  30898. // server regardless of whether the field is empty or not. This may be
  30899. // used to include empty fields in Patch requests.
  30900. ForceSendFields []string `json:"-"`
  30901. // NullFields is a list of field names (e.g. "Code") to include in API
  30902. // requests with the JSON null value. By default, fields with empty
  30903. // values are omitted from API requests. However, any field with an
  30904. // empty value appearing in NullFields will be sent to the server as
  30905. // null. It is an error if a field in this list has a non-empty value.
  30906. // This may be used to include null fields in Patch requests.
  30907. NullFields []string `json:"-"`
  30908. }
  30909. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  30910. type NoMethod TargetVpnGatewayAggregatedListWarning
  30911. raw := NoMethod(*s)
  30912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30913. }
  30914. type TargetVpnGatewayAggregatedListWarningData struct {
  30915. // Key: [Output Only] A key that provides more detail on the warning
  30916. // being returned. For example, for warnings where there are no results
  30917. // in a list request for a particular zone, this key might be scope and
  30918. // the key value might be the zone name. Other examples might be a key
  30919. // indicating a deprecated resource and a suggested replacement, or a
  30920. // warning about invalid network settings (for example, if an instance
  30921. // attempts to perform IP forwarding but is not enabled for IP
  30922. // forwarding).
  30923. Key string `json:"key,omitempty"`
  30924. // Value: [Output Only] A warning data value corresponding to the key.
  30925. Value string `json:"value,omitempty"`
  30926. // ForceSendFields is a list of field names (e.g. "Key") to
  30927. // unconditionally include in API requests. By default, fields with
  30928. // empty values are omitted from API requests. However, any non-pointer,
  30929. // non-interface field appearing in ForceSendFields will be sent to the
  30930. // server regardless of whether the field is empty or not. This may be
  30931. // used to include empty fields in Patch requests.
  30932. ForceSendFields []string `json:"-"`
  30933. // NullFields is a list of field names (e.g. "Key") to include in API
  30934. // requests with the JSON null value. By default, fields with empty
  30935. // values are omitted from API requests. However, any field with an
  30936. // empty value appearing in NullFields will be sent to the server as
  30937. // null. It is an error if a field in this list has a non-empty value.
  30938. // This may be used to include null fields in Patch requests.
  30939. NullFields []string `json:"-"`
  30940. }
  30941. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  30942. type NoMethod TargetVpnGatewayAggregatedListWarningData
  30943. raw := NoMethod(*s)
  30944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30945. }
  30946. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  30947. type TargetVpnGatewayList struct {
  30948. // Id: [Output Only] Unique identifier for the resource; defined by the
  30949. // server.
  30950. Id string `json:"id,omitempty"`
  30951. // Items: A list of TargetVpnGateway resources.
  30952. Items []*TargetVpnGateway `json:"items,omitempty"`
  30953. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  30954. // for target VPN gateways.
  30955. Kind string `json:"kind,omitempty"`
  30956. // NextPageToken: [Output Only] This token allows you to get the next
  30957. // page of results for list requests. If the number of results is larger
  30958. // than maxResults, use the nextPageToken as a value for the query
  30959. // parameter pageToken in the next list request. Subsequent list
  30960. // requests will have their own nextPageToken to continue paging through
  30961. // the results.
  30962. NextPageToken string `json:"nextPageToken,omitempty"`
  30963. // SelfLink: [Output Only] Server-defined URL for this resource.
  30964. SelfLink string `json:"selfLink,omitempty"`
  30965. // Warning: [Output Only] Informational warning message.
  30966. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  30967. // ServerResponse contains the HTTP response code and headers from the
  30968. // server.
  30969. googleapi.ServerResponse `json:"-"`
  30970. // ForceSendFields is a list of field names (e.g. "Id") to
  30971. // unconditionally include in API requests. By default, fields with
  30972. // empty values are omitted from API requests. However, any non-pointer,
  30973. // non-interface field appearing in ForceSendFields will be sent to the
  30974. // server regardless of whether the field is empty or not. This may be
  30975. // used to include empty fields in Patch requests.
  30976. ForceSendFields []string `json:"-"`
  30977. // NullFields is a list of field names (e.g. "Id") to include in API
  30978. // requests with the JSON null value. By default, fields with empty
  30979. // values are omitted from API requests. However, any field with an
  30980. // empty value appearing in NullFields will be sent to the server as
  30981. // null. It is an error if a field in this list has a non-empty value.
  30982. // This may be used to include null fields in Patch requests.
  30983. NullFields []string `json:"-"`
  30984. }
  30985. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  30986. type NoMethod TargetVpnGatewayList
  30987. raw := NoMethod(*s)
  30988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30989. }
  30990. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  30991. // message.
  30992. type TargetVpnGatewayListWarning struct {
  30993. // Code: [Output Only] A warning code, if applicable. For example,
  30994. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30995. // the response.
  30996. //
  30997. // Possible values:
  30998. // "CLEANUP_FAILED"
  30999. // "DEPRECATED_RESOURCE_USED"
  31000. // "DEPRECATED_TYPE_USED"
  31001. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31002. // "EXPERIMENTAL_TYPE_USED"
  31003. // "EXTERNAL_API_WARNING"
  31004. // "FIELD_VALUE_OVERRIDEN"
  31005. // "INJECTED_KERNELS_DEPRECATED"
  31006. // "MISSING_TYPE_DEPENDENCY"
  31007. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31008. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31009. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31010. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31011. // "NEXT_HOP_NOT_RUNNING"
  31012. // "NOT_CRITICAL_ERROR"
  31013. // "NO_RESULTS_ON_PAGE"
  31014. // "REQUIRED_TOS_AGREEMENT"
  31015. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31016. // "RESOURCE_NOT_DELETED"
  31017. // "SCHEMA_VALIDATION_IGNORED"
  31018. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31019. // "UNDECLARED_PROPERTIES"
  31020. // "UNREACHABLE"
  31021. Code string `json:"code,omitempty"`
  31022. // Data: [Output Only] Metadata about this warning in key: value format.
  31023. // For example:
  31024. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31025. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  31026. // Message: [Output Only] A human-readable description of the warning
  31027. // code.
  31028. Message string `json:"message,omitempty"`
  31029. // ForceSendFields is a list of field names (e.g. "Code") to
  31030. // unconditionally include in API requests. By default, fields with
  31031. // empty values are omitted from API requests. However, any non-pointer,
  31032. // non-interface field appearing in ForceSendFields will be sent to the
  31033. // server regardless of whether the field is empty or not. This may be
  31034. // used to include empty fields in Patch requests.
  31035. ForceSendFields []string `json:"-"`
  31036. // NullFields is a list of field names (e.g. "Code") to include in API
  31037. // requests with the JSON null value. By default, fields with empty
  31038. // values are omitted from API requests. However, any field with an
  31039. // empty value appearing in NullFields will be sent to the server as
  31040. // null. It is an error if a field in this list has a non-empty value.
  31041. // This may be used to include null fields in Patch requests.
  31042. NullFields []string `json:"-"`
  31043. }
  31044. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  31045. type NoMethod TargetVpnGatewayListWarning
  31046. raw := NoMethod(*s)
  31047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31048. }
  31049. type TargetVpnGatewayListWarningData struct {
  31050. // Key: [Output Only] A key that provides more detail on the warning
  31051. // being returned. For example, for warnings where there are no results
  31052. // in a list request for a particular zone, this key might be scope and
  31053. // the key value might be the zone name. Other examples might be a key
  31054. // indicating a deprecated resource and a suggested replacement, or a
  31055. // warning about invalid network settings (for example, if an instance
  31056. // attempts to perform IP forwarding but is not enabled for IP
  31057. // forwarding).
  31058. Key string `json:"key,omitempty"`
  31059. // Value: [Output Only] A warning data value corresponding to the key.
  31060. Value string `json:"value,omitempty"`
  31061. // ForceSendFields is a list of field names (e.g. "Key") to
  31062. // unconditionally include in API requests. By default, fields with
  31063. // empty values are omitted from API requests. However, any non-pointer,
  31064. // non-interface field appearing in ForceSendFields will be sent to the
  31065. // server regardless of whether the field is empty or not. This may be
  31066. // used to include empty fields in Patch requests.
  31067. ForceSendFields []string `json:"-"`
  31068. // NullFields is a list of field names (e.g. "Key") to include in API
  31069. // requests with the JSON null value. By default, fields with empty
  31070. // values are omitted from API requests. However, any field with an
  31071. // empty value appearing in NullFields will be sent to the server as
  31072. // null. It is an error if a field in this list has a non-empty value.
  31073. // This may be used to include null fields in Patch requests.
  31074. NullFields []string `json:"-"`
  31075. }
  31076. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  31077. type NoMethod TargetVpnGatewayListWarningData
  31078. raw := NoMethod(*s)
  31079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31080. }
  31081. type TargetVpnGatewaysScopedList struct {
  31082. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  31083. // contained in this scope.
  31084. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  31085. // Warning: [Output Only] Informational warning which replaces the list
  31086. // of addresses when the list is empty.
  31087. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  31088. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  31089. // to unconditionally include in API requests. By default, fields with
  31090. // empty values are omitted from API requests. However, any non-pointer,
  31091. // non-interface field appearing in ForceSendFields will be sent to the
  31092. // server regardless of whether the field is empty or not. This may be
  31093. // used to include empty fields in Patch requests.
  31094. ForceSendFields []string `json:"-"`
  31095. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  31096. // include in API requests with the JSON null value. By default, fields
  31097. // with empty values are omitted from API requests. However, any field
  31098. // with an empty value appearing in NullFields will be sent to the
  31099. // server as null. It is an error if a field in this list has a
  31100. // non-empty value. This may be used to include null fields in Patch
  31101. // requests.
  31102. NullFields []string `json:"-"`
  31103. }
  31104. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  31105. type NoMethod TargetVpnGatewaysScopedList
  31106. raw := NoMethod(*s)
  31107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31108. }
  31109. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  31110. // warning which replaces the list of addresses when the list is empty.
  31111. type TargetVpnGatewaysScopedListWarning struct {
  31112. // Code: [Output Only] A warning code, if applicable. For example,
  31113. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31114. // the response.
  31115. //
  31116. // Possible values:
  31117. // "CLEANUP_FAILED"
  31118. // "DEPRECATED_RESOURCE_USED"
  31119. // "DEPRECATED_TYPE_USED"
  31120. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31121. // "EXPERIMENTAL_TYPE_USED"
  31122. // "EXTERNAL_API_WARNING"
  31123. // "FIELD_VALUE_OVERRIDEN"
  31124. // "INJECTED_KERNELS_DEPRECATED"
  31125. // "MISSING_TYPE_DEPENDENCY"
  31126. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31127. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31128. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31129. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31130. // "NEXT_HOP_NOT_RUNNING"
  31131. // "NOT_CRITICAL_ERROR"
  31132. // "NO_RESULTS_ON_PAGE"
  31133. // "REQUIRED_TOS_AGREEMENT"
  31134. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31135. // "RESOURCE_NOT_DELETED"
  31136. // "SCHEMA_VALIDATION_IGNORED"
  31137. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31138. // "UNDECLARED_PROPERTIES"
  31139. // "UNREACHABLE"
  31140. Code string `json:"code,omitempty"`
  31141. // Data: [Output Only] Metadata about this warning in key: value format.
  31142. // For example:
  31143. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31144. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  31145. // Message: [Output Only] A human-readable description of the warning
  31146. // code.
  31147. Message string `json:"message,omitempty"`
  31148. // ForceSendFields is a list of field names (e.g. "Code") to
  31149. // unconditionally include in API requests. By default, fields with
  31150. // empty values are omitted from API requests. However, any non-pointer,
  31151. // non-interface field appearing in ForceSendFields will be sent to the
  31152. // server regardless of whether the field is empty or not. This may be
  31153. // used to include empty fields in Patch requests.
  31154. ForceSendFields []string `json:"-"`
  31155. // NullFields is a list of field names (e.g. "Code") to include in API
  31156. // requests with the JSON null value. By default, fields with empty
  31157. // values are omitted from API requests. However, any field with an
  31158. // empty value appearing in NullFields will be sent to the server as
  31159. // null. It is an error if a field in this list has a non-empty value.
  31160. // This may be used to include null fields in Patch requests.
  31161. NullFields []string `json:"-"`
  31162. }
  31163. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  31164. type NoMethod TargetVpnGatewaysScopedListWarning
  31165. raw := NoMethod(*s)
  31166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31167. }
  31168. type TargetVpnGatewaysScopedListWarningData struct {
  31169. // Key: [Output Only] A key that provides more detail on the warning
  31170. // being returned. For example, for warnings where there are no results
  31171. // in a list request for a particular zone, this key might be scope and
  31172. // the key value might be the zone name. Other examples might be a key
  31173. // indicating a deprecated resource and a suggested replacement, or a
  31174. // warning about invalid network settings (for example, if an instance
  31175. // attempts to perform IP forwarding but is not enabled for IP
  31176. // forwarding).
  31177. Key string `json:"key,omitempty"`
  31178. // Value: [Output Only] A warning data value corresponding to the key.
  31179. Value string `json:"value,omitempty"`
  31180. // ForceSendFields is a list of field names (e.g. "Key") to
  31181. // unconditionally include in API requests. By default, fields with
  31182. // empty values are omitted from API requests. However, any non-pointer,
  31183. // non-interface field appearing in ForceSendFields will be sent to the
  31184. // server regardless of whether the field is empty or not. This may be
  31185. // used to include empty fields in Patch requests.
  31186. ForceSendFields []string `json:"-"`
  31187. // NullFields is a list of field names (e.g. "Key") to include in API
  31188. // requests with the JSON null value. By default, fields with empty
  31189. // values are omitted from API requests. However, any field with an
  31190. // empty value appearing in NullFields will be sent to the server as
  31191. // null. It is an error if a field in this list has a non-empty value.
  31192. // This may be used to include null fields in Patch requests.
  31193. NullFields []string `json:"-"`
  31194. }
  31195. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  31196. type NoMethod TargetVpnGatewaysScopedListWarningData
  31197. raw := NoMethod(*s)
  31198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31199. }
  31200. type TestFailure struct {
  31201. ActualService string `json:"actualService,omitempty"`
  31202. ExpectedService string `json:"expectedService,omitempty"`
  31203. Host string `json:"host,omitempty"`
  31204. Path string `json:"path,omitempty"`
  31205. // ForceSendFields is a list of field names (e.g. "ActualService") to
  31206. // unconditionally include in API requests. By default, fields with
  31207. // empty values are omitted from API requests. However, any non-pointer,
  31208. // non-interface field appearing in ForceSendFields will be sent to the
  31209. // server regardless of whether the field is empty or not. This may be
  31210. // used to include empty fields in Patch requests.
  31211. ForceSendFields []string `json:"-"`
  31212. // NullFields is a list of field names (e.g. "ActualService") to include
  31213. // in API requests with the JSON null value. By default, fields with
  31214. // empty values are omitted from API requests. However, any field with
  31215. // an empty value appearing in NullFields will be sent to the server as
  31216. // null. It is an error if a field in this list has a non-empty value.
  31217. // This may be used to include null fields in Patch requests.
  31218. NullFields []string `json:"-"`
  31219. }
  31220. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  31221. type NoMethod TestFailure
  31222. raw := NoMethod(*s)
  31223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31224. }
  31225. type TestPermissionsRequest struct {
  31226. // Permissions: The set of permissions to check for the 'resource'.
  31227. // Permissions with wildcards (such as '*' or 'storage.*') are not
  31228. // allowed.
  31229. Permissions []string `json:"permissions,omitempty"`
  31230. // ForceSendFields is a list of field names (e.g. "Permissions") to
  31231. // unconditionally include in API requests. By default, fields with
  31232. // empty values are omitted from API requests. However, any non-pointer,
  31233. // non-interface field appearing in ForceSendFields will be sent to the
  31234. // server regardless of whether the field is empty or not. This may be
  31235. // used to include empty fields in Patch requests.
  31236. ForceSendFields []string `json:"-"`
  31237. // NullFields is a list of field names (e.g. "Permissions") to include
  31238. // in API requests with the JSON null value. By default, fields with
  31239. // empty values are omitted from API requests. However, any field with
  31240. // an empty value appearing in NullFields will be sent to the server as
  31241. // null. It is an error if a field in this list has a non-empty value.
  31242. // This may be used to include null fields in Patch requests.
  31243. NullFields []string `json:"-"`
  31244. }
  31245. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  31246. type NoMethod TestPermissionsRequest
  31247. raw := NoMethod(*s)
  31248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31249. }
  31250. type TestPermissionsResponse struct {
  31251. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  31252. // the caller is allowed.
  31253. Permissions []string `json:"permissions,omitempty"`
  31254. // ServerResponse contains the HTTP response code and headers from the
  31255. // server.
  31256. googleapi.ServerResponse `json:"-"`
  31257. // ForceSendFields is a list of field names (e.g. "Permissions") to
  31258. // unconditionally include in API requests. By default, fields with
  31259. // empty values are omitted from API requests. However, any non-pointer,
  31260. // non-interface field appearing in ForceSendFields will be sent to the
  31261. // server regardless of whether the field is empty or not. This may be
  31262. // used to include empty fields in Patch requests.
  31263. ForceSendFields []string `json:"-"`
  31264. // NullFields is a list of field names (e.g. "Permissions") to include
  31265. // in API requests with the JSON null value. By default, fields with
  31266. // empty values are omitted from API requests. However, any field with
  31267. // an empty value appearing in NullFields will be sent to the server as
  31268. // null. It is an error if a field in this list has a non-empty value.
  31269. // This may be used to include null fields in Patch requests.
  31270. NullFields []string `json:"-"`
  31271. }
  31272. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  31273. type NoMethod TestPermissionsResponse
  31274. raw := NoMethod(*s)
  31275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31276. }
  31277. type UDPHealthCheck struct {
  31278. // Port: The UDP port number for the health check request. Valid values
  31279. // are 1 through 65535.
  31280. Port int64 `json:"port,omitempty"`
  31281. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  31282. // both port and port_name are defined, port takes precedence.
  31283. PortName string `json:"portName,omitempty"`
  31284. // Request: Raw data of request to send in payload of UDP packet. It is
  31285. // an error if this is empty. The request data can only be ASCII.
  31286. Request string `json:"request,omitempty"`
  31287. // Response: The bytes to match against the beginning of the response
  31288. // data. It is an error if this is empty. The response data can only be
  31289. // ASCII.
  31290. Response string `json:"response,omitempty"`
  31291. // ForceSendFields is a list of field names (e.g. "Port") to
  31292. // unconditionally include in API requests. By default, fields with
  31293. // empty values are omitted from API requests. However, any non-pointer,
  31294. // non-interface field appearing in ForceSendFields will be sent to the
  31295. // server regardless of whether the field is empty or not. This may be
  31296. // used to include empty fields in Patch requests.
  31297. ForceSendFields []string `json:"-"`
  31298. // NullFields is a list of field names (e.g. "Port") to include in API
  31299. // requests with the JSON null value. By default, fields with empty
  31300. // values are omitted from API requests. However, any field with an
  31301. // empty value appearing in NullFields will be sent to the server as
  31302. // null. It is an error if a field in this list has a non-empty value.
  31303. // This may be used to include null fields in Patch requests.
  31304. NullFields []string `json:"-"`
  31305. }
  31306. func (s *UDPHealthCheck) MarshalJSON() ([]byte, error) {
  31307. type NoMethod UDPHealthCheck
  31308. raw := NoMethod(*s)
  31309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31310. }
  31311. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  31312. // to the BackendService resource, based on the "longest-match" of the
  31313. // URL's host and path.
  31314. type UrlMap struct {
  31315. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  31316. // format.
  31317. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  31318. // DefaultService: The URL of the backendService resource if none of the
  31319. // hostRules match.
  31320. // Use defaultService instead of defaultRouteAction when simple routing
  31321. // to a backendService is desired and other advanced capabilities like
  31322. // traffic splitting and rewrites are not required.
  31323. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  31324. // should must be set.
  31325. DefaultService string `json:"defaultService,omitempty"`
  31326. // Description: An optional description of this resource. Provide this
  31327. // property when you create the resource.
  31328. Description string `json:"description,omitempty"`
  31329. // Fingerprint: Fingerprint of this resource. A hash of the contents
  31330. // stored in this object. This field is used in optimistic locking. This
  31331. // field will be ignored when inserting a UrlMap. An up-to-date
  31332. // fingerprint must be provided in order to update the UrlMap, otherwise
  31333. // the request will fail with error 412 conditionNotMet.
  31334. //
  31335. // To see the latest fingerprint, make a get() request to retrieve a
  31336. // UrlMap.
  31337. Fingerprint string `json:"fingerprint,omitempty"`
  31338. // HostRules: The list of HostRules to use against the URL.
  31339. HostRules []*HostRule `json:"hostRules,omitempty"`
  31340. // Id: [Output Only] The unique identifier for the resource. This
  31341. // identifier is defined by the server.
  31342. Id uint64 `json:"id,omitempty,string"`
  31343. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  31344. // url maps.
  31345. Kind string `json:"kind,omitempty"`
  31346. // Name: Name of the resource. Provided by the client when the resource
  31347. // is created. The name must be 1-63 characters long, and comply with
  31348. // RFC1035. Specifically, the name must be 1-63 characters long and
  31349. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  31350. // the first character must be a lowercase letter, and all following
  31351. // characters must be a dash, lowercase letter, or digit, except the
  31352. // last character, which cannot be a dash.
  31353. Name string `json:"name,omitempty"`
  31354. // PathMatchers: The list of named PathMatchers to use against the URL.
  31355. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  31356. // Region: [Output Only] URL of the region where the regional URL map
  31357. // resides. This field is not applicable to global URL maps. You must
  31358. // specify this field as part of the HTTP request URL. It is not
  31359. // settable as a field in the request body.
  31360. Region string `json:"region,omitempty"`
  31361. // SelfLink: [Output Only] Server-defined URL for the resource.
  31362. SelfLink string `json:"selfLink,omitempty"`
  31363. // Tests: The list of expected URL mapping tests. Request to update this
  31364. // UrlMap will succeed only if all of the test cases pass. You can
  31365. // specify a maximum of 100 tests per UrlMap.
  31366. Tests []*UrlMapTest `json:"tests,omitempty"`
  31367. // ServerResponse contains the HTTP response code and headers from the
  31368. // server.
  31369. googleapi.ServerResponse `json:"-"`
  31370. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  31371. // to unconditionally include in API requests. By default, fields with
  31372. // empty values are omitted from API requests. However, any non-pointer,
  31373. // non-interface field appearing in ForceSendFields will be sent to the
  31374. // server regardless of whether the field is empty or not. This may be
  31375. // used to include empty fields in Patch requests.
  31376. ForceSendFields []string `json:"-"`
  31377. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  31378. // include in API requests with the JSON null value. By default, fields
  31379. // with empty values are omitted from API requests. However, any field
  31380. // with an empty value appearing in NullFields will be sent to the
  31381. // server as null. It is an error if a field in this list has a
  31382. // non-empty value. This may be used to include null fields in Patch
  31383. // requests.
  31384. NullFields []string `json:"-"`
  31385. }
  31386. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  31387. type NoMethod UrlMap
  31388. raw := NoMethod(*s)
  31389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31390. }
  31391. // UrlMapList: Contains a list of UrlMap resources.
  31392. type UrlMapList struct {
  31393. // Id: [Output Only] Unique identifier for the resource; defined by the
  31394. // server.
  31395. Id string `json:"id,omitempty"`
  31396. // Items: A list of UrlMap resources.
  31397. Items []*UrlMap `json:"items,omitempty"`
  31398. // Kind: Type of resource.
  31399. Kind string `json:"kind,omitempty"`
  31400. // NextPageToken: [Output Only] This token allows you to get the next
  31401. // page of results for list requests. If the number of results is larger
  31402. // than maxResults, use the nextPageToken as a value for the query
  31403. // parameter pageToken in the next list request. Subsequent list
  31404. // requests will have their own nextPageToken to continue paging through
  31405. // the results.
  31406. NextPageToken string `json:"nextPageToken,omitempty"`
  31407. // SelfLink: [Output Only] Server-defined URL for this resource.
  31408. SelfLink string `json:"selfLink,omitempty"`
  31409. // Warning: [Output Only] Informational warning message.
  31410. Warning *UrlMapListWarning `json:"warning,omitempty"`
  31411. // ServerResponse contains the HTTP response code and headers from the
  31412. // server.
  31413. googleapi.ServerResponse `json:"-"`
  31414. // ForceSendFields is a list of field names (e.g. "Id") to
  31415. // unconditionally include in API requests. By default, fields with
  31416. // empty values are omitted from API requests. However, any non-pointer,
  31417. // non-interface field appearing in ForceSendFields will be sent to the
  31418. // server regardless of whether the field is empty or not. This may be
  31419. // used to include empty fields in Patch requests.
  31420. ForceSendFields []string `json:"-"`
  31421. // NullFields is a list of field names (e.g. "Id") to include in API
  31422. // requests with the JSON null value. By default, fields with empty
  31423. // values are omitted from API requests. However, any field with an
  31424. // empty value appearing in NullFields will be sent to the server as
  31425. // null. It is an error if a field in this list has a non-empty value.
  31426. // This may be used to include null fields in Patch requests.
  31427. NullFields []string `json:"-"`
  31428. }
  31429. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  31430. type NoMethod UrlMapList
  31431. raw := NoMethod(*s)
  31432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31433. }
  31434. // UrlMapListWarning: [Output Only] Informational warning message.
  31435. type UrlMapListWarning struct {
  31436. // Code: [Output Only] A warning code, if applicable. For example,
  31437. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31438. // the response.
  31439. //
  31440. // Possible values:
  31441. // "CLEANUP_FAILED"
  31442. // "DEPRECATED_RESOURCE_USED"
  31443. // "DEPRECATED_TYPE_USED"
  31444. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31445. // "EXPERIMENTAL_TYPE_USED"
  31446. // "EXTERNAL_API_WARNING"
  31447. // "FIELD_VALUE_OVERRIDEN"
  31448. // "INJECTED_KERNELS_DEPRECATED"
  31449. // "MISSING_TYPE_DEPENDENCY"
  31450. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31451. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31452. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31453. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31454. // "NEXT_HOP_NOT_RUNNING"
  31455. // "NOT_CRITICAL_ERROR"
  31456. // "NO_RESULTS_ON_PAGE"
  31457. // "REQUIRED_TOS_AGREEMENT"
  31458. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31459. // "RESOURCE_NOT_DELETED"
  31460. // "SCHEMA_VALIDATION_IGNORED"
  31461. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31462. // "UNDECLARED_PROPERTIES"
  31463. // "UNREACHABLE"
  31464. Code string `json:"code,omitempty"`
  31465. // Data: [Output Only] Metadata about this warning in key: value format.
  31466. // For example:
  31467. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31468. Data []*UrlMapListWarningData `json:"data,omitempty"`
  31469. // Message: [Output Only] A human-readable description of the warning
  31470. // code.
  31471. Message string `json:"message,omitempty"`
  31472. // ForceSendFields is a list of field names (e.g. "Code") to
  31473. // unconditionally include in API requests. By default, fields with
  31474. // empty values are omitted from API requests. However, any non-pointer,
  31475. // non-interface field appearing in ForceSendFields will be sent to the
  31476. // server regardless of whether the field is empty or not. This may be
  31477. // used to include empty fields in Patch requests.
  31478. ForceSendFields []string `json:"-"`
  31479. // NullFields is a list of field names (e.g. "Code") to include in API
  31480. // requests with the JSON null value. By default, fields with empty
  31481. // values are omitted from API requests. However, any field with an
  31482. // empty value appearing in NullFields will be sent to the server as
  31483. // null. It is an error if a field in this list has a non-empty value.
  31484. // This may be used to include null fields in Patch requests.
  31485. NullFields []string `json:"-"`
  31486. }
  31487. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  31488. type NoMethod UrlMapListWarning
  31489. raw := NoMethod(*s)
  31490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31491. }
  31492. type UrlMapListWarningData struct {
  31493. // Key: [Output Only] A key that provides more detail on the warning
  31494. // being returned. For example, for warnings where there are no results
  31495. // in a list request for a particular zone, this key might be scope and
  31496. // the key value might be the zone name. Other examples might be a key
  31497. // indicating a deprecated resource and a suggested replacement, or a
  31498. // warning about invalid network settings (for example, if an instance
  31499. // attempts to perform IP forwarding but is not enabled for IP
  31500. // forwarding).
  31501. Key string `json:"key,omitempty"`
  31502. // Value: [Output Only] A warning data value corresponding to the key.
  31503. Value string `json:"value,omitempty"`
  31504. // ForceSendFields is a list of field names (e.g. "Key") to
  31505. // unconditionally include in API requests. By default, fields with
  31506. // empty values are omitted from API requests. However, any non-pointer,
  31507. // non-interface field appearing in ForceSendFields will be sent to the
  31508. // server regardless of whether the field is empty or not. This may be
  31509. // used to include empty fields in Patch requests.
  31510. ForceSendFields []string `json:"-"`
  31511. // NullFields is a list of field names (e.g. "Key") to include in API
  31512. // requests with the JSON null value. By default, fields with empty
  31513. // values are omitted from API requests. However, any field with an
  31514. // empty value appearing in NullFields will be sent to the server as
  31515. // null. It is an error if a field in this list has a non-empty value.
  31516. // This may be used to include null fields in Patch requests.
  31517. NullFields []string `json:"-"`
  31518. }
  31519. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  31520. type NoMethod UrlMapListWarningData
  31521. raw := NoMethod(*s)
  31522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31523. }
  31524. type UrlMapReference struct {
  31525. UrlMap string `json:"urlMap,omitempty"`
  31526. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  31527. // unconditionally include in API requests. By default, fields with
  31528. // empty values are omitted from API requests. However, any non-pointer,
  31529. // non-interface field appearing in ForceSendFields will be sent to the
  31530. // server regardless of whether the field is empty or not. This may be
  31531. // used to include empty fields in Patch requests.
  31532. ForceSendFields []string `json:"-"`
  31533. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  31534. // requests with the JSON null value. By default, fields with empty
  31535. // values are omitted from API requests. However, any field with an
  31536. // empty value appearing in NullFields will be sent to the server as
  31537. // null. It is an error if a field in this list has a non-empty value.
  31538. // This may be used to include null fields in Patch requests.
  31539. NullFields []string `json:"-"`
  31540. }
  31541. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  31542. type NoMethod UrlMapReference
  31543. raw := NoMethod(*s)
  31544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31545. }
  31546. // UrlMapTest: Message for the expected URL mappings.
  31547. type UrlMapTest struct {
  31548. // Description: Description of this test case.
  31549. Description string `json:"description,omitempty"`
  31550. // Host: Host portion of the URL.
  31551. Host string `json:"host,omitempty"`
  31552. // Path: Path portion of the URL.
  31553. Path string `json:"path,omitempty"`
  31554. // Service: Expected BackendService resource the given URL should be
  31555. // mapped to.
  31556. Service string `json:"service,omitempty"`
  31557. // ForceSendFields is a list of field names (e.g. "Description") to
  31558. // unconditionally include in API requests. By default, fields with
  31559. // empty values are omitted from API requests. However, any non-pointer,
  31560. // non-interface field appearing in ForceSendFields will be sent to the
  31561. // server regardless of whether the field is empty or not. This may be
  31562. // used to include empty fields in Patch requests.
  31563. ForceSendFields []string `json:"-"`
  31564. // NullFields is a list of field names (e.g. "Description") to include
  31565. // in API requests with the JSON null value. By default, fields with
  31566. // empty values are omitted from API requests. However, any field with
  31567. // an empty value appearing in NullFields will be sent to the server as
  31568. // null. It is an error if a field in this list has a non-empty value.
  31569. // This may be used to include null fields in Patch requests.
  31570. NullFields []string `json:"-"`
  31571. }
  31572. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  31573. type NoMethod UrlMapTest
  31574. raw := NoMethod(*s)
  31575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31576. }
  31577. // UrlMapValidationResult: Message representing the validation result
  31578. // for a UrlMap.
  31579. type UrlMapValidationResult struct {
  31580. LoadErrors []string `json:"loadErrors,omitempty"`
  31581. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  31582. // If false, 'loadErrors' indicates the reasons.
  31583. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  31584. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  31585. // TestPassed: If successfully loaded, this field indicates whether the
  31586. // test passed. If false, 'testFailures's indicate the reason of
  31587. // failure.
  31588. TestPassed bool `json:"testPassed,omitempty"`
  31589. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  31590. // unconditionally include in API requests. By default, fields with
  31591. // empty values are omitted from API requests. However, any non-pointer,
  31592. // non-interface field appearing in ForceSendFields will be sent to the
  31593. // server regardless of whether the field is empty or not. This may be
  31594. // used to include empty fields in Patch requests.
  31595. ForceSendFields []string `json:"-"`
  31596. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  31597. // API requests with the JSON null value. By default, fields with empty
  31598. // values are omitted from API requests. However, any field with an
  31599. // empty value appearing in NullFields will be sent to the server as
  31600. // null. It is an error if a field in this list has a non-empty value.
  31601. // This may be used to include null fields in Patch requests.
  31602. NullFields []string `json:"-"`
  31603. }
  31604. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  31605. type NoMethod UrlMapValidationResult
  31606. raw := NoMethod(*s)
  31607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31608. }
  31609. type UrlMapsAggregatedList struct {
  31610. // Id: [Output Only] Unique identifier for the resource; defined by the
  31611. // server.
  31612. Id string `json:"id,omitempty"`
  31613. // Items: A list of UrlMapsScopedList resources.
  31614. Items map[string]UrlMapsScopedList `json:"items,omitempty"`
  31615. // Kind: Type of resource.
  31616. Kind string `json:"kind,omitempty"`
  31617. // NextPageToken: [Output Only] This token allows you to get the next
  31618. // page of results for list requests. If the number of results is larger
  31619. // than maxResults, use the nextPageToken as a value for the query
  31620. // parameter pageToken in the next list request. Subsequent list
  31621. // requests will have their own nextPageToken to continue paging through
  31622. // the results.
  31623. NextPageToken string `json:"nextPageToken,omitempty"`
  31624. // SelfLink: [Output Only] Server-defined URL for this resource.
  31625. SelfLink string `json:"selfLink,omitempty"`
  31626. // Warning: [Output Only] Informational warning message.
  31627. Warning *UrlMapsAggregatedListWarning `json:"warning,omitempty"`
  31628. // ServerResponse contains the HTTP response code and headers from the
  31629. // server.
  31630. googleapi.ServerResponse `json:"-"`
  31631. // ForceSendFields is a list of field names (e.g. "Id") to
  31632. // unconditionally include in API requests. By default, fields with
  31633. // empty values are omitted from API requests. However, any non-pointer,
  31634. // non-interface field appearing in ForceSendFields will be sent to the
  31635. // server regardless of whether the field is empty or not. This may be
  31636. // used to include empty fields in Patch requests.
  31637. ForceSendFields []string `json:"-"`
  31638. // NullFields is a list of field names (e.g. "Id") to include in API
  31639. // requests with the JSON null value. By default, fields with empty
  31640. // values are omitted from API requests. However, any field with an
  31641. // empty value appearing in NullFields will be sent to the server as
  31642. // null. It is an error if a field in this list has a non-empty value.
  31643. // This may be used to include null fields in Patch requests.
  31644. NullFields []string `json:"-"`
  31645. }
  31646. func (s *UrlMapsAggregatedList) MarshalJSON() ([]byte, error) {
  31647. type NoMethod UrlMapsAggregatedList
  31648. raw := NoMethod(*s)
  31649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31650. }
  31651. // UrlMapsAggregatedListWarning: [Output Only] Informational warning
  31652. // message.
  31653. type UrlMapsAggregatedListWarning struct {
  31654. // Code: [Output Only] A warning code, if applicable. For example,
  31655. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31656. // the response.
  31657. //
  31658. // Possible values:
  31659. // "CLEANUP_FAILED"
  31660. // "DEPRECATED_RESOURCE_USED"
  31661. // "DEPRECATED_TYPE_USED"
  31662. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31663. // "EXPERIMENTAL_TYPE_USED"
  31664. // "EXTERNAL_API_WARNING"
  31665. // "FIELD_VALUE_OVERRIDEN"
  31666. // "INJECTED_KERNELS_DEPRECATED"
  31667. // "MISSING_TYPE_DEPENDENCY"
  31668. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31669. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31670. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31671. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31672. // "NEXT_HOP_NOT_RUNNING"
  31673. // "NOT_CRITICAL_ERROR"
  31674. // "NO_RESULTS_ON_PAGE"
  31675. // "REQUIRED_TOS_AGREEMENT"
  31676. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31677. // "RESOURCE_NOT_DELETED"
  31678. // "SCHEMA_VALIDATION_IGNORED"
  31679. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31680. // "UNDECLARED_PROPERTIES"
  31681. // "UNREACHABLE"
  31682. Code string `json:"code,omitempty"`
  31683. // Data: [Output Only] Metadata about this warning in key: value format.
  31684. // For example:
  31685. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31686. Data []*UrlMapsAggregatedListWarningData `json:"data,omitempty"`
  31687. // Message: [Output Only] A human-readable description of the warning
  31688. // code.
  31689. Message string `json:"message,omitempty"`
  31690. // ForceSendFields is a list of field names (e.g. "Code") to
  31691. // unconditionally include in API requests. By default, fields with
  31692. // empty values are omitted from API requests. However, any non-pointer,
  31693. // non-interface field appearing in ForceSendFields will be sent to the
  31694. // server regardless of whether the field is empty or not. This may be
  31695. // used to include empty fields in Patch requests.
  31696. ForceSendFields []string `json:"-"`
  31697. // NullFields is a list of field names (e.g. "Code") to include in API
  31698. // requests with the JSON null value. By default, fields with empty
  31699. // values are omitted from API requests. However, any field with an
  31700. // empty value appearing in NullFields will be sent to the server as
  31701. // null. It is an error if a field in this list has a non-empty value.
  31702. // This may be used to include null fields in Patch requests.
  31703. NullFields []string `json:"-"`
  31704. }
  31705. func (s *UrlMapsAggregatedListWarning) MarshalJSON() ([]byte, error) {
  31706. type NoMethod UrlMapsAggregatedListWarning
  31707. raw := NoMethod(*s)
  31708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31709. }
  31710. type UrlMapsAggregatedListWarningData struct {
  31711. // Key: [Output Only] A key that provides more detail on the warning
  31712. // being returned. For example, for warnings where there are no results
  31713. // in a list request for a particular zone, this key might be scope and
  31714. // the key value might be the zone name. Other examples might be a key
  31715. // indicating a deprecated resource and a suggested replacement, or a
  31716. // warning about invalid network settings (for example, if an instance
  31717. // attempts to perform IP forwarding but is not enabled for IP
  31718. // forwarding).
  31719. Key string `json:"key,omitempty"`
  31720. // Value: [Output Only] A warning data value corresponding to the key.
  31721. Value string `json:"value,omitempty"`
  31722. // ForceSendFields is a list of field names (e.g. "Key") to
  31723. // unconditionally include in API requests. By default, fields with
  31724. // empty values are omitted from API requests. However, any non-pointer,
  31725. // non-interface field appearing in ForceSendFields will be sent to the
  31726. // server regardless of whether the field is empty or not. This may be
  31727. // used to include empty fields in Patch requests.
  31728. ForceSendFields []string `json:"-"`
  31729. // NullFields is a list of field names (e.g. "Key") to include in API
  31730. // requests with the JSON null value. By default, fields with empty
  31731. // values are omitted from API requests. However, any field with an
  31732. // empty value appearing in NullFields will be sent to the server as
  31733. // null. It is an error if a field in this list has a non-empty value.
  31734. // This may be used to include null fields in Patch requests.
  31735. NullFields []string `json:"-"`
  31736. }
  31737. func (s *UrlMapsAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  31738. type NoMethod UrlMapsAggregatedListWarningData
  31739. raw := NoMethod(*s)
  31740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31741. }
  31742. type UrlMapsScopedList struct {
  31743. // UrlMaps: A list of UrlMaps contained in this scope.
  31744. UrlMaps []*UrlMap `json:"urlMaps,omitempty"`
  31745. // Warning: Informational warning which replaces the list of backend
  31746. // services when the list is empty.
  31747. Warning *UrlMapsScopedListWarning `json:"warning,omitempty"`
  31748. // ForceSendFields is a list of field names (e.g. "UrlMaps") to
  31749. // unconditionally include in API requests. By default, fields with
  31750. // empty values are omitted from API requests. However, any non-pointer,
  31751. // non-interface field appearing in ForceSendFields will be sent to the
  31752. // server regardless of whether the field is empty or not. This may be
  31753. // used to include empty fields in Patch requests.
  31754. ForceSendFields []string `json:"-"`
  31755. // NullFields is a list of field names (e.g. "UrlMaps") to include in
  31756. // API requests with the JSON null value. By default, fields with empty
  31757. // values are omitted from API requests. However, any field with an
  31758. // empty value appearing in NullFields will be sent to the server as
  31759. // null. It is an error if a field in this list has a non-empty value.
  31760. // This may be used to include null fields in Patch requests.
  31761. NullFields []string `json:"-"`
  31762. }
  31763. func (s *UrlMapsScopedList) MarshalJSON() ([]byte, error) {
  31764. type NoMethod UrlMapsScopedList
  31765. raw := NoMethod(*s)
  31766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31767. }
  31768. // UrlMapsScopedListWarning: Informational warning which replaces the
  31769. // list of backend services when the list is empty.
  31770. type UrlMapsScopedListWarning struct {
  31771. // Code: [Output Only] A warning code, if applicable. For example,
  31772. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31773. // the response.
  31774. //
  31775. // Possible values:
  31776. // "CLEANUP_FAILED"
  31777. // "DEPRECATED_RESOURCE_USED"
  31778. // "DEPRECATED_TYPE_USED"
  31779. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31780. // "EXPERIMENTAL_TYPE_USED"
  31781. // "EXTERNAL_API_WARNING"
  31782. // "FIELD_VALUE_OVERRIDEN"
  31783. // "INJECTED_KERNELS_DEPRECATED"
  31784. // "MISSING_TYPE_DEPENDENCY"
  31785. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31786. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31787. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31788. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31789. // "NEXT_HOP_NOT_RUNNING"
  31790. // "NOT_CRITICAL_ERROR"
  31791. // "NO_RESULTS_ON_PAGE"
  31792. // "REQUIRED_TOS_AGREEMENT"
  31793. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31794. // "RESOURCE_NOT_DELETED"
  31795. // "SCHEMA_VALIDATION_IGNORED"
  31796. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31797. // "UNDECLARED_PROPERTIES"
  31798. // "UNREACHABLE"
  31799. Code string `json:"code,omitempty"`
  31800. // Data: [Output Only] Metadata about this warning in key: value format.
  31801. // For example:
  31802. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31803. Data []*UrlMapsScopedListWarningData `json:"data,omitempty"`
  31804. // Message: [Output Only] A human-readable description of the warning
  31805. // code.
  31806. Message string `json:"message,omitempty"`
  31807. // ForceSendFields is a list of field names (e.g. "Code") to
  31808. // unconditionally include in API requests. By default, fields with
  31809. // empty values are omitted from API requests. However, any non-pointer,
  31810. // non-interface field appearing in ForceSendFields will be sent to the
  31811. // server regardless of whether the field is empty or not. This may be
  31812. // used to include empty fields in Patch requests.
  31813. ForceSendFields []string `json:"-"`
  31814. // NullFields is a list of field names (e.g. "Code") to include in API
  31815. // requests with the JSON null value. By default, fields with empty
  31816. // values are omitted from API requests. However, any field with an
  31817. // empty value appearing in NullFields will be sent to the server as
  31818. // null. It is an error if a field in this list has a non-empty value.
  31819. // This may be used to include null fields in Patch requests.
  31820. NullFields []string `json:"-"`
  31821. }
  31822. func (s *UrlMapsScopedListWarning) MarshalJSON() ([]byte, error) {
  31823. type NoMethod UrlMapsScopedListWarning
  31824. raw := NoMethod(*s)
  31825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31826. }
  31827. type UrlMapsScopedListWarningData struct {
  31828. // Key: [Output Only] A key that provides more detail on the warning
  31829. // being returned. For example, for warnings where there are no results
  31830. // in a list request for a particular zone, this key might be scope and
  31831. // the key value might be the zone name. Other examples might be a key
  31832. // indicating a deprecated resource and a suggested replacement, or a
  31833. // warning about invalid network settings (for example, if an instance
  31834. // attempts to perform IP forwarding but is not enabled for IP
  31835. // forwarding).
  31836. Key string `json:"key,omitempty"`
  31837. // Value: [Output Only] A warning data value corresponding to the key.
  31838. Value string `json:"value,omitempty"`
  31839. // ForceSendFields is a list of field names (e.g. "Key") to
  31840. // unconditionally include in API requests. By default, fields with
  31841. // empty values are omitted from API requests. However, any non-pointer,
  31842. // non-interface field appearing in ForceSendFields will be sent to the
  31843. // server regardless of whether the field is empty or not. This may be
  31844. // used to include empty fields in Patch requests.
  31845. ForceSendFields []string `json:"-"`
  31846. // NullFields is a list of field names (e.g. "Key") to include in API
  31847. // requests with the JSON null value. By default, fields with empty
  31848. // values are omitted from API requests. However, any field with an
  31849. // empty value appearing in NullFields will be sent to the server as
  31850. // null. It is an error if a field in this list has a non-empty value.
  31851. // This may be used to include null fields in Patch requests.
  31852. NullFields []string `json:"-"`
  31853. }
  31854. func (s *UrlMapsScopedListWarningData) MarshalJSON() ([]byte, error) {
  31855. type NoMethod UrlMapsScopedListWarningData
  31856. raw := NoMethod(*s)
  31857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31858. }
  31859. type UrlMapsValidateRequest struct {
  31860. // Resource: Content of the UrlMap to be validated.
  31861. Resource *UrlMap `json:"resource,omitempty"`
  31862. // ForceSendFields is a list of field names (e.g. "Resource") to
  31863. // unconditionally include in API requests. By default, fields with
  31864. // empty values are omitted from API requests. However, any non-pointer,
  31865. // non-interface field appearing in ForceSendFields will be sent to the
  31866. // server regardless of whether the field is empty or not. This may be
  31867. // used to include empty fields in Patch requests.
  31868. ForceSendFields []string `json:"-"`
  31869. // NullFields is a list of field names (e.g. "Resource") to include in
  31870. // API requests with the JSON null value. By default, fields with empty
  31871. // values are omitted from API requests. However, any field with an
  31872. // empty value appearing in NullFields will be sent to the server as
  31873. // null. It is an error if a field in this list has a non-empty value.
  31874. // This may be used to include null fields in Patch requests.
  31875. NullFields []string `json:"-"`
  31876. }
  31877. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  31878. type NoMethod UrlMapsValidateRequest
  31879. raw := NoMethod(*s)
  31880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31881. }
  31882. type UrlMapsValidateResponse struct {
  31883. Result *UrlMapValidationResult `json:"result,omitempty"`
  31884. // ServerResponse contains the HTTP response code and headers from the
  31885. // server.
  31886. googleapi.ServerResponse `json:"-"`
  31887. // ForceSendFields is a list of field names (e.g. "Result") to
  31888. // unconditionally include in API requests. By default, fields with
  31889. // empty values are omitted from API requests. However, any non-pointer,
  31890. // non-interface field appearing in ForceSendFields will be sent to the
  31891. // server regardless of whether the field is empty or not. This may be
  31892. // used to include empty fields in Patch requests.
  31893. ForceSendFields []string `json:"-"`
  31894. // NullFields is a list of field names (e.g. "Result") to include in API
  31895. // requests with the JSON null value. By default, fields with empty
  31896. // values are omitted from API requests. However, any field with an
  31897. // empty value appearing in NullFields will be sent to the server as
  31898. // null. It is an error if a field in this list has a non-empty value.
  31899. // This may be used to include null fields in Patch requests.
  31900. NullFields []string `json:"-"`
  31901. }
  31902. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  31903. type NoMethod UrlMapsValidateResponse
  31904. raw := NoMethod(*s)
  31905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31906. }
  31907. // UsableSubnetwork: Subnetwork which the current user has
  31908. // compute.subnetworks.use permission on.
  31909. type UsableSubnetwork struct {
  31910. // IpCidrRange: The range of internal addresses that are owned by this
  31911. // subnetwork.
  31912. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31913. // Network: Network URL.
  31914. Network string `json:"network,omitempty"`
  31915. // SecondaryIpRanges: Secondary IP ranges.
  31916. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  31917. // Subnetwork: Subnetwork URL.
  31918. Subnetwork string `json:"subnetwork,omitempty"`
  31919. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  31920. // unconditionally include in API requests. By default, fields with
  31921. // empty values are omitted from API requests. However, any non-pointer,
  31922. // non-interface field appearing in ForceSendFields will be sent to the
  31923. // server regardless of whether the field is empty or not. This may be
  31924. // used to include empty fields in Patch requests.
  31925. ForceSendFields []string `json:"-"`
  31926. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  31927. // in API requests with the JSON null value. By default, fields with
  31928. // empty values are omitted from API requests. However, any field with
  31929. // an empty value appearing in NullFields will be sent to the server as
  31930. // null. It is an error if a field in this list has a non-empty value.
  31931. // This may be used to include null fields in Patch requests.
  31932. NullFields []string `json:"-"`
  31933. }
  31934. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  31935. type NoMethod UsableSubnetwork
  31936. raw := NoMethod(*s)
  31937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31938. }
  31939. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  31940. // subnetwork.
  31941. type UsableSubnetworkSecondaryRange struct {
  31942. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  31943. // secondary range.
  31944. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31945. // RangeName: The name associated with this subnetwork secondary range,
  31946. // used when adding an alias IP range to a VM instance. The name must be
  31947. // 1-63 characters long, and comply with RFC1035. The name must be
  31948. // unique within the subnetwork.
  31949. RangeName string `json:"rangeName,omitempty"`
  31950. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  31951. // unconditionally include in API requests. By default, fields with
  31952. // empty values are omitted from API requests. However, any non-pointer,
  31953. // non-interface field appearing in ForceSendFields will be sent to the
  31954. // server regardless of whether the field is empty or not. This may be
  31955. // used to include empty fields in Patch requests.
  31956. ForceSendFields []string `json:"-"`
  31957. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  31958. // in API requests with the JSON null value. By default, fields with
  31959. // empty values are omitted from API requests. However, any field with
  31960. // an empty value appearing in NullFields will be sent to the server as
  31961. // null. It is an error if a field in this list has a non-empty value.
  31962. // This may be used to include null fields in Patch requests.
  31963. NullFields []string `json:"-"`
  31964. }
  31965. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  31966. type NoMethod UsableSubnetworkSecondaryRange
  31967. raw := NoMethod(*s)
  31968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31969. }
  31970. type UsableSubnetworksAggregatedList struct {
  31971. // Id: [Output Only] The unique identifier for the resource. This
  31972. // identifier is defined by the server.
  31973. Id string `json:"id,omitempty"`
  31974. // Items: [Output] A list of usable subnetwork URLs.
  31975. Items []*UsableSubnetwork `json:"items,omitempty"`
  31976. // Kind: [Output Only] Type of resource. Always
  31977. // compute#usableSubnetworksAggregatedList for aggregated lists of
  31978. // usable subnetworks.
  31979. Kind string `json:"kind,omitempty"`
  31980. // NextPageToken: [Output Only] This token allows you to get the next
  31981. // page of results for list requests. If the number of results is larger
  31982. // than maxResults, use the nextPageToken as a value for the query
  31983. // parameter pageToken in the next list request. Subsequent list
  31984. // requests will have their own nextPageToken to continue paging through
  31985. // the results.
  31986. NextPageToken string `json:"nextPageToken,omitempty"`
  31987. // SelfLink: [Output Only] Server-defined URL for this resource.
  31988. SelfLink string `json:"selfLink,omitempty"`
  31989. // Warning: [Output Only] Informational warning message.
  31990. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  31991. // ServerResponse contains the HTTP response code and headers from the
  31992. // server.
  31993. googleapi.ServerResponse `json:"-"`
  31994. // ForceSendFields is a list of field names (e.g. "Id") to
  31995. // unconditionally include in API requests. By default, fields with
  31996. // empty values are omitted from API requests. However, any non-pointer,
  31997. // non-interface field appearing in ForceSendFields will be sent to the
  31998. // server regardless of whether the field is empty or not. This may be
  31999. // used to include empty fields in Patch requests.
  32000. ForceSendFields []string `json:"-"`
  32001. // NullFields is a list of field names (e.g. "Id") to include in API
  32002. // requests with the JSON null value. By default, fields with empty
  32003. // values are omitted from API requests. However, any field with an
  32004. // empty value appearing in NullFields will be sent to the server as
  32005. // null. It is an error if a field in this list has a non-empty value.
  32006. // This may be used to include null fields in Patch requests.
  32007. NullFields []string `json:"-"`
  32008. }
  32009. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  32010. type NoMethod UsableSubnetworksAggregatedList
  32011. raw := NoMethod(*s)
  32012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32013. }
  32014. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  32015. // warning message.
  32016. type UsableSubnetworksAggregatedListWarning struct {
  32017. // Code: [Output Only] A warning code, if applicable. For example,
  32018. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32019. // the response.
  32020. //
  32021. // Possible values:
  32022. // "CLEANUP_FAILED"
  32023. // "DEPRECATED_RESOURCE_USED"
  32024. // "DEPRECATED_TYPE_USED"
  32025. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32026. // "EXPERIMENTAL_TYPE_USED"
  32027. // "EXTERNAL_API_WARNING"
  32028. // "FIELD_VALUE_OVERRIDEN"
  32029. // "INJECTED_KERNELS_DEPRECATED"
  32030. // "MISSING_TYPE_DEPENDENCY"
  32031. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32032. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32033. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32034. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32035. // "NEXT_HOP_NOT_RUNNING"
  32036. // "NOT_CRITICAL_ERROR"
  32037. // "NO_RESULTS_ON_PAGE"
  32038. // "REQUIRED_TOS_AGREEMENT"
  32039. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32040. // "RESOURCE_NOT_DELETED"
  32041. // "SCHEMA_VALIDATION_IGNORED"
  32042. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32043. // "UNDECLARED_PROPERTIES"
  32044. // "UNREACHABLE"
  32045. Code string `json:"code,omitempty"`
  32046. // Data: [Output Only] Metadata about this warning in key: value format.
  32047. // For example:
  32048. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32049. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  32050. // Message: [Output Only] A human-readable description of the warning
  32051. // code.
  32052. Message string `json:"message,omitempty"`
  32053. // ForceSendFields is a list of field names (e.g. "Code") to
  32054. // unconditionally include in API requests. By default, fields with
  32055. // empty values are omitted from API requests. However, any non-pointer,
  32056. // non-interface field appearing in ForceSendFields will be sent to the
  32057. // server regardless of whether the field is empty or not. This may be
  32058. // used to include empty fields in Patch requests.
  32059. ForceSendFields []string `json:"-"`
  32060. // NullFields is a list of field names (e.g. "Code") to include in API
  32061. // requests with the JSON null value. By default, fields with empty
  32062. // values are omitted from API requests. However, any field with an
  32063. // empty value appearing in NullFields will be sent to the server as
  32064. // null. It is an error if a field in this list has a non-empty value.
  32065. // This may be used to include null fields in Patch requests.
  32066. NullFields []string `json:"-"`
  32067. }
  32068. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32069. type NoMethod UsableSubnetworksAggregatedListWarning
  32070. raw := NoMethod(*s)
  32071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32072. }
  32073. type UsableSubnetworksAggregatedListWarningData struct {
  32074. // Key: [Output Only] A key that provides more detail on the warning
  32075. // being returned. For example, for warnings where there are no results
  32076. // in a list request for a particular zone, this key might be scope and
  32077. // the key value might be the zone name. Other examples might be a key
  32078. // indicating a deprecated resource and a suggested replacement, or a
  32079. // warning about invalid network settings (for example, if an instance
  32080. // attempts to perform IP forwarding but is not enabled for IP
  32081. // forwarding).
  32082. Key string `json:"key,omitempty"`
  32083. // Value: [Output Only] A warning data value corresponding to the key.
  32084. Value string `json:"value,omitempty"`
  32085. // ForceSendFields is a list of field names (e.g. "Key") to
  32086. // unconditionally include in API requests. By default, fields with
  32087. // empty values are omitted from API requests. However, any non-pointer,
  32088. // non-interface field appearing in ForceSendFields will be sent to the
  32089. // server regardless of whether the field is empty or not. This may be
  32090. // used to include empty fields in Patch requests.
  32091. ForceSendFields []string `json:"-"`
  32092. // NullFields is a list of field names (e.g. "Key") to include in API
  32093. // requests with the JSON null value. By default, fields with empty
  32094. // values are omitted from API requests. However, any field with an
  32095. // empty value appearing in NullFields will be sent to the server as
  32096. // null. It is an error if a field in this list has a non-empty value.
  32097. // This may be used to include null fields in Patch requests.
  32098. NullFields []string `json:"-"`
  32099. }
  32100. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32101. type NoMethod UsableSubnetworksAggregatedListWarningData
  32102. raw := NoMethod(*s)
  32103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32104. }
  32105. // UsageExportLocation: The location in Cloud Storage and naming method
  32106. // of the daily usage report. Contains bucket_name and report_name
  32107. // prefix.
  32108. type UsageExportLocation struct {
  32109. // BucketName: The name of an existing bucket in Cloud Storage where the
  32110. // usage report object is stored. The Google Service Account is granted
  32111. // write access to this bucket. This can either be the bucket name by
  32112. // itself, such as example-bucket, or the bucket name with gs:// or
  32113. // https://storage.googleapis.com/ in front of it, such as
  32114. // gs://example-bucket.
  32115. BucketName string `json:"bucketName,omitempty"`
  32116. // ReportNamePrefix: An optional prefix for the name of the usage report
  32117. // object stored in bucketName. If not supplied, defaults to usage. The
  32118. // report is stored as a CSV file named
  32119. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  32120. // usage according to Pacific Time. If you supply a prefix, it should
  32121. // conform to Cloud Storage object naming conventions.
  32122. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  32123. // ForceSendFields is a list of field names (e.g. "BucketName") to
  32124. // unconditionally include in API requests. By default, fields with
  32125. // empty values are omitted from API requests. However, any non-pointer,
  32126. // non-interface field appearing in ForceSendFields will be sent to the
  32127. // server regardless of whether the field is empty or not. This may be
  32128. // used to include empty fields in Patch requests.
  32129. ForceSendFields []string `json:"-"`
  32130. // NullFields is a list of field names (e.g. "BucketName") to include in
  32131. // API requests with the JSON null value. By default, fields with empty
  32132. // values are omitted from API requests. However, any field with an
  32133. // empty value appearing in NullFields will be sent to the server as
  32134. // null. It is an error if a field in this list has a non-empty value.
  32135. // This may be used to include null fields in Patch requests.
  32136. NullFields []string `json:"-"`
  32137. }
  32138. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  32139. type NoMethod UsageExportLocation
  32140. raw := NoMethod(*s)
  32141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32142. }
  32143. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  32144. // endpoint (i.e., NIC).
  32145. type VmEndpointNatMappings struct {
  32146. // InstanceName: Name of the VM instance which the endpoint belongs to
  32147. InstanceName string `json:"instanceName,omitempty"`
  32148. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  32149. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  32150. // unconditionally include in API requests. By default, fields with
  32151. // empty values are omitted from API requests. However, any non-pointer,
  32152. // non-interface field appearing in ForceSendFields will be sent to the
  32153. // server regardless of whether the field is empty or not. This may be
  32154. // used to include empty fields in Patch requests.
  32155. ForceSendFields []string `json:"-"`
  32156. // NullFields is a list of field names (e.g. "InstanceName") to include
  32157. // in API requests with the JSON null value. By default, fields with
  32158. // empty values are omitted from API requests. However, any field with
  32159. // an empty value appearing in NullFields will be sent to the server as
  32160. // null. It is an error if a field in this list has a non-empty value.
  32161. // This may be used to include null fields in Patch requests.
  32162. NullFields []string `json:"-"`
  32163. }
  32164. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  32165. type NoMethod VmEndpointNatMappings
  32166. raw := NoMethod(*s)
  32167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32168. }
  32169. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  32170. // mapping for an interface of this endpoint.
  32171. type VmEndpointNatMappingsInterfaceNatMappings struct {
  32172. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  32173. // this interface. These ranges are inclusive, that is, both the first
  32174. // and the last ports can be used for NAT. Example:
  32175. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  32176. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  32177. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  32178. // to this interface. It equals to the aggregated port number in the
  32179. // field nat_ip_port_ranges.
  32180. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  32181. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  32182. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  32183. // "192.168.5.0/24".
  32184. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  32185. // SourceVirtualIp: Primary IP of the VM for this NIC.
  32186. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  32187. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  32188. // unconditionally include in API requests. By default, fields with
  32189. // empty values are omitted from API requests. However, any non-pointer,
  32190. // non-interface field appearing in ForceSendFields will be sent to the
  32191. // server regardless of whether the field is empty or not. This may be
  32192. // used to include empty fields in Patch requests.
  32193. ForceSendFields []string `json:"-"`
  32194. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  32195. // include in API requests with the JSON null value. By default, fields
  32196. // with empty values are omitted from API requests. However, any field
  32197. // with an empty value appearing in NullFields will be sent to the
  32198. // server as null. It is an error if a field in this list has a
  32199. // non-empty value. This may be used to include null fields in Patch
  32200. // requests.
  32201. NullFields []string `json:"-"`
  32202. }
  32203. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  32204. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  32205. raw := NoMethod(*s)
  32206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32207. }
  32208. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  32209. type VmEndpointNatMappingsList struct {
  32210. // Id: [Output Only] The unique identifier for the resource. This
  32211. // identifier is defined by the server.
  32212. Id string `json:"id,omitempty"`
  32213. // Kind: [Output Only] Type of resource. Always
  32214. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  32215. // endpoints.
  32216. Kind string `json:"kind,omitempty"`
  32217. // NextPageToken: [Output Only] This token allows you to get the next
  32218. // page of results for list requests. If the number of results is larger
  32219. // than maxResults, use the nextPageToken as a value for the query
  32220. // parameter pageToken in the next list request. Subsequent list
  32221. // requests will have their own nextPageToken to continue paging through
  32222. // the results.
  32223. NextPageToken string `json:"nextPageToken,omitempty"`
  32224. // Result: [Output Only] A list of Nat mapping information of VM
  32225. // endpoints.
  32226. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  32227. // SelfLink: [Output Only] Server-defined URL for this resource.
  32228. SelfLink string `json:"selfLink,omitempty"`
  32229. // Warning: [Output Only] Informational warning message.
  32230. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  32231. // ServerResponse contains the HTTP response code and headers from the
  32232. // server.
  32233. googleapi.ServerResponse `json:"-"`
  32234. // ForceSendFields is a list of field names (e.g. "Id") to
  32235. // unconditionally include in API requests. By default, fields with
  32236. // empty values are omitted from API requests. However, any non-pointer,
  32237. // non-interface field appearing in ForceSendFields will be sent to the
  32238. // server regardless of whether the field is empty or not. This may be
  32239. // used to include empty fields in Patch requests.
  32240. ForceSendFields []string `json:"-"`
  32241. // NullFields is a list of field names (e.g. "Id") to include in API
  32242. // requests with the JSON null value. By default, fields with empty
  32243. // values are omitted from API requests. However, any field with an
  32244. // empty value appearing in NullFields will be sent to the server as
  32245. // null. It is an error if a field in this list has a non-empty value.
  32246. // This may be used to include null fields in Patch requests.
  32247. NullFields []string `json:"-"`
  32248. }
  32249. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  32250. type NoMethod VmEndpointNatMappingsList
  32251. raw := NoMethod(*s)
  32252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32253. }
  32254. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  32255. // message.
  32256. type VmEndpointNatMappingsListWarning struct {
  32257. // Code: [Output Only] A warning code, if applicable. For example,
  32258. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32259. // the response.
  32260. //
  32261. // Possible values:
  32262. // "CLEANUP_FAILED"
  32263. // "DEPRECATED_RESOURCE_USED"
  32264. // "DEPRECATED_TYPE_USED"
  32265. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32266. // "EXPERIMENTAL_TYPE_USED"
  32267. // "EXTERNAL_API_WARNING"
  32268. // "FIELD_VALUE_OVERRIDEN"
  32269. // "INJECTED_KERNELS_DEPRECATED"
  32270. // "MISSING_TYPE_DEPENDENCY"
  32271. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32272. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32273. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32274. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32275. // "NEXT_HOP_NOT_RUNNING"
  32276. // "NOT_CRITICAL_ERROR"
  32277. // "NO_RESULTS_ON_PAGE"
  32278. // "REQUIRED_TOS_AGREEMENT"
  32279. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32280. // "RESOURCE_NOT_DELETED"
  32281. // "SCHEMA_VALIDATION_IGNORED"
  32282. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32283. // "UNDECLARED_PROPERTIES"
  32284. // "UNREACHABLE"
  32285. Code string `json:"code,omitempty"`
  32286. // Data: [Output Only] Metadata about this warning in key: value format.
  32287. // For example:
  32288. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32289. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  32290. // Message: [Output Only] A human-readable description of the warning
  32291. // code.
  32292. Message string `json:"message,omitempty"`
  32293. // ForceSendFields is a list of field names (e.g. "Code") to
  32294. // unconditionally include in API requests. By default, fields with
  32295. // empty values are omitted from API requests. However, any non-pointer,
  32296. // non-interface field appearing in ForceSendFields will be sent to the
  32297. // server regardless of whether the field is empty or not. This may be
  32298. // used to include empty fields in Patch requests.
  32299. ForceSendFields []string `json:"-"`
  32300. // NullFields is a list of field names (e.g. "Code") to include in API
  32301. // requests with the JSON null value. By default, fields with empty
  32302. // values are omitted from API requests. However, any field with an
  32303. // empty value appearing in NullFields will be sent to the server as
  32304. // null. It is an error if a field in this list has a non-empty value.
  32305. // This may be used to include null fields in Patch requests.
  32306. NullFields []string `json:"-"`
  32307. }
  32308. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  32309. type NoMethod VmEndpointNatMappingsListWarning
  32310. raw := NoMethod(*s)
  32311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32312. }
  32313. type VmEndpointNatMappingsListWarningData struct {
  32314. // Key: [Output Only] A key that provides more detail on the warning
  32315. // being returned. For example, for warnings where there are no results
  32316. // in a list request for a particular zone, this key might be scope and
  32317. // the key value might be the zone name. Other examples might be a key
  32318. // indicating a deprecated resource and a suggested replacement, or a
  32319. // warning about invalid network settings (for example, if an instance
  32320. // attempts to perform IP forwarding but is not enabled for IP
  32321. // forwarding).
  32322. Key string `json:"key,omitempty"`
  32323. // Value: [Output Only] A warning data value corresponding to the key.
  32324. Value string `json:"value,omitempty"`
  32325. // ForceSendFields is a list of field names (e.g. "Key") to
  32326. // unconditionally include in API requests. By default, fields with
  32327. // empty values are omitted from API requests. However, any non-pointer,
  32328. // non-interface field appearing in ForceSendFields will be sent to the
  32329. // server regardless of whether the field is empty or not. This may be
  32330. // used to include empty fields in Patch requests.
  32331. ForceSendFields []string `json:"-"`
  32332. // NullFields is a list of field names (e.g. "Key") to include in API
  32333. // requests with the JSON null value. By default, fields with empty
  32334. // values are omitted from API requests. However, any field with an
  32335. // empty value appearing in NullFields will be sent to the server as
  32336. // null. It is an error if a field in this list has a non-empty value.
  32337. // This may be used to include null fields in Patch requests.
  32338. NullFields []string `json:"-"`
  32339. }
  32340. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  32341. type NoMethod VmEndpointNatMappingsListWarningData
  32342. raw := NoMethod(*s)
  32343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32344. }
  32345. // VpnGateway: Represents a VPN gateway resource.
  32346. type VpnGateway struct {
  32347. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32348. // format.
  32349. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32350. // Description: An optional description of this resource. Provide this
  32351. // property when you create the resource.
  32352. Description string `json:"description,omitempty"`
  32353. // Id: [Output Only] The unique identifier for the resource. This
  32354. // identifier is defined by the server.
  32355. Id uint64 `json:"id,omitempty,string"`
  32356. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  32357. // VPN gateways.
  32358. Kind string `json:"kind,omitempty"`
  32359. // LabelFingerprint: A fingerprint for the labels being applied to this
  32360. // VpnGateway, which is essentially a hash of the labels set used for
  32361. // optimistic locking. The fingerprint is initially generated by Compute
  32362. // Engine and changes after every request to modify or update labels.
  32363. // You must always provide an up-to-date fingerprint hash in order to
  32364. // update or change labels, otherwise the request will fail with error
  32365. // 412 conditionNotMet.
  32366. //
  32367. // To see the latest fingerprint, make a get() request to retrieve an
  32368. // VpnGateway.
  32369. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  32370. // Labels: Labels to apply to this VpnGateway resource. These can be
  32371. // later modified by the setLabels method. Each label key/value must
  32372. // comply with RFC1035. Label values may be empty.
  32373. Labels map[string]string `json:"labels,omitempty"`
  32374. // Name: Name of the resource. Provided by the client when the resource
  32375. // is created. The name must be 1-63 characters long, and comply with
  32376. // RFC1035. Specifically, the name must be 1-63 characters long and
  32377. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32378. // the first character must be a lowercase letter, and all following
  32379. // characters must be a dash, lowercase letter, or digit, except the
  32380. // last character, which cannot be a dash.
  32381. Name string `json:"name,omitempty"`
  32382. // Network: URL of the network to which this VPN gateway is attached.
  32383. // Provided by the client when the VPN gateway is created.
  32384. Network string `json:"network,omitempty"`
  32385. // Region: [Output Only] URL of the region where the VPN gateway
  32386. // resides.
  32387. Region string `json:"region,omitempty"`
  32388. // SelfLink: [Output Only] Server-defined URL for the resource.
  32389. SelfLink string `json:"selfLink,omitempty"`
  32390. // VpnInterfaces: [Output Only] A list of interfaces on this VPN
  32391. // gateway.
  32392. VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
  32393. // ServerResponse contains the HTTP response code and headers from the
  32394. // server.
  32395. googleapi.ServerResponse `json:"-"`
  32396. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32397. // to unconditionally include in API requests. By default, fields with
  32398. // empty values are omitted from API requests. However, any non-pointer,
  32399. // non-interface field appearing in ForceSendFields will be sent to the
  32400. // server regardless of whether the field is empty or not. This may be
  32401. // used to include empty fields in Patch requests.
  32402. ForceSendFields []string `json:"-"`
  32403. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32404. // include in API requests with the JSON null value. By default, fields
  32405. // with empty values are omitted from API requests. However, any field
  32406. // with an empty value appearing in NullFields will be sent to the
  32407. // server as null. It is an error if a field in this list has a
  32408. // non-empty value. This may be used to include null fields in Patch
  32409. // requests.
  32410. NullFields []string `json:"-"`
  32411. }
  32412. func (s *VpnGateway) MarshalJSON() ([]byte, error) {
  32413. type NoMethod VpnGateway
  32414. raw := NoMethod(*s)
  32415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32416. }
  32417. type VpnGatewayAggregatedList struct {
  32418. // Id: [Output Only] Unique identifier for the resource; defined by the
  32419. // server.
  32420. Id string `json:"id,omitempty"`
  32421. // Items: A list of VpnGateway resources.
  32422. Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
  32423. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  32424. // VPN gateways.
  32425. Kind string `json:"kind,omitempty"`
  32426. // NextPageToken: [Output Only] This token allows you to get the next
  32427. // page of results for list requests. If the number of results is larger
  32428. // than maxResults, use the nextPageToken as a value for the query
  32429. // parameter pageToken in the next list request. Subsequent list
  32430. // requests will have their own nextPageToken to continue paging through
  32431. // the results.
  32432. NextPageToken string `json:"nextPageToken,omitempty"`
  32433. // SelfLink: [Output Only] Server-defined URL for this resource.
  32434. SelfLink string `json:"selfLink,omitempty"`
  32435. // Warning: [Output Only] Informational warning message.
  32436. Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  32437. // ServerResponse contains the HTTP response code and headers from the
  32438. // server.
  32439. googleapi.ServerResponse `json:"-"`
  32440. // ForceSendFields is a list of field names (e.g. "Id") to
  32441. // unconditionally include in API requests. By default, fields with
  32442. // empty values are omitted from API requests. However, any non-pointer,
  32443. // non-interface field appearing in ForceSendFields will be sent to the
  32444. // server regardless of whether the field is empty or not. This may be
  32445. // used to include empty fields in Patch requests.
  32446. ForceSendFields []string `json:"-"`
  32447. // NullFields is a list of field names (e.g. "Id") to include in API
  32448. // requests with the JSON null value. By default, fields with empty
  32449. // values are omitted from API requests. However, any field with an
  32450. // empty value appearing in NullFields will be sent to the server as
  32451. // null. It is an error if a field in this list has a non-empty value.
  32452. // This may be used to include null fields in Patch requests.
  32453. NullFields []string `json:"-"`
  32454. }
  32455. func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  32456. type NoMethod VpnGatewayAggregatedList
  32457. raw := NoMethod(*s)
  32458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32459. }
  32460. // VpnGatewayAggregatedListWarning: [Output Only] Informational warning
  32461. // message.
  32462. type VpnGatewayAggregatedListWarning struct {
  32463. // Code: [Output Only] A warning code, if applicable. For example,
  32464. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32465. // the response.
  32466. //
  32467. // Possible values:
  32468. // "CLEANUP_FAILED"
  32469. // "DEPRECATED_RESOURCE_USED"
  32470. // "DEPRECATED_TYPE_USED"
  32471. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32472. // "EXPERIMENTAL_TYPE_USED"
  32473. // "EXTERNAL_API_WARNING"
  32474. // "FIELD_VALUE_OVERRIDEN"
  32475. // "INJECTED_KERNELS_DEPRECATED"
  32476. // "MISSING_TYPE_DEPENDENCY"
  32477. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32478. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32479. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32480. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32481. // "NEXT_HOP_NOT_RUNNING"
  32482. // "NOT_CRITICAL_ERROR"
  32483. // "NO_RESULTS_ON_PAGE"
  32484. // "REQUIRED_TOS_AGREEMENT"
  32485. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32486. // "RESOURCE_NOT_DELETED"
  32487. // "SCHEMA_VALIDATION_IGNORED"
  32488. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32489. // "UNDECLARED_PROPERTIES"
  32490. // "UNREACHABLE"
  32491. Code string `json:"code,omitempty"`
  32492. // Data: [Output Only] Metadata about this warning in key: value format.
  32493. // For example:
  32494. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32495. Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  32496. // Message: [Output Only] A human-readable description of the warning
  32497. // code.
  32498. Message string `json:"message,omitempty"`
  32499. // ForceSendFields is a list of field names (e.g. "Code") to
  32500. // unconditionally include in API requests. By default, fields with
  32501. // empty values are omitted from API requests. However, any non-pointer,
  32502. // non-interface field appearing in ForceSendFields will be sent to the
  32503. // server regardless of whether the field is empty or not. This may be
  32504. // used to include empty fields in Patch requests.
  32505. ForceSendFields []string `json:"-"`
  32506. // NullFields is a list of field names (e.g. "Code") to include in API
  32507. // requests with the JSON null value. By default, fields with empty
  32508. // values are omitted from API requests. However, any field with an
  32509. // empty value appearing in NullFields will be sent to the server as
  32510. // null. It is an error if a field in this list has a non-empty value.
  32511. // This may be used to include null fields in Patch requests.
  32512. NullFields []string `json:"-"`
  32513. }
  32514. func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32515. type NoMethod VpnGatewayAggregatedListWarning
  32516. raw := NoMethod(*s)
  32517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32518. }
  32519. type VpnGatewayAggregatedListWarningData struct {
  32520. // Key: [Output Only] A key that provides more detail on the warning
  32521. // being returned. For example, for warnings where there are no results
  32522. // in a list request for a particular zone, this key might be scope and
  32523. // the key value might be the zone name. Other examples might be a key
  32524. // indicating a deprecated resource and a suggested replacement, or a
  32525. // warning about invalid network settings (for example, if an instance
  32526. // attempts to perform IP forwarding but is not enabled for IP
  32527. // forwarding).
  32528. Key string `json:"key,omitempty"`
  32529. // Value: [Output Only] A warning data value corresponding to the key.
  32530. Value string `json:"value,omitempty"`
  32531. // ForceSendFields is a list of field names (e.g. "Key") to
  32532. // unconditionally include in API requests. By default, fields with
  32533. // empty values are omitted from API requests. However, any non-pointer,
  32534. // non-interface field appearing in ForceSendFields will be sent to the
  32535. // server regardless of whether the field is empty or not. This may be
  32536. // used to include empty fields in Patch requests.
  32537. ForceSendFields []string `json:"-"`
  32538. // NullFields is a list of field names (e.g. "Key") to include in API
  32539. // requests with the JSON null value. By default, fields with empty
  32540. // values are omitted from API requests. However, any field with an
  32541. // empty value appearing in NullFields will be sent to the server as
  32542. // null. It is an error if a field in this list has a non-empty value.
  32543. // This may be used to include null fields in Patch requests.
  32544. NullFields []string `json:"-"`
  32545. }
  32546. func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32547. type NoMethod VpnGatewayAggregatedListWarningData
  32548. raw := NoMethod(*s)
  32549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32550. }
  32551. // VpnGatewayList: Contains a list of VpnGateway resources.
  32552. type VpnGatewayList struct {
  32553. // Id: [Output Only] Unique identifier for the resource; defined by the
  32554. // server.
  32555. Id string `json:"id,omitempty"`
  32556. // Items: A list of VpnGateway resources.
  32557. Items []*VpnGateway `json:"items,omitempty"`
  32558. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  32559. // VPN gateways.
  32560. Kind string `json:"kind,omitempty"`
  32561. // NextPageToken: [Output Only] This token allows you to get the next
  32562. // page of results for list requests. If the number of results is larger
  32563. // than maxResults, use the nextPageToken as a value for the query
  32564. // parameter pageToken in the next list request. Subsequent list
  32565. // requests will have their own nextPageToken to continue paging through
  32566. // the results.
  32567. NextPageToken string `json:"nextPageToken,omitempty"`
  32568. // SelfLink: [Output Only] Server-defined URL for this resource.
  32569. SelfLink string `json:"selfLink,omitempty"`
  32570. // Warning: [Output Only] Informational warning message.
  32571. Warning *VpnGatewayListWarning `json:"warning,omitempty"`
  32572. // ServerResponse contains the HTTP response code and headers from the
  32573. // server.
  32574. googleapi.ServerResponse `json:"-"`
  32575. // ForceSendFields is a list of field names (e.g. "Id") to
  32576. // unconditionally include in API requests. By default, fields with
  32577. // empty values are omitted from API requests. However, any non-pointer,
  32578. // non-interface field appearing in ForceSendFields will be sent to the
  32579. // server regardless of whether the field is empty or not. This may be
  32580. // used to include empty fields in Patch requests.
  32581. ForceSendFields []string `json:"-"`
  32582. // NullFields is a list of field names (e.g. "Id") to include in API
  32583. // requests with the JSON null value. By default, fields with empty
  32584. // values are omitted from API requests. However, any field with an
  32585. // empty value appearing in NullFields will be sent to the server as
  32586. // null. It is an error if a field in this list has a non-empty value.
  32587. // This may be used to include null fields in Patch requests.
  32588. NullFields []string `json:"-"`
  32589. }
  32590. func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
  32591. type NoMethod VpnGatewayList
  32592. raw := NoMethod(*s)
  32593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32594. }
  32595. // VpnGatewayListWarning: [Output Only] Informational warning message.
  32596. type VpnGatewayListWarning struct {
  32597. // Code: [Output Only] A warning code, if applicable. For example,
  32598. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32599. // the response.
  32600. //
  32601. // Possible values:
  32602. // "CLEANUP_FAILED"
  32603. // "DEPRECATED_RESOURCE_USED"
  32604. // "DEPRECATED_TYPE_USED"
  32605. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32606. // "EXPERIMENTAL_TYPE_USED"
  32607. // "EXTERNAL_API_WARNING"
  32608. // "FIELD_VALUE_OVERRIDEN"
  32609. // "INJECTED_KERNELS_DEPRECATED"
  32610. // "MISSING_TYPE_DEPENDENCY"
  32611. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32612. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32613. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32614. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32615. // "NEXT_HOP_NOT_RUNNING"
  32616. // "NOT_CRITICAL_ERROR"
  32617. // "NO_RESULTS_ON_PAGE"
  32618. // "REQUIRED_TOS_AGREEMENT"
  32619. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32620. // "RESOURCE_NOT_DELETED"
  32621. // "SCHEMA_VALIDATION_IGNORED"
  32622. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32623. // "UNDECLARED_PROPERTIES"
  32624. // "UNREACHABLE"
  32625. Code string `json:"code,omitempty"`
  32626. // Data: [Output Only] Metadata about this warning in key: value format.
  32627. // For example:
  32628. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32629. Data []*VpnGatewayListWarningData `json:"data,omitempty"`
  32630. // Message: [Output Only] A human-readable description of the warning
  32631. // code.
  32632. Message string `json:"message,omitempty"`
  32633. // ForceSendFields is a list of field names (e.g. "Code") to
  32634. // unconditionally include in API requests. By default, fields with
  32635. // empty values are omitted from API requests. However, any non-pointer,
  32636. // non-interface field appearing in ForceSendFields will be sent to the
  32637. // server regardless of whether the field is empty or not. This may be
  32638. // used to include empty fields in Patch requests.
  32639. ForceSendFields []string `json:"-"`
  32640. // NullFields is a list of field names (e.g. "Code") to include in API
  32641. // requests with the JSON null value. By default, fields with empty
  32642. // values are omitted from API requests. However, any field with an
  32643. // empty value appearing in NullFields will be sent to the server as
  32644. // null. It is an error if a field in this list has a non-empty value.
  32645. // This may be used to include null fields in Patch requests.
  32646. NullFields []string `json:"-"`
  32647. }
  32648. func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  32649. type NoMethod VpnGatewayListWarning
  32650. raw := NoMethod(*s)
  32651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32652. }
  32653. type VpnGatewayListWarningData struct {
  32654. // Key: [Output Only] A key that provides more detail on the warning
  32655. // being returned. For example, for warnings where there are no results
  32656. // in a list request for a particular zone, this key might be scope and
  32657. // the key value might be the zone name. Other examples might be a key
  32658. // indicating a deprecated resource and a suggested replacement, or a
  32659. // warning about invalid network settings (for example, if an instance
  32660. // attempts to perform IP forwarding but is not enabled for IP
  32661. // forwarding).
  32662. Key string `json:"key,omitempty"`
  32663. // Value: [Output Only] A warning data value corresponding to the key.
  32664. Value string `json:"value,omitempty"`
  32665. // ForceSendFields is a list of field names (e.g. "Key") to
  32666. // unconditionally include in API requests. By default, fields with
  32667. // empty values are omitted from API requests. However, any non-pointer,
  32668. // non-interface field appearing in ForceSendFields will be sent to the
  32669. // server regardless of whether the field is empty or not. This may be
  32670. // used to include empty fields in Patch requests.
  32671. ForceSendFields []string `json:"-"`
  32672. // NullFields is a list of field names (e.g. "Key") to include in API
  32673. // requests with the JSON null value. By default, fields with empty
  32674. // values are omitted from API requests. However, any field with an
  32675. // empty value appearing in NullFields will be sent to the server as
  32676. // null. It is an error if a field in this list has a non-empty value.
  32677. // This may be used to include null fields in Patch requests.
  32678. NullFields []string `json:"-"`
  32679. }
  32680. func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  32681. type NoMethod VpnGatewayListWarningData
  32682. raw := NoMethod(*s)
  32683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32684. }
  32685. // VpnGatewayVpnGatewayInterface: A VPN gateway interface.
  32686. type VpnGatewayVpnGatewayInterface struct {
  32687. // Id: The numeric ID of this VPN gateway interface.
  32688. Id int64 `json:"id,omitempty"`
  32689. // IpAddress: The external IP address for this VPN gateway interface.
  32690. IpAddress string `json:"ipAddress,omitempty"`
  32691. // ForceSendFields is a list of field names (e.g. "Id") to
  32692. // unconditionally include in API requests. By default, fields with
  32693. // empty values are omitted from API requests. However, any non-pointer,
  32694. // non-interface field appearing in ForceSendFields will be sent to the
  32695. // server regardless of whether the field is empty or not. This may be
  32696. // used to include empty fields in Patch requests.
  32697. ForceSendFields []string `json:"-"`
  32698. // NullFields is a list of field names (e.g. "Id") to include in API
  32699. // requests with the JSON null value. By default, fields with empty
  32700. // values are omitted from API requests. However, any field with an
  32701. // empty value appearing in NullFields will be sent to the server as
  32702. // null. It is an error if a field in this list has a non-empty value.
  32703. // This may be used to include null fields in Patch requests.
  32704. NullFields []string `json:"-"`
  32705. }
  32706. func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  32707. type NoMethod VpnGatewayVpnGatewayInterface
  32708. raw := NoMethod(*s)
  32709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32710. }
  32711. type VpnGatewaysScopedList struct {
  32712. // VpnGateways: [Output Only] A list of VPN gateways contained in this
  32713. // scope.
  32714. VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
  32715. // Warning: [Output Only] Informational warning which replaces the list
  32716. // of addresses when the list is empty.
  32717. Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
  32718. // ForceSendFields is a list of field names (e.g. "VpnGateways") to
  32719. // unconditionally include in API requests. By default, fields with
  32720. // empty values are omitted from API requests. However, any non-pointer,
  32721. // non-interface field appearing in ForceSendFields will be sent to the
  32722. // server regardless of whether the field is empty or not. This may be
  32723. // used to include empty fields in Patch requests.
  32724. ForceSendFields []string `json:"-"`
  32725. // NullFields is a list of field names (e.g. "VpnGateways") to include
  32726. // in API requests with the JSON null value. By default, fields with
  32727. // empty values are omitted from API requests. However, any field with
  32728. // an empty value appearing in NullFields will be sent to the server as
  32729. // null. It is an error if a field in this list has a non-empty value.
  32730. // This may be used to include null fields in Patch requests.
  32731. NullFields []string `json:"-"`
  32732. }
  32733. func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  32734. type NoMethod VpnGatewaysScopedList
  32735. raw := NoMethod(*s)
  32736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32737. }
  32738. // VpnGatewaysScopedListWarning: [Output Only] Informational warning
  32739. // which replaces the list of addresses when the list is empty.
  32740. type VpnGatewaysScopedListWarning struct {
  32741. // Code: [Output Only] A warning code, if applicable. For example,
  32742. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32743. // the response.
  32744. //
  32745. // Possible values:
  32746. // "CLEANUP_FAILED"
  32747. // "DEPRECATED_RESOURCE_USED"
  32748. // "DEPRECATED_TYPE_USED"
  32749. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32750. // "EXPERIMENTAL_TYPE_USED"
  32751. // "EXTERNAL_API_WARNING"
  32752. // "FIELD_VALUE_OVERRIDEN"
  32753. // "INJECTED_KERNELS_DEPRECATED"
  32754. // "MISSING_TYPE_DEPENDENCY"
  32755. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32756. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32757. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32758. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32759. // "NEXT_HOP_NOT_RUNNING"
  32760. // "NOT_CRITICAL_ERROR"
  32761. // "NO_RESULTS_ON_PAGE"
  32762. // "REQUIRED_TOS_AGREEMENT"
  32763. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32764. // "RESOURCE_NOT_DELETED"
  32765. // "SCHEMA_VALIDATION_IGNORED"
  32766. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32767. // "UNDECLARED_PROPERTIES"
  32768. // "UNREACHABLE"
  32769. Code string `json:"code,omitempty"`
  32770. // Data: [Output Only] Metadata about this warning in key: value format.
  32771. // For example:
  32772. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32773. Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
  32774. // Message: [Output Only] A human-readable description of the warning
  32775. // code.
  32776. Message string `json:"message,omitempty"`
  32777. // ForceSendFields is a list of field names (e.g. "Code") to
  32778. // unconditionally include in API requests. By default, fields with
  32779. // empty values are omitted from API requests. However, any non-pointer,
  32780. // non-interface field appearing in ForceSendFields will be sent to the
  32781. // server regardless of whether the field is empty or not. This may be
  32782. // used to include empty fields in Patch requests.
  32783. ForceSendFields []string `json:"-"`
  32784. // NullFields is a list of field names (e.g. "Code") to include in API
  32785. // requests with the JSON null value. By default, fields with empty
  32786. // values are omitted from API requests. However, any field with an
  32787. // empty value appearing in NullFields will be sent to the server as
  32788. // null. It is an error if a field in this list has a non-empty value.
  32789. // This may be used to include null fields in Patch requests.
  32790. NullFields []string `json:"-"`
  32791. }
  32792. func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  32793. type NoMethod VpnGatewaysScopedListWarning
  32794. raw := NoMethod(*s)
  32795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32796. }
  32797. type VpnGatewaysScopedListWarningData struct {
  32798. // Key: [Output Only] A key that provides more detail on the warning
  32799. // being returned. For example, for warnings where there are no results
  32800. // in a list request for a particular zone, this key might be scope and
  32801. // the key value might be the zone name. Other examples might be a key
  32802. // indicating a deprecated resource and a suggested replacement, or a
  32803. // warning about invalid network settings (for example, if an instance
  32804. // attempts to perform IP forwarding but is not enabled for IP
  32805. // forwarding).
  32806. Key string `json:"key,omitempty"`
  32807. // Value: [Output Only] A warning data value corresponding to the key.
  32808. Value string `json:"value,omitempty"`
  32809. // ForceSendFields is a list of field names (e.g. "Key") to
  32810. // unconditionally include in API requests. By default, fields with
  32811. // empty values are omitted from API requests. However, any non-pointer,
  32812. // non-interface field appearing in ForceSendFields will be sent to the
  32813. // server regardless of whether the field is empty or not. This may be
  32814. // used to include empty fields in Patch requests.
  32815. ForceSendFields []string `json:"-"`
  32816. // NullFields is a list of field names (e.g. "Key") to include in API
  32817. // requests with the JSON null value. By default, fields with empty
  32818. // values are omitted from API requests. However, any field with an
  32819. // empty value appearing in NullFields will be sent to the server as
  32820. // null. It is an error if a field in this list has a non-empty value.
  32821. // This may be used to include null fields in Patch requests.
  32822. NullFields []string `json:"-"`
  32823. }
  32824. func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  32825. type NoMethod VpnGatewaysScopedListWarningData
  32826. raw := NoMethod(*s)
  32827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32828. }
  32829. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  32830. // (== resource_for v1.vpnTunnels ==)
  32831. type VpnTunnel struct {
  32832. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32833. // format.
  32834. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32835. // Description: An optional description of this resource. Provide this
  32836. // property when you create the resource.
  32837. Description string `json:"description,omitempty"`
  32838. // DetailedStatus: [Output Only] Detailed status message for the VPN
  32839. // tunnel.
  32840. DetailedStatus string `json:"detailedStatus,omitempty"`
  32841. // Id: [Output Only] The unique identifier for the resource. This
  32842. // identifier is defined by the server.
  32843. Id uint64 `json:"id,omitempty,string"`
  32844. // IkeVersion: IKE protocol version to use when establishing the VPN
  32845. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  32846. // Default version is 2.
  32847. IkeVersion int64 `json:"ikeVersion,omitempty"`
  32848. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  32849. // VPN tunnels.
  32850. Kind string `json:"kind,omitempty"`
  32851. // LabelFingerprint: A fingerprint for the labels being applied to this
  32852. // VpnTunnel, which is essentially a hash of the labels set used for
  32853. // optimistic locking. The fingerprint is initially generated by Compute
  32854. // Engine and changes after every request to modify or update labels.
  32855. // You must always provide an up-to-date fingerprint hash in order to
  32856. // update or change labels, otherwise the request will fail with error
  32857. // 412 conditionNotMet.
  32858. //
  32859. // To see the latest fingerprint, make a get() request to retrieve a
  32860. // VpnTunnel.
  32861. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  32862. // Labels: Labels to apply to this VpnTunnel. These can be later
  32863. // modified by the setLabels method. Each label key/value pair must
  32864. // comply with RFC1035. Label values may be empty.
  32865. Labels map[string]string `json:"labels,omitempty"`
  32866. // LocalTrafficSelector: Local traffic selector to use when establishing
  32867. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  32868. // formatted string, for example: 192.168.0.0/16. The ranges should be
  32869. // disjoint. Only IPv4 is supported.
  32870. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  32871. // Name: Name of the resource. Provided by the client when the resource
  32872. // is created. The name must be 1-63 characters long, and comply with
  32873. // RFC1035. Specifically, the name must be 1-63 characters long and
  32874. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32875. // the first character must be a lowercase letter, and all following
  32876. // characters must be a dash, lowercase letter, or digit, except the
  32877. // last character, which cannot be a dash.
  32878. Name string `json:"name,omitempty"`
  32879. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  32880. PeerIp string `json:"peerIp,omitempty"`
  32881. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  32882. // You must specify this field as part of the HTTP request URL. It is
  32883. // not settable as a field in the request body.
  32884. Region string `json:"region,omitempty"`
  32885. // RemoteTrafficSelector: Remote traffic selectors to use when
  32886. // establishing the VPN tunnel with peer VPN gateway. The value should
  32887. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  32888. // should be disjoint. Only IPv4 is supported.
  32889. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  32890. // Router: URL of router resource to be used for dynamic routing.
  32891. Router string `json:"router,omitempty"`
  32892. // SelfLink: [Output Only] Server-defined URL for the resource.
  32893. SelfLink string `json:"selfLink,omitempty"`
  32894. // SharedSecret: Shared secret used to set the secure session between
  32895. // the Cloud VPN gateway and the peer VPN gateway.
  32896. SharedSecret string `json:"sharedSecret,omitempty"`
  32897. // SharedSecretHash: Hash of the shared secret.
  32898. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  32899. // Status: [Output Only] The status of the VPN tunnel.
  32900. //
  32901. // Possible values:
  32902. // "ALLOCATING_RESOURCES"
  32903. // "AUTHORIZATION_ERROR"
  32904. // "DEPROVISIONING"
  32905. // "ESTABLISHED"
  32906. // "FAILED"
  32907. // "FIRST_HANDSHAKE"
  32908. // "NEGOTIATION_FAILURE"
  32909. // "NETWORK_ERROR"
  32910. // "NO_INCOMING_PACKETS"
  32911. // "PROVISIONING"
  32912. // "REJECTED"
  32913. // "WAITING_FOR_FULL_CONFIG"
  32914. Status string `json:"status,omitempty"`
  32915. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  32916. // tunnel is associated. Provided by the client when the VPN tunnel is
  32917. // created.
  32918. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  32919. // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
  32920. // associated. Provided by the client when the VPN tunnel is created.
  32921. // This must be used (instead of target_vpn_gateway) if a High
  32922. // Availability VPN gateway resource is created.
  32923. VpnGateway string `json:"vpnGateway,omitempty"`
  32924. // VpnGatewayInterface: The interface ID of the VPN gateway with which
  32925. // this VPN tunnel is associated.
  32926. VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
  32927. // ServerResponse contains the HTTP response code and headers from the
  32928. // server.
  32929. googleapi.ServerResponse `json:"-"`
  32930. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32931. // to unconditionally include in API requests. By default, fields with
  32932. // empty values are omitted from API requests. However, any non-pointer,
  32933. // non-interface field appearing in ForceSendFields will be sent to the
  32934. // server regardless of whether the field is empty or not. This may be
  32935. // used to include empty fields in Patch requests.
  32936. ForceSendFields []string `json:"-"`
  32937. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32938. // include in API requests with the JSON null value. By default, fields
  32939. // with empty values are omitted from API requests. However, any field
  32940. // with an empty value appearing in NullFields will be sent to the
  32941. // server as null. It is an error if a field in this list has a
  32942. // non-empty value. This may be used to include null fields in Patch
  32943. // requests.
  32944. NullFields []string `json:"-"`
  32945. }
  32946. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  32947. type NoMethod VpnTunnel
  32948. raw := NoMethod(*s)
  32949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32950. }
  32951. type VpnTunnelAggregatedList struct {
  32952. // Id: [Output Only] Unique identifier for the resource; defined by the
  32953. // server.
  32954. Id string `json:"id,omitempty"`
  32955. // Items: A list of VpnTunnelsScopedList resources.
  32956. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  32957. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  32958. // VPN tunnels.
  32959. Kind string `json:"kind,omitempty"`
  32960. // NextPageToken: [Output Only] This token allows you to get the next
  32961. // page of results for list requests. If the number of results is larger
  32962. // than maxResults, use the nextPageToken as a value for the query
  32963. // parameter pageToken in the next list request. Subsequent list
  32964. // requests will have their own nextPageToken to continue paging through
  32965. // the results.
  32966. NextPageToken string `json:"nextPageToken,omitempty"`
  32967. // SelfLink: [Output Only] Server-defined URL for this resource.
  32968. SelfLink string `json:"selfLink,omitempty"`
  32969. // Warning: [Output Only] Informational warning message.
  32970. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  32971. // ServerResponse contains the HTTP response code and headers from the
  32972. // server.
  32973. googleapi.ServerResponse `json:"-"`
  32974. // ForceSendFields is a list of field names (e.g. "Id") to
  32975. // unconditionally include in API requests. By default, fields with
  32976. // empty values are omitted from API requests. However, any non-pointer,
  32977. // non-interface field appearing in ForceSendFields will be sent to the
  32978. // server regardless of whether the field is empty or not. This may be
  32979. // used to include empty fields in Patch requests.
  32980. ForceSendFields []string `json:"-"`
  32981. // NullFields is a list of field names (e.g. "Id") to include in API
  32982. // requests with the JSON null value. By default, fields with empty
  32983. // values are omitted from API requests. However, any field with an
  32984. // empty value appearing in NullFields will be sent to the server as
  32985. // null. It is an error if a field in this list has a non-empty value.
  32986. // This may be used to include null fields in Patch requests.
  32987. NullFields []string `json:"-"`
  32988. }
  32989. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  32990. type NoMethod VpnTunnelAggregatedList
  32991. raw := NoMethod(*s)
  32992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32993. }
  32994. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  32995. // message.
  32996. type VpnTunnelAggregatedListWarning struct {
  32997. // Code: [Output Only] A warning code, if applicable. For example,
  32998. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32999. // the response.
  33000. //
  33001. // Possible values:
  33002. // "CLEANUP_FAILED"
  33003. // "DEPRECATED_RESOURCE_USED"
  33004. // "DEPRECATED_TYPE_USED"
  33005. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33006. // "EXPERIMENTAL_TYPE_USED"
  33007. // "EXTERNAL_API_WARNING"
  33008. // "FIELD_VALUE_OVERRIDEN"
  33009. // "INJECTED_KERNELS_DEPRECATED"
  33010. // "MISSING_TYPE_DEPENDENCY"
  33011. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33012. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33013. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33014. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33015. // "NEXT_HOP_NOT_RUNNING"
  33016. // "NOT_CRITICAL_ERROR"
  33017. // "NO_RESULTS_ON_PAGE"
  33018. // "REQUIRED_TOS_AGREEMENT"
  33019. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33020. // "RESOURCE_NOT_DELETED"
  33021. // "SCHEMA_VALIDATION_IGNORED"
  33022. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33023. // "UNDECLARED_PROPERTIES"
  33024. // "UNREACHABLE"
  33025. Code string `json:"code,omitempty"`
  33026. // Data: [Output Only] Metadata about this warning in key: value format.
  33027. // For example:
  33028. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33029. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  33030. // Message: [Output Only] A human-readable description of the warning
  33031. // code.
  33032. Message string `json:"message,omitempty"`
  33033. // ForceSendFields is a list of field names (e.g. "Code") to
  33034. // unconditionally include in API requests. By default, fields with
  33035. // empty values are omitted from API requests. However, any non-pointer,
  33036. // non-interface field appearing in ForceSendFields will be sent to the
  33037. // server regardless of whether the field is empty or not. This may be
  33038. // used to include empty fields in Patch requests.
  33039. ForceSendFields []string `json:"-"`
  33040. // NullFields is a list of field names (e.g. "Code") to include in API
  33041. // requests with the JSON null value. By default, fields with empty
  33042. // values are omitted from API requests. However, any field with an
  33043. // empty value appearing in NullFields will be sent to the server as
  33044. // null. It is an error if a field in this list has a non-empty value.
  33045. // This may be used to include null fields in Patch requests.
  33046. NullFields []string `json:"-"`
  33047. }
  33048. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  33049. type NoMethod VpnTunnelAggregatedListWarning
  33050. raw := NoMethod(*s)
  33051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33052. }
  33053. type VpnTunnelAggregatedListWarningData struct {
  33054. // Key: [Output Only] A key that provides more detail on the warning
  33055. // being returned. For example, for warnings where there are no results
  33056. // in a list request for a particular zone, this key might be scope and
  33057. // the key value might be the zone name. Other examples might be a key
  33058. // indicating a deprecated resource and a suggested replacement, or a
  33059. // warning about invalid network settings (for example, if an instance
  33060. // attempts to perform IP forwarding but is not enabled for IP
  33061. // forwarding).
  33062. Key string `json:"key,omitempty"`
  33063. // Value: [Output Only] A warning data value corresponding to the key.
  33064. Value string `json:"value,omitempty"`
  33065. // ForceSendFields is a list of field names (e.g. "Key") to
  33066. // unconditionally include in API requests. By default, fields with
  33067. // empty values are omitted from API requests. However, any non-pointer,
  33068. // non-interface field appearing in ForceSendFields will be sent to the
  33069. // server regardless of whether the field is empty or not. This may be
  33070. // used to include empty fields in Patch requests.
  33071. ForceSendFields []string `json:"-"`
  33072. // NullFields is a list of field names (e.g. "Key") to include in API
  33073. // requests with the JSON null value. By default, fields with empty
  33074. // values are omitted from API requests. However, any field with an
  33075. // empty value appearing in NullFields will be sent to the server as
  33076. // null. It is an error if a field in this list has a non-empty value.
  33077. // This may be used to include null fields in Patch requests.
  33078. NullFields []string `json:"-"`
  33079. }
  33080. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  33081. type NoMethod VpnTunnelAggregatedListWarningData
  33082. raw := NoMethod(*s)
  33083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33084. }
  33085. // VpnTunnelList: Contains a list of VpnTunnel resources.
  33086. type VpnTunnelList struct {
  33087. // Id: [Output Only] Unique identifier for the resource; defined by the
  33088. // server.
  33089. Id string `json:"id,omitempty"`
  33090. // Items: A list of VpnTunnel resources.
  33091. Items []*VpnTunnel `json:"items,omitempty"`
  33092. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  33093. // VPN tunnels.
  33094. Kind string `json:"kind,omitempty"`
  33095. // NextPageToken: [Output Only] This token allows you to get the next
  33096. // page of results for list requests. If the number of results is larger
  33097. // than maxResults, use the nextPageToken as a value for the query
  33098. // parameter pageToken in the next list request. Subsequent list
  33099. // requests will have their own nextPageToken to continue paging through
  33100. // the results.
  33101. NextPageToken string `json:"nextPageToken,omitempty"`
  33102. // SelfLink: [Output Only] Server-defined URL for this resource.
  33103. SelfLink string `json:"selfLink,omitempty"`
  33104. // Warning: [Output Only] Informational warning message.
  33105. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  33106. // ServerResponse contains the HTTP response code and headers from the
  33107. // server.
  33108. googleapi.ServerResponse `json:"-"`
  33109. // ForceSendFields is a list of field names (e.g. "Id") to
  33110. // unconditionally include in API requests. By default, fields with
  33111. // empty values are omitted from API requests. However, any non-pointer,
  33112. // non-interface field appearing in ForceSendFields will be sent to the
  33113. // server regardless of whether the field is empty or not. This may be
  33114. // used to include empty fields in Patch requests.
  33115. ForceSendFields []string `json:"-"`
  33116. // NullFields is a list of field names (e.g. "Id") to include in API
  33117. // requests with the JSON null value. By default, fields with empty
  33118. // values are omitted from API requests. However, any field with an
  33119. // empty value appearing in NullFields will be sent to the server as
  33120. // null. It is an error if a field in this list has a non-empty value.
  33121. // This may be used to include null fields in Patch requests.
  33122. NullFields []string `json:"-"`
  33123. }
  33124. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  33125. type NoMethod VpnTunnelList
  33126. raw := NoMethod(*s)
  33127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33128. }
  33129. // VpnTunnelListWarning: [Output Only] Informational warning message.
  33130. type VpnTunnelListWarning struct {
  33131. // Code: [Output Only] A warning code, if applicable. For example,
  33132. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33133. // the response.
  33134. //
  33135. // Possible values:
  33136. // "CLEANUP_FAILED"
  33137. // "DEPRECATED_RESOURCE_USED"
  33138. // "DEPRECATED_TYPE_USED"
  33139. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33140. // "EXPERIMENTAL_TYPE_USED"
  33141. // "EXTERNAL_API_WARNING"
  33142. // "FIELD_VALUE_OVERRIDEN"
  33143. // "INJECTED_KERNELS_DEPRECATED"
  33144. // "MISSING_TYPE_DEPENDENCY"
  33145. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33146. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33147. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33148. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33149. // "NEXT_HOP_NOT_RUNNING"
  33150. // "NOT_CRITICAL_ERROR"
  33151. // "NO_RESULTS_ON_PAGE"
  33152. // "REQUIRED_TOS_AGREEMENT"
  33153. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33154. // "RESOURCE_NOT_DELETED"
  33155. // "SCHEMA_VALIDATION_IGNORED"
  33156. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33157. // "UNDECLARED_PROPERTIES"
  33158. // "UNREACHABLE"
  33159. Code string `json:"code,omitempty"`
  33160. // Data: [Output Only] Metadata about this warning in key: value format.
  33161. // For example:
  33162. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33163. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  33164. // Message: [Output Only] A human-readable description of the warning
  33165. // code.
  33166. Message string `json:"message,omitempty"`
  33167. // ForceSendFields is a list of field names (e.g. "Code") to
  33168. // unconditionally include in API requests. By default, fields with
  33169. // empty values are omitted from API requests. However, any non-pointer,
  33170. // non-interface field appearing in ForceSendFields will be sent to the
  33171. // server regardless of whether the field is empty or not. This may be
  33172. // used to include empty fields in Patch requests.
  33173. ForceSendFields []string `json:"-"`
  33174. // NullFields is a list of field names (e.g. "Code") to include in API
  33175. // requests with the JSON null value. By default, fields with empty
  33176. // values are omitted from API requests. However, any field with an
  33177. // empty value appearing in NullFields will be sent to the server as
  33178. // null. It is an error if a field in this list has a non-empty value.
  33179. // This may be used to include null fields in Patch requests.
  33180. NullFields []string `json:"-"`
  33181. }
  33182. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  33183. type NoMethod VpnTunnelListWarning
  33184. raw := NoMethod(*s)
  33185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33186. }
  33187. type VpnTunnelListWarningData struct {
  33188. // Key: [Output Only] A key that provides more detail on the warning
  33189. // being returned. For example, for warnings where there are no results
  33190. // in a list request for a particular zone, this key might be scope and
  33191. // the key value might be the zone name. Other examples might be a key
  33192. // indicating a deprecated resource and a suggested replacement, or a
  33193. // warning about invalid network settings (for example, if an instance
  33194. // attempts to perform IP forwarding but is not enabled for IP
  33195. // forwarding).
  33196. Key string `json:"key,omitempty"`
  33197. // Value: [Output Only] A warning data value corresponding to the key.
  33198. Value string `json:"value,omitempty"`
  33199. // ForceSendFields is a list of field names (e.g. "Key") to
  33200. // unconditionally include in API requests. By default, fields with
  33201. // empty values are omitted from API requests. However, any non-pointer,
  33202. // non-interface field appearing in ForceSendFields will be sent to the
  33203. // server regardless of whether the field is empty or not. This may be
  33204. // used to include empty fields in Patch requests.
  33205. ForceSendFields []string `json:"-"`
  33206. // NullFields is a list of field names (e.g. "Key") to include in API
  33207. // requests with the JSON null value. By default, fields with empty
  33208. // values are omitted from API requests. However, any field with an
  33209. // empty value appearing in NullFields will be sent to the server as
  33210. // null. It is an error if a field in this list has a non-empty value.
  33211. // This may be used to include null fields in Patch requests.
  33212. NullFields []string `json:"-"`
  33213. }
  33214. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  33215. type NoMethod VpnTunnelListWarningData
  33216. raw := NoMethod(*s)
  33217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33218. }
  33219. type VpnTunnelsScopedList struct {
  33220. // VpnTunnels: A list of vpn tunnels contained in this scope.
  33221. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  33222. // Warning: Informational warning which replaces the list of addresses
  33223. // when the list is empty.
  33224. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  33225. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  33226. // unconditionally include in API requests. By default, fields with
  33227. // empty values are omitted from API requests. However, any non-pointer,
  33228. // non-interface field appearing in ForceSendFields will be sent to the
  33229. // server regardless of whether the field is empty or not. This may be
  33230. // used to include empty fields in Patch requests.
  33231. ForceSendFields []string `json:"-"`
  33232. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  33233. // API requests with the JSON null value. By default, fields with empty
  33234. // values are omitted from API requests. However, any field with an
  33235. // empty value appearing in NullFields will be sent to the server as
  33236. // null. It is an error if a field in this list has a non-empty value.
  33237. // This may be used to include null fields in Patch requests.
  33238. NullFields []string `json:"-"`
  33239. }
  33240. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  33241. type NoMethod VpnTunnelsScopedList
  33242. raw := NoMethod(*s)
  33243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33244. }
  33245. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  33246. // list of addresses when the list is empty.
  33247. type VpnTunnelsScopedListWarning struct {
  33248. // Code: [Output Only] A warning code, if applicable. For example,
  33249. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33250. // the response.
  33251. //
  33252. // Possible values:
  33253. // "CLEANUP_FAILED"
  33254. // "DEPRECATED_RESOURCE_USED"
  33255. // "DEPRECATED_TYPE_USED"
  33256. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33257. // "EXPERIMENTAL_TYPE_USED"
  33258. // "EXTERNAL_API_WARNING"
  33259. // "FIELD_VALUE_OVERRIDEN"
  33260. // "INJECTED_KERNELS_DEPRECATED"
  33261. // "MISSING_TYPE_DEPENDENCY"
  33262. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33263. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33264. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33265. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33266. // "NEXT_HOP_NOT_RUNNING"
  33267. // "NOT_CRITICAL_ERROR"
  33268. // "NO_RESULTS_ON_PAGE"
  33269. // "REQUIRED_TOS_AGREEMENT"
  33270. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33271. // "RESOURCE_NOT_DELETED"
  33272. // "SCHEMA_VALIDATION_IGNORED"
  33273. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33274. // "UNDECLARED_PROPERTIES"
  33275. // "UNREACHABLE"
  33276. Code string `json:"code,omitempty"`
  33277. // Data: [Output Only] Metadata about this warning in key: value format.
  33278. // For example:
  33279. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33280. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  33281. // Message: [Output Only] A human-readable description of the warning
  33282. // code.
  33283. Message string `json:"message,omitempty"`
  33284. // ForceSendFields is a list of field names (e.g. "Code") to
  33285. // unconditionally include in API requests. By default, fields with
  33286. // empty values are omitted from API requests. However, any non-pointer,
  33287. // non-interface field appearing in ForceSendFields will be sent to the
  33288. // server regardless of whether the field is empty or not. This may be
  33289. // used to include empty fields in Patch requests.
  33290. ForceSendFields []string `json:"-"`
  33291. // NullFields is a list of field names (e.g. "Code") to include in API
  33292. // requests with the JSON null value. By default, fields with empty
  33293. // values are omitted from API requests. However, any field with an
  33294. // empty value appearing in NullFields will be sent to the server as
  33295. // null. It is an error if a field in this list has a non-empty value.
  33296. // This may be used to include null fields in Patch requests.
  33297. NullFields []string `json:"-"`
  33298. }
  33299. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  33300. type NoMethod VpnTunnelsScopedListWarning
  33301. raw := NoMethod(*s)
  33302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33303. }
  33304. type VpnTunnelsScopedListWarningData struct {
  33305. // Key: [Output Only] A key that provides more detail on the warning
  33306. // being returned. For example, for warnings where there are no results
  33307. // in a list request for a particular zone, this key might be scope and
  33308. // the key value might be the zone name. Other examples might be a key
  33309. // indicating a deprecated resource and a suggested replacement, or a
  33310. // warning about invalid network settings (for example, if an instance
  33311. // attempts to perform IP forwarding but is not enabled for IP
  33312. // forwarding).
  33313. Key string `json:"key,omitempty"`
  33314. // Value: [Output Only] A warning data value corresponding to the key.
  33315. Value string `json:"value,omitempty"`
  33316. // ForceSendFields is a list of field names (e.g. "Key") to
  33317. // unconditionally include in API requests. By default, fields with
  33318. // empty values are omitted from API requests. However, any non-pointer,
  33319. // non-interface field appearing in ForceSendFields will be sent to the
  33320. // server regardless of whether the field is empty or not. This may be
  33321. // used to include empty fields in Patch requests.
  33322. ForceSendFields []string `json:"-"`
  33323. // NullFields is a list of field names (e.g. "Key") to include in API
  33324. // requests with the JSON null value. By default, fields with empty
  33325. // values are omitted from API requests. However, any field with an
  33326. // empty value appearing in NullFields will be sent to the server as
  33327. // null. It is an error if a field in this list has a non-empty value.
  33328. // This may be used to include null fields in Patch requests.
  33329. NullFields []string `json:"-"`
  33330. }
  33331. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  33332. type NoMethod VpnTunnelsScopedListWarningData
  33333. raw := NoMethod(*s)
  33334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33335. }
  33336. type WafExpressionSet struct {
  33337. // Aliases: A list of alternate IDs. The format should be: - E.g.
  33338. // XSS-stable Generic suffix like "stable" is particularly useful if a
  33339. // policy likes to avail newer set of expressions without having to
  33340. // change the policy. A given alias name can't be used for more than one
  33341. // entity set.
  33342. Aliases []string `json:"aliases,omitempty"`
  33343. // Expressions: List of available expressions.
  33344. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  33345. // Id: Google specified expression set ID. The format should be: - E.g.
  33346. // XSS-20170329
  33347. Id string `json:"id,omitempty"`
  33348. // ForceSendFields is a list of field names (e.g. "Aliases") to
  33349. // unconditionally include in API requests. By default, fields with
  33350. // empty values are omitted from API requests. However, any non-pointer,
  33351. // non-interface field appearing in ForceSendFields will be sent to the
  33352. // server regardless of whether the field is empty or not. This may be
  33353. // used to include empty fields in Patch requests.
  33354. ForceSendFields []string `json:"-"`
  33355. // NullFields is a list of field names (e.g. "Aliases") to include in
  33356. // API requests with the JSON null value. By default, fields with empty
  33357. // values are omitted from API requests. However, any field with an
  33358. // empty value appearing in NullFields will be sent to the server as
  33359. // null. It is an error if a field in this list has a non-empty value.
  33360. // This may be used to include null fields in Patch requests.
  33361. NullFields []string `json:"-"`
  33362. }
  33363. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  33364. type NoMethod WafExpressionSet
  33365. raw := NoMethod(*s)
  33366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33367. }
  33368. type WafExpressionSetExpression struct {
  33369. // Id: Expression ID should uniquely identify the origin of the
  33370. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  33371. // rule set version 2.9.1 rule id 973337. The ID could be used to
  33372. // determine the individual attack definition that has been detected. It
  33373. // could also be used to exclude it from the policy in case of false
  33374. // positive.
  33375. Id string `json:"id,omitempty"`
  33376. // ForceSendFields is a list of field names (e.g. "Id") to
  33377. // unconditionally include in API requests. By default, fields with
  33378. // empty values are omitted from API requests. However, any non-pointer,
  33379. // non-interface field appearing in ForceSendFields will be sent to the
  33380. // server regardless of whether the field is empty or not. This may be
  33381. // used to include empty fields in Patch requests.
  33382. ForceSendFields []string `json:"-"`
  33383. // NullFields is a list of field names (e.g. "Id") to include in API
  33384. // requests with the JSON null value. By default, fields with empty
  33385. // values are omitted from API requests. However, any field with an
  33386. // empty value appearing in NullFields will be sent to the server as
  33387. // null. It is an error if a field in this list has a non-empty value.
  33388. // This may be used to include null fields in Patch requests.
  33389. NullFields []string `json:"-"`
  33390. }
  33391. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  33392. type NoMethod WafExpressionSetExpression
  33393. raw := NoMethod(*s)
  33394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33395. }
  33396. type XpnHostList struct {
  33397. // Id: [Output Only] Unique identifier for the resource; defined by the
  33398. // server.
  33399. Id string `json:"id,omitempty"`
  33400. // Items: [Output Only] A list of shared VPC host project URLs.
  33401. Items []*Project `json:"items,omitempty"`
  33402. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  33403. // lists of shared VPC hosts.
  33404. Kind string `json:"kind,omitempty"`
  33405. // NextPageToken: [Output Only] This token allows you to get the next
  33406. // page of results for list requests. If the number of results is larger
  33407. // than maxResults, use the nextPageToken as a value for the query
  33408. // parameter pageToken in the next list request. Subsequent list
  33409. // requests will have their own nextPageToken to continue paging through
  33410. // the results.
  33411. NextPageToken string `json:"nextPageToken,omitempty"`
  33412. // SelfLink: [Output Only] Server-defined URL for this resource.
  33413. SelfLink string `json:"selfLink,omitempty"`
  33414. // Warning: [Output Only] Informational warning message.
  33415. Warning *XpnHostListWarning `json:"warning,omitempty"`
  33416. // ServerResponse contains the HTTP response code and headers from the
  33417. // server.
  33418. googleapi.ServerResponse `json:"-"`
  33419. // ForceSendFields is a list of field names (e.g. "Id") to
  33420. // unconditionally include in API requests. By default, fields with
  33421. // empty values are omitted from API requests. However, any non-pointer,
  33422. // non-interface field appearing in ForceSendFields will be sent to the
  33423. // server regardless of whether the field is empty or not. This may be
  33424. // used to include empty fields in Patch requests.
  33425. ForceSendFields []string `json:"-"`
  33426. // NullFields is a list of field names (e.g. "Id") to include in API
  33427. // requests with the JSON null value. By default, fields with empty
  33428. // values are omitted from API requests. However, any field with an
  33429. // empty value appearing in NullFields will be sent to the server as
  33430. // null. It is an error if a field in this list has a non-empty value.
  33431. // This may be used to include null fields in Patch requests.
  33432. NullFields []string `json:"-"`
  33433. }
  33434. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  33435. type NoMethod XpnHostList
  33436. raw := NoMethod(*s)
  33437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33438. }
  33439. // XpnHostListWarning: [Output Only] Informational warning message.
  33440. type XpnHostListWarning struct {
  33441. // Code: [Output Only] A warning code, if applicable. For example,
  33442. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33443. // the response.
  33444. //
  33445. // Possible values:
  33446. // "CLEANUP_FAILED"
  33447. // "DEPRECATED_RESOURCE_USED"
  33448. // "DEPRECATED_TYPE_USED"
  33449. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33450. // "EXPERIMENTAL_TYPE_USED"
  33451. // "EXTERNAL_API_WARNING"
  33452. // "FIELD_VALUE_OVERRIDEN"
  33453. // "INJECTED_KERNELS_DEPRECATED"
  33454. // "MISSING_TYPE_DEPENDENCY"
  33455. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33456. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33457. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33458. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33459. // "NEXT_HOP_NOT_RUNNING"
  33460. // "NOT_CRITICAL_ERROR"
  33461. // "NO_RESULTS_ON_PAGE"
  33462. // "REQUIRED_TOS_AGREEMENT"
  33463. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33464. // "RESOURCE_NOT_DELETED"
  33465. // "SCHEMA_VALIDATION_IGNORED"
  33466. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33467. // "UNDECLARED_PROPERTIES"
  33468. // "UNREACHABLE"
  33469. Code string `json:"code,omitempty"`
  33470. // Data: [Output Only] Metadata about this warning in key: value format.
  33471. // For example:
  33472. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33473. Data []*XpnHostListWarningData `json:"data,omitempty"`
  33474. // Message: [Output Only] A human-readable description of the warning
  33475. // code.
  33476. Message string `json:"message,omitempty"`
  33477. // ForceSendFields is a list of field names (e.g. "Code") to
  33478. // unconditionally include in API requests. By default, fields with
  33479. // empty values are omitted from API requests. However, any non-pointer,
  33480. // non-interface field appearing in ForceSendFields will be sent to the
  33481. // server regardless of whether the field is empty or not. This may be
  33482. // used to include empty fields in Patch requests.
  33483. ForceSendFields []string `json:"-"`
  33484. // NullFields is a list of field names (e.g. "Code") to include in API
  33485. // requests with the JSON null value. By default, fields with empty
  33486. // values are omitted from API requests. However, any field with an
  33487. // empty value appearing in NullFields will be sent to the server as
  33488. // null. It is an error if a field in this list has a non-empty value.
  33489. // This may be used to include null fields in Patch requests.
  33490. NullFields []string `json:"-"`
  33491. }
  33492. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  33493. type NoMethod XpnHostListWarning
  33494. raw := NoMethod(*s)
  33495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33496. }
  33497. type XpnHostListWarningData struct {
  33498. // Key: [Output Only] A key that provides more detail on the warning
  33499. // being returned. For example, for warnings where there are no results
  33500. // in a list request for a particular zone, this key might be scope and
  33501. // the key value might be the zone name. Other examples might be a key
  33502. // indicating a deprecated resource and a suggested replacement, or a
  33503. // warning about invalid network settings (for example, if an instance
  33504. // attempts to perform IP forwarding but is not enabled for IP
  33505. // forwarding).
  33506. Key string `json:"key,omitempty"`
  33507. // Value: [Output Only] A warning data value corresponding to the key.
  33508. Value string `json:"value,omitempty"`
  33509. // ForceSendFields is a list of field names (e.g. "Key") to
  33510. // unconditionally include in API requests. By default, fields with
  33511. // empty values are omitted from API requests. However, any non-pointer,
  33512. // non-interface field appearing in ForceSendFields will be sent to the
  33513. // server regardless of whether the field is empty or not. This may be
  33514. // used to include empty fields in Patch requests.
  33515. ForceSendFields []string `json:"-"`
  33516. // NullFields is a list of field names (e.g. "Key") to include in API
  33517. // requests with the JSON null value. By default, fields with empty
  33518. // values are omitted from API requests. However, any field with an
  33519. // empty value appearing in NullFields will be sent to the server as
  33520. // null. It is an error if a field in this list has a non-empty value.
  33521. // This may be used to include null fields in Patch requests.
  33522. NullFields []string `json:"-"`
  33523. }
  33524. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  33525. type NoMethod XpnHostListWarningData
  33526. raw := NoMethod(*s)
  33527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33528. }
  33529. // XpnResourceId: Service resource (a.k.a service project) ID.
  33530. type XpnResourceId struct {
  33531. // Id: The ID of the service resource. In the case of projects, this
  33532. // field supports project id (e.g., my-project-123) and project number
  33533. // (e.g. 12345678).
  33534. Id string `json:"id,omitempty"`
  33535. // Type: The type of the service resource.
  33536. //
  33537. // Possible values:
  33538. // "PROJECT"
  33539. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  33540. Type string `json:"type,omitempty"`
  33541. // ForceSendFields is a list of field names (e.g. "Id") to
  33542. // unconditionally include in API requests. By default, fields with
  33543. // empty values are omitted from API requests. However, any non-pointer,
  33544. // non-interface field appearing in ForceSendFields will be sent to the
  33545. // server regardless of whether the field is empty or not. This may be
  33546. // used to include empty fields in Patch requests.
  33547. ForceSendFields []string `json:"-"`
  33548. // NullFields is a list of field names (e.g. "Id") to include in API
  33549. // requests with the JSON null value. By default, fields with empty
  33550. // values are omitted from API requests. However, any field with an
  33551. // empty value appearing in NullFields will be sent to the server as
  33552. // null. It is an error if a field in this list has a non-empty value.
  33553. // This may be used to include null fields in Patch requests.
  33554. NullFields []string `json:"-"`
  33555. }
  33556. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  33557. type NoMethod XpnResourceId
  33558. raw := NoMethod(*s)
  33559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33560. }
  33561. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  33562. // resource_for v1.zones ==)
  33563. type Zone struct {
  33564. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  33565. // selections for the zone.
  33566. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  33567. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  33568. // format.
  33569. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  33570. // Deprecated: [Output Only] The deprecation status associated with this
  33571. // zone.
  33572. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  33573. // Description: [Output Only] Textual description of the resource.
  33574. Description string `json:"description,omitempty"`
  33575. // Id: [Output Only] The unique identifier for the resource. This
  33576. // identifier is defined by the server.
  33577. Id uint64 `json:"id,omitempty,string"`
  33578. // Kind: [Output Only] Type of the resource. Always compute#zone for
  33579. // zones.
  33580. Kind string `json:"kind,omitempty"`
  33581. // Name: [Output Only] Name of the resource.
  33582. Name string `json:"name,omitempty"`
  33583. // Region: [Output Only] Full URL reference to the region which hosts
  33584. // the zone.
  33585. Region string `json:"region,omitempty"`
  33586. // SelfLink: [Output Only] Server-defined URL for the resource.
  33587. SelfLink string `json:"selfLink,omitempty"`
  33588. // Status: [Output Only] Status of the zone, either UP or DOWN.
  33589. //
  33590. // Possible values:
  33591. // "DOWN"
  33592. // "UP"
  33593. Status string `json:"status,omitempty"`
  33594. // ServerResponse contains the HTTP response code and headers from the
  33595. // server.
  33596. googleapi.ServerResponse `json:"-"`
  33597. // ForceSendFields is a list of field names (e.g.
  33598. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  33599. // By default, fields with empty values are omitted from API requests.
  33600. // However, any non-pointer, non-interface field appearing in
  33601. // ForceSendFields will be sent to the server regardless of whether the
  33602. // field is empty or not. This may be used to include empty fields in
  33603. // Patch requests.
  33604. ForceSendFields []string `json:"-"`
  33605. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  33606. // include in API requests with the JSON null value. By default, fields
  33607. // with empty values are omitted from API requests. However, any field
  33608. // with an empty value appearing in NullFields will be sent to the
  33609. // server as null. It is an error if a field in this list has a
  33610. // non-empty value. This may be used to include null fields in Patch
  33611. // requests.
  33612. NullFields []string `json:"-"`
  33613. }
  33614. func (s *Zone) MarshalJSON() ([]byte, error) {
  33615. type NoMethod Zone
  33616. raw := NoMethod(*s)
  33617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33618. }
  33619. // ZoneList: Contains a list of zone resources.
  33620. type ZoneList struct {
  33621. // Id: [Output Only] Unique identifier for the resource; defined by the
  33622. // server.
  33623. Id string `json:"id,omitempty"`
  33624. // Items: A list of Zone resources.
  33625. Items []*Zone `json:"items,omitempty"`
  33626. // Kind: Type of resource.
  33627. Kind string `json:"kind,omitempty"`
  33628. // NextPageToken: [Output Only] This token allows you to get the next
  33629. // page of results for list requests. If the number of results is larger
  33630. // than maxResults, use the nextPageToken as a value for the query
  33631. // parameter pageToken in the next list request. Subsequent list
  33632. // requests will have their own nextPageToken to continue paging through
  33633. // the results.
  33634. NextPageToken string `json:"nextPageToken,omitempty"`
  33635. // SelfLink: [Output Only] Server-defined URL for this resource.
  33636. SelfLink string `json:"selfLink,omitempty"`
  33637. // Warning: [Output Only] Informational warning message.
  33638. Warning *ZoneListWarning `json:"warning,omitempty"`
  33639. // ServerResponse contains the HTTP response code and headers from the
  33640. // server.
  33641. googleapi.ServerResponse `json:"-"`
  33642. // ForceSendFields is a list of field names (e.g. "Id") to
  33643. // unconditionally include in API requests. By default, fields with
  33644. // empty values are omitted from API requests. However, any non-pointer,
  33645. // non-interface field appearing in ForceSendFields will be sent to the
  33646. // server regardless of whether the field is empty or not. This may be
  33647. // used to include empty fields in Patch requests.
  33648. ForceSendFields []string `json:"-"`
  33649. // NullFields is a list of field names (e.g. "Id") to include in API
  33650. // requests with the JSON null value. By default, fields with empty
  33651. // values are omitted from API requests. However, any field with an
  33652. // empty value appearing in NullFields will be sent to the server as
  33653. // null. It is an error if a field in this list has a non-empty value.
  33654. // This may be used to include null fields in Patch requests.
  33655. NullFields []string `json:"-"`
  33656. }
  33657. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  33658. type NoMethod ZoneList
  33659. raw := NoMethod(*s)
  33660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33661. }
  33662. // ZoneListWarning: [Output Only] Informational warning message.
  33663. type ZoneListWarning struct {
  33664. // Code: [Output Only] A warning code, if applicable. For example,
  33665. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33666. // the response.
  33667. //
  33668. // Possible values:
  33669. // "CLEANUP_FAILED"
  33670. // "DEPRECATED_RESOURCE_USED"
  33671. // "DEPRECATED_TYPE_USED"
  33672. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33673. // "EXPERIMENTAL_TYPE_USED"
  33674. // "EXTERNAL_API_WARNING"
  33675. // "FIELD_VALUE_OVERRIDEN"
  33676. // "INJECTED_KERNELS_DEPRECATED"
  33677. // "MISSING_TYPE_DEPENDENCY"
  33678. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33679. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33680. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33681. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33682. // "NEXT_HOP_NOT_RUNNING"
  33683. // "NOT_CRITICAL_ERROR"
  33684. // "NO_RESULTS_ON_PAGE"
  33685. // "REQUIRED_TOS_AGREEMENT"
  33686. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33687. // "RESOURCE_NOT_DELETED"
  33688. // "SCHEMA_VALIDATION_IGNORED"
  33689. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33690. // "UNDECLARED_PROPERTIES"
  33691. // "UNREACHABLE"
  33692. Code string `json:"code,omitempty"`
  33693. // Data: [Output Only] Metadata about this warning in key: value format.
  33694. // For example:
  33695. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33696. Data []*ZoneListWarningData `json:"data,omitempty"`
  33697. // Message: [Output Only] A human-readable description of the warning
  33698. // code.
  33699. Message string `json:"message,omitempty"`
  33700. // ForceSendFields is a list of field names (e.g. "Code") to
  33701. // unconditionally include in API requests. By default, fields with
  33702. // empty values are omitted from API requests. However, any non-pointer,
  33703. // non-interface field appearing in ForceSendFields will be sent to the
  33704. // server regardless of whether the field is empty or not. This may be
  33705. // used to include empty fields in Patch requests.
  33706. ForceSendFields []string `json:"-"`
  33707. // NullFields is a list of field names (e.g. "Code") to include in API
  33708. // requests with the JSON null value. By default, fields with empty
  33709. // values are omitted from API requests. However, any field with an
  33710. // empty value appearing in NullFields will be sent to the server as
  33711. // null. It is an error if a field in this list has a non-empty value.
  33712. // This may be used to include null fields in Patch requests.
  33713. NullFields []string `json:"-"`
  33714. }
  33715. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  33716. type NoMethod ZoneListWarning
  33717. raw := NoMethod(*s)
  33718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33719. }
  33720. type ZoneListWarningData struct {
  33721. // Key: [Output Only] A key that provides more detail on the warning
  33722. // being returned. For example, for warnings where there are no results
  33723. // in a list request for a particular zone, this key might be scope and
  33724. // the key value might be the zone name. Other examples might be a key
  33725. // indicating a deprecated resource and a suggested replacement, or a
  33726. // warning about invalid network settings (for example, if an instance
  33727. // attempts to perform IP forwarding but is not enabled for IP
  33728. // forwarding).
  33729. Key string `json:"key,omitempty"`
  33730. // Value: [Output Only] A warning data value corresponding to the key.
  33731. Value string `json:"value,omitempty"`
  33732. // ForceSendFields is a list of field names (e.g. "Key") to
  33733. // unconditionally include in API requests. By default, fields with
  33734. // empty values are omitted from API requests. However, any non-pointer,
  33735. // non-interface field appearing in ForceSendFields will be sent to the
  33736. // server regardless of whether the field is empty or not. This may be
  33737. // used to include empty fields in Patch requests.
  33738. ForceSendFields []string `json:"-"`
  33739. // NullFields is a list of field names (e.g. "Key") to include in API
  33740. // requests with the JSON null value. By default, fields with empty
  33741. // values are omitted from API requests. However, any field with an
  33742. // empty value appearing in NullFields will be sent to the server as
  33743. // null. It is an error if a field in this list has a non-empty value.
  33744. // This may be used to include null fields in Patch requests.
  33745. NullFields []string `json:"-"`
  33746. }
  33747. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  33748. type NoMethod ZoneListWarningData
  33749. raw := NoMethod(*s)
  33750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33751. }
  33752. type ZoneSetLabelsRequest struct {
  33753. // LabelFingerprint: The fingerprint of the previous set of labels for
  33754. // this resource, used to detect conflicts. The fingerprint is initially
  33755. // generated by Compute Engine and changes after every request to modify
  33756. // or update labels. You must always provide an up-to-date fingerprint
  33757. // hash in order to update or change labels. Make a get() request to the
  33758. // resource to get the latest fingerprint.
  33759. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  33760. // Labels: The labels to set for this resource.
  33761. Labels map[string]string `json:"labels,omitempty"`
  33762. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  33763. // unconditionally include in API requests. By default, fields with
  33764. // empty values are omitted from API requests. However, any non-pointer,
  33765. // non-interface field appearing in ForceSendFields will be sent to the
  33766. // server regardless of whether the field is empty or not. This may be
  33767. // used to include empty fields in Patch requests.
  33768. ForceSendFields []string `json:"-"`
  33769. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  33770. // include in API requests with the JSON null value. By default, fields
  33771. // with empty values are omitted from API requests. However, any field
  33772. // with an empty value appearing in NullFields will be sent to the
  33773. // server as null. It is an error if a field in this list has a
  33774. // non-empty value. This may be used to include null fields in Patch
  33775. // requests.
  33776. NullFields []string `json:"-"`
  33777. }
  33778. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  33779. type NoMethod ZoneSetLabelsRequest
  33780. raw := NoMethod(*s)
  33781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33782. }
  33783. type ZoneSetPolicyRequest struct {
  33784. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  33785. // Deprecated. Use 'policy' to specify bindings.
  33786. Bindings []*Binding `json:"bindings,omitempty"`
  33787. // Etag: Flatten Policy to create a backward compatible wire-format.
  33788. // Deprecated. Use 'policy' to specify the etag.
  33789. Etag string `json:"etag,omitempty"`
  33790. // Policy: REQUIRED: The complete policy to be applied to the
  33791. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  33792. // empty policy is in general a valid policy but certain services (like
  33793. // Projects) might reject them.
  33794. Policy *Policy `json:"policy,omitempty"`
  33795. // ForceSendFields is a list of field names (e.g. "Bindings") to
  33796. // unconditionally include in API requests. By default, fields with
  33797. // empty values are omitted from API requests. However, any non-pointer,
  33798. // non-interface field appearing in ForceSendFields will be sent to the
  33799. // server regardless of whether the field is empty or not. This may be
  33800. // used to include empty fields in Patch requests.
  33801. ForceSendFields []string `json:"-"`
  33802. // NullFields is a list of field names (e.g. "Bindings") to include in
  33803. // API requests with the JSON null value. By default, fields with empty
  33804. // values are omitted from API requests. However, any field with an
  33805. // empty value appearing in NullFields will be sent to the server as
  33806. // null. It is an error if a field in this list has a non-empty value.
  33807. // This may be used to include null fields in Patch requests.
  33808. NullFields []string `json:"-"`
  33809. }
  33810. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  33811. type NoMethod ZoneSetPolicyRequest
  33812. raw := NoMethod(*s)
  33813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33814. }
  33815. // method id "compute.acceleratorTypes.aggregatedList":
  33816. type AcceleratorTypesAggregatedListCall struct {
  33817. s *Service
  33818. project string
  33819. urlParams_ gensupport.URLParams
  33820. ifNoneMatch_ string
  33821. ctx_ context.Context
  33822. header_ http.Header
  33823. }
  33824. // AggregatedList: Retrieves an aggregated list of accelerator types.
  33825. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  33826. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33827. c.project = project
  33828. return c
  33829. }
  33830. // Filter sets the optional parameter "filter": A filter expression that
  33831. // filters resources listed in the response. The expression must specify
  33832. // the field name, a comparison operator, and the value that you want to
  33833. // use for filtering. The value must be a string, a number, or a
  33834. // boolean. The comparison operator must be either =, !=, >, or <.
  33835. //
  33836. // For example, if you are filtering Compute Engine instances, you can
  33837. // exclude instances named example-instance by specifying name !=
  33838. // example-instance.
  33839. //
  33840. // You can also filter nested fields. For example, you could specify
  33841. // scheduling.automaticRestart = false to include instances only if they
  33842. // are not scheduled for automatic restarts. You can use filtering on
  33843. // nested fields to filter based on resource labels.
  33844. //
  33845. // To filter on multiple expressions, provide each separate expression
  33846. // within parentheses. For example, (scheduling.automaticRestart = true)
  33847. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33848. // AND expression. However, you can include AND and OR expressions
  33849. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33850. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33851. // true).
  33852. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  33853. c.urlParams_.Set("filter", filter)
  33854. return c
  33855. }
  33856. // MaxResults sets the optional parameter "maxResults": The maximum
  33857. // number of results per page that should be returned. If the number of
  33858. // available results is larger than maxResults, Compute Engine returns a
  33859. // nextPageToken that can be used to get the next page of results in
  33860. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33861. // (Default: 500)
  33862. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  33863. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33864. return c
  33865. }
  33866. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33867. // a certain order. By default, results are returned in alphanumerical
  33868. // order based on the resource name.
  33869. //
  33870. // You can also sort results in descending order based on the creation
  33871. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33872. // based on the creationTimestamp field in reverse chronological order
  33873. // (newest result first). Use this to sort resources like operations so
  33874. // that the newest operation is returned first.
  33875. //
  33876. // Currently, only sorting by name or creationTimestamp desc is
  33877. // supported.
  33878. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  33879. c.urlParams_.Set("orderBy", orderBy)
  33880. return c
  33881. }
  33882. // PageToken sets the optional parameter "pageToken": Specifies a page
  33883. // token to use. Set pageToken to the nextPageToken returned by a
  33884. // previous list request to get the next page of results.
  33885. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  33886. c.urlParams_.Set("pageToken", pageToken)
  33887. return c
  33888. }
  33889. // Fields allows partial responses to be retrieved. See
  33890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33891. // for more information.
  33892. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  33893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33894. return c
  33895. }
  33896. // IfNoneMatch sets the optional parameter which makes the operation
  33897. // fail if the object's ETag matches the given value. This is useful for
  33898. // getting updates only after the object has changed since the last
  33899. // request. Use googleapi.IsNotModified to check whether the response
  33900. // error from Do is the result of In-None-Match.
  33901. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  33902. c.ifNoneMatch_ = entityTag
  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 *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  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 *AcceleratorTypesAggregatedListCall) Header() http.Header {
  33915. if c.header_ == nil {
  33916. c.header_ = make(http.Header)
  33917. }
  33918. return c.header_
  33919. }
  33920. func (c *AcceleratorTypesAggregatedListCall) 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. if c.ifNoneMatch_ != "" {
  33927. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33928. }
  33929. var body io.Reader = nil
  33930. c.urlParams_.Set("alt", alt)
  33931. c.urlParams_.Set("prettyPrint", "false")
  33932. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  33933. urls += "?" + c.urlParams_.Encode()
  33934. req, err := http.NewRequest("GET", urls, body)
  33935. if err != nil {
  33936. return nil, err
  33937. }
  33938. req.Header = reqHeaders
  33939. googleapi.Expand(req.URL, map[string]string{
  33940. "project": c.project,
  33941. })
  33942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33943. }
  33944. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  33945. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  33946. // non-nil. Any non-2xx status code is an error. Response headers are in
  33947. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  33948. // response was returned at all) in error.(*googleapi.Error).Header. Use
  33949. // googleapi.IsNotModified to check whether the returned error was
  33950. // because http.StatusNotModified was returned.
  33951. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  33952. gensupport.SetOptions(c.urlParams_, opts...)
  33953. res, err := c.doRequest("json")
  33954. if res != nil && res.StatusCode == http.StatusNotModified {
  33955. if res.Body != nil {
  33956. res.Body.Close()
  33957. }
  33958. return nil, &googleapi.Error{
  33959. Code: res.StatusCode,
  33960. Header: res.Header,
  33961. }
  33962. }
  33963. if err != nil {
  33964. return nil, err
  33965. }
  33966. defer googleapi.CloseBody(res)
  33967. if err := googleapi.CheckResponse(res); err != nil {
  33968. return nil, err
  33969. }
  33970. ret := &AcceleratorTypeAggregatedList{
  33971. ServerResponse: googleapi.ServerResponse{
  33972. Header: res.Header,
  33973. HTTPStatusCode: res.StatusCode,
  33974. },
  33975. }
  33976. target := &ret
  33977. if err := gensupport.DecodeResponse(target, res); err != nil {
  33978. return nil, err
  33979. }
  33980. return ret, nil
  33981. // {
  33982. // "description": "Retrieves an aggregated list of accelerator types.",
  33983. // "httpMethod": "GET",
  33984. // "id": "compute.acceleratorTypes.aggregatedList",
  33985. // "parameterOrder": [
  33986. // "project"
  33987. // ],
  33988. // "parameters": {
  33989. // "filter": {
  33990. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33991. // "location": "query",
  33992. // "type": "string"
  33993. // },
  33994. // "maxResults": {
  33995. // "default": "500",
  33996. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33997. // "format": "uint32",
  33998. // "location": "query",
  33999. // "minimum": "0",
  34000. // "type": "integer"
  34001. // },
  34002. // "orderBy": {
  34003. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34004. // "location": "query",
  34005. // "type": "string"
  34006. // },
  34007. // "pageToken": {
  34008. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34009. // "location": "query",
  34010. // "type": "string"
  34011. // },
  34012. // "project": {
  34013. // "description": "Project ID for this request.",
  34014. // "location": "path",
  34015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34016. // "required": true,
  34017. // "type": "string"
  34018. // }
  34019. // },
  34020. // "path": "{project}/aggregated/acceleratorTypes",
  34021. // "response": {
  34022. // "$ref": "AcceleratorTypeAggregatedList"
  34023. // },
  34024. // "scopes": [
  34025. // "https://www.googleapis.com/auth/cloud-platform",
  34026. // "https://www.googleapis.com/auth/compute",
  34027. // "https://www.googleapis.com/auth/compute.readonly"
  34028. // ]
  34029. // }
  34030. }
  34031. // Pages invokes f for each page of results.
  34032. // A non-nil error returned from f will halt the iteration.
  34033. // The provided context supersedes any context provided to the Context method.
  34034. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  34035. c.ctx_ = ctx
  34036. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34037. for {
  34038. x, err := c.Do()
  34039. if err != nil {
  34040. return err
  34041. }
  34042. if err := f(x); err != nil {
  34043. return err
  34044. }
  34045. if x.NextPageToken == "" {
  34046. return nil
  34047. }
  34048. c.PageToken(x.NextPageToken)
  34049. }
  34050. }
  34051. // method id "compute.acceleratorTypes.get":
  34052. type AcceleratorTypesGetCall struct {
  34053. s *Service
  34054. project string
  34055. zone string
  34056. acceleratorType string
  34057. urlParams_ gensupport.URLParams
  34058. ifNoneMatch_ string
  34059. ctx_ context.Context
  34060. header_ http.Header
  34061. }
  34062. // Get: Returns the specified accelerator type.
  34063. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  34064. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34065. c.project = project
  34066. c.zone = zone
  34067. c.acceleratorType = acceleratorType
  34068. return c
  34069. }
  34070. // Fields allows partial responses to be retrieved. See
  34071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34072. // for more information.
  34073. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  34074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34075. return c
  34076. }
  34077. // IfNoneMatch sets the optional parameter which makes the operation
  34078. // fail if the object's ETag matches the given value. This is useful for
  34079. // getting updates only after the object has changed since the last
  34080. // request. Use googleapi.IsNotModified to check whether the response
  34081. // error from Do is the result of In-None-Match.
  34082. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  34083. c.ifNoneMatch_ = entityTag
  34084. return c
  34085. }
  34086. // Context sets the context to be used in this call's Do method. Any
  34087. // pending HTTP request will be aborted if the provided context is
  34088. // canceled.
  34089. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  34090. c.ctx_ = ctx
  34091. return c
  34092. }
  34093. // Header returns an http.Header that can be modified by the caller to
  34094. // add HTTP headers to the request.
  34095. func (c *AcceleratorTypesGetCall) Header() http.Header {
  34096. if c.header_ == nil {
  34097. c.header_ = make(http.Header)
  34098. }
  34099. return c.header_
  34100. }
  34101. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  34102. reqHeaders := make(http.Header)
  34103. for k, v := range c.header_ {
  34104. reqHeaders[k] = v
  34105. }
  34106. reqHeaders.Set("User-Agent", c.s.userAgent())
  34107. if c.ifNoneMatch_ != "" {
  34108. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34109. }
  34110. var body io.Reader = nil
  34111. c.urlParams_.Set("alt", alt)
  34112. c.urlParams_.Set("prettyPrint", "false")
  34113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  34114. urls += "?" + c.urlParams_.Encode()
  34115. req, err := http.NewRequest("GET", urls, body)
  34116. if err != nil {
  34117. return nil, err
  34118. }
  34119. req.Header = reqHeaders
  34120. googleapi.Expand(req.URL, map[string]string{
  34121. "project": c.project,
  34122. "zone": c.zone,
  34123. "acceleratorType": c.acceleratorType,
  34124. })
  34125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34126. }
  34127. // Do executes the "compute.acceleratorTypes.get" call.
  34128. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  34129. // status code is an error. Response headers are in either
  34130. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  34131. // at all) in error.(*googleapi.Error).Header. Use
  34132. // googleapi.IsNotModified to check whether the returned error was
  34133. // because http.StatusNotModified was returned.
  34134. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  34135. gensupport.SetOptions(c.urlParams_, opts...)
  34136. res, err := c.doRequest("json")
  34137. if res != nil && res.StatusCode == http.StatusNotModified {
  34138. if res.Body != nil {
  34139. res.Body.Close()
  34140. }
  34141. return nil, &googleapi.Error{
  34142. Code: res.StatusCode,
  34143. Header: res.Header,
  34144. }
  34145. }
  34146. if err != nil {
  34147. return nil, err
  34148. }
  34149. defer googleapi.CloseBody(res)
  34150. if err := googleapi.CheckResponse(res); err != nil {
  34151. return nil, err
  34152. }
  34153. ret := &AcceleratorType{
  34154. ServerResponse: googleapi.ServerResponse{
  34155. Header: res.Header,
  34156. HTTPStatusCode: res.StatusCode,
  34157. },
  34158. }
  34159. target := &ret
  34160. if err := gensupport.DecodeResponse(target, res); err != nil {
  34161. return nil, err
  34162. }
  34163. return ret, nil
  34164. // {
  34165. // "description": "Returns the specified accelerator type.",
  34166. // "httpMethod": "GET",
  34167. // "id": "compute.acceleratorTypes.get",
  34168. // "parameterOrder": [
  34169. // "project",
  34170. // "zone",
  34171. // "acceleratorType"
  34172. // ],
  34173. // "parameters": {
  34174. // "acceleratorType": {
  34175. // "description": "Name of the accelerator type to return.",
  34176. // "location": "path",
  34177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34178. // "required": true,
  34179. // "type": "string"
  34180. // },
  34181. // "project": {
  34182. // "description": "Project ID for this request.",
  34183. // "location": "path",
  34184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34185. // "required": true,
  34186. // "type": "string"
  34187. // },
  34188. // "zone": {
  34189. // "description": "The name of the zone for this request.",
  34190. // "location": "path",
  34191. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34192. // "required": true,
  34193. // "type": "string"
  34194. // }
  34195. // },
  34196. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  34197. // "response": {
  34198. // "$ref": "AcceleratorType"
  34199. // },
  34200. // "scopes": [
  34201. // "https://www.googleapis.com/auth/cloud-platform",
  34202. // "https://www.googleapis.com/auth/compute",
  34203. // "https://www.googleapis.com/auth/compute.readonly"
  34204. // ]
  34205. // }
  34206. }
  34207. // method id "compute.acceleratorTypes.list":
  34208. type AcceleratorTypesListCall struct {
  34209. s *Service
  34210. project string
  34211. zone string
  34212. urlParams_ gensupport.URLParams
  34213. ifNoneMatch_ string
  34214. ctx_ context.Context
  34215. header_ http.Header
  34216. }
  34217. // List: Retrieves a list of accelerator types available to the
  34218. // specified project.
  34219. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  34220. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34221. c.project = project
  34222. c.zone = zone
  34223. return c
  34224. }
  34225. // Filter sets the optional parameter "filter": A filter expression that
  34226. // filters resources listed in the response. The expression must specify
  34227. // the field name, a comparison operator, and the value that you want to
  34228. // use for filtering. The value must be a string, a number, or a
  34229. // boolean. The comparison operator must be either =, !=, >, or <.
  34230. //
  34231. // For example, if you are filtering Compute Engine instances, you can
  34232. // exclude instances named example-instance by specifying name !=
  34233. // example-instance.
  34234. //
  34235. // You can also filter nested fields. For example, you could specify
  34236. // scheduling.automaticRestart = false to include instances only if they
  34237. // are not scheduled for automatic restarts. You can use filtering on
  34238. // nested fields to filter based on resource labels.
  34239. //
  34240. // To filter on multiple expressions, provide each separate expression
  34241. // within parentheses. For example, (scheduling.automaticRestart = true)
  34242. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34243. // AND expression. However, you can include AND and OR expressions
  34244. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34245. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34246. // true).
  34247. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  34248. c.urlParams_.Set("filter", filter)
  34249. return c
  34250. }
  34251. // MaxResults sets the optional parameter "maxResults": The maximum
  34252. // number of results per page that should be returned. If the number of
  34253. // available results is larger than maxResults, Compute Engine returns a
  34254. // nextPageToken that can be used to get the next page of results in
  34255. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34256. // (Default: 500)
  34257. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  34258. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34259. return c
  34260. }
  34261. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34262. // a certain order. By default, results are returned in alphanumerical
  34263. // order based on the resource name.
  34264. //
  34265. // You can also sort results in descending order based on the creation
  34266. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34267. // based on the creationTimestamp field in reverse chronological order
  34268. // (newest result first). Use this to sort resources like operations so
  34269. // that the newest operation is returned first.
  34270. //
  34271. // Currently, only sorting by name or creationTimestamp desc is
  34272. // supported.
  34273. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  34274. c.urlParams_.Set("orderBy", orderBy)
  34275. return c
  34276. }
  34277. // PageToken sets the optional parameter "pageToken": Specifies a page
  34278. // token to use. Set pageToken to the nextPageToken returned by a
  34279. // previous list request to get the next page of results.
  34280. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  34281. c.urlParams_.Set("pageToken", pageToken)
  34282. return c
  34283. }
  34284. // Fields allows partial responses to be retrieved. See
  34285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34286. // for more information.
  34287. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  34288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34289. return c
  34290. }
  34291. // IfNoneMatch sets the optional parameter which makes the operation
  34292. // fail if the object's ETag matches the given value. This is useful for
  34293. // getting updates only after the object has changed since the last
  34294. // request. Use googleapi.IsNotModified to check whether the response
  34295. // error from Do is the result of In-None-Match.
  34296. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  34297. c.ifNoneMatch_ = entityTag
  34298. return c
  34299. }
  34300. // Context sets the context to be used in this call's Do method. Any
  34301. // pending HTTP request will be aborted if the provided context is
  34302. // canceled.
  34303. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  34304. c.ctx_ = ctx
  34305. return c
  34306. }
  34307. // Header returns an http.Header that can be modified by the caller to
  34308. // add HTTP headers to the request.
  34309. func (c *AcceleratorTypesListCall) Header() http.Header {
  34310. if c.header_ == nil {
  34311. c.header_ = make(http.Header)
  34312. }
  34313. return c.header_
  34314. }
  34315. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  34316. reqHeaders := make(http.Header)
  34317. for k, v := range c.header_ {
  34318. reqHeaders[k] = v
  34319. }
  34320. reqHeaders.Set("User-Agent", c.s.userAgent())
  34321. if c.ifNoneMatch_ != "" {
  34322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34323. }
  34324. var body io.Reader = nil
  34325. c.urlParams_.Set("alt", alt)
  34326. c.urlParams_.Set("prettyPrint", "false")
  34327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  34328. urls += "?" + c.urlParams_.Encode()
  34329. req, err := http.NewRequest("GET", urls, body)
  34330. if err != nil {
  34331. return nil, err
  34332. }
  34333. req.Header = reqHeaders
  34334. googleapi.Expand(req.URL, map[string]string{
  34335. "project": c.project,
  34336. "zone": c.zone,
  34337. })
  34338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34339. }
  34340. // Do executes the "compute.acceleratorTypes.list" call.
  34341. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  34342. // non-2xx status code is an error. Response headers are in either
  34343. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  34344. // returned at all) in error.(*googleapi.Error).Header. Use
  34345. // googleapi.IsNotModified to check whether the returned error was
  34346. // because http.StatusNotModified was returned.
  34347. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  34348. gensupport.SetOptions(c.urlParams_, opts...)
  34349. res, err := c.doRequest("json")
  34350. if res != nil && res.StatusCode == http.StatusNotModified {
  34351. if res.Body != nil {
  34352. res.Body.Close()
  34353. }
  34354. return nil, &googleapi.Error{
  34355. Code: res.StatusCode,
  34356. Header: res.Header,
  34357. }
  34358. }
  34359. if err != nil {
  34360. return nil, err
  34361. }
  34362. defer googleapi.CloseBody(res)
  34363. if err := googleapi.CheckResponse(res); err != nil {
  34364. return nil, err
  34365. }
  34366. ret := &AcceleratorTypeList{
  34367. ServerResponse: googleapi.ServerResponse{
  34368. Header: res.Header,
  34369. HTTPStatusCode: res.StatusCode,
  34370. },
  34371. }
  34372. target := &ret
  34373. if err := gensupport.DecodeResponse(target, res); err != nil {
  34374. return nil, err
  34375. }
  34376. return ret, nil
  34377. // {
  34378. // "description": "Retrieves a list of accelerator types available to the specified project.",
  34379. // "httpMethod": "GET",
  34380. // "id": "compute.acceleratorTypes.list",
  34381. // "parameterOrder": [
  34382. // "project",
  34383. // "zone"
  34384. // ],
  34385. // "parameters": {
  34386. // "filter": {
  34387. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  34388. // "location": "query",
  34389. // "type": "string"
  34390. // },
  34391. // "maxResults": {
  34392. // "default": "500",
  34393. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34394. // "format": "uint32",
  34395. // "location": "query",
  34396. // "minimum": "0",
  34397. // "type": "integer"
  34398. // },
  34399. // "orderBy": {
  34400. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34401. // "location": "query",
  34402. // "type": "string"
  34403. // },
  34404. // "pageToken": {
  34405. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34406. // "location": "query",
  34407. // "type": "string"
  34408. // },
  34409. // "project": {
  34410. // "description": "Project ID for this request.",
  34411. // "location": "path",
  34412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34413. // "required": true,
  34414. // "type": "string"
  34415. // },
  34416. // "zone": {
  34417. // "description": "The name of the zone for this request.",
  34418. // "location": "path",
  34419. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34420. // "required": true,
  34421. // "type": "string"
  34422. // }
  34423. // },
  34424. // "path": "{project}/zones/{zone}/acceleratorTypes",
  34425. // "response": {
  34426. // "$ref": "AcceleratorTypeList"
  34427. // },
  34428. // "scopes": [
  34429. // "https://www.googleapis.com/auth/cloud-platform",
  34430. // "https://www.googleapis.com/auth/compute",
  34431. // "https://www.googleapis.com/auth/compute.readonly"
  34432. // ]
  34433. // }
  34434. }
  34435. // Pages invokes f for each page of results.
  34436. // A non-nil error returned from f will halt the iteration.
  34437. // The provided context supersedes any context provided to the Context method.
  34438. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  34439. c.ctx_ = ctx
  34440. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34441. for {
  34442. x, err := c.Do()
  34443. if err != nil {
  34444. return err
  34445. }
  34446. if err := f(x); err != nil {
  34447. return err
  34448. }
  34449. if x.NextPageToken == "" {
  34450. return nil
  34451. }
  34452. c.PageToken(x.NextPageToken)
  34453. }
  34454. }
  34455. // method id "compute.addresses.aggregatedList":
  34456. type AddressesAggregatedListCall struct {
  34457. s *Service
  34458. project string
  34459. urlParams_ gensupport.URLParams
  34460. ifNoneMatch_ string
  34461. ctx_ context.Context
  34462. header_ http.Header
  34463. }
  34464. // AggregatedList: Retrieves an aggregated list of addresses.
  34465. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  34466. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  34467. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34468. c.project = project
  34469. return c
  34470. }
  34471. // Filter sets the optional parameter "filter": A filter expression that
  34472. // filters resources listed in the response. The expression must specify
  34473. // the field name, a comparison operator, and the value that you want to
  34474. // use for filtering. The value must be a string, a number, or a
  34475. // boolean. The comparison operator must be either =, !=, >, or <.
  34476. //
  34477. // For example, if you are filtering Compute Engine instances, you can
  34478. // exclude instances named example-instance by specifying name !=
  34479. // example-instance.
  34480. //
  34481. // You can also filter nested fields. For example, you could specify
  34482. // scheduling.automaticRestart = false to include instances only if they
  34483. // are not scheduled for automatic restarts. You can use filtering on
  34484. // nested fields to filter based on resource labels.
  34485. //
  34486. // To filter on multiple expressions, provide each separate expression
  34487. // within parentheses. For example, (scheduling.automaticRestart = true)
  34488. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34489. // AND expression. However, you can include AND and OR expressions
  34490. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34491. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34492. // true).
  34493. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  34494. c.urlParams_.Set("filter", filter)
  34495. return c
  34496. }
  34497. // MaxResults sets the optional parameter "maxResults": The maximum
  34498. // number of results per page that should be returned. If the number of
  34499. // available results is larger than maxResults, Compute Engine returns a
  34500. // nextPageToken that can be used to get the next page of results in
  34501. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34502. // (Default: 500)
  34503. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  34504. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34505. return c
  34506. }
  34507. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34508. // a certain order. By default, results are returned in alphanumerical
  34509. // order based on the resource name.
  34510. //
  34511. // You can also sort results in descending order based on the creation
  34512. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34513. // based on the creationTimestamp field in reverse chronological order
  34514. // (newest result first). Use this to sort resources like operations so
  34515. // that the newest operation is returned first.
  34516. //
  34517. // Currently, only sorting by name or creationTimestamp desc is
  34518. // supported.
  34519. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  34520. c.urlParams_.Set("orderBy", orderBy)
  34521. return c
  34522. }
  34523. // PageToken sets the optional parameter "pageToken": Specifies a page
  34524. // token to use. Set pageToken to the nextPageToken returned by a
  34525. // previous list request to get the next page of results.
  34526. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  34527. c.urlParams_.Set("pageToken", pageToken)
  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 *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  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 *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  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 *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  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 *AddressesAggregatedListCall) Header() http.Header {
  34556. if c.header_ == nil {
  34557. c.header_ = make(http.Header)
  34558. }
  34559. return c.header_
  34560. }
  34561. func (c *AddressesAggregatedListCall) 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}/aggregated/addresses")
  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. })
  34583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34584. }
  34585. // Do executes the "compute.addresses.aggregatedList" call.
  34586. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  34587. // non-2xx status code is an error. Response headers are in either
  34588. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  34589. // returned at all) in error.(*googleapi.Error).Header. Use
  34590. // googleapi.IsNotModified to check whether the returned error was
  34591. // because http.StatusNotModified was returned.
  34592. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  34593. gensupport.SetOptions(c.urlParams_, opts...)
  34594. res, err := c.doRequest("json")
  34595. if res != nil && res.StatusCode == http.StatusNotModified {
  34596. if res.Body != nil {
  34597. res.Body.Close()
  34598. }
  34599. return nil, &googleapi.Error{
  34600. Code: res.StatusCode,
  34601. Header: res.Header,
  34602. }
  34603. }
  34604. if err != nil {
  34605. return nil, err
  34606. }
  34607. defer googleapi.CloseBody(res)
  34608. if err := googleapi.CheckResponse(res); err != nil {
  34609. return nil, err
  34610. }
  34611. ret := &AddressAggregatedList{
  34612. ServerResponse: googleapi.ServerResponse{
  34613. Header: res.Header,
  34614. HTTPStatusCode: res.StatusCode,
  34615. },
  34616. }
  34617. target := &ret
  34618. if err := gensupport.DecodeResponse(target, res); err != nil {
  34619. return nil, err
  34620. }
  34621. return ret, nil
  34622. // {
  34623. // "description": "Retrieves an aggregated list of addresses.",
  34624. // "httpMethod": "GET",
  34625. // "id": "compute.addresses.aggregatedList",
  34626. // "parameterOrder": [
  34627. // "project"
  34628. // ],
  34629. // "parameters": {
  34630. // "filter": {
  34631. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  34632. // "location": "query",
  34633. // "type": "string"
  34634. // },
  34635. // "maxResults": {
  34636. // "default": "500",
  34637. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34638. // "format": "uint32",
  34639. // "location": "query",
  34640. // "minimum": "0",
  34641. // "type": "integer"
  34642. // },
  34643. // "orderBy": {
  34644. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34645. // "location": "query",
  34646. // "type": "string"
  34647. // },
  34648. // "pageToken": {
  34649. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34650. // "location": "query",
  34651. // "type": "string"
  34652. // },
  34653. // "project": {
  34654. // "description": "Project ID for this request.",
  34655. // "location": "path",
  34656. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34657. // "required": true,
  34658. // "type": "string"
  34659. // }
  34660. // },
  34661. // "path": "{project}/aggregated/addresses",
  34662. // "response": {
  34663. // "$ref": "AddressAggregatedList"
  34664. // },
  34665. // "scopes": [
  34666. // "https://www.googleapis.com/auth/cloud-platform",
  34667. // "https://www.googleapis.com/auth/compute",
  34668. // "https://www.googleapis.com/auth/compute.readonly"
  34669. // ]
  34670. // }
  34671. }
  34672. // Pages invokes f for each page of results.
  34673. // A non-nil error returned from f will halt the iteration.
  34674. // The provided context supersedes any context provided to the Context method.
  34675. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  34676. c.ctx_ = ctx
  34677. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34678. for {
  34679. x, err := c.Do()
  34680. if err != nil {
  34681. return err
  34682. }
  34683. if err := f(x); err != nil {
  34684. return err
  34685. }
  34686. if x.NextPageToken == "" {
  34687. return nil
  34688. }
  34689. c.PageToken(x.NextPageToken)
  34690. }
  34691. }
  34692. // method id "compute.addresses.delete":
  34693. type AddressesDeleteCall struct {
  34694. s *Service
  34695. project string
  34696. region string
  34697. address string
  34698. urlParams_ gensupport.URLParams
  34699. ctx_ context.Context
  34700. header_ http.Header
  34701. }
  34702. // Delete: Deletes the specified address resource.
  34703. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  34704. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  34705. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34706. c.project = project
  34707. c.region = region
  34708. c.address = address
  34709. return c
  34710. }
  34711. // RequestId sets the optional parameter "requestId": An optional
  34712. // request ID to identify requests. Specify a unique request ID so that
  34713. // if you must retry your request, the server will know to ignore the
  34714. // request if it has already been completed.
  34715. //
  34716. // For example, consider a situation where you make an initial request
  34717. // and the request times out. If you make the request again with the
  34718. // same request ID, the server can check if original operation with the
  34719. // same request ID was received, and if so, will ignore the second
  34720. // request. This prevents clients from accidentally creating duplicate
  34721. // commitments.
  34722. //
  34723. // The request ID must be a valid UUID with the exception that zero UUID
  34724. // is not supported (00000000-0000-0000-0000-000000000000).
  34725. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  34726. c.urlParams_.Set("requestId", requestId)
  34727. return c
  34728. }
  34729. // Fields allows partial responses to be retrieved. See
  34730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34731. // for more information.
  34732. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  34733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34734. return c
  34735. }
  34736. // Context sets the context to be used in this call's Do method. Any
  34737. // pending HTTP request will be aborted if the provided context is
  34738. // canceled.
  34739. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  34740. c.ctx_ = ctx
  34741. return c
  34742. }
  34743. // Header returns an http.Header that can be modified by the caller to
  34744. // add HTTP headers to the request.
  34745. func (c *AddressesDeleteCall) Header() http.Header {
  34746. if c.header_ == nil {
  34747. c.header_ = make(http.Header)
  34748. }
  34749. return c.header_
  34750. }
  34751. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  34752. reqHeaders := make(http.Header)
  34753. for k, v := range c.header_ {
  34754. reqHeaders[k] = v
  34755. }
  34756. reqHeaders.Set("User-Agent", c.s.userAgent())
  34757. var body io.Reader = nil
  34758. c.urlParams_.Set("alt", alt)
  34759. c.urlParams_.Set("prettyPrint", "false")
  34760. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  34761. urls += "?" + c.urlParams_.Encode()
  34762. req, err := http.NewRequest("DELETE", urls, body)
  34763. if err != nil {
  34764. return nil, err
  34765. }
  34766. req.Header = reqHeaders
  34767. googleapi.Expand(req.URL, map[string]string{
  34768. "project": c.project,
  34769. "region": c.region,
  34770. "address": c.address,
  34771. })
  34772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34773. }
  34774. // Do executes the "compute.addresses.delete" call.
  34775. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34776. // status code is an error. Response headers are in either
  34777. // *Operation.ServerResponse.Header or (if a response was returned at
  34778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34779. // to check whether the returned error was because
  34780. // http.StatusNotModified was returned.
  34781. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34782. gensupport.SetOptions(c.urlParams_, opts...)
  34783. res, err := c.doRequest("json")
  34784. if res != nil && res.StatusCode == http.StatusNotModified {
  34785. if res.Body != nil {
  34786. res.Body.Close()
  34787. }
  34788. return nil, &googleapi.Error{
  34789. Code: res.StatusCode,
  34790. Header: res.Header,
  34791. }
  34792. }
  34793. if err != nil {
  34794. return nil, err
  34795. }
  34796. defer googleapi.CloseBody(res)
  34797. if err := googleapi.CheckResponse(res); err != nil {
  34798. return nil, err
  34799. }
  34800. ret := &Operation{
  34801. ServerResponse: googleapi.ServerResponse{
  34802. Header: res.Header,
  34803. HTTPStatusCode: res.StatusCode,
  34804. },
  34805. }
  34806. target := &ret
  34807. if err := gensupport.DecodeResponse(target, res); err != nil {
  34808. return nil, err
  34809. }
  34810. return ret, nil
  34811. // {
  34812. // "description": "Deletes the specified address resource.",
  34813. // "httpMethod": "DELETE",
  34814. // "id": "compute.addresses.delete",
  34815. // "parameterOrder": [
  34816. // "project",
  34817. // "region",
  34818. // "address"
  34819. // ],
  34820. // "parameters": {
  34821. // "address": {
  34822. // "description": "Name of the address resource to delete.",
  34823. // "location": "path",
  34824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34825. // "required": true,
  34826. // "type": "string"
  34827. // },
  34828. // "project": {
  34829. // "description": "Project ID for this request.",
  34830. // "location": "path",
  34831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34832. // "required": true,
  34833. // "type": "string"
  34834. // },
  34835. // "region": {
  34836. // "description": "Name of the region for this request.",
  34837. // "location": "path",
  34838. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34839. // "required": true,
  34840. // "type": "string"
  34841. // },
  34842. // "requestId": {
  34843. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34844. // "location": "query",
  34845. // "type": "string"
  34846. // }
  34847. // },
  34848. // "path": "{project}/regions/{region}/addresses/{address}",
  34849. // "response": {
  34850. // "$ref": "Operation"
  34851. // },
  34852. // "scopes": [
  34853. // "https://www.googleapis.com/auth/cloud-platform",
  34854. // "https://www.googleapis.com/auth/compute"
  34855. // ]
  34856. // }
  34857. }
  34858. // method id "compute.addresses.get":
  34859. type AddressesGetCall struct {
  34860. s *Service
  34861. project string
  34862. region string
  34863. address string
  34864. urlParams_ gensupport.URLParams
  34865. ifNoneMatch_ string
  34866. ctx_ context.Context
  34867. header_ http.Header
  34868. }
  34869. // Get: Returns the specified address resource.
  34870. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  34871. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  34872. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34873. c.project = project
  34874. c.region = region
  34875. c.address = address
  34876. return c
  34877. }
  34878. // Fields allows partial responses to be retrieved. See
  34879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34880. // for more information.
  34881. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  34882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34883. return c
  34884. }
  34885. // IfNoneMatch sets the optional parameter which makes the operation
  34886. // fail if the object's ETag matches the given value. This is useful for
  34887. // getting updates only after the object has changed since the last
  34888. // request. Use googleapi.IsNotModified to check whether the response
  34889. // error from Do is the result of In-None-Match.
  34890. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  34891. c.ifNoneMatch_ = entityTag
  34892. return c
  34893. }
  34894. // Context sets the context to be used in this call's Do method. Any
  34895. // pending HTTP request will be aborted if the provided context is
  34896. // canceled.
  34897. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  34898. c.ctx_ = ctx
  34899. return c
  34900. }
  34901. // Header returns an http.Header that can be modified by the caller to
  34902. // add HTTP headers to the request.
  34903. func (c *AddressesGetCall) Header() http.Header {
  34904. if c.header_ == nil {
  34905. c.header_ = make(http.Header)
  34906. }
  34907. return c.header_
  34908. }
  34909. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  34910. reqHeaders := make(http.Header)
  34911. for k, v := range c.header_ {
  34912. reqHeaders[k] = v
  34913. }
  34914. reqHeaders.Set("User-Agent", c.s.userAgent())
  34915. if c.ifNoneMatch_ != "" {
  34916. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34917. }
  34918. var body io.Reader = nil
  34919. c.urlParams_.Set("alt", alt)
  34920. c.urlParams_.Set("prettyPrint", "false")
  34921. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  34922. urls += "?" + c.urlParams_.Encode()
  34923. req, err := http.NewRequest("GET", urls, body)
  34924. if err != nil {
  34925. return nil, err
  34926. }
  34927. req.Header = reqHeaders
  34928. googleapi.Expand(req.URL, map[string]string{
  34929. "project": c.project,
  34930. "region": c.region,
  34931. "address": c.address,
  34932. })
  34933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34934. }
  34935. // Do executes the "compute.addresses.get" call.
  34936. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  34937. // code is an error. Response headers are in either
  34938. // *Address.ServerResponse.Header or (if a response was returned at all)
  34939. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  34940. // check whether the returned error was because http.StatusNotModified
  34941. // was returned.
  34942. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  34943. gensupport.SetOptions(c.urlParams_, opts...)
  34944. res, err := c.doRequest("json")
  34945. if res != nil && res.StatusCode == http.StatusNotModified {
  34946. if res.Body != nil {
  34947. res.Body.Close()
  34948. }
  34949. return nil, &googleapi.Error{
  34950. Code: res.StatusCode,
  34951. Header: res.Header,
  34952. }
  34953. }
  34954. if err != nil {
  34955. return nil, err
  34956. }
  34957. defer googleapi.CloseBody(res)
  34958. if err := googleapi.CheckResponse(res); err != nil {
  34959. return nil, err
  34960. }
  34961. ret := &Address{
  34962. ServerResponse: googleapi.ServerResponse{
  34963. Header: res.Header,
  34964. HTTPStatusCode: res.StatusCode,
  34965. },
  34966. }
  34967. target := &ret
  34968. if err := gensupport.DecodeResponse(target, res); err != nil {
  34969. return nil, err
  34970. }
  34971. return ret, nil
  34972. // {
  34973. // "description": "Returns the specified address resource.",
  34974. // "httpMethod": "GET",
  34975. // "id": "compute.addresses.get",
  34976. // "parameterOrder": [
  34977. // "project",
  34978. // "region",
  34979. // "address"
  34980. // ],
  34981. // "parameters": {
  34982. // "address": {
  34983. // "description": "Name of the address resource to return.",
  34984. // "location": "path",
  34985. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34986. // "required": true,
  34987. // "type": "string"
  34988. // },
  34989. // "project": {
  34990. // "description": "Project ID for this request.",
  34991. // "location": "path",
  34992. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34993. // "required": true,
  34994. // "type": "string"
  34995. // },
  34996. // "region": {
  34997. // "description": "Name of the region for this request.",
  34998. // "location": "path",
  34999. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35000. // "required": true,
  35001. // "type": "string"
  35002. // }
  35003. // },
  35004. // "path": "{project}/regions/{region}/addresses/{address}",
  35005. // "response": {
  35006. // "$ref": "Address"
  35007. // },
  35008. // "scopes": [
  35009. // "https://www.googleapis.com/auth/cloud-platform",
  35010. // "https://www.googleapis.com/auth/compute",
  35011. // "https://www.googleapis.com/auth/compute.readonly"
  35012. // ]
  35013. // }
  35014. }
  35015. // method id "compute.addresses.insert":
  35016. type AddressesInsertCall struct {
  35017. s *Service
  35018. project string
  35019. region string
  35020. address *Address
  35021. urlParams_ gensupport.URLParams
  35022. ctx_ context.Context
  35023. header_ http.Header
  35024. }
  35025. // Insert: Creates an address resource in the specified project using
  35026. // the data included in the request.
  35027. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  35028. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  35029. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35030. c.project = project
  35031. c.region = region
  35032. c.address = address
  35033. return c
  35034. }
  35035. // RequestId sets the optional parameter "requestId": An optional
  35036. // request ID to identify requests. Specify a unique request ID so that
  35037. // if you must retry your request, the server will know to ignore the
  35038. // request if it has already been completed.
  35039. //
  35040. // For example, consider a situation where you make an initial request
  35041. // and the request times out. If you make the request again with the
  35042. // same request ID, the server can check if original operation with the
  35043. // same request ID was received, and if so, will ignore the second
  35044. // request. This prevents clients from accidentally creating duplicate
  35045. // commitments.
  35046. //
  35047. // The request ID must be a valid UUID with the exception that zero UUID
  35048. // is not supported (00000000-0000-0000-0000-000000000000).
  35049. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  35050. c.urlParams_.Set("requestId", requestId)
  35051. return c
  35052. }
  35053. // Fields allows partial responses to be retrieved. See
  35054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35055. // for more information.
  35056. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  35057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35058. return c
  35059. }
  35060. // Context sets the context to be used in this call's Do method. Any
  35061. // pending HTTP request will be aborted if the provided context is
  35062. // canceled.
  35063. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  35064. c.ctx_ = ctx
  35065. return c
  35066. }
  35067. // Header returns an http.Header that can be modified by the caller to
  35068. // add HTTP headers to the request.
  35069. func (c *AddressesInsertCall) Header() http.Header {
  35070. if c.header_ == nil {
  35071. c.header_ = make(http.Header)
  35072. }
  35073. return c.header_
  35074. }
  35075. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  35076. reqHeaders := make(http.Header)
  35077. for k, v := range c.header_ {
  35078. reqHeaders[k] = v
  35079. }
  35080. reqHeaders.Set("User-Agent", c.s.userAgent())
  35081. var body io.Reader = nil
  35082. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  35083. if err != nil {
  35084. return nil, err
  35085. }
  35086. reqHeaders.Set("Content-Type", "application/json")
  35087. c.urlParams_.Set("alt", alt)
  35088. c.urlParams_.Set("prettyPrint", "false")
  35089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  35090. urls += "?" + c.urlParams_.Encode()
  35091. req, err := http.NewRequest("POST", urls, body)
  35092. if err != nil {
  35093. return nil, err
  35094. }
  35095. req.Header = reqHeaders
  35096. googleapi.Expand(req.URL, map[string]string{
  35097. "project": c.project,
  35098. "region": c.region,
  35099. })
  35100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35101. }
  35102. // Do executes the "compute.addresses.insert" call.
  35103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35104. // status code is an error. Response headers are in either
  35105. // *Operation.ServerResponse.Header or (if a response was returned at
  35106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35107. // to check whether the returned error was because
  35108. // http.StatusNotModified was returned.
  35109. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35110. gensupport.SetOptions(c.urlParams_, opts...)
  35111. res, err := c.doRequest("json")
  35112. if res != nil && res.StatusCode == http.StatusNotModified {
  35113. if res.Body != nil {
  35114. res.Body.Close()
  35115. }
  35116. return nil, &googleapi.Error{
  35117. Code: res.StatusCode,
  35118. Header: res.Header,
  35119. }
  35120. }
  35121. if err != nil {
  35122. return nil, err
  35123. }
  35124. defer googleapi.CloseBody(res)
  35125. if err := googleapi.CheckResponse(res); err != nil {
  35126. return nil, err
  35127. }
  35128. ret := &Operation{
  35129. ServerResponse: googleapi.ServerResponse{
  35130. Header: res.Header,
  35131. HTTPStatusCode: res.StatusCode,
  35132. },
  35133. }
  35134. target := &ret
  35135. if err := gensupport.DecodeResponse(target, res); err != nil {
  35136. return nil, err
  35137. }
  35138. return ret, nil
  35139. // {
  35140. // "description": "Creates an address resource in the specified project using the data included in the request.",
  35141. // "httpMethod": "POST",
  35142. // "id": "compute.addresses.insert",
  35143. // "parameterOrder": [
  35144. // "project",
  35145. // "region"
  35146. // ],
  35147. // "parameters": {
  35148. // "project": {
  35149. // "description": "Project ID for this request.",
  35150. // "location": "path",
  35151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35152. // "required": true,
  35153. // "type": "string"
  35154. // },
  35155. // "region": {
  35156. // "description": "Name of the region for this request.",
  35157. // "location": "path",
  35158. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35159. // "required": true,
  35160. // "type": "string"
  35161. // },
  35162. // "requestId": {
  35163. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35164. // "location": "query",
  35165. // "type": "string"
  35166. // }
  35167. // },
  35168. // "path": "{project}/regions/{region}/addresses",
  35169. // "request": {
  35170. // "$ref": "Address"
  35171. // },
  35172. // "response": {
  35173. // "$ref": "Operation"
  35174. // },
  35175. // "scopes": [
  35176. // "https://www.googleapis.com/auth/cloud-platform",
  35177. // "https://www.googleapis.com/auth/compute"
  35178. // ]
  35179. // }
  35180. }
  35181. // method id "compute.addresses.list":
  35182. type AddressesListCall struct {
  35183. s *Service
  35184. project string
  35185. region string
  35186. urlParams_ gensupport.URLParams
  35187. ifNoneMatch_ string
  35188. ctx_ context.Context
  35189. header_ http.Header
  35190. }
  35191. // List: Retrieves a list of addresses contained within the specified
  35192. // region.
  35193. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  35194. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  35195. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35196. c.project = project
  35197. c.region = region
  35198. return c
  35199. }
  35200. // Filter sets the optional parameter "filter": A filter expression that
  35201. // filters resources listed in the response. The expression must specify
  35202. // the field name, a comparison operator, and the value that you want to
  35203. // use for filtering. The value must be a string, a number, or a
  35204. // boolean. The comparison operator must be either =, !=, >, or <.
  35205. //
  35206. // For example, if you are filtering Compute Engine instances, you can
  35207. // exclude instances named example-instance by specifying name !=
  35208. // example-instance.
  35209. //
  35210. // You can also filter nested fields. For example, you could specify
  35211. // scheduling.automaticRestart = false to include instances only if they
  35212. // are not scheduled for automatic restarts. You can use filtering on
  35213. // nested fields to filter based on resource labels.
  35214. //
  35215. // To filter on multiple expressions, provide each separate expression
  35216. // within parentheses. For example, (scheduling.automaticRestart = true)
  35217. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35218. // AND expression. However, you can include AND and OR expressions
  35219. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35220. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35221. // true).
  35222. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  35223. c.urlParams_.Set("filter", filter)
  35224. return c
  35225. }
  35226. // MaxResults sets the optional parameter "maxResults": The maximum
  35227. // number of results per page that should be returned. If the number of
  35228. // available results is larger than maxResults, Compute Engine returns a
  35229. // nextPageToken that can be used to get the next page of results in
  35230. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35231. // (Default: 500)
  35232. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  35233. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35234. return c
  35235. }
  35236. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35237. // a certain order. By default, results are returned in alphanumerical
  35238. // order based on the resource name.
  35239. //
  35240. // You can also sort results in descending order based on the creation
  35241. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35242. // based on the creationTimestamp field in reverse chronological order
  35243. // (newest result first). Use this to sort resources like operations so
  35244. // that the newest operation is returned first.
  35245. //
  35246. // Currently, only sorting by name or creationTimestamp desc is
  35247. // supported.
  35248. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  35249. c.urlParams_.Set("orderBy", orderBy)
  35250. return c
  35251. }
  35252. // PageToken sets the optional parameter "pageToken": Specifies a page
  35253. // token to use. Set pageToken to the nextPageToken returned by a
  35254. // previous list request to get the next page of results.
  35255. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  35256. c.urlParams_.Set("pageToken", pageToken)
  35257. return c
  35258. }
  35259. // Fields allows partial responses to be retrieved. See
  35260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35261. // for more information.
  35262. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  35263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35264. return c
  35265. }
  35266. // IfNoneMatch sets the optional parameter which makes the operation
  35267. // fail if the object's ETag matches the given value. This is useful for
  35268. // getting updates only after the object has changed since the last
  35269. // request. Use googleapi.IsNotModified to check whether the response
  35270. // error from Do is the result of In-None-Match.
  35271. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  35272. c.ifNoneMatch_ = entityTag
  35273. return c
  35274. }
  35275. // Context sets the context to be used in this call's Do method. Any
  35276. // pending HTTP request will be aborted if the provided context is
  35277. // canceled.
  35278. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  35279. c.ctx_ = ctx
  35280. return c
  35281. }
  35282. // Header returns an http.Header that can be modified by the caller to
  35283. // add HTTP headers to the request.
  35284. func (c *AddressesListCall) Header() http.Header {
  35285. if c.header_ == nil {
  35286. c.header_ = make(http.Header)
  35287. }
  35288. return c.header_
  35289. }
  35290. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  35291. reqHeaders := make(http.Header)
  35292. for k, v := range c.header_ {
  35293. reqHeaders[k] = v
  35294. }
  35295. reqHeaders.Set("User-Agent", c.s.userAgent())
  35296. if c.ifNoneMatch_ != "" {
  35297. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35298. }
  35299. var body io.Reader = nil
  35300. c.urlParams_.Set("alt", alt)
  35301. c.urlParams_.Set("prettyPrint", "false")
  35302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  35303. urls += "?" + c.urlParams_.Encode()
  35304. req, err := http.NewRequest("GET", urls, body)
  35305. if err != nil {
  35306. return nil, err
  35307. }
  35308. req.Header = reqHeaders
  35309. googleapi.Expand(req.URL, map[string]string{
  35310. "project": c.project,
  35311. "region": c.region,
  35312. })
  35313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35314. }
  35315. // Do executes the "compute.addresses.list" call.
  35316. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  35317. // status code is an error. Response headers are in either
  35318. // *AddressList.ServerResponse.Header or (if a response was returned at
  35319. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35320. // to check whether the returned error was because
  35321. // http.StatusNotModified was returned.
  35322. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  35323. gensupport.SetOptions(c.urlParams_, opts...)
  35324. res, err := c.doRequest("json")
  35325. if res != nil && res.StatusCode == http.StatusNotModified {
  35326. if res.Body != nil {
  35327. res.Body.Close()
  35328. }
  35329. return nil, &googleapi.Error{
  35330. Code: res.StatusCode,
  35331. Header: res.Header,
  35332. }
  35333. }
  35334. if err != nil {
  35335. return nil, err
  35336. }
  35337. defer googleapi.CloseBody(res)
  35338. if err := googleapi.CheckResponse(res); err != nil {
  35339. return nil, err
  35340. }
  35341. ret := &AddressList{
  35342. ServerResponse: googleapi.ServerResponse{
  35343. Header: res.Header,
  35344. HTTPStatusCode: res.StatusCode,
  35345. },
  35346. }
  35347. target := &ret
  35348. if err := gensupport.DecodeResponse(target, res); err != nil {
  35349. return nil, err
  35350. }
  35351. return ret, nil
  35352. // {
  35353. // "description": "Retrieves a list of addresses contained within the specified region.",
  35354. // "httpMethod": "GET",
  35355. // "id": "compute.addresses.list",
  35356. // "parameterOrder": [
  35357. // "project",
  35358. // "region"
  35359. // ],
  35360. // "parameters": {
  35361. // "filter": {
  35362. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35363. // "location": "query",
  35364. // "type": "string"
  35365. // },
  35366. // "maxResults": {
  35367. // "default": "500",
  35368. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35369. // "format": "uint32",
  35370. // "location": "query",
  35371. // "minimum": "0",
  35372. // "type": "integer"
  35373. // },
  35374. // "orderBy": {
  35375. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35376. // "location": "query",
  35377. // "type": "string"
  35378. // },
  35379. // "pageToken": {
  35380. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35381. // "location": "query",
  35382. // "type": "string"
  35383. // },
  35384. // "project": {
  35385. // "description": "Project ID for this request.",
  35386. // "location": "path",
  35387. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35388. // "required": true,
  35389. // "type": "string"
  35390. // },
  35391. // "region": {
  35392. // "description": "Name of the region for this request.",
  35393. // "location": "path",
  35394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35395. // "required": true,
  35396. // "type": "string"
  35397. // }
  35398. // },
  35399. // "path": "{project}/regions/{region}/addresses",
  35400. // "response": {
  35401. // "$ref": "AddressList"
  35402. // },
  35403. // "scopes": [
  35404. // "https://www.googleapis.com/auth/cloud-platform",
  35405. // "https://www.googleapis.com/auth/compute",
  35406. // "https://www.googleapis.com/auth/compute.readonly"
  35407. // ]
  35408. // }
  35409. }
  35410. // Pages invokes f for each page of results.
  35411. // A non-nil error returned from f will halt the iteration.
  35412. // The provided context supersedes any context provided to the Context method.
  35413. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  35414. c.ctx_ = ctx
  35415. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35416. for {
  35417. x, err := c.Do()
  35418. if err != nil {
  35419. return err
  35420. }
  35421. if err := f(x); err != nil {
  35422. return err
  35423. }
  35424. if x.NextPageToken == "" {
  35425. return nil
  35426. }
  35427. c.PageToken(x.NextPageToken)
  35428. }
  35429. }
  35430. // method id "compute.addresses.setLabels":
  35431. type AddressesSetLabelsCall struct {
  35432. s *Service
  35433. project string
  35434. region string
  35435. resource string
  35436. regionsetlabelsrequest *RegionSetLabelsRequest
  35437. urlParams_ gensupport.URLParams
  35438. ctx_ context.Context
  35439. header_ http.Header
  35440. }
  35441. // SetLabels: Sets the labels on an Address. To learn more about labels,
  35442. // read the Labeling Resources documentation.
  35443. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  35444. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35445. c.project = project
  35446. c.region = region
  35447. c.resource = resource
  35448. c.regionsetlabelsrequest = regionsetlabelsrequest
  35449. return c
  35450. }
  35451. // RequestId sets the optional parameter "requestId": An optional
  35452. // request ID to identify requests. Specify a unique request ID so that
  35453. // if you must retry your request, the server will know to ignore the
  35454. // request if it has already been completed.
  35455. //
  35456. // For example, consider a situation where you make an initial request
  35457. // and the request times out. If you make the request again with the
  35458. // same request ID, the server can check if original operation with the
  35459. // same request ID was received, and if so, will ignore the second
  35460. // request. This prevents clients from accidentally creating duplicate
  35461. // commitments.
  35462. //
  35463. // The request ID must be a valid UUID with the exception that zero UUID
  35464. // is not supported (00000000-0000-0000-0000-000000000000).
  35465. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  35466. c.urlParams_.Set("requestId", requestId)
  35467. return c
  35468. }
  35469. // Fields allows partial responses to be retrieved. See
  35470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35471. // for more information.
  35472. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  35473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35474. return c
  35475. }
  35476. // Context sets the context to be used in this call's Do method. Any
  35477. // pending HTTP request will be aborted if the provided context is
  35478. // canceled.
  35479. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  35480. c.ctx_ = ctx
  35481. return c
  35482. }
  35483. // Header returns an http.Header that can be modified by the caller to
  35484. // add HTTP headers to the request.
  35485. func (c *AddressesSetLabelsCall) Header() http.Header {
  35486. if c.header_ == nil {
  35487. c.header_ = make(http.Header)
  35488. }
  35489. return c.header_
  35490. }
  35491. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  35492. reqHeaders := make(http.Header)
  35493. for k, v := range c.header_ {
  35494. reqHeaders[k] = v
  35495. }
  35496. reqHeaders.Set("User-Agent", c.s.userAgent())
  35497. var body io.Reader = nil
  35498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  35499. if err != nil {
  35500. return nil, err
  35501. }
  35502. reqHeaders.Set("Content-Type", "application/json")
  35503. c.urlParams_.Set("alt", alt)
  35504. c.urlParams_.Set("prettyPrint", "false")
  35505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  35506. urls += "?" + c.urlParams_.Encode()
  35507. req, err := http.NewRequest("POST", urls, body)
  35508. if err != nil {
  35509. return nil, err
  35510. }
  35511. req.Header = reqHeaders
  35512. googleapi.Expand(req.URL, map[string]string{
  35513. "project": c.project,
  35514. "region": c.region,
  35515. "resource": c.resource,
  35516. })
  35517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35518. }
  35519. // Do executes the "compute.addresses.setLabels" call.
  35520. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35521. // status code is an error. Response headers are in either
  35522. // *Operation.ServerResponse.Header or (if a response was returned at
  35523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35524. // to check whether the returned error was because
  35525. // http.StatusNotModified was returned.
  35526. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35527. gensupport.SetOptions(c.urlParams_, opts...)
  35528. res, err := c.doRequest("json")
  35529. if res != nil && res.StatusCode == http.StatusNotModified {
  35530. if res.Body != nil {
  35531. res.Body.Close()
  35532. }
  35533. return nil, &googleapi.Error{
  35534. Code: res.StatusCode,
  35535. Header: res.Header,
  35536. }
  35537. }
  35538. if err != nil {
  35539. return nil, err
  35540. }
  35541. defer googleapi.CloseBody(res)
  35542. if err := googleapi.CheckResponse(res); err != nil {
  35543. return nil, err
  35544. }
  35545. ret := &Operation{
  35546. ServerResponse: googleapi.ServerResponse{
  35547. Header: res.Header,
  35548. HTTPStatusCode: res.StatusCode,
  35549. },
  35550. }
  35551. target := &ret
  35552. if err := gensupport.DecodeResponse(target, res); err != nil {
  35553. return nil, err
  35554. }
  35555. return ret, nil
  35556. // {
  35557. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  35558. // "httpMethod": "POST",
  35559. // "id": "compute.addresses.setLabels",
  35560. // "parameterOrder": [
  35561. // "project",
  35562. // "region",
  35563. // "resource"
  35564. // ],
  35565. // "parameters": {
  35566. // "project": {
  35567. // "description": "Project ID for this request.",
  35568. // "location": "path",
  35569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35570. // "required": true,
  35571. // "type": "string"
  35572. // },
  35573. // "region": {
  35574. // "description": "The region for this request.",
  35575. // "location": "path",
  35576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35577. // "required": true,
  35578. // "type": "string"
  35579. // },
  35580. // "requestId": {
  35581. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35582. // "location": "query",
  35583. // "type": "string"
  35584. // },
  35585. // "resource": {
  35586. // "description": "Name or id of the resource for this request.",
  35587. // "location": "path",
  35588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35589. // "required": true,
  35590. // "type": "string"
  35591. // }
  35592. // },
  35593. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  35594. // "request": {
  35595. // "$ref": "RegionSetLabelsRequest"
  35596. // },
  35597. // "response": {
  35598. // "$ref": "Operation"
  35599. // },
  35600. // "scopes": [
  35601. // "https://www.googleapis.com/auth/cloud-platform",
  35602. // "https://www.googleapis.com/auth/compute"
  35603. // ]
  35604. // }
  35605. }
  35606. // method id "compute.addresses.testIamPermissions":
  35607. type AddressesTestIamPermissionsCall struct {
  35608. s *Service
  35609. project string
  35610. region string
  35611. resource string
  35612. testpermissionsrequest *TestPermissionsRequest
  35613. urlParams_ gensupport.URLParams
  35614. ctx_ context.Context
  35615. header_ http.Header
  35616. }
  35617. // TestIamPermissions: Returns permissions that a caller has on the
  35618. // specified resource.
  35619. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  35620. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35621. c.project = project
  35622. c.region = region
  35623. c.resource = resource
  35624. c.testpermissionsrequest = testpermissionsrequest
  35625. return c
  35626. }
  35627. // Fields allows partial responses to be retrieved. See
  35628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35629. // for more information.
  35630. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  35631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35632. return c
  35633. }
  35634. // Context sets the context to be used in this call's Do method. Any
  35635. // pending HTTP request will be aborted if the provided context is
  35636. // canceled.
  35637. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  35638. c.ctx_ = ctx
  35639. return c
  35640. }
  35641. // Header returns an http.Header that can be modified by the caller to
  35642. // add HTTP headers to the request.
  35643. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  35644. if c.header_ == nil {
  35645. c.header_ = make(http.Header)
  35646. }
  35647. return c.header_
  35648. }
  35649. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  35650. reqHeaders := make(http.Header)
  35651. for k, v := range c.header_ {
  35652. reqHeaders[k] = v
  35653. }
  35654. reqHeaders.Set("User-Agent", c.s.userAgent())
  35655. var body io.Reader = nil
  35656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  35657. if err != nil {
  35658. return nil, err
  35659. }
  35660. reqHeaders.Set("Content-Type", "application/json")
  35661. c.urlParams_.Set("alt", alt)
  35662. c.urlParams_.Set("prettyPrint", "false")
  35663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  35664. urls += "?" + c.urlParams_.Encode()
  35665. req, err := http.NewRequest("POST", urls, body)
  35666. if err != nil {
  35667. return nil, err
  35668. }
  35669. req.Header = reqHeaders
  35670. googleapi.Expand(req.URL, map[string]string{
  35671. "project": c.project,
  35672. "region": c.region,
  35673. "resource": c.resource,
  35674. })
  35675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35676. }
  35677. // Do executes the "compute.addresses.testIamPermissions" call.
  35678. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  35679. // non-2xx status code is an error. Response headers are in either
  35680. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  35681. // returned at all) in error.(*googleapi.Error).Header. Use
  35682. // googleapi.IsNotModified to check whether the returned error was
  35683. // because http.StatusNotModified was returned.
  35684. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  35685. gensupport.SetOptions(c.urlParams_, opts...)
  35686. res, err := c.doRequest("json")
  35687. if res != nil && res.StatusCode == http.StatusNotModified {
  35688. if res.Body != nil {
  35689. res.Body.Close()
  35690. }
  35691. return nil, &googleapi.Error{
  35692. Code: res.StatusCode,
  35693. Header: res.Header,
  35694. }
  35695. }
  35696. if err != nil {
  35697. return nil, err
  35698. }
  35699. defer googleapi.CloseBody(res)
  35700. if err := googleapi.CheckResponse(res); err != nil {
  35701. return nil, err
  35702. }
  35703. ret := &TestPermissionsResponse{
  35704. ServerResponse: googleapi.ServerResponse{
  35705. Header: res.Header,
  35706. HTTPStatusCode: res.StatusCode,
  35707. },
  35708. }
  35709. target := &ret
  35710. if err := gensupport.DecodeResponse(target, res); err != nil {
  35711. return nil, err
  35712. }
  35713. return ret, nil
  35714. // {
  35715. // "description": "Returns permissions that a caller has on the specified resource.",
  35716. // "httpMethod": "POST",
  35717. // "id": "compute.addresses.testIamPermissions",
  35718. // "parameterOrder": [
  35719. // "project",
  35720. // "region",
  35721. // "resource"
  35722. // ],
  35723. // "parameters": {
  35724. // "project": {
  35725. // "description": "Project ID for this request.",
  35726. // "location": "path",
  35727. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35728. // "required": true,
  35729. // "type": "string"
  35730. // },
  35731. // "region": {
  35732. // "description": "The name of the region for this request.",
  35733. // "location": "path",
  35734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35735. // "required": true,
  35736. // "type": "string"
  35737. // },
  35738. // "resource": {
  35739. // "description": "Name or id of the resource for this request.",
  35740. // "location": "path",
  35741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35742. // "required": true,
  35743. // "type": "string"
  35744. // }
  35745. // },
  35746. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  35747. // "request": {
  35748. // "$ref": "TestPermissionsRequest"
  35749. // },
  35750. // "response": {
  35751. // "$ref": "TestPermissionsResponse"
  35752. // },
  35753. // "scopes": [
  35754. // "https://www.googleapis.com/auth/cloud-platform",
  35755. // "https://www.googleapis.com/auth/compute",
  35756. // "https://www.googleapis.com/auth/compute.readonly"
  35757. // ]
  35758. // }
  35759. }
  35760. // method id "compute.allocations.aggregatedList":
  35761. type AllocationsAggregatedListCall struct {
  35762. s *Service
  35763. project string
  35764. urlParams_ gensupport.URLParams
  35765. ifNoneMatch_ string
  35766. ctx_ context.Context
  35767. header_ http.Header
  35768. }
  35769. // AggregatedList: Retrieves an aggregated list of allocations.
  35770. func (r *AllocationsService) AggregatedList(project string) *AllocationsAggregatedListCall {
  35771. c := &AllocationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35772. c.project = project
  35773. return c
  35774. }
  35775. // Filter sets the optional parameter "filter": A filter expression that
  35776. // filters resources listed in the response. The expression must specify
  35777. // the field name, a comparison operator, and the value that you want to
  35778. // use for filtering. The value must be a string, a number, or a
  35779. // boolean. The comparison operator must be either =, !=, >, or <.
  35780. //
  35781. // For example, if you are filtering Compute Engine instances, you can
  35782. // exclude instances named example-instance by specifying name !=
  35783. // example-instance.
  35784. //
  35785. // You can also filter nested fields. For example, you could specify
  35786. // scheduling.automaticRestart = false to include instances only if they
  35787. // are not scheduled for automatic restarts. You can use filtering on
  35788. // nested fields to filter based on resource labels.
  35789. //
  35790. // To filter on multiple expressions, provide each separate expression
  35791. // within parentheses. For example, (scheduling.automaticRestart = true)
  35792. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35793. // AND expression. However, you can include AND and OR expressions
  35794. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35795. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35796. // true).
  35797. func (c *AllocationsAggregatedListCall) Filter(filter string) *AllocationsAggregatedListCall {
  35798. c.urlParams_.Set("filter", filter)
  35799. return c
  35800. }
  35801. // MaxResults sets the optional parameter "maxResults": The maximum
  35802. // number of results per page that should be returned. If the number of
  35803. // available results is larger than maxResults, Compute Engine returns a
  35804. // nextPageToken that can be used to get the next page of results in
  35805. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35806. // (Default: 500)
  35807. func (c *AllocationsAggregatedListCall) MaxResults(maxResults int64) *AllocationsAggregatedListCall {
  35808. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35809. return c
  35810. }
  35811. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35812. // a certain order. By default, results are returned in alphanumerical
  35813. // order based on the resource name.
  35814. //
  35815. // You can also sort results in descending order based on the creation
  35816. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35817. // based on the creationTimestamp field in reverse chronological order
  35818. // (newest result first). Use this to sort resources like operations so
  35819. // that the newest operation is returned first.
  35820. //
  35821. // Currently, only sorting by name or creationTimestamp desc is
  35822. // supported.
  35823. func (c *AllocationsAggregatedListCall) OrderBy(orderBy string) *AllocationsAggregatedListCall {
  35824. c.urlParams_.Set("orderBy", orderBy)
  35825. return c
  35826. }
  35827. // PageToken sets the optional parameter "pageToken": Specifies a page
  35828. // token to use. Set pageToken to the nextPageToken returned by a
  35829. // previous list request to get the next page of results.
  35830. func (c *AllocationsAggregatedListCall) PageToken(pageToken string) *AllocationsAggregatedListCall {
  35831. c.urlParams_.Set("pageToken", pageToken)
  35832. return c
  35833. }
  35834. // Fields allows partial responses to be retrieved. See
  35835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35836. // for more information.
  35837. func (c *AllocationsAggregatedListCall) Fields(s ...googleapi.Field) *AllocationsAggregatedListCall {
  35838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35839. return c
  35840. }
  35841. // IfNoneMatch sets the optional parameter which makes the operation
  35842. // fail if the object's ETag matches the given value. This is useful for
  35843. // getting updates only after the object has changed since the last
  35844. // request. Use googleapi.IsNotModified to check whether the response
  35845. // error from Do is the result of In-None-Match.
  35846. func (c *AllocationsAggregatedListCall) IfNoneMatch(entityTag string) *AllocationsAggregatedListCall {
  35847. c.ifNoneMatch_ = entityTag
  35848. return c
  35849. }
  35850. // Context sets the context to be used in this call's Do method. Any
  35851. // pending HTTP request will be aborted if the provided context is
  35852. // canceled.
  35853. func (c *AllocationsAggregatedListCall) Context(ctx context.Context) *AllocationsAggregatedListCall {
  35854. c.ctx_ = ctx
  35855. return c
  35856. }
  35857. // Header returns an http.Header that can be modified by the caller to
  35858. // add HTTP headers to the request.
  35859. func (c *AllocationsAggregatedListCall) Header() http.Header {
  35860. if c.header_ == nil {
  35861. c.header_ = make(http.Header)
  35862. }
  35863. return c.header_
  35864. }
  35865. func (c *AllocationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  35866. reqHeaders := make(http.Header)
  35867. for k, v := range c.header_ {
  35868. reqHeaders[k] = v
  35869. }
  35870. reqHeaders.Set("User-Agent", c.s.userAgent())
  35871. if c.ifNoneMatch_ != "" {
  35872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35873. }
  35874. var body io.Reader = nil
  35875. c.urlParams_.Set("alt", alt)
  35876. c.urlParams_.Set("prettyPrint", "false")
  35877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/allocations")
  35878. urls += "?" + c.urlParams_.Encode()
  35879. req, err := http.NewRequest("GET", urls, body)
  35880. if err != nil {
  35881. return nil, err
  35882. }
  35883. req.Header = reqHeaders
  35884. googleapi.Expand(req.URL, map[string]string{
  35885. "project": c.project,
  35886. })
  35887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35888. }
  35889. // Do executes the "compute.allocations.aggregatedList" call.
  35890. // Exactly one of *AllocationAggregatedList or error will be non-nil.
  35891. // Any non-2xx status code is an error. Response headers are in either
  35892. // *AllocationAggregatedList.ServerResponse.Header or (if a response was
  35893. // returned at all) in error.(*googleapi.Error).Header. Use
  35894. // googleapi.IsNotModified to check whether the returned error was
  35895. // because http.StatusNotModified was returned.
  35896. func (c *AllocationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*AllocationAggregatedList, error) {
  35897. gensupport.SetOptions(c.urlParams_, opts...)
  35898. res, err := c.doRequest("json")
  35899. if res != nil && res.StatusCode == http.StatusNotModified {
  35900. if res.Body != nil {
  35901. res.Body.Close()
  35902. }
  35903. return nil, &googleapi.Error{
  35904. Code: res.StatusCode,
  35905. Header: res.Header,
  35906. }
  35907. }
  35908. if err != nil {
  35909. return nil, err
  35910. }
  35911. defer googleapi.CloseBody(res)
  35912. if err := googleapi.CheckResponse(res); err != nil {
  35913. return nil, err
  35914. }
  35915. ret := &AllocationAggregatedList{
  35916. ServerResponse: googleapi.ServerResponse{
  35917. Header: res.Header,
  35918. HTTPStatusCode: res.StatusCode,
  35919. },
  35920. }
  35921. target := &ret
  35922. if err := gensupport.DecodeResponse(target, res); err != nil {
  35923. return nil, err
  35924. }
  35925. return ret, nil
  35926. // {
  35927. // "description": "Retrieves an aggregated list of allocations.",
  35928. // "httpMethod": "GET",
  35929. // "id": "compute.allocations.aggregatedList",
  35930. // "parameterOrder": [
  35931. // "project"
  35932. // ],
  35933. // "parameters": {
  35934. // "filter": {
  35935. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35936. // "location": "query",
  35937. // "type": "string"
  35938. // },
  35939. // "maxResults": {
  35940. // "default": "500",
  35941. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35942. // "format": "uint32",
  35943. // "location": "query",
  35944. // "minimum": "0",
  35945. // "type": "integer"
  35946. // },
  35947. // "orderBy": {
  35948. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35949. // "location": "query",
  35950. // "type": "string"
  35951. // },
  35952. // "pageToken": {
  35953. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35954. // "location": "query",
  35955. // "type": "string"
  35956. // },
  35957. // "project": {
  35958. // "description": "Project ID for this request.",
  35959. // "location": "path",
  35960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35961. // "required": true,
  35962. // "type": "string"
  35963. // }
  35964. // },
  35965. // "path": "{project}/aggregated/allocations",
  35966. // "response": {
  35967. // "$ref": "AllocationAggregatedList"
  35968. // },
  35969. // "scopes": [
  35970. // "https://www.googleapis.com/auth/cloud-platform",
  35971. // "https://www.googleapis.com/auth/compute",
  35972. // "https://www.googleapis.com/auth/compute.readonly"
  35973. // ]
  35974. // }
  35975. }
  35976. // Pages invokes f for each page of results.
  35977. // A non-nil error returned from f will halt the iteration.
  35978. // The provided context supersedes any context provided to the Context method.
  35979. func (c *AllocationsAggregatedListCall) Pages(ctx context.Context, f func(*AllocationAggregatedList) error) error {
  35980. c.ctx_ = ctx
  35981. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35982. for {
  35983. x, err := c.Do()
  35984. if err != nil {
  35985. return err
  35986. }
  35987. if err := f(x); err != nil {
  35988. return err
  35989. }
  35990. if x.NextPageToken == "" {
  35991. return nil
  35992. }
  35993. c.PageToken(x.NextPageToken)
  35994. }
  35995. }
  35996. // method id "compute.allocations.delete":
  35997. type AllocationsDeleteCall struct {
  35998. s *Service
  35999. project string
  36000. zone string
  36001. allocation string
  36002. urlParams_ gensupport.URLParams
  36003. ctx_ context.Context
  36004. header_ http.Header
  36005. }
  36006. // Delete: Deletes the specified allocation.
  36007. func (r *AllocationsService) Delete(project string, zone string, allocation string) *AllocationsDeleteCall {
  36008. c := &AllocationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36009. c.project = project
  36010. c.zone = zone
  36011. c.allocation = allocation
  36012. return c
  36013. }
  36014. // RequestId sets the optional parameter "requestId": An optional
  36015. // request ID to identify requests. Specify a unique request ID so that
  36016. // if you must retry your request, the server will know to ignore the
  36017. // request if it has already been completed.
  36018. //
  36019. // For example, consider a situation where you make an initial request
  36020. // and the request times out. If you make the request again with the
  36021. // same request ID, the server can check if original operation with the
  36022. // same request ID was received, and if so, will ignore the second
  36023. // request. This prevents clients from accidentally creating duplicate
  36024. // commitments.
  36025. //
  36026. // The request ID must be a valid UUID with the exception that zero UUID
  36027. // is not supported (00000000-0000-0000-0000-000000000000).
  36028. func (c *AllocationsDeleteCall) RequestId(requestId string) *AllocationsDeleteCall {
  36029. c.urlParams_.Set("requestId", requestId)
  36030. return c
  36031. }
  36032. // Fields allows partial responses to be retrieved. See
  36033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36034. // for more information.
  36035. func (c *AllocationsDeleteCall) Fields(s ...googleapi.Field) *AllocationsDeleteCall {
  36036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36037. return c
  36038. }
  36039. // Context sets the context to be used in this call's Do method. Any
  36040. // pending HTTP request will be aborted if the provided context is
  36041. // canceled.
  36042. func (c *AllocationsDeleteCall) Context(ctx context.Context) *AllocationsDeleteCall {
  36043. c.ctx_ = ctx
  36044. return c
  36045. }
  36046. // Header returns an http.Header that can be modified by the caller to
  36047. // add HTTP headers to the request.
  36048. func (c *AllocationsDeleteCall) Header() http.Header {
  36049. if c.header_ == nil {
  36050. c.header_ = make(http.Header)
  36051. }
  36052. return c.header_
  36053. }
  36054. func (c *AllocationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  36055. reqHeaders := make(http.Header)
  36056. for k, v := range c.header_ {
  36057. reqHeaders[k] = v
  36058. }
  36059. reqHeaders.Set("User-Agent", c.s.userAgent())
  36060. var body io.Reader = nil
  36061. c.urlParams_.Set("alt", alt)
  36062. c.urlParams_.Set("prettyPrint", "false")
  36063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  36064. urls += "?" + c.urlParams_.Encode()
  36065. req, err := http.NewRequest("DELETE", urls, body)
  36066. if err != nil {
  36067. return nil, err
  36068. }
  36069. req.Header = reqHeaders
  36070. googleapi.Expand(req.URL, map[string]string{
  36071. "project": c.project,
  36072. "zone": c.zone,
  36073. "allocation": c.allocation,
  36074. })
  36075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36076. }
  36077. // Do executes the "compute.allocations.delete" call.
  36078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36079. // status code is an error. Response headers are in either
  36080. // *Operation.ServerResponse.Header or (if a response was returned at
  36081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36082. // to check whether the returned error was because
  36083. // http.StatusNotModified was returned.
  36084. func (c *AllocationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36085. gensupport.SetOptions(c.urlParams_, opts...)
  36086. res, err := c.doRequest("json")
  36087. if res != nil && res.StatusCode == http.StatusNotModified {
  36088. if res.Body != nil {
  36089. res.Body.Close()
  36090. }
  36091. return nil, &googleapi.Error{
  36092. Code: res.StatusCode,
  36093. Header: res.Header,
  36094. }
  36095. }
  36096. if err != nil {
  36097. return nil, err
  36098. }
  36099. defer googleapi.CloseBody(res)
  36100. if err := googleapi.CheckResponse(res); err != nil {
  36101. return nil, err
  36102. }
  36103. ret := &Operation{
  36104. ServerResponse: googleapi.ServerResponse{
  36105. Header: res.Header,
  36106. HTTPStatusCode: res.StatusCode,
  36107. },
  36108. }
  36109. target := &ret
  36110. if err := gensupport.DecodeResponse(target, res); err != nil {
  36111. return nil, err
  36112. }
  36113. return ret, nil
  36114. // {
  36115. // "description": "Deletes the specified allocation.",
  36116. // "httpMethod": "DELETE",
  36117. // "id": "compute.allocations.delete",
  36118. // "parameterOrder": [
  36119. // "project",
  36120. // "zone",
  36121. // "allocation"
  36122. // ],
  36123. // "parameters": {
  36124. // "allocation": {
  36125. // "description": "Name of the allocation to delete.",
  36126. // "location": "path",
  36127. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36128. // "required": true,
  36129. // "type": "string"
  36130. // },
  36131. // "project": {
  36132. // "description": "Project ID for this request.",
  36133. // "location": "path",
  36134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36135. // "required": true,
  36136. // "type": "string"
  36137. // },
  36138. // "requestId": {
  36139. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36140. // "location": "query",
  36141. // "type": "string"
  36142. // },
  36143. // "zone": {
  36144. // "description": "Name of the zone for this request.",
  36145. // "location": "path",
  36146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36147. // "required": true,
  36148. // "type": "string"
  36149. // }
  36150. // },
  36151. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  36152. // "response": {
  36153. // "$ref": "Operation"
  36154. // },
  36155. // "scopes": [
  36156. // "https://www.googleapis.com/auth/cloud-platform",
  36157. // "https://www.googleapis.com/auth/compute"
  36158. // ]
  36159. // }
  36160. }
  36161. // method id "compute.allocations.get":
  36162. type AllocationsGetCall struct {
  36163. s *Service
  36164. project string
  36165. zone string
  36166. allocation string
  36167. urlParams_ gensupport.URLParams
  36168. ifNoneMatch_ string
  36169. ctx_ context.Context
  36170. header_ http.Header
  36171. }
  36172. // Get: Retrieves all information of the specified allocation.
  36173. func (r *AllocationsService) Get(project string, zone string, allocation string) *AllocationsGetCall {
  36174. c := &AllocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36175. c.project = project
  36176. c.zone = zone
  36177. c.allocation = allocation
  36178. return c
  36179. }
  36180. // Fields allows partial responses to be retrieved. See
  36181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36182. // for more information.
  36183. func (c *AllocationsGetCall) Fields(s ...googleapi.Field) *AllocationsGetCall {
  36184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36185. return c
  36186. }
  36187. // IfNoneMatch sets the optional parameter which makes the operation
  36188. // fail if the object's ETag matches the given value. This is useful for
  36189. // getting updates only after the object has changed since the last
  36190. // request. Use googleapi.IsNotModified to check whether the response
  36191. // error from Do is the result of In-None-Match.
  36192. func (c *AllocationsGetCall) IfNoneMatch(entityTag string) *AllocationsGetCall {
  36193. c.ifNoneMatch_ = entityTag
  36194. return c
  36195. }
  36196. // Context sets the context to be used in this call's Do method. Any
  36197. // pending HTTP request will be aborted if the provided context is
  36198. // canceled.
  36199. func (c *AllocationsGetCall) Context(ctx context.Context) *AllocationsGetCall {
  36200. c.ctx_ = ctx
  36201. return c
  36202. }
  36203. // Header returns an http.Header that can be modified by the caller to
  36204. // add HTTP headers to the request.
  36205. func (c *AllocationsGetCall) Header() http.Header {
  36206. if c.header_ == nil {
  36207. c.header_ = make(http.Header)
  36208. }
  36209. return c.header_
  36210. }
  36211. func (c *AllocationsGetCall) doRequest(alt string) (*http.Response, error) {
  36212. reqHeaders := make(http.Header)
  36213. for k, v := range c.header_ {
  36214. reqHeaders[k] = v
  36215. }
  36216. reqHeaders.Set("User-Agent", c.s.userAgent())
  36217. if c.ifNoneMatch_ != "" {
  36218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36219. }
  36220. var body io.Reader = nil
  36221. c.urlParams_.Set("alt", alt)
  36222. c.urlParams_.Set("prettyPrint", "false")
  36223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  36224. urls += "?" + c.urlParams_.Encode()
  36225. req, err := http.NewRequest("GET", urls, body)
  36226. if err != nil {
  36227. return nil, err
  36228. }
  36229. req.Header = reqHeaders
  36230. googleapi.Expand(req.URL, map[string]string{
  36231. "project": c.project,
  36232. "zone": c.zone,
  36233. "allocation": c.allocation,
  36234. })
  36235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36236. }
  36237. // Do executes the "compute.allocations.get" call.
  36238. // Exactly one of *Allocation or error will be non-nil. Any non-2xx
  36239. // status code is an error. Response headers are in either
  36240. // *Allocation.ServerResponse.Header or (if a response was returned at
  36241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36242. // to check whether the returned error was because
  36243. // http.StatusNotModified was returned.
  36244. func (c *AllocationsGetCall) Do(opts ...googleapi.CallOption) (*Allocation, error) {
  36245. gensupport.SetOptions(c.urlParams_, opts...)
  36246. res, err := c.doRequest("json")
  36247. if res != nil && res.StatusCode == http.StatusNotModified {
  36248. if res.Body != nil {
  36249. res.Body.Close()
  36250. }
  36251. return nil, &googleapi.Error{
  36252. Code: res.StatusCode,
  36253. Header: res.Header,
  36254. }
  36255. }
  36256. if err != nil {
  36257. return nil, err
  36258. }
  36259. defer googleapi.CloseBody(res)
  36260. if err := googleapi.CheckResponse(res); err != nil {
  36261. return nil, err
  36262. }
  36263. ret := &Allocation{
  36264. ServerResponse: googleapi.ServerResponse{
  36265. Header: res.Header,
  36266. HTTPStatusCode: res.StatusCode,
  36267. },
  36268. }
  36269. target := &ret
  36270. if err := gensupport.DecodeResponse(target, res); err != nil {
  36271. return nil, err
  36272. }
  36273. return ret, nil
  36274. // {
  36275. // "description": "Retrieves all information of the specified allocation.",
  36276. // "httpMethod": "GET",
  36277. // "id": "compute.allocations.get",
  36278. // "parameterOrder": [
  36279. // "project",
  36280. // "zone",
  36281. // "allocation"
  36282. // ],
  36283. // "parameters": {
  36284. // "allocation": {
  36285. // "description": "Name of the allocation to retrieve.",
  36286. // "location": "path",
  36287. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36288. // "required": true,
  36289. // "type": "string"
  36290. // },
  36291. // "project": {
  36292. // "description": "Project ID for this request.",
  36293. // "location": "path",
  36294. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36295. // "required": true,
  36296. // "type": "string"
  36297. // },
  36298. // "zone": {
  36299. // "description": "Name of the zone for this request.",
  36300. // "location": "path",
  36301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36302. // "required": true,
  36303. // "type": "string"
  36304. // }
  36305. // },
  36306. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  36307. // "response": {
  36308. // "$ref": "Allocation"
  36309. // },
  36310. // "scopes": [
  36311. // "https://www.googleapis.com/auth/cloud-platform",
  36312. // "https://www.googleapis.com/auth/compute",
  36313. // "https://www.googleapis.com/auth/compute.readonly"
  36314. // ]
  36315. // }
  36316. }
  36317. // method id "compute.allocations.getIamPolicy":
  36318. type AllocationsGetIamPolicyCall struct {
  36319. s *Service
  36320. project string
  36321. zone string
  36322. resource string
  36323. urlParams_ gensupport.URLParams
  36324. ifNoneMatch_ string
  36325. ctx_ context.Context
  36326. header_ http.Header
  36327. }
  36328. // GetIamPolicy: Gets the access control policy for a resource. May be
  36329. // empty if no such policy or resource exists.
  36330. func (r *AllocationsService) GetIamPolicy(project string, zone string, resource string) *AllocationsGetIamPolicyCall {
  36331. c := &AllocationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36332. c.project = project
  36333. c.zone = zone
  36334. c.resource = resource
  36335. return c
  36336. }
  36337. // Fields allows partial responses to be retrieved. See
  36338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36339. // for more information.
  36340. func (c *AllocationsGetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsGetIamPolicyCall {
  36341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36342. return c
  36343. }
  36344. // IfNoneMatch sets the optional parameter which makes the operation
  36345. // fail if the object's ETag matches the given value. This is useful for
  36346. // getting updates only after the object has changed since the last
  36347. // request. Use googleapi.IsNotModified to check whether the response
  36348. // error from Do is the result of In-None-Match.
  36349. func (c *AllocationsGetIamPolicyCall) IfNoneMatch(entityTag string) *AllocationsGetIamPolicyCall {
  36350. c.ifNoneMatch_ = entityTag
  36351. return c
  36352. }
  36353. // Context sets the context to be used in this call's Do method. Any
  36354. // pending HTTP request will be aborted if the provided context is
  36355. // canceled.
  36356. func (c *AllocationsGetIamPolicyCall) Context(ctx context.Context) *AllocationsGetIamPolicyCall {
  36357. c.ctx_ = ctx
  36358. return c
  36359. }
  36360. // Header returns an http.Header that can be modified by the caller to
  36361. // add HTTP headers to the request.
  36362. func (c *AllocationsGetIamPolicyCall) Header() http.Header {
  36363. if c.header_ == nil {
  36364. c.header_ = make(http.Header)
  36365. }
  36366. return c.header_
  36367. }
  36368. func (c *AllocationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  36369. reqHeaders := make(http.Header)
  36370. for k, v := range c.header_ {
  36371. reqHeaders[k] = v
  36372. }
  36373. reqHeaders.Set("User-Agent", c.s.userAgent())
  36374. if c.ifNoneMatch_ != "" {
  36375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36376. }
  36377. var body io.Reader = nil
  36378. c.urlParams_.Set("alt", alt)
  36379. c.urlParams_.Set("prettyPrint", "false")
  36380. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/getIamPolicy")
  36381. urls += "?" + c.urlParams_.Encode()
  36382. req, err := http.NewRequest("GET", urls, body)
  36383. if err != nil {
  36384. return nil, err
  36385. }
  36386. req.Header = reqHeaders
  36387. googleapi.Expand(req.URL, map[string]string{
  36388. "project": c.project,
  36389. "zone": c.zone,
  36390. "resource": c.resource,
  36391. })
  36392. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36393. }
  36394. // Do executes the "compute.allocations.getIamPolicy" call.
  36395. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  36396. // code is an error. Response headers are in either
  36397. // *Policy.ServerResponse.Header or (if a response was returned at all)
  36398. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36399. // check whether the returned error was because http.StatusNotModified
  36400. // was returned.
  36401. func (c *AllocationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  36402. gensupport.SetOptions(c.urlParams_, opts...)
  36403. res, err := c.doRequest("json")
  36404. if res != nil && res.StatusCode == http.StatusNotModified {
  36405. if res.Body != nil {
  36406. res.Body.Close()
  36407. }
  36408. return nil, &googleapi.Error{
  36409. Code: res.StatusCode,
  36410. Header: res.Header,
  36411. }
  36412. }
  36413. if err != nil {
  36414. return nil, err
  36415. }
  36416. defer googleapi.CloseBody(res)
  36417. if err := googleapi.CheckResponse(res); err != nil {
  36418. return nil, err
  36419. }
  36420. ret := &Policy{
  36421. ServerResponse: googleapi.ServerResponse{
  36422. Header: res.Header,
  36423. HTTPStatusCode: res.StatusCode,
  36424. },
  36425. }
  36426. target := &ret
  36427. if err := gensupport.DecodeResponse(target, res); err != nil {
  36428. return nil, err
  36429. }
  36430. return ret, nil
  36431. // {
  36432. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  36433. // "httpMethod": "GET",
  36434. // "id": "compute.allocations.getIamPolicy",
  36435. // "parameterOrder": [
  36436. // "project",
  36437. // "zone",
  36438. // "resource"
  36439. // ],
  36440. // "parameters": {
  36441. // "project": {
  36442. // "description": "Project ID for this request.",
  36443. // "location": "path",
  36444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36445. // "required": true,
  36446. // "type": "string"
  36447. // },
  36448. // "resource": {
  36449. // "description": "Name or id of the resource for this request.",
  36450. // "location": "path",
  36451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36452. // "required": true,
  36453. // "type": "string"
  36454. // },
  36455. // "zone": {
  36456. // "description": "The name of the zone for this request.",
  36457. // "location": "path",
  36458. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36459. // "required": true,
  36460. // "type": "string"
  36461. // }
  36462. // },
  36463. // "path": "{project}/zones/{zone}/allocations/{resource}/getIamPolicy",
  36464. // "response": {
  36465. // "$ref": "Policy"
  36466. // },
  36467. // "scopes": [
  36468. // "https://www.googleapis.com/auth/cloud-platform",
  36469. // "https://www.googleapis.com/auth/compute",
  36470. // "https://www.googleapis.com/auth/compute.readonly"
  36471. // ]
  36472. // }
  36473. }
  36474. // method id "compute.allocations.insert":
  36475. type AllocationsInsertCall struct {
  36476. s *Service
  36477. project string
  36478. zone string
  36479. allocation *Allocation
  36480. urlParams_ gensupport.URLParams
  36481. ctx_ context.Context
  36482. header_ http.Header
  36483. }
  36484. // Insert: Creates a new allocation.
  36485. func (r *AllocationsService) Insert(project string, zone string, allocation *Allocation) *AllocationsInsertCall {
  36486. c := &AllocationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36487. c.project = project
  36488. c.zone = zone
  36489. c.allocation = allocation
  36490. return c
  36491. }
  36492. // RequestId sets the optional parameter "requestId": An optional
  36493. // request ID to identify requests. Specify a unique request ID so that
  36494. // if you must retry your request, the server will know to ignore the
  36495. // request if it has already been completed.
  36496. //
  36497. // For example, consider a situation where you make an initial request
  36498. // and the request times out. If you make the request again with the
  36499. // same request ID, the server can check if original operation with the
  36500. // same request ID was received, and if so, will ignore the second
  36501. // request. This prevents clients from accidentally creating duplicate
  36502. // commitments.
  36503. //
  36504. // The request ID must be a valid UUID with the exception that zero UUID
  36505. // is not supported (00000000-0000-0000-0000-000000000000).
  36506. func (c *AllocationsInsertCall) RequestId(requestId string) *AllocationsInsertCall {
  36507. c.urlParams_.Set("requestId", requestId)
  36508. return c
  36509. }
  36510. // Fields allows partial responses to be retrieved. See
  36511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36512. // for more information.
  36513. func (c *AllocationsInsertCall) Fields(s ...googleapi.Field) *AllocationsInsertCall {
  36514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36515. return c
  36516. }
  36517. // Context sets the context to be used in this call's Do method. Any
  36518. // pending HTTP request will be aborted if the provided context is
  36519. // canceled.
  36520. func (c *AllocationsInsertCall) Context(ctx context.Context) *AllocationsInsertCall {
  36521. c.ctx_ = ctx
  36522. return c
  36523. }
  36524. // Header returns an http.Header that can be modified by the caller to
  36525. // add HTTP headers to the request.
  36526. func (c *AllocationsInsertCall) Header() http.Header {
  36527. if c.header_ == nil {
  36528. c.header_ = make(http.Header)
  36529. }
  36530. return c.header_
  36531. }
  36532. func (c *AllocationsInsertCall) doRequest(alt string) (*http.Response, error) {
  36533. reqHeaders := make(http.Header)
  36534. for k, v := range c.header_ {
  36535. reqHeaders[k] = v
  36536. }
  36537. reqHeaders.Set("User-Agent", c.s.userAgent())
  36538. var body io.Reader = nil
  36539. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocation)
  36540. if err != nil {
  36541. return nil, err
  36542. }
  36543. reqHeaders.Set("Content-Type", "application/json")
  36544. c.urlParams_.Set("alt", alt)
  36545. c.urlParams_.Set("prettyPrint", "false")
  36546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  36547. urls += "?" + c.urlParams_.Encode()
  36548. req, err := http.NewRequest("POST", urls, body)
  36549. if err != nil {
  36550. return nil, err
  36551. }
  36552. req.Header = reqHeaders
  36553. googleapi.Expand(req.URL, map[string]string{
  36554. "project": c.project,
  36555. "zone": c.zone,
  36556. })
  36557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36558. }
  36559. // Do executes the "compute.allocations.insert" call.
  36560. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36561. // status code is an error. Response headers are in either
  36562. // *Operation.ServerResponse.Header or (if a response was returned at
  36563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36564. // to check whether the returned error was because
  36565. // http.StatusNotModified was returned.
  36566. func (c *AllocationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36567. gensupport.SetOptions(c.urlParams_, opts...)
  36568. res, err := c.doRequest("json")
  36569. if res != nil && res.StatusCode == http.StatusNotModified {
  36570. if res.Body != nil {
  36571. res.Body.Close()
  36572. }
  36573. return nil, &googleapi.Error{
  36574. Code: res.StatusCode,
  36575. Header: res.Header,
  36576. }
  36577. }
  36578. if err != nil {
  36579. return nil, err
  36580. }
  36581. defer googleapi.CloseBody(res)
  36582. if err := googleapi.CheckResponse(res); err != nil {
  36583. return nil, err
  36584. }
  36585. ret := &Operation{
  36586. ServerResponse: googleapi.ServerResponse{
  36587. Header: res.Header,
  36588. HTTPStatusCode: res.StatusCode,
  36589. },
  36590. }
  36591. target := &ret
  36592. if err := gensupport.DecodeResponse(target, res); err != nil {
  36593. return nil, err
  36594. }
  36595. return ret, nil
  36596. // {
  36597. // "description": "Creates a new allocation.",
  36598. // "httpMethod": "POST",
  36599. // "id": "compute.allocations.insert",
  36600. // "parameterOrder": [
  36601. // "project",
  36602. // "zone"
  36603. // ],
  36604. // "parameters": {
  36605. // "project": {
  36606. // "description": "Project ID for this request.",
  36607. // "location": "path",
  36608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36609. // "required": true,
  36610. // "type": "string"
  36611. // },
  36612. // "requestId": {
  36613. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36614. // "location": "query",
  36615. // "type": "string"
  36616. // },
  36617. // "zone": {
  36618. // "description": "Name of the zone for this request.",
  36619. // "location": "path",
  36620. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36621. // "required": true,
  36622. // "type": "string"
  36623. // }
  36624. // },
  36625. // "path": "{project}/zones/{zone}/allocations",
  36626. // "request": {
  36627. // "$ref": "Allocation"
  36628. // },
  36629. // "response": {
  36630. // "$ref": "Operation"
  36631. // },
  36632. // "scopes": [
  36633. // "https://www.googleapis.com/auth/cloud-platform",
  36634. // "https://www.googleapis.com/auth/compute"
  36635. // ]
  36636. // }
  36637. }
  36638. // method id "compute.allocations.list":
  36639. type AllocationsListCall struct {
  36640. s *Service
  36641. project string
  36642. zone string
  36643. urlParams_ gensupport.URLParams
  36644. ifNoneMatch_ string
  36645. ctx_ context.Context
  36646. header_ http.Header
  36647. }
  36648. // List: A list all the allocations that have been configured for the
  36649. // specified project in specified zone.
  36650. func (r *AllocationsService) List(project string, zone string) *AllocationsListCall {
  36651. c := &AllocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36652. c.project = project
  36653. c.zone = zone
  36654. return c
  36655. }
  36656. // Filter sets the optional parameter "filter": A filter expression that
  36657. // filters resources listed in the response. The expression must specify
  36658. // the field name, a comparison operator, and the value that you want to
  36659. // use for filtering. The value must be a string, a number, or a
  36660. // boolean. The comparison operator must be either =, !=, >, or <.
  36661. //
  36662. // For example, if you are filtering Compute Engine instances, you can
  36663. // exclude instances named example-instance by specifying name !=
  36664. // example-instance.
  36665. //
  36666. // You can also filter nested fields. For example, you could specify
  36667. // scheduling.automaticRestart = false to include instances only if they
  36668. // are not scheduled for automatic restarts. You can use filtering on
  36669. // nested fields to filter based on resource labels.
  36670. //
  36671. // To filter on multiple expressions, provide each separate expression
  36672. // within parentheses. For example, (scheduling.automaticRestart = true)
  36673. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36674. // AND expression. However, you can include AND and OR expressions
  36675. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36676. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36677. // true).
  36678. func (c *AllocationsListCall) Filter(filter string) *AllocationsListCall {
  36679. c.urlParams_.Set("filter", filter)
  36680. return c
  36681. }
  36682. // MaxResults sets the optional parameter "maxResults": The maximum
  36683. // number of results per page that should be returned. If the number of
  36684. // available results is larger than maxResults, Compute Engine returns a
  36685. // nextPageToken that can be used to get the next page of results in
  36686. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36687. // (Default: 500)
  36688. func (c *AllocationsListCall) MaxResults(maxResults int64) *AllocationsListCall {
  36689. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36690. return c
  36691. }
  36692. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36693. // a certain order. By default, results are returned in alphanumerical
  36694. // order based on the resource name.
  36695. //
  36696. // You can also sort results in descending order based on the creation
  36697. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36698. // based on the creationTimestamp field in reverse chronological order
  36699. // (newest result first). Use this to sort resources like operations so
  36700. // that the newest operation is returned first.
  36701. //
  36702. // Currently, only sorting by name or creationTimestamp desc is
  36703. // supported.
  36704. func (c *AllocationsListCall) OrderBy(orderBy string) *AllocationsListCall {
  36705. c.urlParams_.Set("orderBy", orderBy)
  36706. return c
  36707. }
  36708. // PageToken sets the optional parameter "pageToken": Specifies a page
  36709. // token to use. Set pageToken to the nextPageToken returned by a
  36710. // previous list request to get the next page of results.
  36711. func (c *AllocationsListCall) PageToken(pageToken string) *AllocationsListCall {
  36712. c.urlParams_.Set("pageToken", pageToken)
  36713. return c
  36714. }
  36715. // Fields allows partial responses to be retrieved. See
  36716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36717. // for more information.
  36718. func (c *AllocationsListCall) Fields(s ...googleapi.Field) *AllocationsListCall {
  36719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36720. return c
  36721. }
  36722. // IfNoneMatch sets the optional parameter which makes the operation
  36723. // fail if the object's ETag matches the given value. This is useful for
  36724. // getting updates only after the object has changed since the last
  36725. // request. Use googleapi.IsNotModified to check whether the response
  36726. // error from Do is the result of In-None-Match.
  36727. func (c *AllocationsListCall) IfNoneMatch(entityTag string) *AllocationsListCall {
  36728. c.ifNoneMatch_ = entityTag
  36729. return c
  36730. }
  36731. // Context sets the context to be used in this call's Do method. Any
  36732. // pending HTTP request will be aborted if the provided context is
  36733. // canceled.
  36734. func (c *AllocationsListCall) Context(ctx context.Context) *AllocationsListCall {
  36735. c.ctx_ = ctx
  36736. return c
  36737. }
  36738. // Header returns an http.Header that can be modified by the caller to
  36739. // add HTTP headers to the request.
  36740. func (c *AllocationsListCall) Header() http.Header {
  36741. if c.header_ == nil {
  36742. c.header_ = make(http.Header)
  36743. }
  36744. return c.header_
  36745. }
  36746. func (c *AllocationsListCall) doRequest(alt string) (*http.Response, error) {
  36747. reqHeaders := make(http.Header)
  36748. for k, v := range c.header_ {
  36749. reqHeaders[k] = v
  36750. }
  36751. reqHeaders.Set("User-Agent", c.s.userAgent())
  36752. if c.ifNoneMatch_ != "" {
  36753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36754. }
  36755. var body io.Reader = nil
  36756. c.urlParams_.Set("alt", alt)
  36757. c.urlParams_.Set("prettyPrint", "false")
  36758. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  36759. urls += "?" + c.urlParams_.Encode()
  36760. req, err := http.NewRequest("GET", urls, body)
  36761. if err != nil {
  36762. return nil, err
  36763. }
  36764. req.Header = reqHeaders
  36765. googleapi.Expand(req.URL, map[string]string{
  36766. "project": c.project,
  36767. "zone": c.zone,
  36768. })
  36769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36770. }
  36771. // Do executes the "compute.allocations.list" call.
  36772. // Exactly one of *AllocationList or error will be non-nil. Any non-2xx
  36773. // status code is an error. Response headers are in either
  36774. // *AllocationList.ServerResponse.Header or (if a response was returned
  36775. // at all) in error.(*googleapi.Error).Header. Use
  36776. // googleapi.IsNotModified to check whether the returned error was
  36777. // because http.StatusNotModified was returned.
  36778. func (c *AllocationsListCall) Do(opts ...googleapi.CallOption) (*AllocationList, error) {
  36779. gensupport.SetOptions(c.urlParams_, opts...)
  36780. res, err := c.doRequest("json")
  36781. if res != nil && res.StatusCode == http.StatusNotModified {
  36782. if res.Body != nil {
  36783. res.Body.Close()
  36784. }
  36785. return nil, &googleapi.Error{
  36786. Code: res.StatusCode,
  36787. Header: res.Header,
  36788. }
  36789. }
  36790. if err != nil {
  36791. return nil, err
  36792. }
  36793. defer googleapi.CloseBody(res)
  36794. if err := googleapi.CheckResponse(res); err != nil {
  36795. return nil, err
  36796. }
  36797. ret := &AllocationList{
  36798. ServerResponse: googleapi.ServerResponse{
  36799. Header: res.Header,
  36800. HTTPStatusCode: res.StatusCode,
  36801. },
  36802. }
  36803. target := &ret
  36804. if err := gensupport.DecodeResponse(target, res); err != nil {
  36805. return nil, err
  36806. }
  36807. return ret, nil
  36808. // {
  36809. // "description": "A list all the allocations that have been configured for the specified project in specified zone.",
  36810. // "httpMethod": "GET",
  36811. // "id": "compute.allocations.list",
  36812. // "parameterOrder": [
  36813. // "project",
  36814. // "zone"
  36815. // ],
  36816. // "parameters": {
  36817. // "filter": {
  36818. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  36819. // "location": "query",
  36820. // "type": "string"
  36821. // },
  36822. // "maxResults": {
  36823. // "default": "500",
  36824. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  36825. // "format": "uint32",
  36826. // "location": "query",
  36827. // "minimum": "0",
  36828. // "type": "integer"
  36829. // },
  36830. // "orderBy": {
  36831. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  36832. // "location": "query",
  36833. // "type": "string"
  36834. // },
  36835. // "pageToken": {
  36836. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  36837. // "location": "query",
  36838. // "type": "string"
  36839. // },
  36840. // "project": {
  36841. // "description": "Project ID for this request.",
  36842. // "location": "path",
  36843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36844. // "required": true,
  36845. // "type": "string"
  36846. // },
  36847. // "zone": {
  36848. // "description": "Name of the zone for this request.",
  36849. // "location": "path",
  36850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36851. // "required": true,
  36852. // "type": "string"
  36853. // }
  36854. // },
  36855. // "path": "{project}/zones/{zone}/allocations",
  36856. // "response": {
  36857. // "$ref": "AllocationList"
  36858. // },
  36859. // "scopes": [
  36860. // "https://www.googleapis.com/auth/cloud-platform",
  36861. // "https://www.googleapis.com/auth/compute",
  36862. // "https://www.googleapis.com/auth/compute.readonly"
  36863. // ]
  36864. // }
  36865. }
  36866. // Pages invokes f for each page of results.
  36867. // A non-nil error returned from f will halt the iteration.
  36868. // The provided context supersedes any context provided to the Context method.
  36869. func (c *AllocationsListCall) Pages(ctx context.Context, f func(*AllocationList) error) error {
  36870. c.ctx_ = ctx
  36871. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36872. for {
  36873. x, err := c.Do()
  36874. if err != nil {
  36875. return err
  36876. }
  36877. if err := f(x); err != nil {
  36878. return err
  36879. }
  36880. if x.NextPageToken == "" {
  36881. return nil
  36882. }
  36883. c.PageToken(x.NextPageToken)
  36884. }
  36885. }
  36886. // method id "compute.allocations.setIamPolicy":
  36887. type AllocationsSetIamPolicyCall struct {
  36888. s *Service
  36889. project string
  36890. zone string
  36891. resource string
  36892. zonesetpolicyrequest *ZoneSetPolicyRequest
  36893. urlParams_ gensupport.URLParams
  36894. ctx_ context.Context
  36895. header_ http.Header
  36896. }
  36897. // SetIamPolicy: Sets the access control policy on the specified
  36898. // resource. Replaces any existing policy.
  36899. func (r *AllocationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *AllocationsSetIamPolicyCall {
  36900. c := &AllocationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36901. c.project = project
  36902. c.zone = zone
  36903. c.resource = resource
  36904. c.zonesetpolicyrequest = zonesetpolicyrequest
  36905. return c
  36906. }
  36907. // Fields allows partial responses to be retrieved. See
  36908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36909. // for more information.
  36910. func (c *AllocationsSetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsSetIamPolicyCall {
  36911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36912. return c
  36913. }
  36914. // Context sets the context to be used in this call's Do method. Any
  36915. // pending HTTP request will be aborted if the provided context is
  36916. // canceled.
  36917. func (c *AllocationsSetIamPolicyCall) Context(ctx context.Context) *AllocationsSetIamPolicyCall {
  36918. c.ctx_ = ctx
  36919. return c
  36920. }
  36921. // Header returns an http.Header that can be modified by the caller to
  36922. // add HTTP headers to the request.
  36923. func (c *AllocationsSetIamPolicyCall) Header() http.Header {
  36924. if c.header_ == nil {
  36925. c.header_ = make(http.Header)
  36926. }
  36927. return c.header_
  36928. }
  36929. func (c *AllocationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  36930. reqHeaders := make(http.Header)
  36931. for k, v := range c.header_ {
  36932. reqHeaders[k] = v
  36933. }
  36934. reqHeaders.Set("User-Agent", c.s.userAgent())
  36935. var body io.Reader = nil
  36936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  36937. if err != nil {
  36938. return nil, err
  36939. }
  36940. reqHeaders.Set("Content-Type", "application/json")
  36941. c.urlParams_.Set("alt", alt)
  36942. c.urlParams_.Set("prettyPrint", "false")
  36943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/setIamPolicy")
  36944. urls += "?" + c.urlParams_.Encode()
  36945. req, err := http.NewRequest("POST", urls, body)
  36946. if err != nil {
  36947. return nil, err
  36948. }
  36949. req.Header = reqHeaders
  36950. googleapi.Expand(req.URL, map[string]string{
  36951. "project": c.project,
  36952. "zone": c.zone,
  36953. "resource": c.resource,
  36954. })
  36955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36956. }
  36957. // Do executes the "compute.allocations.setIamPolicy" call.
  36958. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  36959. // code is an error. Response headers are in either
  36960. // *Policy.ServerResponse.Header or (if a response was returned at all)
  36961. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36962. // check whether the returned error was because http.StatusNotModified
  36963. // was returned.
  36964. func (c *AllocationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  36965. gensupport.SetOptions(c.urlParams_, opts...)
  36966. res, err := c.doRequest("json")
  36967. if res != nil && res.StatusCode == http.StatusNotModified {
  36968. if res.Body != nil {
  36969. res.Body.Close()
  36970. }
  36971. return nil, &googleapi.Error{
  36972. Code: res.StatusCode,
  36973. Header: res.Header,
  36974. }
  36975. }
  36976. if err != nil {
  36977. return nil, err
  36978. }
  36979. defer googleapi.CloseBody(res)
  36980. if err := googleapi.CheckResponse(res); err != nil {
  36981. return nil, err
  36982. }
  36983. ret := &Policy{
  36984. ServerResponse: googleapi.ServerResponse{
  36985. Header: res.Header,
  36986. HTTPStatusCode: res.StatusCode,
  36987. },
  36988. }
  36989. target := &ret
  36990. if err := gensupport.DecodeResponse(target, res); err != nil {
  36991. return nil, err
  36992. }
  36993. return ret, nil
  36994. // {
  36995. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  36996. // "httpMethod": "POST",
  36997. // "id": "compute.allocations.setIamPolicy",
  36998. // "parameterOrder": [
  36999. // "project",
  37000. // "zone",
  37001. // "resource"
  37002. // ],
  37003. // "parameters": {
  37004. // "project": {
  37005. // "description": "Project ID for this request.",
  37006. // "location": "path",
  37007. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37008. // "required": true,
  37009. // "type": "string"
  37010. // },
  37011. // "resource": {
  37012. // "description": "Name or id of the resource for this request.",
  37013. // "location": "path",
  37014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37015. // "required": true,
  37016. // "type": "string"
  37017. // },
  37018. // "zone": {
  37019. // "description": "The name of the zone for this request.",
  37020. // "location": "path",
  37021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37022. // "required": true,
  37023. // "type": "string"
  37024. // }
  37025. // },
  37026. // "path": "{project}/zones/{zone}/allocations/{resource}/setIamPolicy",
  37027. // "request": {
  37028. // "$ref": "ZoneSetPolicyRequest"
  37029. // },
  37030. // "response": {
  37031. // "$ref": "Policy"
  37032. // },
  37033. // "scopes": [
  37034. // "https://www.googleapis.com/auth/cloud-platform",
  37035. // "https://www.googleapis.com/auth/compute"
  37036. // ]
  37037. // }
  37038. }
  37039. // method id "compute.allocations.testIamPermissions":
  37040. type AllocationsTestIamPermissionsCall struct {
  37041. s *Service
  37042. project string
  37043. zone string
  37044. resource string
  37045. testpermissionsrequest *TestPermissionsRequest
  37046. urlParams_ gensupport.URLParams
  37047. ctx_ context.Context
  37048. header_ http.Header
  37049. }
  37050. // TestIamPermissions: Returns permissions that a caller has on the
  37051. // specified resource.
  37052. func (r *AllocationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AllocationsTestIamPermissionsCall {
  37053. c := &AllocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37054. c.project = project
  37055. c.zone = zone
  37056. c.resource = resource
  37057. c.testpermissionsrequest = testpermissionsrequest
  37058. return c
  37059. }
  37060. // Fields allows partial responses to be retrieved. See
  37061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37062. // for more information.
  37063. func (c *AllocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *AllocationsTestIamPermissionsCall {
  37064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37065. return c
  37066. }
  37067. // Context sets the context to be used in this call's Do method. Any
  37068. // pending HTTP request will be aborted if the provided context is
  37069. // canceled.
  37070. func (c *AllocationsTestIamPermissionsCall) Context(ctx context.Context) *AllocationsTestIamPermissionsCall {
  37071. c.ctx_ = ctx
  37072. return c
  37073. }
  37074. // Header returns an http.Header that can be modified by the caller to
  37075. // add HTTP headers to the request.
  37076. func (c *AllocationsTestIamPermissionsCall) Header() http.Header {
  37077. if c.header_ == nil {
  37078. c.header_ = make(http.Header)
  37079. }
  37080. return c.header_
  37081. }
  37082. func (c *AllocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  37083. reqHeaders := make(http.Header)
  37084. for k, v := range c.header_ {
  37085. reqHeaders[k] = v
  37086. }
  37087. reqHeaders.Set("User-Agent", c.s.userAgent())
  37088. var body io.Reader = nil
  37089. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  37090. if err != nil {
  37091. return nil, err
  37092. }
  37093. reqHeaders.Set("Content-Type", "application/json")
  37094. c.urlParams_.Set("alt", alt)
  37095. c.urlParams_.Set("prettyPrint", "false")
  37096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/testIamPermissions")
  37097. urls += "?" + c.urlParams_.Encode()
  37098. req, err := http.NewRequest("POST", urls, body)
  37099. if err != nil {
  37100. return nil, err
  37101. }
  37102. req.Header = reqHeaders
  37103. googleapi.Expand(req.URL, map[string]string{
  37104. "project": c.project,
  37105. "zone": c.zone,
  37106. "resource": c.resource,
  37107. })
  37108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37109. }
  37110. // Do executes the "compute.allocations.testIamPermissions" call.
  37111. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  37112. // non-2xx status code is an error. Response headers are in either
  37113. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  37114. // returned at all) in error.(*googleapi.Error).Header. Use
  37115. // googleapi.IsNotModified to check whether the returned error was
  37116. // because http.StatusNotModified was returned.
  37117. func (c *AllocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  37118. gensupport.SetOptions(c.urlParams_, opts...)
  37119. res, err := c.doRequest("json")
  37120. if res != nil && res.StatusCode == http.StatusNotModified {
  37121. if res.Body != nil {
  37122. res.Body.Close()
  37123. }
  37124. return nil, &googleapi.Error{
  37125. Code: res.StatusCode,
  37126. Header: res.Header,
  37127. }
  37128. }
  37129. if err != nil {
  37130. return nil, err
  37131. }
  37132. defer googleapi.CloseBody(res)
  37133. if err := googleapi.CheckResponse(res); err != nil {
  37134. return nil, err
  37135. }
  37136. ret := &TestPermissionsResponse{
  37137. ServerResponse: googleapi.ServerResponse{
  37138. Header: res.Header,
  37139. HTTPStatusCode: res.StatusCode,
  37140. },
  37141. }
  37142. target := &ret
  37143. if err := gensupport.DecodeResponse(target, res); err != nil {
  37144. return nil, err
  37145. }
  37146. return ret, nil
  37147. // {
  37148. // "description": "Returns permissions that a caller has on the specified resource.",
  37149. // "httpMethod": "POST",
  37150. // "id": "compute.allocations.testIamPermissions",
  37151. // "parameterOrder": [
  37152. // "project",
  37153. // "zone",
  37154. // "resource"
  37155. // ],
  37156. // "parameters": {
  37157. // "project": {
  37158. // "description": "Project ID for this request.",
  37159. // "location": "path",
  37160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37161. // "required": true,
  37162. // "type": "string"
  37163. // },
  37164. // "resource": {
  37165. // "description": "Name or id of the resource for this request.",
  37166. // "location": "path",
  37167. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37168. // "required": true,
  37169. // "type": "string"
  37170. // },
  37171. // "zone": {
  37172. // "description": "The name of the zone for this request.",
  37173. // "location": "path",
  37174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37175. // "required": true,
  37176. // "type": "string"
  37177. // }
  37178. // },
  37179. // "path": "{project}/zones/{zone}/allocations/{resource}/testIamPermissions",
  37180. // "request": {
  37181. // "$ref": "TestPermissionsRequest"
  37182. // },
  37183. // "response": {
  37184. // "$ref": "TestPermissionsResponse"
  37185. // },
  37186. // "scopes": [
  37187. // "https://www.googleapis.com/auth/cloud-platform",
  37188. // "https://www.googleapis.com/auth/compute",
  37189. // "https://www.googleapis.com/auth/compute.readonly"
  37190. // ]
  37191. // }
  37192. }
  37193. // method id "compute.allocations.updateResourceShape":
  37194. type AllocationsUpdateResourceShapeCall struct {
  37195. s *Service
  37196. project string
  37197. zone string
  37198. allocation string
  37199. allocationsupdateresourceshaperequest *AllocationsUpdateResourceShapeRequest
  37200. urlParams_ gensupport.URLParams
  37201. ctx_ context.Context
  37202. header_ http.Header
  37203. }
  37204. // UpdateResourceShape: Updates the shape of an allocation.
  37205. func (r *AllocationsService) UpdateResourceShape(project string, zone string, allocation string, allocationsupdateresourceshaperequest *AllocationsUpdateResourceShapeRequest) *AllocationsUpdateResourceShapeCall {
  37206. c := &AllocationsUpdateResourceShapeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37207. c.project = project
  37208. c.zone = zone
  37209. c.allocation = allocation
  37210. c.allocationsupdateresourceshaperequest = allocationsupdateresourceshaperequest
  37211. return c
  37212. }
  37213. // RequestId sets the optional parameter "requestId": An optional
  37214. // request ID to identify requests. Specify a unique request ID so that
  37215. // if you must retry your request, the server will know to ignore the
  37216. // request if it has already been completed.
  37217. //
  37218. // For example, consider a situation where you make an initial request
  37219. // and the request times out. If you make the request again with the
  37220. // same request ID, the server can check if original operation with the
  37221. // same request ID was received, and if so, will ignore the second
  37222. // request. This prevents clients from accidentally creating duplicate
  37223. // commitments.
  37224. //
  37225. // The request ID must be a valid UUID with the exception that zero UUID
  37226. // is not supported (00000000-0000-0000-0000-000000000000).
  37227. func (c *AllocationsUpdateResourceShapeCall) RequestId(requestId string) *AllocationsUpdateResourceShapeCall {
  37228. c.urlParams_.Set("requestId", requestId)
  37229. return c
  37230. }
  37231. // Fields allows partial responses to be retrieved. See
  37232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37233. // for more information.
  37234. func (c *AllocationsUpdateResourceShapeCall) Fields(s ...googleapi.Field) *AllocationsUpdateResourceShapeCall {
  37235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37236. return c
  37237. }
  37238. // Context sets the context to be used in this call's Do method. Any
  37239. // pending HTTP request will be aborted if the provided context is
  37240. // canceled.
  37241. func (c *AllocationsUpdateResourceShapeCall) Context(ctx context.Context) *AllocationsUpdateResourceShapeCall {
  37242. c.ctx_ = ctx
  37243. return c
  37244. }
  37245. // Header returns an http.Header that can be modified by the caller to
  37246. // add HTTP headers to the request.
  37247. func (c *AllocationsUpdateResourceShapeCall) Header() http.Header {
  37248. if c.header_ == nil {
  37249. c.header_ = make(http.Header)
  37250. }
  37251. return c.header_
  37252. }
  37253. func (c *AllocationsUpdateResourceShapeCall) doRequest(alt string) (*http.Response, error) {
  37254. reqHeaders := make(http.Header)
  37255. for k, v := range c.header_ {
  37256. reqHeaders[k] = v
  37257. }
  37258. reqHeaders.Set("User-Agent", c.s.userAgent())
  37259. var body io.Reader = nil
  37260. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocationsupdateresourceshaperequest)
  37261. if err != nil {
  37262. return nil, err
  37263. }
  37264. reqHeaders.Set("Content-Type", "application/json")
  37265. c.urlParams_.Set("alt", alt)
  37266. c.urlParams_.Set("prettyPrint", "false")
  37267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}/updateResourceShape")
  37268. urls += "?" + c.urlParams_.Encode()
  37269. req, err := http.NewRequest("POST", urls, body)
  37270. if err != nil {
  37271. return nil, err
  37272. }
  37273. req.Header = reqHeaders
  37274. googleapi.Expand(req.URL, map[string]string{
  37275. "project": c.project,
  37276. "zone": c.zone,
  37277. "allocation": c.allocation,
  37278. })
  37279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37280. }
  37281. // Do executes the "compute.allocations.updateResourceShape" call.
  37282. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37283. // status code is an error. Response headers are in either
  37284. // *Operation.ServerResponse.Header or (if a response was returned at
  37285. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37286. // to check whether the returned error was because
  37287. // http.StatusNotModified was returned.
  37288. func (c *AllocationsUpdateResourceShapeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37289. gensupport.SetOptions(c.urlParams_, opts...)
  37290. res, err := c.doRequest("json")
  37291. if res != nil && res.StatusCode == http.StatusNotModified {
  37292. if res.Body != nil {
  37293. res.Body.Close()
  37294. }
  37295. return nil, &googleapi.Error{
  37296. Code: res.StatusCode,
  37297. Header: res.Header,
  37298. }
  37299. }
  37300. if err != nil {
  37301. return nil, err
  37302. }
  37303. defer googleapi.CloseBody(res)
  37304. if err := googleapi.CheckResponse(res); err != nil {
  37305. return nil, err
  37306. }
  37307. ret := &Operation{
  37308. ServerResponse: googleapi.ServerResponse{
  37309. Header: res.Header,
  37310. HTTPStatusCode: res.StatusCode,
  37311. },
  37312. }
  37313. target := &ret
  37314. if err := gensupport.DecodeResponse(target, res); err != nil {
  37315. return nil, err
  37316. }
  37317. return ret, nil
  37318. // {
  37319. // "description": "Updates the shape of an allocation.",
  37320. // "httpMethod": "POST",
  37321. // "id": "compute.allocations.updateResourceShape",
  37322. // "parameterOrder": [
  37323. // "project",
  37324. // "zone",
  37325. // "allocation"
  37326. // ],
  37327. // "parameters": {
  37328. // "allocation": {
  37329. // "description": "Name of the allocation to update.",
  37330. // "location": "path",
  37331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37332. // "required": true,
  37333. // "type": "string"
  37334. // },
  37335. // "project": {
  37336. // "description": "Project ID for this request.",
  37337. // "location": "path",
  37338. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37339. // "required": true,
  37340. // "type": "string"
  37341. // },
  37342. // "requestId": {
  37343. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37344. // "location": "query",
  37345. // "type": "string"
  37346. // },
  37347. // "zone": {
  37348. // "description": "Name of the zone for this request.",
  37349. // "location": "path",
  37350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37351. // "required": true,
  37352. // "type": "string"
  37353. // }
  37354. // },
  37355. // "path": "{project}/zones/{zone}/allocations/{allocation}/updateResourceShape",
  37356. // "request": {
  37357. // "$ref": "AllocationsUpdateResourceShapeRequest"
  37358. // },
  37359. // "response": {
  37360. // "$ref": "Operation"
  37361. // },
  37362. // "scopes": [
  37363. // "https://www.googleapis.com/auth/cloud-platform",
  37364. // "https://www.googleapis.com/auth/compute"
  37365. // ]
  37366. // }
  37367. }
  37368. // method id "compute.autoscalers.aggregatedList":
  37369. type AutoscalersAggregatedListCall struct {
  37370. s *Service
  37371. project string
  37372. urlParams_ gensupport.URLParams
  37373. ifNoneMatch_ string
  37374. ctx_ context.Context
  37375. header_ http.Header
  37376. }
  37377. // AggregatedList: Retrieves an aggregated list of autoscalers.
  37378. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  37379. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37380. c.project = project
  37381. return c
  37382. }
  37383. // Filter sets the optional parameter "filter": A filter expression that
  37384. // filters resources listed in the response. The expression must specify
  37385. // the field name, a comparison operator, and the value that you want to
  37386. // use for filtering. The value must be a string, a number, or a
  37387. // boolean. The comparison operator must be either =, !=, >, or <.
  37388. //
  37389. // For example, if you are filtering Compute Engine instances, you can
  37390. // exclude instances named example-instance by specifying name !=
  37391. // example-instance.
  37392. //
  37393. // You can also filter nested fields. For example, you could specify
  37394. // scheduling.automaticRestart = false to include instances only if they
  37395. // are not scheduled for automatic restarts. You can use filtering on
  37396. // nested fields to filter based on resource labels.
  37397. //
  37398. // To filter on multiple expressions, provide each separate expression
  37399. // within parentheses. For example, (scheduling.automaticRestart = true)
  37400. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37401. // AND expression. However, you can include AND and OR expressions
  37402. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37403. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37404. // true).
  37405. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  37406. c.urlParams_.Set("filter", filter)
  37407. return c
  37408. }
  37409. // MaxResults sets the optional parameter "maxResults": The maximum
  37410. // number of results per page that should be returned. If the number of
  37411. // available results is larger than maxResults, Compute Engine returns a
  37412. // nextPageToken that can be used to get the next page of results in
  37413. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37414. // (Default: 500)
  37415. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  37416. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37417. return c
  37418. }
  37419. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37420. // a certain order. By default, results are returned in alphanumerical
  37421. // order based on the resource name.
  37422. //
  37423. // You can also sort results in descending order based on the creation
  37424. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37425. // based on the creationTimestamp field in reverse chronological order
  37426. // (newest result first). Use this to sort resources like operations so
  37427. // that the newest operation is returned first.
  37428. //
  37429. // Currently, only sorting by name or creationTimestamp desc is
  37430. // supported.
  37431. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  37432. c.urlParams_.Set("orderBy", orderBy)
  37433. return c
  37434. }
  37435. // PageToken sets the optional parameter "pageToken": Specifies a page
  37436. // token to use. Set pageToken to the nextPageToken returned by a
  37437. // previous list request to get the next page of results.
  37438. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  37439. c.urlParams_.Set("pageToken", pageToken)
  37440. return c
  37441. }
  37442. // Fields allows partial responses to be retrieved. See
  37443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37444. // for more information.
  37445. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  37446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37447. return c
  37448. }
  37449. // IfNoneMatch sets the optional parameter which makes the operation
  37450. // fail if the object's ETag matches the given value. This is useful for
  37451. // getting updates only after the object has changed since the last
  37452. // request. Use googleapi.IsNotModified to check whether the response
  37453. // error from Do is the result of In-None-Match.
  37454. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  37455. c.ifNoneMatch_ = entityTag
  37456. return c
  37457. }
  37458. // Context sets the context to be used in this call's Do method. Any
  37459. // pending HTTP request will be aborted if the provided context is
  37460. // canceled.
  37461. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  37462. c.ctx_ = ctx
  37463. return c
  37464. }
  37465. // Header returns an http.Header that can be modified by the caller to
  37466. // add HTTP headers to the request.
  37467. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  37468. if c.header_ == nil {
  37469. c.header_ = make(http.Header)
  37470. }
  37471. return c.header_
  37472. }
  37473. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37474. reqHeaders := make(http.Header)
  37475. for k, v := range c.header_ {
  37476. reqHeaders[k] = v
  37477. }
  37478. reqHeaders.Set("User-Agent", c.s.userAgent())
  37479. if c.ifNoneMatch_ != "" {
  37480. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37481. }
  37482. var body io.Reader = nil
  37483. c.urlParams_.Set("alt", alt)
  37484. c.urlParams_.Set("prettyPrint", "false")
  37485. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  37486. urls += "?" + c.urlParams_.Encode()
  37487. req, err := http.NewRequest("GET", urls, body)
  37488. if err != nil {
  37489. return nil, err
  37490. }
  37491. req.Header = reqHeaders
  37492. googleapi.Expand(req.URL, map[string]string{
  37493. "project": c.project,
  37494. })
  37495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37496. }
  37497. // Do executes the "compute.autoscalers.aggregatedList" call.
  37498. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  37499. // Any non-2xx status code is an error. Response headers are in either
  37500. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  37501. // returned at all) in error.(*googleapi.Error).Header. Use
  37502. // googleapi.IsNotModified to check whether the returned error was
  37503. // because http.StatusNotModified was returned.
  37504. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  37505. gensupport.SetOptions(c.urlParams_, opts...)
  37506. res, err := c.doRequest("json")
  37507. if res != nil && res.StatusCode == http.StatusNotModified {
  37508. if res.Body != nil {
  37509. res.Body.Close()
  37510. }
  37511. return nil, &googleapi.Error{
  37512. Code: res.StatusCode,
  37513. Header: res.Header,
  37514. }
  37515. }
  37516. if err != nil {
  37517. return nil, err
  37518. }
  37519. defer googleapi.CloseBody(res)
  37520. if err := googleapi.CheckResponse(res); err != nil {
  37521. return nil, err
  37522. }
  37523. ret := &AutoscalerAggregatedList{
  37524. ServerResponse: googleapi.ServerResponse{
  37525. Header: res.Header,
  37526. HTTPStatusCode: res.StatusCode,
  37527. },
  37528. }
  37529. target := &ret
  37530. if err := gensupport.DecodeResponse(target, res); err != nil {
  37531. return nil, err
  37532. }
  37533. return ret, nil
  37534. // {
  37535. // "description": "Retrieves an aggregated list of autoscalers.",
  37536. // "httpMethod": "GET",
  37537. // "id": "compute.autoscalers.aggregatedList",
  37538. // "parameterOrder": [
  37539. // "project"
  37540. // ],
  37541. // "parameters": {
  37542. // "filter": {
  37543. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37544. // "location": "query",
  37545. // "type": "string"
  37546. // },
  37547. // "maxResults": {
  37548. // "default": "500",
  37549. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37550. // "format": "uint32",
  37551. // "location": "query",
  37552. // "minimum": "0",
  37553. // "type": "integer"
  37554. // },
  37555. // "orderBy": {
  37556. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37557. // "location": "query",
  37558. // "type": "string"
  37559. // },
  37560. // "pageToken": {
  37561. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37562. // "location": "query",
  37563. // "type": "string"
  37564. // },
  37565. // "project": {
  37566. // "description": "Project ID for this request.",
  37567. // "location": "path",
  37568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37569. // "required": true,
  37570. // "type": "string"
  37571. // }
  37572. // },
  37573. // "path": "{project}/aggregated/autoscalers",
  37574. // "response": {
  37575. // "$ref": "AutoscalerAggregatedList"
  37576. // },
  37577. // "scopes": [
  37578. // "https://www.googleapis.com/auth/cloud-platform",
  37579. // "https://www.googleapis.com/auth/compute",
  37580. // "https://www.googleapis.com/auth/compute.readonly"
  37581. // ]
  37582. // }
  37583. }
  37584. // Pages invokes f for each page of results.
  37585. // A non-nil error returned from f will halt the iteration.
  37586. // The provided context supersedes any context provided to the Context method.
  37587. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  37588. c.ctx_ = ctx
  37589. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37590. for {
  37591. x, err := c.Do()
  37592. if err != nil {
  37593. return err
  37594. }
  37595. if err := f(x); err != nil {
  37596. return err
  37597. }
  37598. if x.NextPageToken == "" {
  37599. return nil
  37600. }
  37601. c.PageToken(x.NextPageToken)
  37602. }
  37603. }
  37604. // method id "compute.autoscalers.delete":
  37605. type AutoscalersDeleteCall struct {
  37606. s *Service
  37607. project string
  37608. zone string
  37609. autoscaler string
  37610. urlParams_ gensupport.URLParams
  37611. ctx_ context.Context
  37612. header_ http.Header
  37613. }
  37614. // Delete: Deletes the specified autoscaler.
  37615. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  37616. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37617. c.project = project
  37618. c.zone = zone
  37619. c.autoscaler = autoscaler
  37620. return c
  37621. }
  37622. // RequestId sets the optional parameter "requestId": An optional
  37623. // request ID to identify requests. Specify a unique request ID so that
  37624. // if you must retry your request, the server will know to ignore the
  37625. // request if it has already been completed.
  37626. //
  37627. // For example, consider a situation where you make an initial request
  37628. // and the request times out. If you make the request again with the
  37629. // same request ID, the server can check if original operation with the
  37630. // same request ID was received, and if so, will ignore the second
  37631. // request. This prevents clients from accidentally creating duplicate
  37632. // commitments.
  37633. //
  37634. // The request ID must be a valid UUID with the exception that zero UUID
  37635. // is not supported (00000000-0000-0000-0000-000000000000).
  37636. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  37637. c.urlParams_.Set("requestId", requestId)
  37638. return c
  37639. }
  37640. // Fields allows partial responses to be retrieved. See
  37641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37642. // for more information.
  37643. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  37644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37645. return c
  37646. }
  37647. // Context sets the context to be used in this call's Do method. Any
  37648. // pending HTTP request will be aborted if the provided context is
  37649. // canceled.
  37650. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  37651. c.ctx_ = ctx
  37652. return c
  37653. }
  37654. // Header returns an http.Header that can be modified by the caller to
  37655. // add HTTP headers to the request.
  37656. func (c *AutoscalersDeleteCall) Header() http.Header {
  37657. if c.header_ == nil {
  37658. c.header_ = make(http.Header)
  37659. }
  37660. return c.header_
  37661. }
  37662. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  37663. reqHeaders := make(http.Header)
  37664. for k, v := range c.header_ {
  37665. reqHeaders[k] = v
  37666. }
  37667. reqHeaders.Set("User-Agent", c.s.userAgent())
  37668. var body io.Reader = nil
  37669. c.urlParams_.Set("alt", alt)
  37670. c.urlParams_.Set("prettyPrint", "false")
  37671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  37672. urls += "?" + c.urlParams_.Encode()
  37673. req, err := http.NewRequest("DELETE", urls, body)
  37674. if err != nil {
  37675. return nil, err
  37676. }
  37677. req.Header = reqHeaders
  37678. googleapi.Expand(req.URL, map[string]string{
  37679. "project": c.project,
  37680. "zone": c.zone,
  37681. "autoscaler": c.autoscaler,
  37682. })
  37683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37684. }
  37685. // Do executes the "compute.autoscalers.delete" call.
  37686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37687. // status code is an error. Response headers are in either
  37688. // *Operation.ServerResponse.Header or (if a response was returned at
  37689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37690. // to check whether the returned error was because
  37691. // http.StatusNotModified was returned.
  37692. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37693. gensupport.SetOptions(c.urlParams_, opts...)
  37694. res, err := c.doRequest("json")
  37695. if res != nil && res.StatusCode == http.StatusNotModified {
  37696. if res.Body != nil {
  37697. res.Body.Close()
  37698. }
  37699. return nil, &googleapi.Error{
  37700. Code: res.StatusCode,
  37701. Header: res.Header,
  37702. }
  37703. }
  37704. if err != nil {
  37705. return nil, err
  37706. }
  37707. defer googleapi.CloseBody(res)
  37708. if err := googleapi.CheckResponse(res); err != nil {
  37709. return nil, err
  37710. }
  37711. ret := &Operation{
  37712. ServerResponse: googleapi.ServerResponse{
  37713. Header: res.Header,
  37714. HTTPStatusCode: res.StatusCode,
  37715. },
  37716. }
  37717. target := &ret
  37718. if err := gensupport.DecodeResponse(target, res); err != nil {
  37719. return nil, err
  37720. }
  37721. return ret, nil
  37722. // {
  37723. // "description": "Deletes the specified autoscaler.",
  37724. // "httpMethod": "DELETE",
  37725. // "id": "compute.autoscalers.delete",
  37726. // "parameterOrder": [
  37727. // "project",
  37728. // "zone",
  37729. // "autoscaler"
  37730. // ],
  37731. // "parameters": {
  37732. // "autoscaler": {
  37733. // "description": "Name of the autoscaler to delete.",
  37734. // "location": "path",
  37735. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37736. // "required": true,
  37737. // "type": "string"
  37738. // },
  37739. // "project": {
  37740. // "description": "Project ID for this request.",
  37741. // "location": "path",
  37742. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37743. // "required": true,
  37744. // "type": "string"
  37745. // },
  37746. // "requestId": {
  37747. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37748. // "location": "query",
  37749. // "type": "string"
  37750. // },
  37751. // "zone": {
  37752. // "description": "Name of the zone for this request.",
  37753. // "location": "path",
  37754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37755. // "required": true,
  37756. // "type": "string"
  37757. // }
  37758. // },
  37759. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  37760. // "response": {
  37761. // "$ref": "Operation"
  37762. // },
  37763. // "scopes": [
  37764. // "https://www.googleapis.com/auth/cloud-platform",
  37765. // "https://www.googleapis.com/auth/compute"
  37766. // ]
  37767. // }
  37768. }
  37769. // method id "compute.autoscalers.get":
  37770. type AutoscalersGetCall struct {
  37771. s *Service
  37772. project string
  37773. zone string
  37774. autoscaler string
  37775. urlParams_ gensupport.URLParams
  37776. ifNoneMatch_ string
  37777. ctx_ context.Context
  37778. header_ http.Header
  37779. }
  37780. // Get: Returns the specified autoscaler resource. Gets a list of
  37781. // available autoscalers by making a list() request.
  37782. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  37783. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37784. c.project = project
  37785. c.zone = zone
  37786. c.autoscaler = autoscaler
  37787. return c
  37788. }
  37789. // Fields allows partial responses to be retrieved. See
  37790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37791. // for more information.
  37792. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  37793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37794. return c
  37795. }
  37796. // IfNoneMatch sets the optional parameter which makes the operation
  37797. // fail if the object's ETag matches the given value. This is useful for
  37798. // getting updates only after the object has changed since the last
  37799. // request. Use googleapi.IsNotModified to check whether the response
  37800. // error from Do is the result of In-None-Match.
  37801. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  37802. c.ifNoneMatch_ = entityTag
  37803. return c
  37804. }
  37805. // Context sets the context to be used in this call's Do method. Any
  37806. // pending HTTP request will be aborted if the provided context is
  37807. // canceled.
  37808. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  37809. c.ctx_ = ctx
  37810. return c
  37811. }
  37812. // Header returns an http.Header that can be modified by the caller to
  37813. // add HTTP headers to the request.
  37814. func (c *AutoscalersGetCall) Header() http.Header {
  37815. if c.header_ == nil {
  37816. c.header_ = make(http.Header)
  37817. }
  37818. return c.header_
  37819. }
  37820. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  37821. reqHeaders := make(http.Header)
  37822. for k, v := range c.header_ {
  37823. reqHeaders[k] = v
  37824. }
  37825. reqHeaders.Set("User-Agent", c.s.userAgent())
  37826. if c.ifNoneMatch_ != "" {
  37827. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37828. }
  37829. var body io.Reader = nil
  37830. c.urlParams_.Set("alt", alt)
  37831. c.urlParams_.Set("prettyPrint", "false")
  37832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  37833. urls += "?" + c.urlParams_.Encode()
  37834. req, err := http.NewRequest("GET", urls, body)
  37835. if err != nil {
  37836. return nil, err
  37837. }
  37838. req.Header = reqHeaders
  37839. googleapi.Expand(req.URL, map[string]string{
  37840. "project": c.project,
  37841. "zone": c.zone,
  37842. "autoscaler": c.autoscaler,
  37843. })
  37844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37845. }
  37846. // Do executes the "compute.autoscalers.get" call.
  37847. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  37848. // status code is an error. Response headers are in either
  37849. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  37850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37851. // to check whether the returned error was because
  37852. // http.StatusNotModified was returned.
  37853. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  37854. gensupport.SetOptions(c.urlParams_, opts...)
  37855. res, err := c.doRequest("json")
  37856. if res != nil && res.StatusCode == http.StatusNotModified {
  37857. if res.Body != nil {
  37858. res.Body.Close()
  37859. }
  37860. return nil, &googleapi.Error{
  37861. Code: res.StatusCode,
  37862. Header: res.Header,
  37863. }
  37864. }
  37865. if err != nil {
  37866. return nil, err
  37867. }
  37868. defer googleapi.CloseBody(res)
  37869. if err := googleapi.CheckResponse(res); err != nil {
  37870. return nil, err
  37871. }
  37872. ret := &Autoscaler{
  37873. ServerResponse: googleapi.ServerResponse{
  37874. Header: res.Header,
  37875. HTTPStatusCode: res.StatusCode,
  37876. },
  37877. }
  37878. target := &ret
  37879. if err := gensupport.DecodeResponse(target, res); err != nil {
  37880. return nil, err
  37881. }
  37882. return ret, nil
  37883. // {
  37884. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  37885. // "httpMethod": "GET",
  37886. // "id": "compute.autoscalers.get",
  37887. // "parameterOrder": [
  37888. // "project",
  37889. // "zone",
  37890. // "autoscaler"
  37891. // ],
  37892. // "parameters": {
  37893. // "autoscaler": {
  37894. // "description": "Name of the autoscaler to return.",
  37895. // "location": "path",
  37896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37897. // "required": true,
  37898. // "type": "string"
  37899. // },
  37900. // "project": {
  37901. // "description": "Project ID for this request.",
  37902. // "location": "path",
  37903. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37904. // "required": true,
  37905. // "type": "string"
  37906. // },
  37907. // "zone": {
  37908. // "description": "Name of the zone for this request.",
  37909. // "location": "path",
  37910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37911. // "required": true,
  37912. // "type": "string"
  37913. // }
  37914. // },
  37915. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  37916. // "response": {
  37917. // "$ref": "Autoscaler"
  37918. // },
  37919. // "scopes": [
  37920. // "https://www.googleapis.com/auth/cloud-platform",
  37921. // "https://www.googleapis.com/auth/compute",
  37922. // "https://www.googleapis.com/auth/compute.readonly"
  37923. // ]
  37924. // }
  37925. }
  37926. // method id "compute.autoscalers.insert":
  37927. type AutoscalersInsertCall struct {
  37928. s *Service
  37929. project string
  37930. zone string
  37931. autoscaler *Autoscaler
  37932. urlParams_ gensupport.URLParams
  37933. ctx_ context.Context
  37934. header_ http.Header
  37935. }
  37936. // Insert: Creates an autoscaler in the specified project using the data
  37937. // included in the request.
  37938. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  37939. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37940. c.project = project
  37941. c.zone = zone
  37942. c.autoscaler = autoscaler
  37943. return c
  37944. }
  37945. // RequestId sets the optional parameter "requestId": An optional
  37946. // request ID to identify requests. Specify a unique request ID so that
  37947. // if you must retry your request, the server will know to ignore the
  37948. // request if it has already been completed.
  37949. //
  37950. // For example, consider a situation where you make an initial request
  37951. // and the request times out. If you make the request again with the
  37952. // same request ID, the server can check if original operation with the
  37953. // same request ID was received, and if so, will ignore the second
  37954. // request. This prevents clients from accidentally creating duplicate
  37955. // commitments.
  37956. //
  37957. // The request ID must be a valid UUID with the exception that zero UUID
  37958. // is not supported (00000000-0000-0000-0000-000000000000).
  37959. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  37960. c.urlParams_.Set("requestId", requestId)
  37961. return c
  37962. }
  37963. // Fields allows partial responses to be retrieved. See
  37964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37965. // for more information.
  37966. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  37967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37968. return c
  37969. }
  37970. // Context sets the context to be used in this call's Do method. Any
  37971. // pending HTTP request will be aborted if the provided context is
  37972. // canceled.
  37973. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  37974. c.ctx_ = ctx
  37975. return c
  37976. }
  37977. // Header returns an http.Header that can be modified by the caller to
  37978. // add HTTP headers to the request.
  37979. func (c *AutoscalersInsertCall) Header() http.Header {
  37980. if c.header_ == nil {
  37981. c.header_ = make(http.Header)
  37982. }
  37983. return c.header_
  37984. }
  37985. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  37986. reqHeaders := make(http.Header)
  37987. for k, v := range c.header_ {
  37988. reqHeaders[k] = v
  37989. }
  37990. reqHeaders.Set("User-Agent", c.s.userAgent())
  37991. var body io.Reader = nil
  37992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  37993. if err != nil {
  37994. return nil, err
  37995. }
  37996. reqHeaders.Set("Content-Type", "application/json")
  37997. c.urlParams_.Set("alt", alt)
  37998. c.urlParams_.Set("prettyPrint", "false")
  37999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  38000. urls += "?" + c.urlParams_.Encode()
  38001. req, err := http.NewRequest("POST", urls, body)
  38002. if err != nil {
  38003. return nil, err
  38004. }
  38005. req.Header = reqHeaders
  38006. googleapi.Expand(req.URL, map[string]string{
  38007. "project": c.project,
  38008. "zone": c.zone,
  38009. })
  38010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38011. }
  38012. // Do executes the "compute.autoscalers.insert" call.
  38013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38014. // status code is an error. Response headers are in either
  38015. // *Operation.ServerResponse.Header or (if a response was returned at
  38016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38017. // to check whether the returned error was because
  38018. // http.StatusNotModified was returned.
  38019. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38020. gensupport.SetOptions(c.urlParams_, opts...)
  38021. res, err := c.doRequest("json")
  38022. if res != nil && res.StatusCode == http.StatusNotModified {
  38023. if res.Body != nil {
  38024. res.Body.Close()
  38025. }
  38026. return nil, &googleapi.Error{
  38027. Code: res.StatusCode,
  38028. Header: res.Header,
  38029. }
  38030. }
  38031. if err != nil {
  38032. return nil, err
  38033. }
  38034. defer googleapi.CloseBody(res)
  38035. if err := googleapi.CheckResponse(res); err != nil {
  38036. return nil, err
  38037. }
  38038. ret := &Operation{
  38039. ServerResponse: googleapi.ServerResponse{
  38040. Header: res.Header,
  38041. HTTPStatusCode: res.StatusCode,
  38042. },
  38043. }
  38044. target := &ret
  38045. if err := gensupport.DecodeResponse(target, res); err != nil {
  38046. return nil, err
  38047. }
  38048. return ret, nil
  38049. // {
  38050. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  38051. // "httpMethod": "POST",
  38052. // "id": "compute.autoscalers.insert",
  38053. // "parameterOrder": [
  38054. // "project",
  38055. // "zone"
  38056. // ],
  38057. // "parameters": {
  38058. // "project": {
  38059. // "description": "Project ID for this request.",
  38060. // "location": "path",
  38061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38062. // "required": true,
  38063. // "type": "string"
  38064. // },
  38065. // "requestId": {
  38066. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38067. // "location": "query",
  38068. // "type": "string"
  38069. // },
  38070. // "zone": {
  38071. // "description": "Name of the zone for this request.",
  38072. // "location": "path",
  38073. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38074. // "required": true,
  38075. // "type": "string"
  38076. // }
  38077. // },
  38078. // "path": "{project}/zones/{zone}/autoscalers",
  38079. // "request": {
  38080. // "$ref": "Autoscaler"
  38081. // },
  38082. // "response": {
  38083. // "$ref": "Operation"
  38084. // },
  38085. // "scopes": [
  38086. // "https://www.googleapis.com/auth/cloud-platform",
  38087. // "https://www.googleapis.com/auth/compute"
  38088. // ]
  38089. // }
  38090. }
  38091. // method id "compute.autoscalers.list":
  38092. type AutoscalersListCall struct {
  38093. s *Service
  38094. project string
  38095. zone string
  38096. urlParams_ gensupport.URLParams
  38097. ifNoneMatch_ string
  38098. ctx_ context.Context
  38099. header_ http.Header
  38100. }
  38101. // List: Retrieves a list of autoscalers contained within the specified
  38102. // zone.
  38103. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  38104. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38105. c.project = project
  38106. c.zone = zone
  38107. return c
  38108. }
  38109. // Filter sets the optional parameter "filter": A filter expression that
  38110. // filters resources listed in the response. The expression must specify
  38111. // the field name, a comparison operator, and the value that you want to
  38112. // use for filtering. The value must be a string, a number, or a
  38113. // boolean. The comparison operator must be either =, !=, >, or <.
  38114. //
  38115. // For example, if you are filtering Compute Engine instances, you can
  38116. // exclude instances named example-instance by specifying name !=
  38117. // example-instance.
  38118. //
  38119. // You can also filter nested fields. For example, you could specify
  38120. // scheduling.automaticRestart = false to include instances only if they
  38121. // are not scheduled for automatic restarts. You can use filtering on
  38122. // nested fields to filter based on resource labels.
  38123. //
  38124. // To filter on multiple expressions, provide each separate expression
  38125. // within parentheses. For example, (scheduling.automaticRestart = true)
  38126. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38127. // AND expression. However, you can include AND and OR expressions
  38128. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38129. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38130. // true).
  38131. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  38132. c.urlParams_.Set("filter", filter)
  38133. return c
  38134. }
  38135. // MaxResults sets the optional parameter "maxResults": The maximum
  38136. // number of results per page that should be returned. If the number of
  38137. // available results is larger than maxResults, Compute Engine returns a
  38138. // nextPageToken that can be used to get the next page of results in
  38139. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38140. // (Default: 500)
  38141. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  38142. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38143. return c
  38144. }
  38145. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38146. // a certain order. By default, results are returned in alphanumerical
  38147. // order based on the resource name.
  38148. //
  38149. // You can also sort results in descending order based on the creation
  38150. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38151. // based on the creationTimestamp field in reverse chronological order
  38152. // (newest result first). Use this to sort resources like operations so
  38153. // that the newest operation is returned first.
  38154. //
  38155. // Currently, only sorting by name or creationTimestamp desc is
  38156. // supported.
  38157. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  38158. c.urlParams_.Set("orderBy", orderBy)
  38159. return c
  38160. }
  38161. // PageToken sets the optional parameter "pageToken": Specifies a page
  38162. // token to use. Set pageToken to the nextPageToken returned by a
  38163. // previous list request to get the next page of results.
  38164. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  38165. c.urlParams_.Set("pageToken", pageToken)
  38166. return c
  38167. }
  38168. // Fields allows partial responses to be retrieved. See
  38169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38170. // for more information.
  38171. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  38172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38173. return c
  38174. }
  38175. // IfNoneMatch sets the optional parameter which makes the operation
  38176. // fail if the object's ETag matches the given value. This is useful for
  38177. // getting updates only after the object has changed since the last
  38178. // request. Use googleapi.IsNotModified to check whether the response
  38179. // error from Do is the result of In-None-Match.
  38180. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  38181. c.ifNoneMatch_ = entityTag
  38182. return c
  38183. }
  38184. // Context sets the context to be used in this call's Do method. Any
  38185. // pending HTTP request will be aborted if the provided context is
  38186. // canceled.
  38187. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  38188. c.ctx_ = ctx
  38189. return c
  38190. }
  38191. // Header returns an http.Header that can be modified by the caller to
  38192. // add HTTP headers to the request.
  38193. func (c *AutoscalersListCall) Header() http.Header {
  38194. if c.header_ == nil {
  38195. c.header_ = make(http.Header)
  38196. }
  38197. return c.header_
  38198. }
  38199. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  38200. reqHeaders := make(http.Header)
  38201. for k, v := range c.header_ {
  38202. reqHeaders[k] = v
  38203. }
  38204. reqHeaders.Set("User-Agent", c.s.userAgent())
  38205. if c.ifNoneMatch_ != "" {
  38206. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38207. }
  38208. var body io.Reader = nil
  38209. c.urlParams_.Set("alt", alt)
  38210. c.urlParams_.Set("prettyPrint", "false")
  38211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  38212. urls += "?" + c.urlParams_.Encode()
  38213. req, err := http.NewRequest("GET", urls, body)
  38214. if err != nil {
  38215. return nil, err
  38216. }
  38217. req.Header = reqHeaders
  38218. googleapi.Expand(req.URL, map[string]string{
  38219. "project": c.project,
  38220. "zone": c.zone,
  38221. })
  38222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38223. }
  38224. // Do executes the "compute.autoscalers.list" call.
  38225. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  38226. // status code is an error. Response headers are in either
  38227. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  38228. // at all) in error.(*googleapi.Error).Header. Use
  38229. // googleapi.IsNotModified to check whether the returned error was
  38230. // because http.StatusNotModified was returned.
  38231. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  38232. gensupport.SetOptions(c.urlParams_, opts...)
  38233. res, err := c.doRequest("json")
  38234. if res != nil && res.StatusCode == http.StatusNotModified {
  38235. if res.Body != nil {
  38236. res.Body.Close()
  38237. }
  38238. return nil, &googleapi.Error{
  38239. Code: res.StatusCode,
  38240. Header: res.Header,
  38241. }
  38242. }
  38243. if err != nil {
  38244. return nil, err
  38245. }
  38246. defer googleapi.CloseBody(res)
  38247. if err := googleapi.CheckResponse(res); err != nil {
  38248. return nil, err
  38249. }
  38250. ret := &AutoscalerList{
  38251. ServerResponse: googleapi.ServerResponse{
  38252. Header: res.Header,
  38253. HTTPStatusCode: res.StatusCode,
  38254. },
  38255. }
  38256. target := &ret
  38257. if err := gensupport.DecodeResponse(target, res); err != nil {
  38258. return nil, err
  38259. }
  38260. return ret, nil
  38261. // {
  38262. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  38263. // "httpMethod": "GET",
  38264. // "id": "compute.autoscalers.list",
  38265. // "parameterOrder": [
  38266. // "project",
  38267. // "zone"
  38268. // ],
  38269. // "parameters": {
  38270. // "filter": {
  38271. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38272. // "location": "query",
  38273. // "type": "string"
  38274. // },
  38275. // "maxResults": {
  38276. // "default": "500",
  38277. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38278. // "format": "uint32",
  38279. // "location": "query",
  38280. // "minimum": "0",
  38281. // "type": "integer"
  38282. // },
  38283. // "orderBy": {
  38284. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38285. // "location": "query",
  38286. // "type": "string"
  38287. // },
  38288. // "pageToken": {
  38289. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38290. // "location": "query",
  38291. // "type": "string"
  38292. // },
  38293. // "project": {
  38294. // "description": "Project ID for this request.",
  38295. // "location": "path",
  38296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38297. // "required": true,
  38298. // "type": "string"
  38299. // },
  38300. // "zone": {
  38301. // "description": "Name of the zone for this request.",
  38302. // "location": "path",
  38303. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38304. // "required": true,
  38305. // "type": "string"
  38306. // }
  38307. // },
  38308. // "path": "{project}/zones/{zone}/autoscalers",
  38309. // "response": {
  38310. // "$ref": "AutoscalerList"
  38311. // },
  38312. // "scopes": [
  38313. // "https://www.googleapis.com/auth/cloud-platform",
  38314. // "https://www.googleapis.com/auth/compute",
  38315. // "https://www.googleapis.com/auth/compute.readonly"
  38316. // ]
  38317. // }
  38318. }
  38319. // Pages invokes f for each page of results.
  38320. // A non-nil error returned from f will halt the iteration.
  38321. // The provided context supersedes any context provided to the Context method.
  38322. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  38323. c.ctx_ = ctx
  38324. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38325. for {
  38326. x, err := c.Do()
  38327. if err != nil {
  38328. return err
  38329. }
  38330. if err := f(x); err != nil {
  38331. return err
  38332. }
  38333. if x.NextPageToken == "" {
  38334. return nil
  38335. }
  38336. c.PageToken(x.NextPageToken)
  38337. }
  38338. }
  38339. // method id "compute.autoscalers.patch":
  38340. type AutoscalersPatchCall struct {
  38341. s *Service
  38342. project string
  38343. zone string
  38344. autoscaler *Autoscaler
  38345. urlParams_ gensupport.URLParams
  38346. ctx_ context.Context
  38347. header_ http.Header
  38348. }
  38349. // Patch: Updates an autoscaler in the specified project using the data
  38350. // included in the request. This method supports PATCH semantics and
  38351. // uses the JSON merge patch format and processing rules.
  38352. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  38353. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38354. c.project = project
  38355. c.zone = zone
  38356. c.autoscaler = autoscaler
  38357. return c
  38358. }
  38359. // Autoscaler sets the optional parameter "autoscaler": Name of the
  38360. // autoscaler to patch.
  38361. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  38362. c.urlParams_.Set("autoscaler", autoscaler)
  38363. return c
  38364. }
  38365. // RequestId sets the optional parameter "requestId": An optional
  38366. // request ID to identify requests. Specify a unique request ID so that
  38367. // if you must retry your request, the server will know to ignore the
  38368. // request if it has already been completed.
  38369. //
  38370. // For example, consider a situation where you make an initial request
  38371. // and the request times out. If you make the request again with the
  38372. // same request ID, the server can check if original operation with the
  38373. // same request ID was received, and if so, will ignore the second
  38374. // request. This prevents clients from accidentally creating duplicate
  38375. // commitments.
  38376. //
  38377. // The request ID must be a valid UUID with the exception that zero UUID
  38378. // is not supported (00000000-0000-0000-0000-000000000000).
  38379. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  38380. c.urlParams_.Set("requestId", requestId)
  38381. return c
  38382. }
  38383. // Fields allows partial responses to be retrieved. See
  38384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38385. // for more information.
  38386. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  38387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38388. return c
  38389. }
  38390. // Context sets the context to be used in this call's Do method. Any
  38391. // pending HTTP request will be aborted if the provided context is
  38392. // canceled.
  38393. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  38394. c.ctx_ = ctx
  38395. return c
  38396. }
  38397. // Header returns an http.Header that can be modified by the caller to
  38398. // add HTTP headers to the request.
  38399. func (c *AutoscalersPatchCall) Header() http.Header {
  38400. if c.header_ == nil {
  38401. c.header_ = make(http.Header)
  38402. }
  38403. return c.header_
  38404. }
  38405. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  38406. reqHeaders := make(http.Header)
  38407. for k, v := range c.header_ {
  38408. reqHeaders[k] = v
  38409. }
  38410. reqHeaders.Set("User-Agent", c.s.userAgent())
  38411. var body io.Reader = nil
  38412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  38413. if err != nil {
  38414. return nil, err
  38415. }
  38416. reqHeaders.Set("Content-Type", "application/json")
  38417. c.urlParams_.Set("alt", alt)
  38418. c.urlParams_.Set("prettyPrint", "false")
  38419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  38420. urls += "?" + c.urlParams_.Encode()
  38421. req, err := http.NewRequest("PATCH", urls, body)
  38422. if err != nil {
  38423. return nil, err
  38424. }
  38425. req.Header = reqHeaders
  38426. googleapi.Expand(req.URL, map[string]string{
  38427. "project": c.project,
  38428. "zone": c.zone,
  38429. })
  38430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38431. }
  38432. // Do executes the "compute.autoscalers.patch" call.
  38433. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38434. // status code is an error. Response headers are in either
  38435. // *Operation.ServerResponse.Header or (if a response was returned at
  38436. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38437. // to check whether the returned error was because
  38438. // http.StatusNotModified was returned.
  38439. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38440. gensupport.SetOptions(c.urlParams_, opts...)
  38441. res, err := c.doRequest("json")
  38442. if res != nil && res.StatusCode == http.StatusNotModified {
  38443. if res.Body != nil {
  38444. res.Body.Close()
  38445. }
  38446. return nil, &googleapi.Error{
  38447. Code: res.StatusCode,
  38448. Header: res.Header,
  38449. }
  38450. }
  38451. if err != nil {
  38452. return nil, err
  38453. }
  38454. defer googleapi.CloseBody(res)
  38455. if err := googleapi.CheckResponse(res); err != nil {
  38456. return nil, err
  38457. }
  38458. ret := &Operation{
  38459. ServerResponse: googleapi.ServerResponse{
  38460. Header: res.Header,
  38461. HTTPStatusCode: res.StatusCode,
  38462. },
  38463. }
  38464. target := &ret
  38465. if err := gensupport.DecodeResponse(target, res); err != nil {
  38466. return nil, err
  38467. }
  38468. return ret, nil
  38469. // {
  38470. // "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.",
  38471. // "httpMethod": "PATCH",
  38472. // "id": "compute.autoscalers.patch",
  38473. // "parameterOrder": [
  38474. // "project",
  38475. // "zone"
  38476. // ],
  38477. // "parameters": {
  38478. // "autoscaler": {
  38479. // "description": "Name of the autoscaler to patch.",
  38480. // "location": "query",
  38481. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38482. // "type": "string"
  38483. // },
  38484. // "project": {
  38485. // "description": "Project ID for this request.",
  38486. // "location": "path",
  38487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38488. // "required": true,
  38489. // "type": "string"
  38490. // },
  38491. // "requestId": {
  38492. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38493. // "location": "query",
  38494. // "type": "string"
  38495. // },
  38496. // "zone": {
  38497. // "description": "Name of the zone for this request.",
  38498. // "location": "path",
  38499. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38500. // "required": true,
  38501. // "type": "string"
  38502. // }
  38503. // },
  38504. // "path": "{project}/zones/{zone}/autoscalers",
  38505. // "request": {
  38506. // "$ref": "Autoscaler"
  38507. // },
  38508. // "response": {
  38509. // "$ref": "Operation"
  38510. // },
  38511. // "scopes": [
  38512. // "https://www.googleapis.com/auth/cloud-platform",
  38513. // "https://www.googleapis.com/auth/compute"
  38514. // ]
  38515. // }
  38516. }
  38517. // method id "compute.autoscalers.testIamPermissions":
  38518. type AutoscalersTestIamPermissionsCall struct {
  38519. s *Service
  38520. project string
  38521. zone string
  38522. resource string
  38523. testpermissionsrequest *TestPermissionsRequest
  38524. urlParams_ gensupport.URLParams
  38525. ctx_ context.Context
  38526. header_ http.Header
  38527. }
  38528. // TestIamPermissions: Returns permissions that a caller has on the
  38529. // specified resource.
  38530. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  38531. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38532. c.project = project
  38533. c.zone = zone
  38534. c.resource = resource
  38535. c.testpermissionsrequest = testpermissionsrequest
  38536. return c
  38537. }
  38538. // Fields allows partial responses to be retrieved. See
  38539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38540. // for more information.
  38541. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  38542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38543. return c
  38544. }
  38545. // Context sets the context to be used in this call's Do method. Any
  38546. // pending HTTP request will be aborted if the provided context is
  38547. // canceled.
  38548. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  38549. c.ctx_ = ctx
  38550. return c
  38551. }
  38552. // Header returns an http.Header that can be modified by the caller to
  38553. // add HTTP headers to the request.
  38554. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  38555. if c.header_ == nil {
  38556. c.header_ = make(http.Header)
  38557. }
  38558. return c.header_
  38559. }
  38560. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  38561. reqHeaders := make(http.Header)
  38562. for k, v := range c.header_ {
  38563. reqHeaders[k] = v
  38564. }
  38565. reqHeaders.Set("User-Agent", c.s.userAgent())
  38566. var body io.Reader = nil
  38567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  38568. if err != nil {
  38569. return nil, err
  38570. }
  38571. reqHeaders.Set("Content-Type", "application/json")
  38572. c.urlParams_.Set("alt", alt)
  38573. c.urlParams_.Set("prettyPrint", "false")
  38574. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  38575. urls += "?" + c.urlParams_.Encode()
  38576. req, err := http.NewRequest("POST", urls, body)
  38577. if err != nil {
  38578. return nil, err
  38579. }
  38580. req.Header = reqHeaders
  38581. googleapi.Expand(req.URL, map[string]string{
  38582. "project": c.project,
  38583. "zone": c.zone,
  38584. "resource": c.resource,
  38585. })
  38586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38587. }
  38588. // Do executes the "compute.autoscalers.testIamPermissions" call.
  38589. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  38590. // non-2xx status code is an error. Response headers are in either
  38591. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  38592. // returned at all) in error.(*googleapi.Error).Header. Use
  38593. // googleapi.IsNotModified to check whether the returned error was
  38594. // because http.StatusNotModified was returned.
  38595. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  38596. gensupport.SetOptions(c.urlParams_, opts...)
  38597. res, err := c.doRequest("json")
  38598. if res != nil && res.StatusCode == http.StatusNotModified {
  38599. if res.Body != nil {
  38600. res.Body.Close()
  38601. }
  38602. return nil, &googleapi.Error{
  38603. Code: res.StatusCode,
  38604. Header: res.Header,
  38605. }
  38606. }
  38607. if err != nil {
  38608. return nil, err
  38609. }
  38610. defer googleapi.CloseBody(res)
  38611. if err := googleapi.CheckResponse(res); err != nil {
  38612. return nil, err
  38613. }
  38614. ret := &TestPermissionsResponse{
  38615. ServerResponse: googleapi.ServerResponse{
  38616. Header: res.Header,
  38617. HTTPStatusCode: res.StatusCode,
  38618. },
  38619. }
  38620. target := &ret
  38621. if err := gensupport.DecodeResponse(target, res); err != nil {
  38622. return nil, err
  38623. }
  38624. return ret, nil
  38625. // {
  38626. // "description": "Returns permissions that a caller has on the specified resource.",
  38627. // "httpMethod": "POST",
  38628. // "id": "compute.autoscalers.testIamPermissions",
  38629. // "parameterOrder": [
  38630. // "project",
  38631. // "zone",
  38632. // "resource"
  38633. // ],
  38634. // "parameters": {
  38635. // "project": {
  38636. // "description": "Project ID for this request.",
  38637. // "location": "path",
  38638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38639. // "required": true,
  38640. // "type": "string"
  38641. // },
  38642. // "resource": {
  38643. // "description": "Name or id of the resource for this request.",
  38644. // "location": "path",
  38645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38646. // "required": true,
  38647. // "type": "string"
  38648. // },
  38649. // "zone": {
  38650. // "description": "The name of the zone for this request.",
  38651. // "location": "path",
  38652. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38653. // "required": true,
  38654. // "type": "string"
  38655. // }
  38656. // },
  38657. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  38658. // "request": {
  38659. // "$ref": "TestPermissionsRequest"
  38660. // },
  38661. // "response": {
  38662. // "$ref": "TestPermissionsResponse"
  38663. // },
  38664. // "scopes": [
  38665. // "https://www.googleapis.com/auth/cloud-platform",
  38666. // "https://www.googleapis.com/auth/compute",
  38667. // "https://www.googleapis.com/auth/compute.readonly"
  38668. // ]
  38669. // }
  38670. }
  38671. // method id "compute.autoscalers.update":
  38672. type AutoscalersUpdateCall struct {
  38673. s *Service
  38674. project string
  38675. zone string
  38676. autoscaler *Autoscaler
  38677. urlParams_ gensupport.URLParams
  38678. ctx_ context.Context
  38679. header_ http.Header
  38680. }
  38681. // Update: Updates an autoscaler in the specified project using the data
  38682. // included in the request.
  38683. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  38684. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38685. c.project = project
  38686. c.zone = zone
  38687. c.autoscaler = autoscaler
  38688. return c
  38689. }
  38690. // Autoscaler sets the optional parameter "autoscaler": Name of the
  38691. // autoscaler to update.
  38692. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  38693. c.urlParams_.Set("autoscaler", autoscaler)
  38694. return c
  38695. }
  38696. // RequestId sets the optional parameter "requestId": An optional
  38697. // request ID to identify requests. Specify a unique request ID so that
  38698. // if you must retry your request, the server will know to ignore the
  38699. // request if it has already been completed.
  38700. //
  38701. // For example, consider a situation where you make an initial request
  38702. // and the request times out. If you make the request again with the
  38703. // same request ID, the server can check if original operation with the
  38704. // same request ID was received, and if so, will ignore the second
  38705. // request. This prevents clients from accidentally creating duplicate
  38706. // commitments.
  38707. //
  38708. // The request ID must be a valid UUID with the exception that zero UUID
  38709. // is not supported (00000000-0000-0000-0000-000000000000).
  38710. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  38711. c.urlParams_.Set("requestId", requestId)
  38712. return c
  38713. }
  38714. // Fields allows partial responses to be retrieved. See
  38715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38716. // for more information.
  38717. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  38718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38719. return c
  38720. }
  38721. // Context sets the context to be used in this call's Do method. Any
  38722. // pending HTTP request will be aborted if the provided context is
  38723. // canceled.
  38724. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  38725. c.ctx_ = ctx
  38726. return c
  38727. }
  38728. // Header returns an http.Header that can be modified by the caller to
  38729. // add HTTP headers to the request.
  38730. func (c *AutoscalersUpdateCall) Header() http.Header {
  38731. if c.header_ == nil {
  38732. c.header_ = make(http.Header)
  38733. }
  38734. return c.header_
  38735. }
  38736. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  38737. reqHeaders := make(http.Header)
  38738. for k, v := range c.header_ {
  38739. reqHeaders[k] = v
  38740. }
  38741. reqHeaders.Set("User-Agent", c.s.userAgent())
  38742. var body io.Reader = nil
  38743. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  38744. if err != nil {
  38745. return nil, err
  38746. }
  38747. reqHeaders.Set("Content-Type", "application/json")
  38748. c.urlParams_.Set("alt", alt)
  38749. c.urlParams_.Set("prettyPrint", "false")
  38750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  38751. urls += "?" + c.urlParams_.Encode()
  38752. req, err := http.NewRequest("PUT", urls, body)
  38753. if err != nil {
  38754. return nil, err
  38755. }
  38756. req.Header = reqHeaders
  38757. googleapi.Expand(req.URL, map[string]string{
  38758. "project": c.project,
  38759. "zone": c.zone,
  38760. })
  38761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38762. }
  38763. // Do executes the "compute.autoscalers.update" call.
  38764. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38765. // status code is an error. Response headers are in either
  38766. // *Operation.ServerResponse.Header or (if a response was returned at
  38767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38768. // to check whether the returned error was because
  38769. // http.StatusNotModified was returned.
  38770. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38771. gensupport.SetOptions(c.urlParams_, opts...)
  38772. res, err := c.doRequest("json")
  38773. if res != nil && res.StatusCode == http.StatusNotModified {
  38774. if res.Body != nil {
  38775. res.Body.Close()
  38776. }
  38777. return nil, &googleapi.Error{
  38778. Code: res.StatusCode,
  38779. Header: res.Header,
  38780. }
  38781. }
  38782. if err != nil {
  38783. return nil, err
  38784. }
  38785. defer googleapi.CloseBody(res)
  38786. if err := googleapi.CheckResponse(res); err != nil {
  38787. return nil, err
  38788. }
  38789. ret := &Operation{
  38790. ServerResponse: googleapi.ServerResponse{
  38791. Header: res.Header,
  38792. HTTPStatusCode: res.StatusCode,
  38793. },
  38794. }
  38795. target := &ret
  38796. if err := gensupport.DecodeResponse(target, res); err != nil {
  38797. return nil, err
  38798. }
  38799. return ret, nil
  38800. // {
  38801. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  38802. // "httpMethod": "PUT",
  38803. // "id": "compute.autoscalers.update",
  38804. // "parameterOrder": [
  38805. // "project",
  38806. // "zone"
  38807. // ],
  38808. // "parameters": {
  38809. // "autoscaler": {
  38810. // "description": "Name of the autoscaler to update.",
  38811. // "location": "query",
  38812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38813. // "type": "string"
  38814. // },
  38815. // "project": {
  38816. // "description": "Project ID for this request.",
  38817. // "location": "path",
  38818. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38819. // "required": true,
  38820. // "type": "string"
  38821. // },
  38822. // "requestId": {
  38823. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38824. // "location": "query",
  38825. // "type": "string"
  38826. // },
  38827. // "zone": {
  38828. // "description": "Name of the zone for this request.",
  38829. // "location": "path",
  38830. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38831. // "required": true,
  38832. // "type": "string"
  38833. // }
  38834. // },
  38835. // "path": "{project}/zones/{zone}/autoscalers",
  38836. // "request": {
  38837. // "$ref": "Autoscaler"
  38838. // },
  38839. // "response": {
  38840. // "$ref": "Operation"
  38841. // },
  38842. // "scopes": [
  38843. // "https://www.googleapis.com/auth/cloud-platform",
  38844. // "https://www.googleapis.com/auth/compute"
  38845. // ]
  38846. // }
  38847. }
  38848. // method id "compute.backendBuckets.addSignedUrlKey":
  38849. type BackendBucketsAddSignedUrlKeyCall struct {
  38850. s *Service
  38851. project string
  38852. backendBucket string
  38853. signedurlkey *SignedUrlKey
  38854. urlParams_ gensupport.URLParams
  38855. ctx_ context.Context
  38856. header_ http.Header
  38857. }
  38858. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  38859. // for this backend bucket.
  38860. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  38861. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38862. c.project = project
  38863. c.backendBucket = backendBucket
  38864. c.signedurlkey = signedurlkey
  38865. return c
  38866. }
  38867. // RequestId sets the optional parameter "requestId": An optional
  38868. // request ID to identify requests. Specify a unique request ID so that
  38869. // if you must retry your request, the server will know to ignore the
  38870. // request if it has already been completed.
  38871. //
  38872. // For example, consider a situation where you make an initial request
  38873. // and the request times out. If you make the request again with the
  38874. // same request ID, the server can check if original operation with the
  38875. // same request ID was received, and if so, will ignore the second
  38876. // request. This prevents clients from accidentally creating duplicate
  38877. // commitments.
  38878. //
  38879. // The request ID must be a valid UUID with the exception that zero UUID
  38880. // is not supported (00000000-0000-0000-0000-000000000000).
  38881. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  38882. c.urlParams_.Set("requestId", requestId)
  38883. return c
  38884. }
  38885. // Fields allows partial responses to be retrieved. See
  38886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38887. // for more information.
  38888. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  38889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38890. return c
  38891. }
  38892. // Context sets the context to be used in this call's Do method. Any
  38893. // pending HTTP request will be aborted if the provided context is
  38894. // canceled.
  38895. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  38896. c.ctx_ = ctx
  38897. return c
  38898. }
  38899. // Header returns an http.Header that can be modified by the caller to
  38900. // add HTTP headers to the request.
  38901. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  38902. if c.header_ == nil {
  38903. c.header_ = make(http.Header)
  38904. }
  38905. return c.header_
  38906. }
  38907. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  38908. reqHeaders := make(http.Header)
  38909. for k, v := range c.header_ {
  38910. reqHeaders[k] = v
  38911. }
  38912. reqHeaders.Set("User-Agent", c.s.userAgent())
  38913. var body io.Reader = nil
  38914. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  38915. if err != nil {
  38916. return nil, err
  38917. }
  38918. reqHeaders.Set("Content-Type", "application/json")
  38919. c.urlParams_.Set("alt", alt)
  38920. c.urlParams_.Set("prettyPrint", "false")
  38921. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  38922. urls += "?" + c.urlParams_.Encode()
  38923. req, err := http.NewRequest("POST", urls, body)
  38924. if err != nil {
  38925. return nil, err
  38926. }
  38927. req.Header = reqHeaders
  38928. googleapi.Expand(req.URL, map[string]string{
  38929. "project": c.project,
  38930. "backendBucket": c.backendBucket,
  38931. })
  38932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38933. }
  38934. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  38935. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38936. // status code is an error. Response headers are in either
  38937. // *Operation.ServerResponse.Header or (if a response was returned at
  38938. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38939. // to check whether the returned error was because
  38940. // http.StatusNotModified was returned.
  38941. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38942. gensupport.SetOptions(c.urlParams_, opts...)
  38943. res, err := c.doRequest("json")
  38944. if res != nil && res.StatusCode == http.StatusNotModified {
  38945. if res.Body != nil {
  38946. res.Body.Close()
  38947. }
  38948. return nil, &googleapi.Error{
  38949. Code: res.StatusCode,
  38950. Header: res.Header,
  38951. }
  38952. }
  38953. if err != nil {
  38954. return nil, err
  38955. }
  38956. defer googleapi.CloseBody(res)
  38957. if err := googleapi.CheckResponse(res); err != nil {
  38958. return nil, err
  38959. }
  38960. ret := &Operation{
  38961. ServerResponse: googleapi.ServerResponse{
  38962. Header: res.Header,
  38963. HTTPStatusCode: res.StatusCode,
  38964. },
  38965. }
  38966. target := &ret
  38967. if err := gensupport.DecodeResponse(target, res); err != nil {
  38968. return nil, err
  38969. }
  38970. return ret, nil
  38971. // {
  38972. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  38973. // "httpMethod": "POST",
  38974. // "id": "compute.backendBuckets.addSignedUrlKey",
  38975. // "parameterOrder": [
  38976. // "project",
  38977. // "backendBucket"
  38978. // ],
  38979. // "parameters": {
  38980. // "backendBucket": {
  38981. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  38982. // "location": "path",
  38983. // "required": true,
  38984. // "type": "string"
  38985. // },
  38986. // "project": {
  38987. // "description": "Project ID for this request.",
  38988. // "location": "path",
  38989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38990. // "required": true,
  38991. // "type": "string"
  38992. // },
  38993. // "requestId": {
  38994. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38995. // "location": "query",
  38996. // "type": "string"
  38997. // }
  38998. // },
  38999. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  39000. // "request": {
  39001. // "$ref": "SignedUrlKey"
  39002. // },
  39003. // "response": {
  39004. // "$ref": "Operation"
  39005. // },
  39006. // "scopes": [
  39007. // "https://www.googleapis.com/auth/cloud-platform",
  39008. // "https://www.googleapis.com/auth/compute"
  39009. // ]
  39010. // }
  39011. }
  39012. // method id "compute.backendBuckets.delete":
  39013. type BackendBucketsDeleteCall struct {
  39014. s *Service
  39015. project string
  39016. backendBucket string
  39017. urlParams_ gensupport.URLParams
  39018. ctx_ context.Context
  39019. header_ http.Header
  39020. }
  39021. // Delete: Deletes the specified BackendBucket resource.
  39022. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  39023. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39024. c.project = project
  39025. c.backendBucket = backendBucket
  39026. return c
  39027. }
  39028. // RequestId sets the optional parameter "requestId": An optional
  39029. // request ID to identify requests. Specify a unique request ID so that
  39030. // if you must retry your request, the server will know to ignore the
  39031. // request if it has already been completed.
  39032. //
  39033. // For example, consider a situation where you make an initial request
  39034. // and the request times out. If you make the request again with the
  39035. // same request ID, the server can check if original operation with the
  39036. // same request ID was received, and if so, will ignore the second
  39037. // request. This prevents clients from accidentally creating duplicate
  39038. // commitments.
  39039. //
  39040. // The request ID must be a valid UUID with the exception that zero UUID
  39041. // is not supported (00000000-0000-0000-0000-000000000000).
  39042. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  39043. c.urlParams_.Set("requestId", requestId)
  39044. return c
  39045. }
  39046. // Fields allows partial responses to be retrieved. See
  39047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39048. // for more information.
  39049. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  39050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39051. return c
  39052. }
  39053. // Context sets the context to be used in this call's Do method. Any
  39054. // pending HTTP request will be aborted if the provided context is
  39055. // canceled.
  39056. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  39057. c.ctx_ = ctx
  39058. return c
  39059. }
  39060. // Header returns an http.Header that can be modified by the caller to
  39061. // add HTTP headers to the request.
  39062. func (c *BackendBucketsDeleteCall) Header() http.Header {
  39063. if c.header_ == nil {
  39064. c.header_ = make(http.Header)
  39065. }
  39066. return c.header_
  39067. }
  39068. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39069. reqHeaders := make(http.Header)
  39070. for k, v := range c.header_ {
  39071. reqHeaders[k] = v
  39072. }
  39073. reqHeaders.Set("User-Agent", c.s.userAgent())
  39074. var body io.Reader = nil
  39075. c.urlParams_.Set("alt", alt)
  39076. c.urlParams_.Set("prettyPrint", "false")
  39077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  39078. urls += "?" + c.urlParams_.Encode()
  39079. req, err := http.NewRequest("DELETE", urls, body)
  39080. if err != nil {
  39081. return nil, err
  39082. }
  39083. req.Header = reqHeaders
  39084. googleapi.Expand(req.URL, map[string]string{
  39085. "project": c.project,
  39086. "backendBucket": c.backendBucket,
  39087. })
  39088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39089. }
  39090. // Do executes the "compute.backendBuckets.delete" call.
  39091. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39092. // status code is an error. Response headers are in either
  39093. // *Operation.ServerResponse.Header or (if a response was returned at
  39094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39095. // to check whether the returned error was because
  39096. // http.StatusNotModified was returned.
  39097. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39098. gensupport.SetOptions(c.urlParams_, opts...)
  39099. res, err := c.doRequest("json")
  39100. if res != nil && res.StatusCode == http.StatusNotModified {
  39101. if res.Body != nil {
  39102. res.Body.Close()
  39103. }
  39104. return nil, &googleapi.Error{
  39105. Code: res.StatusCode,
  39106. Header: res.Header,
  39107. }
  39108. }
  39109. if err != nil {
  39110. return nil, err
  39111. }
  39112. defer googleapi.CloseBody(res)
  39113. if err := googleapi.CheckResponse(res); err != nil {
  39114. return nil, err
  39115. }
  39116. ret := &Operation{
  39117. ServerResponse: googleapi.ServerResponse{
  39118. Header: res.Header,
  39119. HTTPStatusCode: res.StatusCode,
  39120. },
  39121. }
  39122. target := &ret
  39123. if err := gensupport.DecodeResponse(target, res); err != nil {
  39124. return nil, err
  39125. }
  39126. return ret, nil
  39127. // {
  39128. // "description": "Deletes the specified BackendBucket resource.",
  39129. // "httpMethod": "DELETE",
  39130. // "id": "compute.backendBuckets.delete",
  39131. // "parameterOrder": [
  39132. // "project",
  39133. // "backendBucket"
  39134. // ],
  39135. // "parameters": {
  39136. // "backendBucket": {
  39137. // "description": "Name of the BackendBucket resource to delete.",
  39138. // "location": "path",
  39139. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39140. // "required": true,
  39141. // "type": "string"
  39142. // },
  39143. // "project": {
  39144. // "description": "Project ID for this request.",
  39145. // "location": "path",
  39146. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39147. // "required": true,
  39148. // "type": "string"
  39149. // },
  39150. // "requestId": {
  39151. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39152. // "location": "query",
  39153. // "type": "string"
  39154. // }
  39155. // },
  39156. // "path": "{project}/global/backendBuckets/{backendBucket}",
  39157. // "response": {
  39158. // "$ref": "Operation"
  39159. // },
  39160. // "scopes": [
  39161. // "https://www.googleapis.com/auth/cloud-platform",
  39162. // "https://www.googleapis.com/auth/compute"
  39163. // ]
  39164. // }
  39165. }
  39166. // method id "compute.backendBuckets.deleteSignedUrlKey":
  39167. type BackendBucketsDeleteSignedUrlKeyCall struct {
  39168. s *Service
  39169. project string
  39170. backendBucket string
  39171. urlParams_ gensupport.URLParams
  39172. ctx_ context.Context
  39173. header_ http.Header
  39174. }
  39175. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  39176. // URLs for this backend bucket.
  39177. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  39178. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39179. c.project = project
  39180. c.backendBucket = backendBucket
  39181. c.urlParams_.Set("keyName", keyName)
  39182. return c
  39183. }
  39184. // RequestId sets the optional parameter "requestId": An optional
  39185. // request ID to identify requests. Specify a unique request ID so that
  39186. // if you must retry your request, the server will know to ignore the
  39187. // request if it has already been completed.
  39188. //
  39189. // For example, consider a situation where you make an initial request
  39190. // and the request times out. If you make the request again with the
  39191. // same request ID, the server can check if original operation with the
  39192. // same request ID was received, and if so, will ignore the second
  39193. // request. This prevents clients from accidentally creating duplicate
  39194. // commitments.
  39195. //
  39196. // The request ID must be a valid UUID with the exception that zero UUID
  39197. // is not supported (00000000-0000-0000-0000-000000000000).
  39198. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  39199. c.urlParams_.Set("requestId", requestId)
  39200. return c
  39201. }
  39202. // Fields allows partial responses to be retrieved. See
  39203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39204. // for more information.
  39205. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  39206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39207. return c
  39208. }
  39209. // Context sets the context to be used in this call's Do method. Any
  39210. // pending HTTP request will be aborted if the provided context is
  39211. // canceled.
  39212. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  39213. c.ctx_ = ctx
  39214. return c
  39215. }
  39216. // Header returns an http.Header that can be modified by the caller to
  39217. // add HTTP headers to the request.
  39218. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  39219. if c.header_ == nil {
  39220. c.header_ = make(http.Header)
  39221. }
  39222. return c.header_
  39223. }
  39224. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  39225. reqHeaders := make(http.Header)
  39226. for k, v := range c.header_ {
  39227. reqHeaders[k] = v
  39228. }
  39229. reqHeaders.Set("User-Agent", c.s.userAgent())
  39230. var body io.Reader = nil
  39231. c.urlParams_.Set("alt", alt)
  39232. c.urlParams_.Set("prettyPrint", "false")
  39233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  39234. urls += "?" + c.urlParams_.Encode()
  39235. req, err := http.NewRequest("POST", urls, body)
  39236. if err != nil {
  39237. return nil, err
  39238. }
  39239. req.Header = reqHeaders
  39240. googleapi.Expand(req.URL, map[string]string{
  39241. "project": c.project,
  39242. "backendBucket": c.backendBucket,
  39243. })
  39244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39245. }
  39246. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  39247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39248. // status code is an error. Response headers are in either
  39249. // *Operation.ServerResponse.Header or (if a response was returned at
  39250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39251. // to check whether the returned error was because
  39252. // http.StatusNotModified was returned.
  39253. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39254. gensupport.SetOptions(c.urlParams_, opts...)
  39255. res, err := c.doRequest("json")
  39256. if res != nil && res.StatusCode == http.StatusNotModified {
  39257. if res.Body != nil {
  39258. res.Body.Close()
  39259. }
  39260. return nil, &googleapi.Error{
  39261. Code: res.StatusCode,
  39262. Header: res.Header,
  39263. }
  39264. }
  39265. if err != nil {
  39266. return nil, err
  39267. }
  39268. defer googleapi.CloseBody(res)
  39269. if err := googleapi.CheckResponse(res); err != nil {
  39270. return nil, err
  39271. }
  39272. ret := &Operation{
  39273. ServerResponse: googleapi.ServerResponse{
  39274. Header: res.Header,
  39275. HTTPStatusCode: res.StatusCode,
  39276. },
  39277. }
  39278. target := &ret
  39279. if err := gensupport.DecodeResponse(target, res); err != nil {
  39280. return nil, err
  39281. }
  39282. return ret, nil
  39283. // {
  39284. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  39285. // "httpMethod": "POST",
  39286. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  39287. // "parameterOrder": [
  39288. // "project",
  39289. // "backendBucket",
  39290. // "keyName"
  39291. // ],
  39292. // "parameters": {
  39293. // "backendBucket": {
  39294. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  39295. // "location": "path",
  39296. // "required": true,
  39297. // "type": "string"
  39298. // },
  39299. // "keyName": {
  39300. // "description": "The name of the Signed URL Key to delete.",
  39301. // "location": "query",
  39302. // "required": true,
  39303. // "type": "string"
  39304. // },
  39305. // "project": {
  39306. // "description": "Project ID for this request.",
  39307. // "location": "path",
  39308. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39309. // "required": true,
  39310. // "type": "string"
  39311. // },
  39312. // "requestId": {
  39313. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39314. // "location": "query",
  39315. // "type": "string"
  39316. // }
  39317. // },
  39318. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  39319. // "response": {
  39320. // "$ref": "Operation"
  39321. // },
  39322. // "scopes": [
  39323. // "https://www.googleapis.com/auth/cloud-platform",
  39324. // "https://www.googleapis.com/auth/compute"
  39325. // ]
  39326. // }
  39327. }
  39328. // method id "compute.backendBuckets.get":
  39329. type BackendBucketsGetCall struct {
  39330. s *Service
  39331. project string
  39332. backendBucket string
  39333. urlParams_ gensupport.URLParams
  39334. ifNoneMatch_ string
  39335. ctx_ context.Context
  39336. header_ http.Header
  39337. }
  39338. // Get: Returns the specified BackendBucket resource. Gets a list of
  39339. // available backend buckets by making a list() request.
  39340. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  39341. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39342. c.project = project
  39343. c.backendBucket = backendBucket
  39344. return c
  39345. }
  39346. // Fields allows partial responses to be retrieved. See
  39347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39348. // for more information.
  39349. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  39350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39351. return c
  39352. }
  39353. // IfNoneMatch sets the optional parameter which makes the operation
  39354. // fail if the object's ETag matches the given value. This is useful for
  39355. // getting updates only after the object has changed since the last
  39356. // request. Use googleapi.IsNotModified to check whether the response
  39357. // error from Do is the result of In-None-Match.
  39358. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  39359. c.ifNoneMatch_ = entityTag
  39360. return c
  39361. }
  39362. // Context sets the context to be used in this call's Do method. Any
  39363. // pending HTTP request will be aborted if the provided context is
  39364. // canceled.
  39365. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  39366. c.ctx_ = ctx
  39367. return c
  39368. }
  39369. // Header returns an http.Header that can be modified by the caller to
  39370. // add HTTP headers to the request.
  39371. func (c *BackendBucketsGetCall) Header() http.Header {
  39372. if c.header_ == nil {
  39373. c.header_ = make(http.Header)
  39374. }
  39375. return c.header_
  39376. }
  39377. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  39378. reqHeaders := make(http.Header)
  39379. for k, v := range c.header_ {
  39380. reqHeaders[k] = v
  39381. }
  39382. reqHeaders.Set("User-Agent", c.s.userAgent())
  39383. if c.ifNoneMatch_ != "" {
  39384. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39385. }
  39386. var body io.Reader = nil
  39387. c.urlParams_.Set("alt", alt)
  39388. c.urlParams_.Set("prettyPrint", "false")
  39389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  39390. urls += "?" + c.urlParams_.Encode()
  39391. req, err := http.NewRequest("GET", urls, body)
  39392. if err != nil {
  39393. return nil, err
  39394. }
  39395. req.Header = reqHeaders
  39396. googleapi.Expand(req.URL, map[string]string{
  39397. "project": c.project,
  39398. "backendBucket": c.backendBucket,
  39399. })
  39400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39401. }
  39402. // Do executes the "compute.backendBuckets.get" call.
  39403. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  39404. // status code is an error. Response headers are in either
  39405. // *BackendBucket.ServerResponse.Header or (if a response was returned
  39406. // at all) in error.(*googleapi.Error).Header. Use
  39407. // googleapi.IsNotModified to check whether the returned error was
  39408. // because http.StatusNotModified was returned.
  39409. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  39410. gensupport.SetOptions(c.urlParams_, opts...)
  39411. res, err := c.doRequest("json")
  39412. if res != nil && res.StatusCode == http.StatusNotModified {
  39413. if res.Body != nil {
  39414. res.Body.Close()
  39415. }
  39416. return nil, &googleapi.Error{
  39417. Code: res.StatusCode,
  39418. Header: res.Header,
  39419. }
  39420. }
  39421. if err != nil {
  39422. return nil, err
  39423. }
  39424. defer googleapi.CloseBody(res)
  39425. if err := googleapi.CheckResponse(res); err != nil {
  39426. return nil, err
  39427. }
  39428. ret := &BackendBucket{
  39429. ServerResponse: googleapi.ServerResponse{
  39430. Header: res.Header,
  39431. HTTPStatusCode: res.StatusCode,
  39432. },
  39433. }
  39434. target := &ret
  39435. if err := gensupport.DecodeResponse(target, res); err != nil {
  39436. return nil, err
  39437. }
  39438. return ret, nil
  39439. // {
  39440. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  39441. // "httpMethod": "GET",
  39442. // "id": "compute.backendBuckets.get",
  39443. // "parameterOrder": [
  39444. // "project",
  39445. // "backendBucket"
  39446. // ],
  39447. // "parameters": {
  39448. // "backendBucket": {
  39449. // "description": "Name of the BackendBucket resource to return.",
  39450. // "location": "path",
  39451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39452. // "required": true,
  39453. // "type": "string"
  39454. // },
  39455. // "project": {
  39456. // "description": "Project ID for this request.",
  39457. // "location": "path",
  39458. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39459. // "required": true,
  39460. // "type": "string"
  39461. // }
  39462. // },
  39463. // "path": "{project}/global/backendBuckets/{backendBucket}",
  39464. // "response": {
  39465. // "$ref": "BackendBucket"
  39466. // },
  39467. // "scopes": [
  39468. // "https://www.googleapis.com/auth/cloud-platform",
  39469. // "https://www.googleapis.com/auth/compute",
  39470. // "https://www.googleapis.com/auth/compute.readonly"
  39471. // ]
  39472. // }
  39473. }
  39474. // method id "compute.backendBuckets.getIamPolicy":
  39475. type BackendBucketsGetIamPolicyCall struct {
  39476. s *Service
  39477. project string
  39478. resource string
  39479. urlParams_ gensupport.URLParams
  39480. ifNoneMatch_ string
  39481. ctx_ context.Context
  39482. header_ http.Header
  39483. }
  39484. // GetIamPolicy: Gets the access control policy for a resource. May be
  39485. // empty if no such policy or resource exists.
  39486. func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
  39487. c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39488. c.project = project
  39489. c.resource = resource
  39490. return c
  39491. }
  39492. // Fields allows partial responses to be retrieved. See
  39493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39494. // for more information.
  39495. func (c *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
  39496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39497. return c
  39498. }
  39499. // IfNoneMatch sets the optional parameter which makes the operation
  39500. // fail if the object's ETag matches the given value. This is useful for
  39501. // getting updates only after the object has changed since the last
  39502. // request. Use googleapi.IsNotModified to check whether the response
  39503. // error from Do is the result of In-None-Match.
  39504. func (c *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
  39505. c.ifNoneMatch_ = entityTag
  39506. return c
  39507. }
  39508. // Context sets the context to be used in this call's Do method. Any
  39509. // pending HTTP request will be aborted if the provided context is
  39510. // canceled.
  39511. func (c *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
  39512. c.ctx_ = ctx
  39513. return c
  39514. }
  39515. // Header returns an http.Header that can be modified by the caller to
  39516. // add HTTP headers to the request.
  39517. func (c *BackendBucketsGetIamPolicyCall) Header() http.Header {
  39518. if c.header_ == nil {
  39519. c.header_ = make(http.Header)
  39520. }
  39521. return c.header_
  39522. }
  39523. func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  39524. reqHeaders := make(http.Header)
  39525. for k, v := range c.header_ {
  39526. reqHeaders[k] = v
  39527. }
  39528. reqHeaders.Set("User-Agent", c.s.userAgent())
  39529. if c.ifNoneMatch_ != "" {
  39530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39531. }
  39532. var body io.Reader = nil
  39533. c.urlParams_.Set("alt", alt)
  39534. c.urlParams_.Set("prettyPrint", "false")
  39535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/getIamPolicy")
  39536. urls += "?" + c.urlParams_.Encode()
  39537. req, err := http.NewRequest("GET", urls, body)
  39538. if err != nil {
  39539. return nil, err
  39540. }
  39541. req.Header = reqHeaders
  39542. googleapi.Expand(req.URL, map[string]string{
  39543. "project": c.project,
  39544. "resource": c.resource,
  39545. })
  39546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39547. }
  39548. // Do executes the "compute.backendBuckets.getIamPolicy" call.
  39549. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  39550. // code is an error. Response headers are in either
  39551. // *Policy.ServerResponse.Header or (if a response was returned at all)
  39552. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39553. // check whether the returned error was because http.StatusNotModified
  39554. // was returned.
  39555. func (c *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  39556. gensupport.SetOptions(c.urlParams_, opts...)
  39557. res, err := c.doRequest("json")
  39558. if res != nil && res.StatusCode == http.StatusNotModified {
  39559. if res.Body != nil {
  39560. res.Body.Close()
  39561. }
  39562. return nil, &googleapi.Error{
  39563. Code: res.StatusCode,
  39564. Header: res.Header,
  39565. }
  39566. }
  39567. if err != nil {
  39568. return nil, err
  39569. }
  39570. defer googleapi.CloseBody(res)
  39571. if err := googleapi.CheckResponse(res); err != nil {
  39572. return nil, err
  39573. }
  39574. ret := &Policy{
  39575. ServerResponse: googleapi.ServerResponse{
  39576. Header: res.Header,
  39577. HTTPStatusCode: res.StatusCode,
  39578. },
  39579. }
  39580. target := &ret
  39581. if err := gensupport.DecodeResponse(target, res); err != nil {
  39582. return nil, err
  39583. }
  39584. return ret, nil
  39585. // {
  39586. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  39587. // "httpMethod": "GET",
  39588. // "id": "compute.backendBuckets.getIamPolicy",
  39589. // "parameterOrder": [
  39590. // "project",
  39591. // "resource"
  39592. // ],
  39593. // "parameters": {
  39594. // "project": {
  39595. // "description": "Project ID for this request.",
  39596. // "location": "path",
  39597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39598. // "required": true,
  39599. // "type": "string"
  39600. // },
  39601. // "resource": {
  39602. // "description": "Name or id of the resource for this request.",
  39603. // "location": "path",
  39604. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39605. // "required": true,
  39606. // "type": "string"
  39607. // }
  39608. // },
  39609. // "path": "{project}/global/backendBuckets/{resource}/getIamPolicy",
  39610. // "response": {
  39611. // "$ref": "Policy"
  39612. // },
  39613. // "scopes": [
  39614. // "https://www.googleapis.com/auth/cloud-platform",
  39615. // "https://www.googleapis.com/auth/compute",
  39616. // "https://www.googleapis.com/auth/compute.readonly"
  39617. // ]
  39618. // }
  39619. }
  39620. // method id "compute.backendBuckets.insert":
  39621. type BackendBucketsInsertCall struct {
  39622. s *Service
  39623. project string
  39624. backendbucket *BackendBucket
  39625. urlParams_ gensupport.URLParams
  39626. ctx_ context.Context
  39627. header_ http.Header
  39628. }
  39629. // Insert: Creates a BackendBucket resource in the specified project
  39630. // using the data included in the request.
  39631. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  39632. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39633. c.project = project
  39634. c.backendbucket = backendbucket
  39635. return c
  39636. }
  39637. // RequestId sets the optional parameter "requestId": An optional
  39638. // request ID to identify requests. Specify a unique request ID so that
  39639. // if you must retry your request, the server will know to ignore the
  39640. // request if it has already been completed.
  39641. //
  39642. // For example, consider a situation where you make an initial request
  39643. // and the request times out. If you make the request again with the
  39644. // same request ID, the server can check if original operation with the
  39645. // same request ID was received, and if so, will ignore the second
  39646. // request. This prevents clients from accidentally creating duplicate
  39647. // commitments.
  39648. //
  39649. // The request ID must be a valid UUID with the exception that zero UUID
  39650. // is not supported (00000000-0000-0000-0000-000000000000).
  39651. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  39652. c.urlParams_.Set("requestId", requestId)
  39653. return c
  39654. }
  39655. // Fields allows partial responses to be retrieved. See
  39656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39657. // for more information.
  39658. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  39659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39660. return c
  39661. }
  39662. // Context sets the context to be used in this call's Do method. Any
  39663. // pending HTTP request will be aborted if the provided context is
  39664. // canceled.
  39665. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  39666. c.ctx_ = ctx
  39667. return c
  39668. }
  39669. // Header returns an http.Header that can be modified by the caller to
  39670. // add HTTP headers to the request.
  39671. func (c *BackendBucketsInsertCall) Header() http.Header {
  39672. if c.header_ == nil {
  39673. c.header_ = make(http.Header)
  39674. }
  39675. return c.header_
  39676. }
  39677. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  39678. reqHeaders := make(http.Header)
  39679. for k, v := range c.header_ {
  39680. reqHeaders[k] = v
  39681. }
  39682. reqHeaders.Set("User-Agent", c.s.userAgent())
  39683. var body io.Reader = nil
  39684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  39685. if err != nil {
  39686. return nil, err
  39687. }
  39688. reqHeaders.Set("Content-Type", "application/json")
  39689. c.urlParams_.Set("alt", alt)
  39690. c.urlParams_.Set("prettyPrint", "false")
  39691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  39692. urls += "?" + c.urlParams_.Encode()
  39693. req, err := http.NewRequest("POST", urls, body)
  39694. if err != nil {
  39695. return nil, err
  39696. }
  39697. req.Header = reqHeaders
  39698. googleapi.Expand(req.URL, map[string]string{
  39699. "project": c.project,
  39700. })
  39701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39702. }
  39703. // Do executes the "compute.backendBuckets.insert" call.
  39704. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39705. // status code is an error. Response headers are in either
  39706. // *Operation.ServerResponse.Header or (if a response was returned at
  39707. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39708. // to check whether the returned error was because
  39709. // http.StatusNotModified was returned.
  39710. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39711. gensupport.SetOptions(c.urlParams_, opts...)
  39712. res, err := c.doRequest("json")
  39713. if res != nil && res.StatusCode == http.StatusNotModified {
  39714. if res.Body != nil {
  39715. res.Body.Close()
  39716. }
  39717. return nil, &googleapi.Error{
  39718. Code: res.StatusCode,
  39719. Header: res.Header,
  39720. }
  39721. }
  39722. if err != nil {
  39723. return nil, err
  39724. }
  39725. defer googleapi.CloseBody(res)
  39726. if err := googleapi.CheckResponse(res); err != nil {
  39727. return nil, err
  39728. }
  39729. ret := &Operation{
  39730. ServerResponse: googleapi.ServerResponse{
  39731. Header: res.Header,
  39732. HTTPStatusCode: res.StatusCode,
  39733. },
  39734. }
  39735. target := &ret
  39736. if err := gensupport.DecodeResponse(target, res); err != nil {
  39737. return nil, err
  39738. }
  39739. return ret, nil
  39740. // {
  39741. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  39742. // "httpMethod": "POST",
  39743. // "id": "compute.backendBuckets.insert",
  39744. // "parameterOrder": [
  39745. // "project"
  39746. // ],
  39747. // "parameters": {
  39748. // "project": {
  39749. // "description": "Project ID for this request.",
  39750. // "location": "path",
  39751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39752. // "required": true,
  39753. // "type": "string"
  39754. // },
  39755. // "requestId": {
  39756. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39757. // "location": "query",
  39758. // "type": "string"
  39759. // }
  39760. // },
  39761. // "path": "{project}/global/backendBuckets",
  39762. // "request": {
  39763. // "$ref": "BackendBucket"
  39764. // },
  39765. // "response": {
  39766. // "$ref": "Operation"
  39767. // },
  39768. // "scopes": [
  39769. // "https://www.googleapis.com/auth/cloud-platform",
  39770. // "https://www.googleapis.com/auth/compute"
  39771. // ]
  39772. // }
  39773. }
  39774. // method id "compute.backendBuckets.list":
  39775. type BackendBucketsListCall struct {
  39776. s *Service
  39777. project string
  39778. urlParams_ gensupport.URLParams
  39779. ifNoneMatch_ string
  39780. ctx_ context.Context
  39781. header_ http.Header
  39782. }
  39783. // List: Retrieves the list of BackendBucket resources available to the
  39784. // specified project.
  39785. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  39786. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39787. c.project = project
  39788. return c
  39789. }
  39790. // Filter sets the optional parameter "filter": A filter expression that
  39791. // filters resources listed in the response. The expression must specify
  39792. // the field name, a comparison operator, and the value that you want to
  39793. // use for filtering. The value must be a string, a number, or a
  39794. // boolean. The comparison operator must be either =, !=, >, or <.
  39795. //
  39796. // For example, if you are filtering Compute Engine instances, you can
  39797. // exclude instances named example-instance by specifying name !=
  39798. // example-instance.
  39799. //
  39800. // You can also filter nested fields. For example, you could specify
  39801. // scheduling.automaticRestart = false to include instances only if they
  39802. // are not scheduled for automatic restarts. You can use filtering on
  39803. // nested fields to filter based on resource labels.
  39804. //
  39805. // To filter on multiple expressions, provide each separate expression
  39806. // within parentheses. For example, (scheduling.automaticRestart = true)
  39807. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39808. // AND expression. However, you can include AND and OR expressions
  39809. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39810. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39811. // true).
  39812. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  39813. c.urlParams_.Set("filter", filter)
  39814. return c
  39815. }
  39816. // MaxResults sets the optional parameter "maxResults": The maximum
  39817. // number of results per page that should be returned. If the number of
  39818. // available results is larger than maxResults, Compute Engine returns a
  39819. // nextPageToken that can be used to get the next page of results in
  39820. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39821. // (Default: 500)
  39822. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  39823. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39824. return c
  39825. }
  39826. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39827. // a certain order. By default, results are returned in alphanumerical
  39828. // order based on the resource name.
  39829. //
  39830. // You can also sort results in descending order based on the creation
  39831. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39832. // based on the creationTimestamp field in reverse chronological order
  39833. // (newest result first). Use this to sort resources like operations so
  39834. // that the newest operation is returned first.
  39835. //
  39836. // Currently, only sorting by name or creationTimestamp desc is
  39837. // supported.
  39838. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  39839. c.urlParams_.Set("orderBy", orderBy)
  39840. return c
  39841. }
  39842. // PageToken sets the optional parameter "pageToken": Specifies a page
  39843. // token to use. Set pageToken to the nextPageToken returned by a
  39844. // previous list request to get the next page of results.
  39845. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  39846. c.urlParams_.Set("pageToken", pageToken)
  39847. return c
  39848. }
  39849. // Fields allows partial responses to be retrieved. See
  39850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39851. // for more information.
  39852. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  39853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39854. return c
  39855. }
  39856. // IfNoneMatch sets the optional parameter which makes the operation
  39857. // fail if the object's ETag matches the given value. This is useful for
  39858. // getting updates only after the object has changed since the last
  39859. // request. Use googleapi.IsNotModified to check whether the response
  39860. // error from Do is the result of In-None-Match.
  39861. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  39862. c.ifNoneMatch_ = entityTag
  39863. return c
  39864. }
  39865. // Context sets the context to be used in this call's Do method. Any
  39866. // pending HTTP request will be aborted if the provided context is
  39867. // canceled.
  39868. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  39869. c.ctx_ = ctx
  39870. return c
  39871. }
  39872. // Header returns an http.Header that can be modified by the caller to
  39873. // add HTTP headers to the request.
  39874. func (c *BackendBucketsListCall) Header() http.Header {
  39875. if c.header_ == nil {
  39876. c.header_ = make(http.Header)
  39877. }
  39878. return c.header_
  39879. }
  39880. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  39881. reqHeaders := make(http.Header)
  39882. for k, v := range c.header_ {
  39883. reqHeaders[k] = v
  39884. }
  39885. reqHeaders.Set("User-Agent", c.s.userAgent())
  39886. if c.ifNoneMatch_ != "" {
  39887. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39888. }
  39889. var body io.Reader = nil
  39890. c.urlParams_.Set("alt", alt)
  39891. c.urlParams_.Set("prettyPrint", "false")
  39892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  39893. urls += "?" + c.urlParams_.Encode()
  39894. req, err := http.NewRequest("GET", urls, body)
  39895. if err != nil {
  39896. return nil, err
  39897. }
  39898. req.Header = reqHeaders
  39899. googleapi.Expand(req.URL, map[string]string{
  39900. "project": c.project,
  39901. })
  39902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39903. }
  39904. // Do executes the "compute.backendBuckets.list" call.
  39905. // Exactly one of *BackendBucketList or error will be non-nil. Any
  39906. // non-2xx status code is an error. Response headers are in either
  39907. // *BackendBucketList.ServerResponse.Header or (if a response was
  39908. // returned at all) in error.(*googleapi.Error).Header. Use
  39909. // googleapi.IsNotModified to check whether the returned error was
  39910. // because http.StatusNotModified was returned.
  39911. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  39912. gensupport.SetOptions(c.urlParams_, opts...)
  39913. res, err := c.doRequest("json")
  39914. if res != nil && res.StatusCode == http.StatusNotModified {
  39915. if res.Body != nil {
  39916. res.Body.Close()
  39917. }
  39918. return nil, &googleapi.Error{
  39919. Code: res.StatusCode,
  39920. Header: res.Header,
  39921. }
  39922. }
  39923. if err != nil {
  39924. return nil, err
  39925. }
  39926. defer googleapi.CloseBody(res)
  39927. if err := googleapi.CheckResponse(res); err != nil {
  39928. return nil, err
  39929. }
  39930. ret := &BackendBucketList{
  39931. ServerResponse: googleapi.ServerResponse{
  39932. Header: res.Header,
  39933. HTTPStatusCode: res.StatusCode,
  39934. },
  39935. }
  39936. target := &ret
  39937. if err := gensupport.DecodeResponse(target, res); err != nil {
  39938. return nil, err
  39939. }
  39940. return ret, nil
  39941. // {
  39942. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  39943. // "httpMethod": "GET",
  39944. // "id": "compute.backendBuckets.list",
  39945. // "parameterOrder": [
  39946. // "project"
  39947. // ],
  39948. // "parameters": {
  39949. // "filter": {
  39950. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39951. // "location": "query",
  39952. // "type": "string"
  39953. // },
  39954. // "maxResults": {
  39955. // "default": "500",
  39956. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39957. // "format": "uint32",
  39958. // "location": "query",
  39959. // "minimum": "0",
  39960. // "type": "integer"
  39961. // },
  39962. // "orderBy": {
  39963. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39964. // "location": "query",
  39965. // "type": "string"
  39966. // },
  39967. // "pageToken": {
  39968. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39969. // "location": "query",
  39970. // "type": "string"
  39971. // },
  39972. // "project": {
  39973. // "description": "Project ID for this request.",
  39974. // "location": "path",
  39975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39976. // "required": true,
  39977. // "type": "string"
  39978. // }
  39979. // },
  39980. // "path": "{project}/global/backendBuckets",
  39981. // "response": {
  39982. // "$ref": "BackendBucketList"
  39983. // },
  39984. // "scopes": [
  39985. // "https://www.googleapis.com/auth/cloud-platform",
  39986. // "https://www.googleapis.com/auth/compute",
  39987. // "https://www.googleapis.com/auth/compute.readonly"
  39988. // ]
  39989. // }
  39990. }
  39991. // Pages invokes f for each page of results.
  39992. // A non-nil error returned from f will halt the iteration.
  39993. // The provided context supersedes any context provided to the Context method.
  39994. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  39995. c.ctx_ = ctx
  39996. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39997. for {
  39998. x, err := c.Do()
  39999. if err != nil {
  40000. return err
  40001. }
  40002. if err := f(x); err != nil {
  40003. return err
  40004. }
  40005. if x.NextPageToken == "" {
  40006. return nil
  40007. }
  40008. c.PageToken(x.NextPageToken)
  40009. }
  40010. }
  40011. // method id "compute.backendBuckets.patch":
  40012. type BackendBucketsPatchCall struct {
  40013. s *Service
  40014. project string
  40015. backendBucket string
  40016. backendbucket *BackendBucket
  40017. urlParams_ gensupport.URLParams
  40018. ctx_ context.Context
  40019. header_ http.Header
  40020. }
  40021. // Patch: Updates the specified BackendBucket resource with the data
  40022. // included in the request. This method supports PATCH semantics and
  40023. // uses the JSON merge patch format and processing rules.
  40024. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  40025. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40026. c.project = project
  40027. c.backendBucket = backendBucket
  40028. c.backendbucket = backendbucket
  40029. return c
  40030. }
  40031. // RequestId sets the optional parameter "requestId": An optional
  40032. // request ID to identify requests. Specify a unique request ID so that
  40033. // if you must retry your request, the server will know to ignore the
  40034. // request if it has already been completed.
  40035. //
  40036. // For example, consider a situation where you make an initial request
  40037. // and the request times out. If you make the request again with the
  40038. // same request ID, the server can check if original operation with the
  40039. // same request ID was received, and if so, will ignore the second
  40040. // request. This prevents clients from accidentally creating duplicate
  40041. // commitments.
  40042. //
  40043. // The request ID must be a valid UUID with the exception that zero UUID
  40044. // is not supported (00000000-0000-0000-0000-000000000000).
  40045. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  40046. c.urlParams_.Set("requestId", requestId)
  40047. return c
  40048. }
  40049. // Fields allows partial responses to be retrieved. See
  40050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40051. // for more information.
  40052. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  40053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40054. return c
  40055. }
  40056. // Context sets the context to be used in this call's Do method. Any
  40057. // pending HTTP request will be aborted if the provided context is
  40058. // canceled.
  40059. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  40060. c.ctx_ = ctx
  40061. return c
  40062. }
  40063. // Header returns an http.Header that can be modified by the caller to
  40064. // add HTTP headers to the request.
  40065. func (c *BackendBucketsPatchCall) Header() http.Header {
  40066. if c.header_ == nil {
  40067. c.header_ = make(http.Header)
  40068. }
  40069. return c.header_
  40070. }
  40071. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  40072. reqHeaders := make(http.Header)
  40073. for k, v := range c.header_ {
  40074. reqHeaders[k] = v
  40075. }
  40076. reqHeaders.Set("User-Agent", c.s.userAgent())
  40077. var body io.Reader = nil
  40078. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  40079. if err != nil {
  40080. return nil, err
  40081. }
  40082. reqHeaders.Set("Content-Type", "application/json")
  40083. c.urlParams_.Set("alt", alt)
  40084. c.urlParams_.Set("prettyPrint", "false")
  40085. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  40086. urls += "?" + c.urlParams_.Encode()
  40087. req, err := http.NewRequest("PATCH", urls, body)
  40088. if err != nil {
  40089. return nil, err
  40090. }
  40091. req.Header = reqHeaders
  40092. googleapi.Expand(req.URL, map[string]string{
  40093. "project": c.project,
  40094. "backendBucket": c.backendBucket,
  40095. })
  40096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40097. }
  40098. // Do executes the "compute.backendBuckets.patch" call.
  40099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40100. // status code is an error. Response headers are in either
  40101. // *Operation.ServerResponse.Header or (if a response was returned at
  40102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40103. // to check whether the returned error was because
  40104. // http.StatusNotModified was returned.
  40105. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40106. gensupport.SetOptions(c.urlParams_, opts...)
  40107. res, err := c.doRequest("json")
  40108. if res != nil && res.StatusCode == http.StatusNotModified {
  40109. if res.Body != nil {
  40110. res.Body.Close()
  40111. }
  40112. return nil, &googleapi.Error{
  40113. Code: res.StatusCode,
  40114. Header: res.Header,
  40115. }
  40116. }
  40117. if err != nil {
  40118. return nil, err
  40119. }
  40120. defer googleapi.CloseBody(res)
  40121. if err := googleapi.CheckResponse(res); err != nil {
  40122. return nil, err
  40123. }
  40124. ret := &Operation{
  40125. ServerResponse: googleapi.ServerResponse{
  40126. Header: res.Header,
  40127. HTTPStatusCode: res.StatusCode,
  40128. },
  40129. }
  40130. target := &ret
  40131. if err := gensupport.DecodeResponse(target, res); err != nil {
  40132. return nil, err
  40133. }
  40134. return ret, nil
  40135. // {
  40136. // "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.",
  40137. // "httpMethod": "PATCH",
  40138. // "id": "compute.backendBuckets.patch",
  40139. // "parameterOrder": [
  40140. // "project",
  40141. // "backendBucket"
  40142. // ],
  40143. // "parameters": {
  40144. // "backendBucket": {
  40145. // "description": "Name of the BackendBucket resource to patch.",
  40146. // "location": "path",
  40147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40148. // "required": true,
  40149. // "type": "string"
  40150. // },
  40151. // "project": {
  40152. // "description": "Project ID for this request.",
  40153. // "location": "path",
  40154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40155. // "required": true,
  40156. // "type": "string"
  40157. // },
  40158. // "requestId": {
  40159. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40160. // "location": "query",
  40161. // "type": "string"
  40162. // }
  40163. // },
  40164. // "path": "{project}/global/backendBuckets/{backendBucket}",
  40165. // "request": {
  40166. // "$ref": "BackendBucket"
  40167. // },
  40168. // "response": {
  40169. // "$ref": "Operation"
  40170. // },
  40171. // "scopes": [
  40172. // "https://www.googleapis.com/auth/cloud-platform",
  40173. // "https://www.googleapis.com/auth/compute"
  40174. // ]
  40175. // }
  40176. }
  40177. // method id "compute.backendBuckets.setIamPolicy":
  40178. type BackendBucketsSetIamPolicyCall struct {
  40179. s *Service
  40180. project string
  40181. resource string
  40182. globalsetpolicyrequest *GlobalSetPolicyRequest
  40183. urlParams_ gensupport.URLParams
  40184. ctx_ context.Context
  40185. header_ http.Header
  40186. }
  40187. // SetIamPolicy: Sets the access control policy on the specified
  40188. // resource. Replaces any existing policy.
  40189. func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
  40190. c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40191. c.project = project
  40192. c.resource = resource
  40193. c.globalsetpolicyrequest = globalsetpolicyrequest
  40194. return c
  40195. }
  40196. // Fields allows partial responses to be retrieved. See
  40197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40198. // for more information.
  40199. func (c *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
  40200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40201. return c
  40202. }
  40203. // Context sets the context to be used in this call's Do method. Any
  40204. // pending HTTP request will be aborted if the provided context is
  40205. // canceled.
  40206. func (c *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
  40207. c.ctx_ = ctx
  40208. return c
  40209. }
  40210. // Header returns an http.Header that can be modified by the caller to
  40211. // add HTTP headers to the request.
  40212. func (c *BackendBucketsSetIamPolicyCall) Header() http.Header {
  40213. if c.header_ == nil {
  40214. c.header_ = make(http.Header)
  40215. }
  40216. return c.header_
  40217. }
  40218. func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  40219. reqHeaders := make(http.Header)
  40220. for k, v := range c.header_ {
  40221. reqHeaders[k] = v
  40222. }
  40223. reqHeaders.Set("User-Agent", c.s.userAgent())
  40224. var body io.Reader = nil
  40225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  40226. if err != nil {
  40227. return nil, err
  40228. }
  40229. reqHeaders.Set("Content-Type", "application/json")
  40230. c.urlParams_.Set("alt", alt)
  40231. c.urlParams_.Set("prettyPrint", "false")
  40232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/setIamPolicy")
  40233. urls += "?" + c.urlParams_.Encode()
  40234. req, err := http.NewRequest("POST", urls, body)
  40235. if err != nil {
  40236. return nil, err
  40237. }
  40238. req.Header = reqHeaders
  40239. googleapi.Expand(req.URL, map[string]string{
  40240. "project": c.project,
  40241. "resource": c.resource,
  40242. })
  40243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40244. }
  40245. // Do executes the "compute.backendBuckets.setIamPolicy" call.
  40246. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40247. // code is an error. Response headers are in either
  40248. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40249. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40250. // check whether the returned error was because http.StatusNotModified
  40251. // was returned.
  40252. func (c *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40253. gensupport.SetOptions(c.urlParams_, opts...)
  40254. res, err := c.doRequest("json")
  40255. if res != nil && res.StatusCode == http.StatusNotModified {
  40256. if res.Body != nil {
  40257. res.Body.Close()
  40258. }
  40259. return nil, &googleapi.Error{
  40260. Code: res.StatusCode,
  40261. Header: res.Header,
  40262. }
  40263. }
  40264. if err != nil {
  40265. return nil, err
  40266. }
  40267. defer googleapi.CloseBody(res)
  40268. if err := googleapi.CheckResponse(res); err != nil {
  40269. return nil, err
  40270. }
  40271. ret := &Policy{
  40272. ServerResponse: googleapi.ServerResponse{
  40273. Header: res.Header,
  40274. HTTPStatusCode: res.StatusCode,
  40275. },
  40276. }
  40277. target := &ret
  40278. if err := gensupport.DecodeResponse(target, res); err != nil {
  40279. return nil, err
  40280. }
  40281. return ret, nil
  40282. // {
  40283. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  40284. // "httpMethod": "POST",
  40285. // "id": "compute.backendBuckets.setIamPolicy",
  40286. // "parameterOrder": [
  40287. // "project",
  40288. // "resource"
  40289. // ],
  40290. // "parameters": {
  40291. // "project": {
  40292. // "description": "Project ID for this request.",
  40293. // "location": "path",
  40294. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40295. // "required": true,
  40296. // "type": "string"
  40297. // },
  40298. // "resource": {
  40299. // "description": "Name or id of the resource for this request.",
  40300. // "location": "path",
  40301. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40302. // "required": true,
  40303. // "type": "string"
  40304. // }
  40305. // },
  40306. // "path": "{project}/global/backendBuckets/{resource}/setIamPolicy",
  40307. // "request": {
  40308. // "$ref": "GlobalSetPolicyRequest"
  40309. // },
  40310. // "response": {
  40311. // "$ref": "Policy"
  40312. // },
  40313. // "scopes": [
  40314. // "https://www.googleapis.com/auth/cloud-platform",
  40315. // "https://www.googleapis.com/auth/compute"
  40316. // ]
  40317. // }
  40318. }
  40319. // method id "compute.backendBuckets.testIamPermissions":
  40320. type BackendBucketsTestIamPermissionsCall struct {
  40321. s *Service
  40322. project string
  40323. resource string
  40324. testpermissionsrequest *TestPermissionsRequest
  40325. urlParams_ gensupport.URLParams
  40326. ctx_ context.Context
  40327. header_ http.Header
  40328. }
  40329. // TestIamPermissions: Returns permissions that a caller has on the
  40330. // specified resource.
  40331. func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
  40332. c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40333. c.project = project
  40334. c.resource = resource
  40335. c.testpermissionsrequest = testpermissionsrequest
  40336. return c
  40337. }
  40338. // Fields allows partial responses to be retrieved. See
  40339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40340. // for more information.
  40341. func (c *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
  40342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40343. return c
  40344. }
  40345. // Context sets the context to be used in this call's Do method. Any
  40346. // pending HTTP request will be aborted if the provided context is
  40347. // canceled.
  40348. func (c *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
  40349. c.ctx_ = ctx
  40350. return c
  40351. }
  40352. // Header returns an http.Header that can be modified by the caller to
  40353. // add HTTP headers to the request.
  40354. func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header {
  40355. if c.header_ == nil {
  40356. c.header_ = make(http.Header)
  40357. }
  40358. return c.header_
  40359. }
  40360. func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  40361. reqHeaders := make(http.Header)
  40362. for k, v := range c.header_ {
  40363. reqHeaders[k] = v
  40364. }
  40365. reqHeaders.Set("User-Agent", c.s.userAgent())
  40366. var body io.Reader = nil
  40367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  40368. if err != nil {
  40369. return nil, err
  40370. }
  40371. reqHeaders.Set("Content-Type", "application/json")
  40372. c.urlParams_.Set("alt", alt)
  40373. c.urlParams_.Set("prettyPrint", "false")
  40374. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/testIamPermissions")
  40375. urls += "?" + c.urlParams_.Encode()
  40376. req, err := http.NewRequest("POST", urls, body)
  40377. if err != nil {
  40378. return nil, err
  40379. }
  40380. req.Header = reqHeaders
  40381. googleapi.Expand(req.URL, map[string]string{
  40382. "project": c.project,
  40383. "resource": c.resource,
  40384. })
  40385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40386. }
  40387. // Do executes the "compute.backendBuckets.testIamPermissions" call.
  40388. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  40389. // non-2xx status code is an error. Response headers are in either
  40390. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  40391. // returned at all) in error.(*googleapi.Error).Header. Use
  40392. // googleapi.IsNotModified to check whether the returned error was
  40393. // because http.StatusNotModified was returned.
  40394. func (c *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  40395. gensupport.SetOptions(c.urlParams_, opts...)
  40396. res, err := c.doRequest("json")
  40397. if res != nil && res.StatusCode == http.StatusNotModified {
  40398. if res.Body != nil {
  40399. res.Body.Close()
  40400. }
  40401. return nil, &googleapi.Error{
  40402. Code: res.StatusCode,
  40403. Header: res.Header,
  40404. }
  40405. }
  40406. if err != nil {
  40407. return nil, err
  40408. }
  40409. defer googleapi.CloseBody(res)
  40410. if err := googleapi.CheckResponse(res); err != nil {
  40411. return nil, err
  40412. }
  40413. ret := &TestPermissionsResponse{
  40414. ServerResponse: googleapi.ServerResponse{
  40415. Header: res.Header,
  40416. HTTPStatusCode: res.StatusCode,
  40417. },
  40418. }
  40419. target := &ret
  40420. if err := gensupport.DecodeResponse(target, res); err != nil {
  40421. return nil, err
  40422. }
  40423. return ret, nil
  40424. // {
  40425. // "description": "Returns permissions that a caller has on the specified resource.",
  40426. // "httpMethod": "POST",
  40427. // "id": "compute.backendBuckets.testIamPermissions",
  40428. // "parameterOrder": [
  40429. // "project",
  40430. // "resource"
  40431. // ],
  40432. // "parameters": {
  40433. // "project": {
  40434. // "description": "Project ID for this request.",
  40435. // "location": "path",
  40436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40437. // "required": true,
  40438. // "type": "string"
  40439. // },
  40440. // "resource": {
  40441. // "description": "Name or id of the resource for this request.",
  40442. // "location": "path",
  40443. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40444. // "required": true,
  40445. // "type": "string"
  40446. // }
  40447. // },
  40448. // "path": "{project}/global/backendBuckets/{resource}/testIamPermissions",
  40449. // "request": {
  40450. // "$ref": "TestPermissionsRequest"
  40451. // },
  40452. // "response": {
  40453. // "$ref": "TestPermissionsResponse"
  40454. // },
  40455. // "scopes": [
  40456. // "https://www.googleapis.com/auth/cloud-platform",
  40457. // "https://www.googleapis.com/auth/compute",
  40458. // "https://www.googleapis.com/auth/compute.readonly"
  40459. // ]
  40460. // }
  40461. }
  40462. // method id "compute.backendBuckets.update":
  40463. type BackendBucketsUpdateCall struct {
  40464. s *Service
  40465. project string
  40466. backendBucket string
  40467. backendbucket *BackendBucket
  40468. urlParams_ gensupport.URLParams
  40469. ctx_ context.Context
  40470. header_ http.Header
  40471. }
  40472. // Update: Updates the specified BackendBucket resource with the data
  40473. // included in the request.
  40474. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  40475. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40476. c.project = project
  40477. c.backendBucket = backendBucket
  40478. c.backendbucket = backendbucket
  40479. return c
  40480. }
  40481. // RequestId sets the optional parameter "requestId": An optional
  40482. // request ID to identify requests. Specify a unique request ID so that
  40483. // if you must retry your request, the server will know to ignore the
  40484. // request if it has already been completed.
  40485. //
  40486. // For example, consider a situation where you make an initial request
  40487. // and the request times out. If you make the request again with the
  40488. // same request ID, the server can check if original operation with the
  40489. // same request ID was received, and if so, will ignore the second
  40490. // request. This prevents clients from accidentally creating duplicate
  40491. // commitments.
  40492. //
  40493. // The request ID must be a valid UUID with the exception that zero UUID
  40494. // is not supported (00000000-0000-0000-0000-000000000000).
  40495. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  40496. c.urlParams_.Set("requestId", requestId)
  40497. return c
  40498. }
  40499. // Fields allows partial responses to be retrieved. See
  40500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40501. // for more information.
  40502. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  40503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40504. return c
  40505. }
  40506. // Context sets the context to be used in this call's Do method. Any
  40507. // pending HTTP request will be aborted if the provided context is
  40508. // canceled.
  40509. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  40510. c.ctx_ = ctx
  40511. return c
  40512. }
  40513. // Header returns an http.Header that can be modified by the caller to
  40514. // add HTTP headers to the request.
  40515. func (c *BackendBucketsUpdateCall) Header() http.Header {
  40516. if c.header_ == nil {
  40517. c.header_ = make(http.Header)
  40518. }
  40519. return c.header_
  40520. }
  40521. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  40522. reqHeaders := make(http.Header)
  40523. for k, v := range c.header_ {
  40524. reqHeaders[k] = v
  40525. }
  40526. reqHeaders.Set("User-Agent", c.s.userAgent())
  40527. var body io.Reader = nil
  40528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  40529. if err != nil {
  40530. return nil, err
  40531. }
  40532. reqHeaders.Set("Content-Type", "application/json")
  40533. c.urlParams_.Set("alt", alt)
  40534. c.urlParams_.Set("prettyPrint", "false")
  40535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  40536. urls += "?" + c.urlParams_.Encode()
  40537. req, err := http.NewRequest("PUT", urls, body)
  40538. if err != nil {
  40539. return nil, err
  40540. }
  40541. req.Header = reqHeaders
  40542. googleapi.Expand(req.URL, map[string]string{
  40543. "project": c.project,
  40544. "backendBucket": c.backendBucket,
  40545. })
  40546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40547. }
  40548. // Do executes the "compute.backendBuckets.update" call.
  40549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40550. // status code is an error. Response headers are in either
  40551. // *Operation.ServerResponse.Header or (if a response was returned at
  40552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40553. // to check whether the returned error was because
  40554. // http.StatusNotModified was returned.
  40555. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40556. gensupport.SetOptions(c.urlParams_, opts...)
  40557. res, err := c.doRequest("json")
  40558. if res != nil && res.StatusCode == http.StatusNotModified {
  40559. if res.Body != nil {
  40560. res.Body.Close()
  40561. }
  40562. return nil, &googleapi.Error{
  40563. Code: res.StatusCode,
  40564. Header: res.Header,
  40565. }
  40566. }
  40567. if err != nil {
  40568. return nil, err
  40569. }
  40570. defer googleapi.CloseBody(res)
  40571. if err := googleapi.CheckResponse(res); err != nil {
  40572. return nil, err
  40573. }
  40574. ret := &Operation{
  40575. ServerResponse: googleapi.ServerResponse{
  40576. Header: res.Header,
  40577. HTTPStatusCode: res.StatusCode,
  40578. },
  40579. }
  40580. target := &ret
  40581. if err := gensupport.DecodeResponse(target, res); err != nil {
  40582. return nil, err
  40583. }
  40584. return ret, nil
  40585. // {
  40586. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  40587. // "httpMethod": "PUT",
  40588. // "id": "compute.backendBuckets.update",
  40589. // "parameterOrder": [
  40590. // "project",
  40591. // "backendBucket"
  40592. // ],
  40593. // "parameters": {
  40594. // "backendBucket": {
  40595. // "description": "Name of the BackendBucket resource to update.",
  40596. // "location": "path",
  40597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40598. // "required": true,
  40599. // "type": "string"
  40600. // },
  40601. // "project": {
  40602. // "description": "Project ID for this request.",
  40603. // "location": "path",
  40604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40605. // "required": true,
  40606. // "type": "string"
  40607. // },
  40608. // "requestId": {
  40609. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40610. // "location": "query",
  40611. // "type": "string"
  40612. // }
  40613. // },
  40614. // "path": "{project}/global/backendBuckets/{backendBucket}",
  40615. // "request": {
  40616. // "$ref": "BackendBucket"
  40617. // },
  40618. // "response": {
  40619. // "$ref": "Operation"
  40620. // },
  40621. // "scopes": [
  40622. // "https://www.googleapis.com/auth/cloud-platform",
  40623. // "https://www.googleapis.com/auth/compute"
  40624. // ]
  40625. // }
  40626. }
  40627. // method id "compute.backendServices.addSignedUrlKey":
  40628. type BackendServicesAddSignedUrlKeyCall struct {
  40629. s *Service
  40630. project string
  40631. backendService string
  40632. signedurlkey *SignedUrlKey
  40633. urlParams_ gensupport.URLParams
  40634. ctx_ context.Context
  40635. header_ http.Header
  40636. }
  40637. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  40638. // for this backend service.
  40639. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  40640. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40641. c.project = project
  40642. c.backendService = backendService
  40643. c.signedurlkey = signedurlkey
  40644. return c
  40645. }
  40646. // RequestId sets the optional parameter "requestId": An optional
  40647. // request ID to identify requests. Specify a unique request ID so that
  40648. // if you must retry your request, the server will know to ignore the
  40649. // request if it has already been completed.
  40650. //
  40651. // For example, consider a situation where you make an initial request
  40652. // and the request times out. If you make the request again with the
  40653. // same request ID, the server can check if original operation with the
  40654. // same request ID was received, and if so, will ignore the second
  40655. // request. This prevents clients from accidentally creating duplicate
  40656. // commitments.
  40657. //
  40658. // The request ID must be a valid UUID with the exception that zero UUID
  40659. // is not supported (00000000-0000-0000-0000-000000000000).
  40660. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  40661. c.urlParams_.Set("requestId", requestId)
  40662. return c
  40663. }
  40664. // Fields allows partial responses to be retrieved. See
  40665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40666. // for more information.
  40667. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  40668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40669. return c
  40670. }
  40671. // Context sets the context to be used in this call's Do method. Any
  40672. // pending HTTP request will be aborted if the provided context is
  40673. // canceled.
  40674. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  40675. c.ctx_ = ctx
  40676. return c
  40677. }
  40678. // Header returns an http.Header that can be modified by the caller to
  40679. // add HTTP headers to the request.
  40680. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  40681. if c.header_ == nil {
  40682. c.header_ = make(http.Header)
  40683. }
  40684. return c.header_
  40685. }
  40686. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  40687. reqHeaders := make(http.Header)
  40688. for k, v := range c.header_ {
  40689. reqHeaders[k] = v
  40690. }
  40691. reqHeaders.Set("User-Agent", c.s.userAgent())
  40692. var body io.Reader = nil
  40693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  40694. if err != nil {
  40695. return nil, err
  40696. }
  40697. reqHeaders.Set("Content-Type", "application/json")
  40698. c.urlParams_.Set("alt", alt)
  40699. c.urlParams_.Set("prettyPrint", "false")
  40700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  40701. urls += "?" + c.urlParams_.Encode()
  40702. req, err := http.NewRequest("POST", urls, body)
  40703. if err != nil {
  40704. return nil, err
  40705. }
  40706. req.Header = reqHeaders
  40707. googleapi.Expand(req.URL, map[string]string{
  40708. "project": c.project,
  40709. "backendService": c.backendService,
  40710. })
  40711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40712. }
  40713. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  40714. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40715. // status code is an error. Response headers are in either
  40716. // *Operation.ServerResponse.Header or (if a response was returned at
  40717. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40718. // to check whether the returned error was because
  40719. // http.StatusNotModified was returned.
  40720. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40721. gensupport.SetOptions(c.urlParams_, opts...)
  40722. res, err := c.doRequest("json")
  40723. if res != nil && res.StatusCode == http.StatusNotModified {
  40724. if res.Body != nil {
  40725. res.Body.Close()
  40726. }
  40727. return nil, &googleapi.Error{
  40728. Code: res.StatusCode,
  40729. Header: res.Header,
  40730. }
  40731. }
  40732. if err != nil {
  40733. return nil, err
  40734. }
  40735. defer googleapi.CloseBody(res)
  40736. if err := googleapi.CheckResponse(res); err != nil {
  40737. return nil, err
  40738. }
  40739. ret := &Operation{
  40740. ServerResponse: googleapi.ServerResponse{
  40741. Header: res.Header,
  40742. HTTPStatusCode: res.StatusCode,
  40743. },
  40744. }
  40745. target := &ret
  40746. if err := gensupport.DecodeResponse(target, res); err != nil {
  40747. return nil, err
  40748. }
  40749. return ret, nil
  40750. // {
  40751. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  40752. // "httpMethod": "POST",
  40753. // "id": "compute.backendServices.addSignedUrlKey",
  40754. // "parameterOrder": [
  40755. // "project",
  40756. // "backendService"
  40757. // ],
  40758. // "parameters": {
  40759. // "backendService": {
  40760. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  40761. // "location": "path",
  40762. // "required": true,
  40763. // "type": "string"
  40764. // },
  40765. // "project": {
  40766. // "description": "Project ID for this request.",
  40767. // "location": "path",
  40768. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40769. // "required": true,
  40770. // "type": "string"
  40771. // },
  40772. // "requestId": {
  40773. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40774. // "location": "query",
  40775. // "type": "string"
  40776. // }
  40777. // },
  40778. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  40779. // "request": {
  40780. // "$ref": "SignedUrlKey"
  40781. // },
  40782. // "response": {
  40783. // "$ref": "Operation"
  40784. // },
  40785. // "scopes": [
  40786. // "https://www.googleapis.com/auth/cloud-platform",
  40787. // "https://www.googleapis.com/auth/compute"
  40788. // ]
  40789. // }
  40790. }
  40791. // method id "compute.backendServices.aggregatedList":
  40792. type BackendServicesAggregatedListCall struct {
  40793. s *Service
  40794. project string
  40795. urlParams_ gensupport.URLParams
  40796. ifNoneMatch_ string
  40797. ctx_ context.Context
  40798. header_ http.Header
  40799. }
  40800. // AggregatedList: Retrieves the list of all BackendService resources,
  40801. // regional and global, available to the specified project.
  40802. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  40803. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40804. c.project = project
  40805. return c
  40806. }
  40807. // Filter sets the optional parameter "filter": A filter expression that
  40808. // filters resources listed in the response. The expression must specify
  40809. // the field name, a comparison operator, and the value that you want to
  40810. // use for filtering. The value must be a string, a number, or a
  40811. // boolean. The comparison operator must be either =, !=, >, or <.
  40812. //
  40813. // For example, if you are filtering Compute Engine instances, you can
  40814. // exclude instances named example-instance by specifying name !=
  40815. // example-instance.
  40816. //
  40817. // You can also filter nested fields. For example, you could specify
  40818. // scheduling.automaticRestart = false to include instances only if they
  40819. // are not scheduled for automatic restarts. You can use filtering on
  40820. // nested fields to filter based on resource labels.
  40821. //
  40822. // To filter on multiple expressions, provide each separate expression
  40823. // within parentheses. For example, (scheduling.automaticRestart = true)
  40824. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40825. // AND expression. However, you can include AND and OR expressions
  40826. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40827. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40828. // true).
  40829. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  40830. c.urlParams_.Set("filter", filter)
  40831. return c
  40832. }
  40833. // MaxResults sets the optional parameter "maxResults": The maximum
  40834. // number of results per page that should be returned. If the number of
  40835. // available results is larger than maxResults, Compute Engine returns a
  40836. // nextPageToken that can be used to get the next page of results in
  40837. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40838. // (Default: 500)
  40839. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  40840. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40841. return c
  40842. }
  40843. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40844. // a certain order. By default, results are returned in alphanumerical
  40845. // order based on the resource name.
  40846. //
  40847. // You can also sort results in descending order based on the creation
  40848. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40849. // based on the creationTimestamp field in reverse chronological order
  40850. // (newest result first). Use this to sort resources like operations so
  40851. // that the newest operation is returned first.
  40852. //
  40853. // Currently, only sorting by name or creationTimestamp desc is
  40854. // supported.
  40855. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  40856. c.urlParams_.Set("orderBy", orderBy)
  40857. return c
  40858. }
  40859. // PageToken sets the optional parameter "pageToken": Specifies a page
  40860. // token to use. Set pageToken to the nextPageToken returned by a
  40861. // previous list request to get the next page of results.
  40862. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  40863. c.urlParams_.Set("pageToken", pageToken)
  40864. return c
  40865. }
  40866. // Fields allows partial responses to be retrieved. See
  40867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40868. // for more information.
  40869. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  40870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40871. return c
  40872. }
  40873. // IfNoneMatch sets the optional parameter which makes the operation
  40874. // fail if the object's ETag matches the given value. This is useful for
  40875. // getting updates only after the object has changed since the last
  40876. // request. Use googleapi.IsNotModified to check whether the response
  40877. // error from Do is the result of In-None-Match.
  40878. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  40879. c.ifNoneMatch_ = entityTag
  40880. return c
  40881. }
  40882. // Context sets the context to be used in this call's Do method. Any
  40883. // pending HTTP request will be aborted if the provided context is
  40884. // canceled.
  40885. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  40886. c.ctx_ = ctx
  40887. return c
  40888. }
  40889. // Header returns an http.Header that can be modified by the caller to
  40890. // add HTTP headers to the request.
  40891. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  40892. if c.header_ == nil {
  40893. c.header_ = make(http.Header)
  40894. }
  40895. return c.header_
  40896. }
  40897. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  40898. reqHeaders := make(http.Header)
  40899. for k, v := range c.header_ {
  40900. reqHeaders[k] = v
  40901. }
  40902. reqHeaders.Set("User-Agent", c.s.userAgent())
  40903. if c.ifNoneMatch_ != "" {
  40904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40905. }
  40906. var body io.Reader = nil
  40907. c.urlParams_.Set("alt", alt)
  40908. c.urlParams_.Set("prettyPrint", "false")
  40909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  40910. urls += "?" + c.urlParams_.Encode()
  40911. req, err := http.NewRequest("GET", urls, body)
  40912. if err != nil {
  40913. return nil, err
  40914. }
  40915. req.Header = reqHeaders
  40916. googleapi.Expand(req.URL, map[string]string{
  40917. "project": c.project,
  40918. })
  40919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40920. }
  40921. // Do executes the "compute.backendServices.aggregatedList" call.
  40922. // Exactly one of *BackendServiceAggregatedList or error will be
  40923. // non-nil. Any non-2xx status code is an error. Response headers are in
  40924. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  40925. // response was returned at all) in error.(*googleapi.Error).Header. Use
  40926. // googleapi.IsNotModified to check whether the returned error was
  40927. // because http.StatusNotModified was returned.
  40928. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  40929. gensupport.SetOptions(c.urlParams_, opts...)
  40930. res, err := c.doRequest("json")
  40931. if res != nil && res.StatusCode == http.StatusNotModified {
  40932. if res.Body != nil {
  40933. res.Body.Close()
  40934. }
  40935. return nil, &googleapi.Error{
  40936. Code: res.StatusCode,
  40937. Header: res.Header,
  40938. }
  40939. }
  40940. if err != nil {
  40941. return nil, err
  40942. }
  40943. defer googleapi.CloseBody(res)
  40944. if err := googleapi.CheckResponse(res); err != nil {
  40945. return nil, err
  40946. }
  40947. ret := &BackendServiceAggregatedList{
  40948. ServerResponse: googleapi.ServerResponse{
  40949. Header: res.Header,
  40950. HTTPStatusCode: res.StatusCode,
  40951. },
  40952. }
  40953. target := &ret
  40954. if err := gensupport.DecodeResponse(target, res); err != nil {
  40955. return nil, err
  40956. }
  40957. return ret, nil
  40958. // {
  40959. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  40960. // "httpMethod": "GET",
  40961. // "id": "compute.backendServices.aggregatedList",
  40962. // "parameterOrder": [
  40963. // "project"
  40964. // ],
  40965. // "parameters": {
  40966. // "filter": {
  40967. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40968. // "location": "query",
  40969. // "type": "string"
  40970. // },
  40971. // "maxResults": {
  40972. // "default": "500",
  40973. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40974. // "format": "uint32",
  40975. // "location": "query",
  40976. // "minimum": "0",
  40977. // "type": "integer"
  40978. // },
  40979. // "orderBy": {
  40980. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40981. // "location": "query",
  40982. // "type": "string"
  40983. // },
  40984. // "pageToken": {
  40985. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40986. // "location": "query",
  40987. // "type": "string"
  40988. // },
  40989. // "project": {
  40990. // "description": "Name of the project scoping this request.",
  40991. // "location": "path",
  40992. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40993. // "required": true,
  40994. // "type": "string"
  40995. // }
  40996. // },
  40997. // "path": "{project}/aggregated/backendServices",
  40998. // "response": {
  40999. // "$ref": "BackendServiceAggregatedList"
  41000. // },
  41001. // "scopes": [
  41002. // "https://www.googleapis.com/auth/cloud-platform",
  41003. // "https://www.googleapis.com/auth/compute",
  41004. // "https://www.googleapis.com/auth/compute.readonly"
  41005. // ]
  41006. // }
  41007. }
  41008. // Pages invokes f for each page of results.
  41009. // A non-nil error returned from f will halt the iteration.
  41010. // The provided context supersedes any context provided to the Context method.
  41011. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  41012. c.ctx_ = ctx
  41013. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41014. for {
  41015. x, err := c.Do()
  41016. if err != nil {
  41017. return err
  41018. }
  41019. if err := f(x); err != nil {
  41020. return err
  41021. }
  41022. if x.NextPageToken == "" {
  41023. return nil
  41024. }
  41025. c.PageToken(x.NextPageToken)
  41026. }
  41027. }
  41028. // method id "compute.backendServices.delete":
  41029. type BackendServicesDeleteCall struct {
  41030. s *Service
  41031. project string
  41032. backendService string
  41033. urlParams_ gensupport.URLParams
  41034. ctx_ context.Context
  41035. header_ http.Header
  41036. }
  41037. // Delete: Deletes the specified BackendService resource.
  41038. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  41039. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  41040. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41041. c.project = project
  41042. c.backendService = backendService
  41043. return c
  41044. }
  41045. // RequestId sets the optional parameter "requestId": An optional
  41046. // request ID to identify requests. Specify a unique request ID so that
  41047. // if you must retry your request, the server will know to ignore the
  41048. // request if it has already been completed.
  41049. //
  41050. // For example, consider a situation where you make an initial request
  41051. // and the request times out. If you make the request again with the
  41052. // same request ID, the server can check if original operation with the
  41053. // same request ID was received, and if so, will ignore the second
  41054. // request. This prevents clients from accidentally creating duplicate
  41055. // commitments.
  41056. //
  41057. // The request ID must be a valid UUID with the exception that zero UUID
  41058. // is not supported (00000000-0000-0000-0000-000000000000).
  41059. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  41060. c.urlParams_.Set("requestId", requestId)
  41061. return c
  41062. }
  41063. // Fields allows partial responses to be retrieved. See
  41064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41065. // for more information.
  41066. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  41067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41068. return c
  41069. }
  41070. // Context sets the context to be used in this call's Do method. Any
  41071. // pending HTTP request will be aborted if the provided context is
  41072. // canceled.
  41073. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  41074. c.ctx_ = ctx
  41075. return c
  41076. }
  41077. // Header returns an http.Header that can be modified by the caller to
  41078. // add HTTP headers to the request.
  41079. func (c *BackendServicesDeleteCall) Header() http.Header {
  41080. if c.header_ == nil {
  41081. c.header_ = make(http.Header)
  41082. }
  41083. return c.header_
  41084. }
  41085. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  41086. reqHeaders := make(http.Header)
  41087. for k, v := range c.header_ {
  41088. reqHeaders[k] = v
  41089. }
  41090. reqHeaders.Set("User-Agent", c.s.userAgent())
  41091. var body io.Reader = nil
  41092. c.urlParams_.Set("alt", alt)
  41093. c.urlParams_.Set("prettyPrint", "false")
  41094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  41095. urls += "?" + c.urlParams_.Encode()
  41096. req, err := http.NewRequest("DELETE", urls, body)
  41097. if err != nil {
  41098. return nil, err
  41099. }
  41100. req.Header = reqHeaders
  41101. googleapi.Expand(req.URL, map[string]string{
  41102. "project": c.project,
  41103. "backendService": c.backendService,
  41104. })
  41105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41106. }
  41107. // Do executes the "compute.backendServices.delete" call.
  41108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41109. // status code is an error. Response headers are in either
  41110. // *Operation.ServerResponse.Header or (if a response was returned at
  41111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41112. // to check whether the returned error was because
  41113. // http.StatusNotModified was returned.
  41114. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41115. gensupport.SetOptions(c.urlParams_, opts...)
  41116. res, err := c.doRequest("json")
  41117. if res != nil && res.StatusCode == http.StatusNotModified {
  41118. if res.Body != nil {
  41119. res.Body.Close()
  41120. }
  41121. return nil, &googleapi.Error{
  41122. Code: res.StatusCode,
  41123. Header: res.Header,
  41124. }
  41125. }
  41126. if err != nil {
  41127. return nil, err
  41128. }
  41129. defer googleapi.CloseBody(res)
  41130. if err := googleapi.CheckResponse(res); err != nil {
  41131. return nil, err
  41132. }
  41133. ret := &Operation{
  41134. ServerResponse: googleapi.ServerResponse{
  41135. Header: res.Header,
  41136. HTTPStatusCode: res.StatusCode,
  41137. },
  41138. }
  41139. target := &ret
  41140. if err := gensupport.DecodeResponse(target, res); err != nil {
  41141. return nil, err
  41142. }
  41143. return ret, nil
  41144. // {
  41145. // "description": "Deletes the specified BackendService resource.",
  41146. // "httpMethod": "DELETE",
  41147. // "id": "compute.backendServices.delete",
  41148. // "parameterOrder": [
  41149. // "project",
  41150. // "backendService"
  41151. // ],
  41152. // "parameters": {
  41153. // "backendService": {
  41154. // "description": "Name of the BackendService resource to delete.",
  41155. // "location": "path",
  41156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41157. // "required": true,
  41158. // "type": "string"
  41159. // },
  41160. // "project": {
  41161. // "description": "Project ID for this request.",
  41162. // "location": "path",
  41163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41164. // "required": true,
  41165. // "type": "string"
  41166. // },
  41167. // "requestId": {
  41168. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41169. // "location": "query",
  41170. // "type": "string"
  41171. // }
  41172. // },
  41173. // "path": "{project}/global/backendServices/{backendService}",
  41174. // "response": {
  41175. // "$ref": "Operation"
  41176. // },
  41177. // "scopes": [
  41178. // "https://www.googleapis.com/auth/cloud-platform",
  41179. // "https://www.googleapis.com/auth/compute"
  41180. // ]
  41181. // }
  41182. }
  41183. // method id "compute.backendServices.deleteSignedUrlKey":
  41184. type BackendServicesDeleteSignedUrlKeyCall struct {
  41185. s *Service
  41186. project string
  41187. backendService string
  41188. urlParams_ gensupport.URLParams
  41189. ctx_ context.Context
  41190. header_ http.Header
  41191. }
  41192. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  41193. // URLs for this backend service.
  41194. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  41195. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41196. c.project = project
  41197. c.backendService = backendService
  41198. c.urlParams_.Set("keyName", keyName)
  41199. return c
  41200. }
  41201. // RequestId sets the optional parameter "requestId": An optional
  41202. // request ID to identify requests. Specify a unique request ID so that
  41203. // if you must retry your request, the server will know to ignore the
  41204. // request if it has already been completed.
  41205. //
  41206. // For example, consider a situation where you make an initial request
  41207. // and the request times out. If you make the request again with the
  41208. // same request ID, the server can check if original operation with the
  41209. // same request ID was received, and if so, will ignore the second
  41210. // request. This prevents clients from accidentally creating duplicate
  41211. // commitments.
  41212. //
  41213. // The request ID must be a valid UUID with the exception that zero UUID
  41214. // is not supported (00000000-0000-0000-0000-000000000000).
  41215. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  41216. c.urlParams_.Set("requestId", requestId)
  41217. return c
  41218. }
  41219. // Fields allows partial responses to be retrieved. See
  41220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41221. // for more information.
  41222. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  41223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41224. return c
  41225. }
  41226. // Context sets the context to be used in this call's Do method. Any
  41227. // pending HTTP request will be aborted if the provided context is
  41228. // canceled.
  41229. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  41230. c.ctx_ = ctx
  41231. return c
  41232. }
  41233. // Header returns an http.Header that can be modified by the caller to
  41234. // add HTTP headers to the request.
  41235. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  41236. if c.header_ == nil {
  41237. c.header_ = make(http.Header)
  41238. }
  41239. return c.header_
  41240. }
  41241. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  41242. reqHeaders := make(http.Header)
  41243. for k, v := range c.header_ {
  41244. reqHeaders[k] = v
  41245. }
  41246. reqHeaders.Set("User-Agent", c.s.userAgent())
  41247. var body io.Reader = nil
  41248. c.urlParams_.Set("alt", alt)
  41249. c.urlParams_.Set("prettyPrint", "false")
  41250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  41251. urls += "?" + c.urlParams_.Encode()
  41252. req, err := http.NewRequest("POST", urls, body)
  41253. if err != nil {
  41254. return nil, err
  41255. }
  41256. req.Header = reqHeaders
  41257. googleapi.Expand(req.URL, map[string]string{
  41258. "project": c.project,
  41259. "backendService": c.backendService,
  41260. })
  41261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41262. }
  41263. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  41264. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41265. // status code is an error. Response headers are in either
  41266. // *Operation.ServerResponse.Header or (if a response was returned at
  41267. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41268. // to check whether the returned error was because
  41269. // http.StatusNotModified was returned.
  41270. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41271. gensupport.SetOptions(c.urlParams_, opts...)
  41272. res, err := c.doRequest("json")
  41273. if res != nil && res.StatusCode == http.StatusNotModified {
  41274. if res.Body != nil {
  41275. res.Body.Close()
  41276. }
  41277. return nil, &googleapi.Error{
  41278. Code: res.StatusCode,
  41279. Header: res.Header,
  41280. }
  41281. }
  41282. if err != nil {
  41283. return nil, err
  41284. }
  41285. defer googleapi.CloseBody(res)
  41286. if err := googleapi.CheckResponse(res); err != nil {
  41287. return nil, err
  41288. }
  41289. ret := &Operation{
  41290. ServerResponse: googleapi.ServerResponse{
  41291. Header: res.Header,
  41292. HTTPStatusCode: res.StatusCode,
  41293. },
  41294. }
  41295. target := &ret
  41296. if err := gensupport.DecodeResponse(target, res); err != nil {
  41297. return nil, err
  41298. }
  41299. return ret, nil
  41300. // {
  41301. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  41302. // "httpMethod": "POST",
  41303. // "id": "compute.backendServices.deleteSignedUrlKey",
  41304. // "parameterOrder": [
  41305. // "project",
  41306. // "backendService",
  41307. // "keyName"
  41308. // ],
  41309. // "parameters": {
  41310. // "backendService": {
  41311. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  41312. // "location": "path",
  41313. // "required": true,
  41314. // "type": "string"
  41315. // },
  41316. // "keyName": {
  41317. // "description": "The name of the Signed URL Key to delete.",
  41318. // "location": "query",
  41319. // "required": true,
  41320. // "type": "string"
  41321. // },
  41322. // "project": {
  41323. // "description": "Project ID for this request.",
  41324. // "location": "path",
  41325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41326. // "required": true,
  41327. // "type": "string"
  41328. // },
  41329. // "requestId": {
  41330. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41331. // "location": "query",
  41332. // "type": "string"
  41333. // }
  41334. // },
  41335. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  41336. // "response": {
  41337. // "$ref": "Operation"
  41338. // },
  41339. // "scopes": [
  41340. // "https://www.googleapis.com/auth/cloud-platform",
  41341. // "https://www.googleapis.com/auth/compute"
  41342. // ]
  41343. // }
  41344. }
  41345. // method id "compute.backendServices.get":
  41346. type BackendServicesGetCall struct {
  41347. s *Service
  41348. project string
  41349. backendService string
  41350. urlParams_ gensupport.URLParams
  41351. ifNoneMatch_ string
  41352. ctx_ context.Context
  41353. header_ http.Header
  41354. }
  41355. // Get: Returns the specified BackendService resource. Gets a list of
  41356. // available backend services.
  41357. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  41358. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  41359. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41360. c.project = project
  41361. c.backendService = backendService
  41362. return c
  41363. }
  41364. // Fields allows partial responses to be retrieved. See
  41365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41366. // for more information.
  41367. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  41368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41369. return c
  41370. }
  41371. // IfNoneMatch sets the optional parameter which makes the operation
  41372. // fail if the object's ETag matches the given value. This is useful for
  41373. // getting updates only after the object has changed since the last
  41374. // request. Use googleapi.IsNotModified to check whether the response
  41375. // error from Do is the result of In-None-Match.
  41376. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  41377. c.ifNoneMatch_ = entityTag
  41378. return c
  41379. }
  41380. // Context sets the context to be used in this call's Do method. Any
  41381. // pending HTTP request will be aborted if the provided context is
  41382. // canceled.
  41383. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  41384. c.ctx_ = ctx
  41385. return c
  41386. }
  41387. // Header returns an http.Header that can be modified by the caller to
  41388. // add HTTP headers to the request.
  41389. func (c *BackendServicesGetCall) Header() http.Header {
  41390. if c.header_ == nil {
  41391. c.header_ = make(http.Header)
  41392. }
  41393. return c.header_
  41394. }
  41395. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  41396. reqHeaders := make(http.Header)
  41397. for k, v := range c.header_ {
  41398. reqHeaders[k] = v
  41399. }
  41400. reqHeaders.Set("User-Agent", c.s.userAgent())
  41401. if c.ifNoneMatch_ != "" {
  41402. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41403. }
  41404. var body io.Reader = nil
  41405. c.urlParams_.Set("alt", alt)
  41406. c.urlParams_.Set("prettyPrint", "false")
  41407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  41408. urls += "?" + c.urlParams_.Encode()
  41409. req, err := http.NewRequest("GET", urls, body)
  41410. if err != nil {
  41411. return nil, err
  41412. }
  41413. req.Header = reqHeaders
  41414. googleapi.Expand(req.URL, map[string]string{
  41415. "project": c.project,
  41416. "backendService": c.backendService,
  41417. })
  41418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41419. }
  41420. // Do executes the "compute.backendServices.get" call.
  41421. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  41422. // status code is an error. Response headers are in either
  41423. // *BackendService.ServerResponse.Header or (if a response was returned
  41424. // at all) in error.(*googleapi.Error).Header. Use
  41425. // googleapi.IsNotModified to check whether the returned error was
  41426. // because http.StatusNotModified was returned.
  41427. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  41428. gensupport.SetOptions(c.urlParams_, opts...)
  41429. res, err := c.doRequest("json")
  41430. if res != nil && res.StatusCode == http.StatusNotModified {
  41431. if res.Body != nil {
  41432. res.Body.Close()
  41433. }
  41434. return nil, &googleapi.Error{
  41435. Code: res.StatusCode,
  41436. Header: res.Header,
  41437. }
  41438. }
  41439. if err != nil {
  41440. return nil, err
  41441. }
  41442. defer googleapi.CloseBody(res)
  41443. if err := googleapi.CheckResponse(res); err != nil {
  41444. return nil, err
  41445. }
  41446. ret := &BackendService{
  41447. ServerResponse: googleapi.ServerResponse{
  41448. Header: res.Header,
  41449. HTTPStatusCode: res.StatusCode,
  41450. },
  41451. }
  41452. target := &ret
  41453. if err := gensupport.DecodeResponse(target, res); err != nil {
  41454. return nil, err
  41455. }
  41456. return ret, nil
  41457. // {
  41458. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  41459. // "httpMethod": "GET",
  41460. // "id": "compute.backendServices.get",
  41461. // "parameterOrder": [
  41462. // "project",
  41463. // "backendService"
  41464. // ],
  41465. // "parameters": {
  41466. // "backendService": {
  41467. // "description": "Name of the BackendService resource to return.",
  41468. // "location": "path",
  41469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41470. // "required": true,
  41471. // "type": "string"
  41472. // },
  41473. // "project": {
  41474. // "description": "Project ID for this request.",
  41475. // "location": "path",
  41476. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41477. // "required": true,
  41478. // "type": "string"
  41479. // }
  41480. // },
  41481. // "path": "{project}/global/backendServices/{backendService}",
  41482. // "response": {
  41483. // "$ref": "BackendService"
  41484. // },
  41485. // "scopes": [
  41486. // "https://www.googleapis.com/auth/cloud-platform",
  41487. // "https://www.googleapis.com/auth/compute",
  41488. // "https://www.googleapis.com/auth/compute.readonly"
  41489. // ]
  41490. // }
  41491. }
  41492. // method id "compute.backendServices.getHealth":
  41493. type BackendServicesGetHealthCall struct {
  41494. s *Service
  41495. project string
  41496. backendService string
  41497. resourcegroupreference *ResourceGroupReference
  41498. urlParams_ gensupport.URLParams
  41499. ctx_ context.Context
  41500. header_ http.Header
  41501. }
  41502. // GetHealth: Gets the most recent health check results for this
  41503. // BackendService.
  41504. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  41505. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  41506. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41507. c.project = project
  41508. c.backendService = backendService
  41509. c.resourcegroupreference = resourcegroupreference
  41510. return c
  41511. }
  41512. // Fields allows partial responses to be retrieved. See
  41513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41514. // for more information.
  41515. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  41516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41517. return c
  41518. }
  41519. // Context sets the context to be used in this call's Do method. Any
  41520. // pending HTTP request will be aborted if the provided context is
  41521. // canceled.
  41522. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  41523. c.ctx_ = ctx
  41524. return c
  41525. }
  41526. // Header returns an http.Header that can be modified by the caller to
  41527. // add HTTP headers to the request.
  41528. func (c *BackendServicesGetHealthCall) Header() http.Header {
  41529. if c.header_ == nil {
  41530. c.header_ = make(http.Header)
  41531. }
  41532. return c.header_
  41533. }
  41534. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  41535. reqHeaders := make(http.Header)
  41536. for k, v := range c.header_ {
  41537. reqHeaders[k] = v
  41538. }
  41539. reqHeaders.Set("User-Agent", c.s.userAgent())
  41540. var body io.Reader = nil
  41541. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  41542. if err != nil {
  41543. return nil, err
  41544. }
  41545. reqHeaders.Set("Content-Type", "application/json")
  41546. c.urlParams_.Set("alt", alt)
  41547. c.urlParams_.Set("prettyPrint", "false")
  41548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  41549. urls += "?" + c.urlParams_.Encode()
  41550. req, err := http.NewRequest("POST", urls, body)
  41551. if err != nil {
  41552. return nil, err
  41553. }
  41554. req.Header = reqHeaders
  41555. googleapi.Expand(req.URL, map[string]string{
  41556. "project": c.project,
  41557. "backendService": c.backendService,
  41558. })
  41559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41560. }
  41561. // Do executes the "compute.backendServices.getHealth" call.
  41562. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  41563. // Any non-2xx status code is an error. Response headers are in either
  41564. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  41565. // was returned at all) in error.(*googleapi.Error).Header. Use
  41566. // googleapi.IsNotModified to check whether the returned error was
  41567. // because http.StatusNotModified was returned.
  41568. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  41569. gensupport.SetOptions(c.urlParams_, opts...)
  41570. res, err := c.doRequest("json")
  41571. if res != nil && res.StatusCode == http.StatusNotModified {
  41572. if res.Body != nil {
  41573. res.Body.Close()
  41574. }
  41575. return nil, &googleapi.Error{
  41576. Code: res.StatusCode,
  41577. Header: res.Header,
  41578. }
  41579. }
  41580. if err != nil {
  41581. return nil, err
  41582. }
  41583. defer googleapi.CloseBody(res)
  41584. if err := googleapi.CheckResponse(res); err != nil {
  41585. return nil, err
  41586. }
  41587. ret := &BackendServiceGroupHealth{
  41588. ServerResponse: googleapi.ServerResponse{
  41589. Header: res.Header,
  41590. HTTPStatusCode: res.StatusCode,
  41591. },
  41592. }
  41593. target := &ret
  41594. if err := gensupport.DecodeResponse(target, res); err != nil {
  41595. return nil, err
  41596. }
  41597. return ret, nil
  41598. // {
  41599. // "description": "Gets the most recent health check results for this BackendService.",
  41600. // "httpMethod": "POST",
  41601. // "id": "compute.backendServices.getHealth",
  41602. // "parameterOrder": [
  41603. // "project",
  41604. // "backendService"
  41605. // ],
  41606. // "parameters": {
  41607. // "backendService": {
  41608. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  41609. // "location": "path",
  41610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41611. // "required": true,
  41612. // "type": "string"
  41613. // },
  41614. // "project": {
  41615. // "location": "path",
  41616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41617. // "required": true,
  41618. // "type": "string"
  41619. // }
  41620. // },
  41621. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  41622. // "request": {
  41623. // "$ref": "ResourceGroupReference"
  41624. // },
  41625. // "response": {
  41626. // "$ref": "BackendServiceGroupHealth"
  41627. // },
  41628. // "scopes": [
  41629. // "https://www.googleapis.com/auth/cloud-platform",
  41630. // "https://www.googleapis.com/auth/compute",
  41631. // "https://www.googleapis.com/auth/compute.readonly"
  41632. // ]
  41633. // }
  41634. }
  41635. // method id "compute.backendServices.insert":
  41636. type BackendServicesInsertCall struct {
  41637. s *Service
  41638. project string
  41639. backendservice *BackendService
  41640. urlParams_ gensupport.URLParams
  41641. ctx_ context.Context
  41642. header_ http.Header
  41643. }
  41644. // Insert: Creates a BackendService resource in the specified project
  41645. // using the data included in the request. There are several
  41646. // restrictions and guidelines to keep in mind when creating a backend
  41647. // service. Read Restrictions and Guidelines for more information.
  41648. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  41649. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  41650. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41651. c.project = project
  41652. c.backendservice = backendservice
  41653. return c
  41654. }
  41655. // RequestId sets the optional parameter "requestId": An optional
  41656. // request ID to identify requests. Specify a unique request ID so that
  41657. // if you must retry your request, the server will know to ignore the
  41658. // request if it has already been completed.
  41659. //
  41660. // For example, consider a situation where you make an initial request
  41661. // and the request times out. If you make the request again with the
  41662. // same request ID, the server can check if original operation with the
  41663. // same request ID was received, and if so, will ignore the second
  41664. // request. This prevents clients from accidentally creating duplicate
  41665. // commitments.
  41666. //
  41667. // The request ID must be a valid UUID with the exception that zero UUID
  41668. // is not supported (00000000-0000-0000-0000-000000000000).
  41669. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  41670. c.urlParams_.Set("requestId", requestId)
  41671. return c
  41672. }
  41673. // Fields allows partial responses to be retrieved. See
  41674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41675. // for more information.
  41676. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  41677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  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 *BackendServicesInsertCall) Header() http.Header {
  41690. if c.header_ == nil {
  41691. c.header_ = make(http.Header)
  41692. }
  41693. return c.header_
  41694. }
  41695. func (c *BackendServicesInsertCall) 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. var body io.Reader = nil
  41702. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  41703. if err != nil {
  41704. return nil, err
  41705. }
  41706. reqHeaders.Set("Content-Type", "application/json")
  41707. c.urlParams_.Set("alt", alt)
  41708. c.urlParams_.Set("prettyPrint", "false")
  41709. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  41710. urls += "?" + c.urlParams_.Encode()
  41711. req, err := http.NewRequest("POST", urls, body)
  41712. if err != nil {
  41713. return nil, err
  41714. }
  41715. req.Header = reqHeaders
  41716. googleapi.Expand(req.URL, map[string]string{
  41717. "project": c.project,
  41718. })
  41719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41720. }
  41721. // Do executes the "compute.backendServices.insert" call.
  41722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41723. // status code is an error. Response headers are in either
  41724. // *Operation.ServerResponse.Header or (if a response was returned at
  41725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41726. // to check whether the returned error was because
  41727. // http.StatusNotModified was returned.
  41728. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41729. gensupport.SetOptions(c.urlParams_, opts...)
  41730. res, err := c.doRequest("json")
  41731. if res != nil && res.StatusCode == http.StatusNotModified {
  41732. if res.Body != nil {
  41733. res.Body.Close()
  41734. }
  41735. return nil, &googleapi.Error{
  41736. Code: res.StatusCode,
  41737. Header: res.Header,
  41738. }
  41739. }
  41740. if err != nil {
  41741. return nil, err
  41742. }
  41743. defer googleapi.CloseBody(res)
  41744. if err := googleapi.CheckResponse(res); err != nil {
  41745. return nil, err
  41746. }
  41747. ret := &Operation{
  41748. ServerResponse: googleapi.ServerResponse{
  41749. Header: res.Header,
  41750. HTTPStatusCode: res.StatusCode,
  41751. },
  41752. }
  41753. target := &ret
  41754. if err := gensupport.DecodeResponse(target, res); err != nil {
  41755. return nil, err
  41756. }
  41757. return ret, nil
  41758. // {
  41759. // "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.",
  41760. // "httpMethod": "POST",
  41761. // "id": "compute.backendServices.insert",
  41762. // "parameterOrder": [
  41763. // "project"
  41764. // ],
  41765. // "parameters": {
  41766. // "project": {
  41767. // "description": "Project ID for this request.",
  41768. // "location": "path",
  41769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41770. // "required": true,
  41771. // "type": "string"
  41772. // },
  41773. // "requestId": {
  41774. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41775. // "location": "query",
  41776. // "type": "string"
  41777. // }
  41778. // },
  41779. // "path": "{project}/global/backendServices",
  41780. // "request": {
  41781. // "$ref": "BackendService"
  41782. // },
  41783. // "response": {
  41784. // "$ref": "Operation"
  41785. // },
  41786. // "scopes": [
  41787. // "https://www.googleapis.com/auth/cloud-platform",
  41788. // "https://www.googleapis.com/auth/compute"
  41789. // ]
  41790. // }
  41791. }
  41792. // method id "compute.backendServices.list":
  41793. type BackendServicesListCall struct {
  41794. s *Service
  41795. project string
  41796. urlParams_ gensupport.URLParams
  41797. ifNoneMatch_ string
  41798. ctx_ context.Context
  41799. header_ http.Header
  41800. }
  41801. // List: Retrieves the list of BackendService resources available to the
  41802. // specified project.
  41803. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  41804. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  41805. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41806. c.project = project
  41807. return c
  41808. }
  41809. // Filter sets the optional parameter "filter": A filter expression that
  41810. // filters resources listed in the response. The expression must specify
  41811. // the field name, a comparison operator, and the value that you want to
  41812. // use for filtering. The value must be a string, a number, or a
  41813. // boolean. The comparison operator must be either =, !=, >, or <.
  41814. //
  41815. // For example, if you are filtering Compute Engine instances, you can
  41816. // exclude instances named example-instance by specifying name !=
  41817. // example-instance.
  41818. //
  41819. // You can also filter nested fields. For example, you could specify
  41820. // scheduling.automaticRestart = false to include instances only if they
  41821. // are not scheduled for automatic restarts. You can use filtering on
  41822. // nested fields to filter based on resource labels.
  41823. //
  41824. // To filter on multiple expressions, provide each separate expression
  41825. // within parentheses. For example, (scheduling.automaticRestart = true)
  41826. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41827. // AND expression. However, you can include AND and OR expressions
  41828. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41829. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41830. // true).
  41831. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  41832. c.urlParams_.Set("filter", filter)
  41833. return c
  41834. }
  41835. // MaxResults sets the optional parameter "maxResults": The maximum
  41836. // number of results per page that should be returned. If the number of
  41837. // available results is larger than maxResults, Compute Engine returns a
  41838. // nextPageToken that can be used to get the next page of results in
  41839. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41840. // (Default: 500)
  41841. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  41842. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41843. return c
  41844. }
  41845. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41846. // a certain order. By default, results are returned in alphanumerical
  41847. // order based on the resource name.
  41848. //
  41849. // You can also sort results in descending order based on the creation
  41850. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41851. // based on the creationTimestamp field in reverse chronological order
  41852. // (newest result first). Use this to sort resources like operations so
  41853. // that the newest operation is returned first.
  41854. //
  41855. // Currently, only sorting by name or creationTimestamp desc is
  41856. // supported.
  41857. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  41858. c.urlParams_.Set("orderBy", orderBy)
  41859. return c
  41860. }
  41861. // PageToken sets the optional parameter "pageToken": Specifies a page
  41862. // token to use. Set pageToken to the nextPageToken returned by a
  41863. // previous list request to get the next page of results.
  41864. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  41865. c.urlParams_.Set("pageToken", pageToken)
  41866. return c
  41867. }
  41868. // Fields allows partial responses to be retrieved. See
  41869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41870. // for more information.
  41871. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  41872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41873. return c
  41874. }
  41875. // IfNoneMatch sets the optional parameter which makes the operation
  41876. // fail if the object's ETag matches the given value. This is useful for
  41877. // getting updates only after the object has changed since the last
  41878. // request. Use googleapi.IsNotModified to check whether the response
  41879. // error from Do is the result of In-None-Match.
  41880. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  41881. c.ifNoneMatch_ = entityTag
  41882. return c
  41883. }
  41884. // Context sets the context to be used in this call's Do method. Any
  41885. // pending HTTP request will be aborted if the provided context is
  41886. // canceled.
  41887. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  41888. c.ctx_ = ctx
  41889. return c
  41890. }
  41891. // Header returns an http.Header that can be modified by the caller to
  41892. // add HTTP headers to the request.
  41893. func (c *BackendServicesListCall) Header() http.Header {
  41894. if c.header_ == nil {
  41895. c.header_ = make(http.Header)
  41896. }
  41897. return c.header_
  41898. }
  41899. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  41900. reqHeaders := make(http.Header)
  41901. for k, v := range c.header_ {
  41902. reqHeaders[k] = v
  41903. }
  41904. reqHeaders.Set("User-Agent", c.s.userAgent())
  41905. if c.ifNoneMatch_ != "" {
  41906. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41907. }
  41908. var body io.Reader = nil
  41909. c.urlParams_.Set("alt", alt)
  41910. c.urlParams_.Set("prettyPrint", "false")
  41911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  41912. urls += "?" + c.urlParams_.Encode()
  41913. req, err := http.NewRequest("GET", urls, body)
  41914. if err != nil {
  41915. return nil, err
  41916. }
  41917. req.Header = reqHeaders
  41918. googleapi.Expand(req.URL, map[string]string{
  41919. "project": c.project,
  41920. })
  41921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41922. }
  41923. // Do executes the "compute.backendServices.list" call.
  41924. // Exactly one of *BackendServiceList or error will be non-nil. Any
  41925. // non-2xx status code is an error. Response headers are in either
  41926. // *BackendServiceList.ServerResponse.Header or (if a response was
  41927. // returned at all) in error.(*googleapi.Error).Header. Use
  41928. // googleapi.IsNotModified to check whether the returned error was
  41929. // because http.StatusNotModified was returned.
  41930. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  41931. gensupport.SetOptions(c.urlParams_, opts...)
  41932. res, err := c.doRequest("json")
  41933. if res != nil && res.StatusCode == http.StatusNotModified {
  41934. if res.Body != nil {
  41935. res.Body.Close()
  41936. }
  41937. return nil, &googleapi.Error{
  41938. Code: res.StatusCode,
  41939. Header: res.Header,
  41940. }
  41941. }
  41942. if err != nil {
  41943. return nil, err
  41944. }
  41945. defer googleapi.CloseBody(res)
  41946. if err := googleapi.CheckResponse(res); err != nil {
  41947. return nil, err
  41948. }
  41949. ret := &BackendServiceList{
  41950. ServerResponse: googleapi.ServerResponse{
  41951. Header: res.Header,
  41952. HTTPStatusCode: res.StatusCode,
  41953. },
  41954. }
  41955. target := &ret
  41956. if err := gensupport.DecodeResponse(target, res); err != nil {
  41957. return nil, err
  41958. }
  41959. return ret, nil
  41960. // {
  41961. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  41962. // "httpMethod": "GET",
  41963. // "id": "compute.backendServices.list",
  41964. // "parameterOrder": [
  41965. // "project"
  41966. // ],
  41967. // "parameters": {
  41968. // "filter": {
  41969. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41970. // "location": "query",
  41971. // "type": "string"
  41972. // },
  41973. // "maxResults": {
  41974. // "default": "500",
  41975. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41976. // "format": "uint32",
  41977. // "location": "query",
  41978. // "minimum": "0",
  41979. // "type": "integer"
  41980. // },
  41981. // "orderBy": {
  41982. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41983. // "location": "query",
  41984. // "type": "string"
  41985. // },
  41986. // "pageToken": {
  41987. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41988. // "location": "query",
  41989. // "type": "string"
  41990. // },
  41991. // "project": {
  41992. // "description": "Project ID for this request.",
  41993. // "location": "path",
  41994. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41995. // "required": true,
  41996. // "type": "string"
  41997. // }
  41998. // },
  41999. // "path": "{project}/global/backendServices",
  42000. // "response": {
  42001. // "$ref": "BackendServiceList"
  42002. // },
  42003. // "scopes": [
  42004. // "https://www.googleapis.com/auth/cloud-platform",
  42005. // "https://www.googleapis.com/auth/compute",
  42006. // "https://www.googleapis.com/auth/compute.readonly"
  42007. // ]
  42008. // }
  42009. }
  42010. // Pages invokes f for each page of results.
  42011. // A non-nil error returned from f will halt the iteration.
  42012. // The provided context supersedes any context provided to the Context method.
  42013. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  42014. c.ctx_ = ctx
  42015. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42016. for {
  42017. x, err := c.Do()
  42018. if err != nil {
  42019. return err
  42020. }
  42021. if err := f(x); err != nil {
  42022. return err
  42023. }
  42024. if x.NextPageToken == "" {
  42025. return nil
  42026. }
  42027. c.PageToken(x.NextPageToken)
  42028. }
  42029. }
  42030. // method id "compute.backendServices.patch":
  42031. type BackendServicesPatchCall struct {
  42032. s *Service
  42033. project string
  42034. backendService string
  42035. backendservice *BackendService
  42036. urlParams_ gensupport.URLParams
  42037. ctx_ context.Context
  42038. header_ http.Header
  42039. }
  42040. // Patch: Patches the specified BackendService resource with the data
  42041. // included in the request. There are several restrictions and
  42042. // guidelines to keep in mind when updating a backend service. Read
  42043. // Restrictions and Guidelines for more information. This method
  42044. // supports PATCH semantics and uses the JSON merge patch format and
  42045. // processing rules.
  42046. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  42047. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  42048. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42049. c.project = project
  42050. c.backendService = backendService
  42051. c.backendservice = backendservice
  42052. return c
  42053. }
  42054. // RequestId sets the optional parameter "requestId": An optional
  42055. // request ID to identify requests. Specify a unique request ID so that
  42056. // if you must retry your request, the server will know to ignore the
  42057. // request if it has already been completed.
  42058. //
  42059. // For example, consider a situation where you make an initial request
  42060. // and the request times out. If you make the request again with the
  42061. // same request ID, the server can check if original operation with the
  42062. // same request ID was received, and if so, will ignore the second
  42063. // request. This prevents clients from accidentally creating duplicate
  42064. // commitments.
  42065. //
  42066. // The request ID must be a valid UUID with the exception that zero UUID
  42067. // is not supported (00000000-0000-0000-0000-000000000000).
  42068. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  42069. c.urlParams_.Set("requestId", requestId)
  42070. return c
  42071. }
  42072. // Fields allows partial responses to be retrieved. See
  42073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42074. // for more information.
  42075. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  42076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42077. return c
  42078. }
  42079. // Context sets the context to be used in this call's Do method. Any
  42080. // pending HTTP request will be aborted if the provided context is
  42081. // canceled.
  42082. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  42083. c.ctx_ = ctx
  42084. return c
  42085. }
  42086. // Header returns an http.Header that can be modified by the caller to
  42087. // add HTTP headers to the request.
  42088. func (c *BackendServicesPatchCall) Header() http.Header {
  42089. if c.header_ == nil {
  42090. c.header_ = make(http.Header)
  42091. }
  42092. return c.header_
  42093. }
  42094. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  42095. reqHeaders := make(http.Header)
  42096. for k, v := range c.header_ {
  42097. reqHeaders[k] = v
  42098. }
  42099. reqHeaders.Set("User-Agent", c.s.userAgent())
  42100. var body io.Reader = nil
  42101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  42102. if err != nil {
  42103. return nil, err
  42104. }
  42105. reqHeaders.Set("Content-Type", "application/json")
  42106. c.urlParams_.Set("alt", alt)
  42107. c.urlParams_.Set("prettyPrint", "false")
  42108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  42109. urls += "?" + c.urlParams_.Encode()
  42110. req, err := http.NewRequest("PATCH", urls, body)
  42111. if err != nil {
  42112. return nil, err
  42113. }
  42114. req.Header = reqHeaders
  42115. googleapi.Expand(req.URL, map[string]string{
  42116. "project": c.project,
  42117. "backendService": c.backendService,
  42118. })
  42119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42120. }
  42121. // Do executes the "compute.backendServices.patch" call.
  42122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42123. // status code is an error. Response headers are in either
  42124. // *Operation.ServerResponse.Header or (if a response was returned at
  42125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42126. // to check whether the returned error was because
  42127. // http.StatusNotModified was returned.
  42128. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42129. gensupport.SetOptions(c.urlParams_, opts...)
  42130. res, err := c.doRequest("json")
  42131. if res != nil && res.StatusCode == http.StatusNotModified {
  42132. if res.Body != nil {
  42133. res.Body.Close()
  42134. }
  42135. return nil, &googleapi.Error{
  42136. Code: res.StatusCode,
  42137. Header: res.Header,
  42138. }
  42139. }
  42140. if err != nil {
  42141. return nil, err
  42142. }
  42143. defer googleapi.CloseBody(res)
  42144. if err := googleapi.CheckResponse(res); err != nil {
  42145. return nil, err
  42146. }
  42147. ret := &Operation{
  42148. ServerResponse: googleapi.ServerResponse{
  42149. Header: res.Header,
  42150. HTTPStatusCode: res.StatusCode,
  42151. },
  42152. }
  42153. target := &ret
  42154. if err := gensupport.DecodeResponse(target, res); err != nil {
  42155. return nil, err
  42156. }
  42157. return ret, nil
  42158. // {
  42159. // "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.",
  42160. // "httpMethod": "PATCH",
  42161. // "id": "compute.backendServices.patch",
  42162. // "parameterOrder": [
  42163. // "project",
  42164. // "backendService"
  42165. // ],
  42166. // "parameters": {
  42167. // "backendService": {
  42168. // "description": "Name of the BackendService resource to patch.",
  42169. // "location": "path",
  42170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42171. // "required": true,
  42172. // "type": "string"
  42173. // },
  42174. // "project": {
  42175. // "description": "Project ID for this request.",
  42176. // "location": "path",
  42177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42178. // "required": true,
  42179. // "type": "string"
  42180. // },
  42181. // "requestId": {
  42182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42183. // "location": "query",
  42184. // "type": "string"
  42185. // }
  42186. // },
  42187. // "path": "{project}/global/backendServices/{backendService}",
  42188. // "request": {
  42189. // "$ref": "BackendService"
  42190. // },
  42191. // "response": {
  42192. // "$ref": "Operation"
  42193. // },
  42194. // "scopes": [
  42195. // "https://www.googleapis.com/auth/cloud-platform",
  42196. // "https://www.googleapis.com/auth/compute"
  42197. // ]
  42198. // }
  42199. }
  42200. // method id "compute.backendServices.setSecurityPolicy":
  42201. type BackendServicesSetSecurityPolicyCall struct {
  42202. s *Service
  42203. project string
  42204. backendService string
  42205. securitypolicyreference *SecurityPolicyReference
  42206. urlParams_ gensupport.URLParams
  42207. ctx_ context.Context
  42208. header_ http.Header
  42209. }
  42210. // SetSecurityPolicy: Sets the security policy for the specified backend
  42211. // service.
  42212. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  42213. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42214. c.project = project
  42215. c.backendService = backendService
  42216. c.securitypolicyreference = securitypolicyreference
  42217. return c
  42218. }
  42219. // RequestId sets the optional parameter "requestId": An optional
  42220. // request ID to identify requests. Specify a unique request ID so that
  42221. // if you must retry your request, the server will know to ignore the
  42222. // request if it has already been completed.
  42223. //
  42224. // For example, consider a situation where you make an initial request
  42225. // and the request times out. If you make the request again with the
  42226. // same request ID, the server can check if original operation with the
  42227. // same request ID was received, and if so, will ignore the second
  42228. // request. This prevents clients from accidentally creating duplicate
  42229. // commitments.
  42230. //
  42231. // The request ID must be a valid UUID with the exception that zero UUID
  42232. // is not supported (00000000-0000-0000-0000-000000000000).
  42233. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  42234. c.urlParams_.Set("requestId", requestId)
  42235. return c
  42236. }
  42237. // Fields allows partial responses to be retrieved. See
  42238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42239. // for more information.
  42240. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  42241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42242. return c
  42243. }
  42244. // Context sets the context to be used in this call's Do method. Any
  42245. // pending HTTP request will be aborted if the provided context is
  42246. // canceled.
  42247. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  42248. c.ctx_ = ctx
  42249. return c
  42250. }
  42251. // Header returns an http.Header that can be modified by the caller to
  42252. // add HTTP headers to the request.
  42253. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  42254. if c.header_ == nil {
  42255. c.header_ = make(http.Header)
  42256. }
  42257. return c.header_
  42258. }
  42259. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  42260. reqHeaders := make(http.Header)
  42261. for k, v := range c.header_ {
  42262. reqHeaders[k] = v
  42263. }
  42264. reqHeaders.Set("User-Agent", c.s.userAgent())
  42265. var body io.Reader = nil
  42266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  42267. if err != nil {
  42268. return nil, err
  42269. }
  42270. reqHeaders.Set("Content-Type", "application/json")
  42271. c.urlParams_.Set("alt", alt)
  42272. c.urlParams_.Set("prettyPrint", "false")
  42273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  42274. urls += "?" + c.urlParams_.Encode()
  42275. req, err := http.NewRequest("POST", urls, body)
  42276. if err != nil {
  42277. return nil, err
  42278. }
  42279. req.Header = reqHeaders
  42280. googleapi.Expand(req.URL, map[string]string{
  42281. "project": c.project,
  42282. "backendService": c.backendService,
  42283. })
  42284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42285. }
  42286. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  42287. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42288. // status code is an error. Response headers are in either
  42289. // *Operation.ServerResponse.Header or (if a response was returned at
  42290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42291. // to check whether the returned error was because
  42292. // http.StatusNotModified was returned.
  42293. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42294. gensupport.SetOptions(c.urlParams_, opts...)
  42295. res, err := c.doRequest("json")
  42296. if res != nil && res.StatusCode == http.StatusNotModified {
  42297. if res.Body != nil {
  42298. res.Body.Close()
  42299. }
  42300. return nil, &googleapi.Error{
  42301. Code: res.StatusCode,
  42302. Header: res.Header,
  42303. }
  42304. }
  42305. if err != nil {
  42306. return nil, err
  42307. }
  42308. defer googleapi.CloseBody(res)
  42309. if err := googleapi.CheckResponse(res); err != nil {
  42310. return nil, err
  42311. }
  42312. ret := &Operation{
  42313. ServerResponse: googleapi.ServerResponse{
  42314. Header: res.Header,
  42315. HTTPStatusCode: res.StatusCode,
  42316. },
  42317. }
  42318. target := &ret
  42319. if err := gensupport.DecodeResponse(target, res); err != nil {
  42320. return nil, err
  42321. }
  42322. return ret, nil
  42323. // {
  42324. // "description": "Sets the security policy for the specified backend service.",
  42325. // "httpMethod": "POST",
  42326. // "id": "compute.backendServices.setSecurityPolicy",
  42327. // "parameterOrder": [
  42328. // "project",
  42329. // "backendService"
  42330. // ],
  42331. // "parameters": {
  42332. // "backendService": {
  42333. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  42334. // "location": "path",
  42335. // "required": true,
  42336. // "type": "string"
  42337. // },
  42338. // "project": {
  42339. // "description": "Project ID for this request.",
  42340. // "location": "path",
  42341. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42342. // "required": true,
  42343. // "type": "string"
  42344. // },
  42345. // "requestId": {
  42346. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42347. // "location": "query",
  42348. // "type": "string"
  42349. // }
  42350. // },
  42351. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  42352. // "request": {
  42353. // "$ref": "SecurityPolicyReference"
  42354. // },
  42355. // "response": {
  42356. // "$ref": "Operation"
  42357. // },
  42358. // "scopes": [
  42359. // "https://www.googleapis.com/auth/cloud-platform",
  42360. // "https://www.googleapis.com/auth/compute"
  42361. // ]
  42362. // }
  42363. }
  42364. // method id "compute.backendServices.testIamPermissions":
  42365. type BackendServicesTestIamPermissionsCall struct {
  42366. s *Service
  42367. project string
  42368. resource string
  42369. testpermissionsrequest *TestPermissionsRequest
  42370. urlParams_ gensupport.URLParams
  42371. ctx_ context.Context
  42372. header_ http.Header
  42373. }
  42374. // TestIamPermissions: Returns permissions that a caller has on the
  42375. // specified resource.
  42376. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  42377. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42378. c.project = project
  42379. c.resource = resource
  42380. c.testpermissionsrequest = testpermissionsrequest
  42381. return c
  42382. }
  42383. // Fields allows partial responses to be retrieved. See
  42384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42385. // for more information.
  42386. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  42387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42388. return c
  42389. }
  42390. // Context sets the context to be used in this call's Do method. Any
  42391. // pending HTTP request will be aborted if the provided context is
  42392. // canceled.
  42393. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  42394. c.ctx_ = ctx
  42395. return c
  42396. }
  42397. // Header returns an http.Header that can be modified by the caller to
  42398. // add HTTP headers to the request.
  42399. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  42400. if c.header_ == nil {
  42401. c.header_ = make(http.Header)
  42402. }
  42403. return c.header_
  42404. }
  42405. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  42406. reqHeaders := make(http.Header)
  42407. for k, v := range c.header_ {
  42408. reqHeaders[k] = v
  42409. }
  42410. reqHeaders.Set("User-Agent", c.s.userAgent())
  42411. var body io.Reader = nil
  42412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  42413. if err != nil {
  42414. return nil, err
  42415. }
  42416. reqHeaders.Set("Content-Type", "application/json")
  42417. c.urlParams_.Set("alt", alt)
  42418. c.urlParams_.Set("prettyPrint", "false")
  42419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  42420. urls += "?" + c.urlParams_.Encode()
  42421. req, err := http.NewRequest("POST", urls, body)
  42422. if err != nil {
  42423. return nil, err
  42424. }
  42425. req.Header = reqHeaders
  42426. googleapi.Expand(req.URL, map[string]string{
  42427. "project": c.project,
  42428. "resource": c.resource,
  42429. })
  42430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42431. }
  42432. // Do executes the "compute.backendServices.testIamPermissions" call.
  42433. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  42434. // non-2xx status code is an error. Response headers are in either
  42435. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  42436. // returned at all) in error.(*googleapi.Error).Header. Use
  42437. // googleapi.IsNotModified to check whether the returned error was
  42438. // because http.StatusNotModified was returned.
  42439. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  42440. gensupport.SetOptions(c.urlParams_, opts...)
  42441. res, err := c.doRequest("json")
  42442. if res != nil && res.StatusCode == http.StatusNotModified {
  42443. if res.Body != nil {
  42444. res.Body.Close()
  42445. }
  42446. return nil, &googleapi.Error{
  42447. Code: res.StatusCode,
  42448. Header: res.Header,
  42449. }
  42450. }
  42451. if err != nil {
  42452. return nil, err
  42453. }
  42454. defer googleapi.CloseBody(res)
  42455. if err := googleapi.CheckResponse(res); err != nil {
  42456. return nil, err
  42457. }
  42458. ret := &TestPermissionsResponse{
  42459. ServerResponse: googleapi.ServerResponse{
  42460. Header: res.Header,
  42461. HTTPStatusCode: res.StatusCode,
  42462. },
  42463. }
  42464. target := &ret
  42465. if err := gensupport.DecodeResponse(target, res); err != nil {
  42466. return nil, err
  42467. }
  42468. return ret, nil
  42469. // {
  42470. // "description": "Returns permissions that a caller has on the specified resource.",
  42471. // "httpMethod": "POST",
  42472. // "id": "compute.backendServices.testIamPermissions",
  42473. // "parameterOrder": [
  42474. // "project",
  42475. // "resource"
  42476. // ],
  42477. // "parameters": {
  42478. // "project": {
  42479. // "description": "Project ID for this request.",
  42480. // "location": "path",
  42481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42482. // "required": true,
  42483. // "type": "string"
  42484. // },
  42485. // "resource": {
  42486. // "description": "Name or id of the resource for this request.",
  42487. // "location": "path",
  42488. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42489. // "required": true,
  42490. // "type": "string"
  42491. // }
  42492. // },
  42493. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  42494. // "request": {
  42495. // "$ref": "TestPermissionsRequest"
  42496. // },
  42497. // "response": {
  42498. // "$ref": "TestPermissionsResponse"
  42499. // },
  42500. // "scopes": [
  42501. // "https://www.googleapis.com/auth/cloud-platform",
  42502. // "https://www.googleapis.com/auth/compute",
  42503. // "https://www.googleapis.com/auth/compute.readonly"
  42504. // ]
  42505. // }
  42506. }
  42507. // method id "compute.backendServices.update":
  42508. type BackendServicesUpdateCall struct {
  42509. s *Service
  42510. project string
  42511. backendService string
  42512. backendservice *BackendService
  42513. urlParams_ gensupport.URLParams
  42514. ctx_ context.Context
  42515. header_ http.Header
  42516. }
  42517. // Update: Updates the specified BackendService resource with the data
  42518. // included in the request. There are several restrictions and
  42519. // guidelines to keep in mind when updating a backend service. Read
  42520. // Restrictions and Guidelines for more information.
  42521. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  42522. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  42523. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42524. c.project = project
  42525. c.backendService = backendService
  42526. c.backendservice = backendservice
  42527. return c
  42528. }
  42529. // RequestId sets the optional parameter "requestId": An optional
  42530. // request ID to identify requests. Specify a unique request ID so that
  42531. // if you must retry your request, the server will know to ignore the
  42532. // request if it has already been completed.
  42533. //
  42534. // For example, consider a situation where you make an initial request
  42535. // and the request times out. If you make the request again with the
  42536. // same request ID, the server can check if original operation with the
  42537. // same request ID was received, and if so, will ignore the second
  42538. // request. This prevents clients from accidentally creating duplicate
  42539. // commitments.
  42540. //
  42541. // The request ID must be a valid UUID with the exception that zero UUID
  42542. // is not supported (00000000-0000-0000-0000-000000000000).
  42543. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  42544. c.urlParams_.Set("requestId", requestId)
  42545. return c
  42546. }
  42547. // Fields allows partial responses to be retrieved. See
  42548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42549. // for more information.
  42550. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  42551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42552. return c
  42553. }
  42554. // Context sets the context to be used in this call's Do method. Any
  42555. // pending HTTP request will be aborted if the provided context is
  42556. // canceled.
  42557. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  42558. c.ctx_ = ctx
  42559. return c
  42560. }
  42561. // Header returns an http.Header that can be modified by the caller to
  42562. // add HTTP headers to the request.
  42563. func (c *BackendServicesUpdateCall) Header() http.Header {
  42564. if c.header_ == nil {
  42565. c.header_ = make(http.Header)
  42566. }
  42567. return c.header_
  42568. }
  42569. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  42570. reqHeaders := make(http.Header)
  42571. for k, v := range c.header_ {
  42572. reqHeaders[k] = v
  42573. }
  42574. reqHeaders.Set("User-Agent", c.s.userAgent())
  42575. var body io.Reader = nil
  42576. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  42577. if err != nil {
  42578. return nil, err
  42579. }
  42580. reqHeaders.Set("Content-Type", "application/json")
  42581. c.urlParams_.Set("alt", alt)
  42582. c.urlParams_.Set("prettyPrint", "false")
  42583. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  42584. urls += "?" + c.urlParams_.Encode()
  42585. req, err := http.NewRequest("PUT", urls, body)
  42586. if err != nil {
  42587. return nil, err
  42588. }
  42589. req.Header = reqHeaders
  42590. googleapi.Expand(req.URL, map[string]string{
  42591. "project": c.project,
  42592. "backendService": c.backendService,
  42593. })
  42594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42595. }
  42596. // Do executes the "compute.backendServices.update" call.
  42597. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42598. // status code is an error. Response headers are in either
  42599. // *Operation.ServerResponse.Header or (if a response was returned at
  42600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42601. // to check whether the returned error was because
  42602. // http.StatusNotModified was returned.
  42603. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42604. gensupport.SetOptions(c.urlParams_, opts...)
  42605. res, err := c.doRequest("json")
  42606. if res != nil && res.StatusCode == http.StatusNotModified {
  42607. if res.Body != nil {
  42608. res.Body.Close()
  42609. }
  42610. return nil, &googleapi.Error{
  42611. Code: res.StatusCode,
  42612. Header: res.Header,
  42613. }
  42614. }
  42615. if err != nil {
  42616. return nil, err
  42617. }
  42618. defer googleapi.CloseBody(res)
  42619. if err := googleapi.CheckResponse(res); err != nil {
  42620. return nil, err
  42621. }
  42622. ret := &Operation{
  42623. ServerResponse: googleapi.ServerResponse{
  42624. Header: res.Header,
  42625. HTTPStatusCode: res.StatusCode,
  42626. },
  42627. }
  42628. target := &ret
  42629. if err := gensupport.DecodeResponse(target, res); err != nil {
  42630. return nil, err
  42631. }
  42632. return ret, nil
  42633. // {
  42634. // "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.",
  42635. // "httpMethod": "PUT",
  42636. // "id": "compute.backendServices.update",
  42637. // "parameterOrder": [
  42638. // "project",
  42639. // "backendService"
  42640. // ],
  42641. // "parameters": {
  42642. // "backendService": {
  42643. // "description": "Name of the BackendService resource to update.",
  42644. // "location": "path",
  42645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42646. // "required": true,
  42647. // "type": "string"
  42648. // },
  42649. // "project": {
  42650. // "description": "Project ID for this request.",
  42651. // "location": "path",
  42652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42653. // "required": true,
  42654. // "type": "string"
  42655. // },
  42656. // "requestId": {
  42657. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42658. // "location": "query",
  42659. // "type": "string"
  42660. // }
  42661. // },
  42662. // "path": "{project}/global/backendServices/{backendService}",
  42663. // "request": {
  42664. // "$ref": "BackendService"
  42665. // },
  42666. // "response": {
  42667. // "$ref": "Operation"
  42668. // },
  42669. // "scopes": [
  42670. // "https://www.googleapis.com/auth/cloud-platform",
  42671. // "https://www.googleapis.com/auth/compute"
  42672. // ]
  42673. // }
  42674. }
  42675. // method id "compute.diskTypes.aggregatedList":
  42676. type DiskTypesAggregatedListCall struct {
  42677. s *Service
  42678. project string
  42679. urlParams_ gensupport.URLParams
  42680. ifNoneMatch_ string
  42681. ctx_ context.Context
  42682. header_ http.Header
  42683. }
  42684. // AggregatedList: Retrieves an aggregated list of disk types.
  42685. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  42686. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  42687. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42688. c.project = project
  42689. return c
  42690. }
  42691. // Filter sets the optional parameter "filter": A filter expression that
  42692. // filters resources listed in the response. The expression must specify
  42693. // the field name, a comparison operator, and the value that you want to
  42694. // use for filtering. The value must be a string, a number, or a
  42695. // boolean. The comparison operator must be either =, !=, >, or <.
  42696. //
  42697. // For example, if you are filtering Compute Engine instances, you can
  42698. // exclude instances named example-instance by specifying name !=
  42699. // example-instance.
  42700. //
  42701. // You can also filter nested fields. For example, you could specify
  42702. // scheduling.automaticRestart = false to include instances only if they
  42703. // are not scheduled for automatic restarts. You can use filtering on
  42704. // nested fields to filter based on resource labels.
  42705. //
  42706. // To filter on multiple expressions, provide each separate expression
  42707. // within parentheses. For example, (scheduling.automaticRestart = true)
  42708. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42709. // AND expression. However, you can include AND and OR expressions
  42710. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42711. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42712. // true).
  42713. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  42714. c.urlParams_.Set("filter", filter)
  42715. return c
  42716. }
  42717. // MaxResults sets the optional parameter "maxResults": The maximum
  42718. // number of results per page that should be returned. If the number of
  42719. // available results is larger than maxResults, Compute Engine returns a
  42720. // nextPageToken that can be used to get the next page of results in
  42721. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42722. // (Default: 500)
  42723. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  42724. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42725. return c
  42726. }
  42727. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42728. // a certain order. By default, results are returned in alphanumerical
  42729. // order based on the resource name.
  42730. //
  42731. // You can also sort results in descending order based on the creation
  42732. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42733. // based on the creationTimestamp field in reverse chronological order
  42734. // (newest result first). Use this to sort resources like operations so
  42735. // that the newest operation is returned first.
  42736. //
  42737. // Currently, only sorting by name or creationTimestamp desc is
  42738. // supported.
  42739. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  42740. c.urlParams_.Set("orderBy", orderBy)
  42741. return c
  42742. }
  42743. // PageToken sets the optional parameter "pageToken": Specifies a page
  42744. // token to use. Set pageToken to the nextPageToken returned by a
  42745. // previous list request to get the next page of results.
  42746. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  42747. c.urlParams_.Set("pageToken", pageToken)
  42748. return c
  42749. }
  42750. // Fields allows partial responses to be retrieved. See
  42751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42752. // for more information.
  42753. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  42754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42755. return c
  42756. }
  42757. // IfNoneMatch sets the optional parameter which makes the operation
  42758. // fail if the object's ETag matches the given value. This is useful for
  42759. // getting updates only after the object has changed since the last
  42760. // request. Use googleapi.IsNotModified to check whether the response
  42761. // error from Do is the result of In-None-Match.
  42762. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  42763. c.ifNoneMatch_ = entityTag
  42764. return c
  42765. }
  42766. // Context sets the context to be used in this call's Do method. Any
  42767. // pending HTTP request will be aborted if the provided context is
  42768. // canceled.
  42769. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  42770. c.ctx_ = ctx
  42771. return c
  42772. }
  42773. // Header returns an http.Header that can be modified by the caller to
  42774. // add HTTP headers to the request.
  42775. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  42776. if c.header_ == nil {
  42777. c.header_ = make(http.Header)
  42778. }
  42779. return c.header_
  42780. }
  42781. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  42782. reqHeaders := make(http.Header)
  42783. for k, v := range c.header_ {
  42784. reqHeaders[k] = v
  42785. }
  42786. reqHeaders.Set("User-Agent", c.s.userAgent())
  42787. if c.ifNoneMatch_ != "" {
  42788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42789. }
  42790. var body io.Reader = nil
  42791. c.urlParams_.Set("alt", alt)
  42792. c.urlParams_.Set("prettyPrint", "false")
  42793. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  42794. urls += "?" + c.urlParams_.Encode()
  42795. req, err := http.NewRequest("GET", urls, body)
  42796. if err != nil {
  42797. return nil, err
  42798. }
  42799. req.Header = reqHeaders
  42800. googleapi.Expand(req.URL, map[string]string{
  42801. "project": c.project,
  42802. })
  42803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42804. }
  42805. // Do executes the "compute.diskTypes.aggregatedList" call.
  42806. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  42807. // non-2xx status code is an error. Response headers are in either
  42808. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  42809. // returned at all) in error.(*googleapi.Error).Header. Use
  42810. // googleapi.IsNotModified to check whether the returned error was
  42811. // because http.StatusNotModified was returned.
  42812. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  42813. gensupport.SetOptions(c.urlParams_, opts...)
  42814. res, err := c.doRequest("json")
  42815. if res != nil && res.StatusCode == http.StatusNotModified {
  42816. if res.Body != nil {
  42817. res.Body.Close()
  42818. }
  42819. return nil, &googleapi.Error{
  42820. Code: res.StatusCode,
  42821. Header: res.Header,
  42822. }
  42823. }
  42824. if err != nil {
  42825. return nil, err
  42826. }
  42827. defer googleapi.CloseBody(res)
  42828. if err := googleapi.CheckResponse(res); err != nil {
  42829. return nil, err
  42830. }
  42831. ret := &DiskTypeAggregatedList{
  42832. ServerResponse: googleapi.ServerResponse{
  42833. Header: res.Header,
  42834. HTTPStatusCode: res.StatusCode,
  42835. },
  42836. }
  42837. target := &ret
  42838. if err := gensupport.DecodeResponse(target, res); err != nil {
  42839. return nil, err
  42840. }
  42841. return ret, nil
  42842. // {
  42843. // "description": "Retrieves an aggregated list of disk types.",
  42844. // "httpMethod": "GET",
  42845. // "id": "compute.diskTypes.aggregatedList",
  42846. // "parameterOrder": [
  42847. // "project"
  42848. // ],
  42849. // "parameters": {
  42850. // "filter": {
  42851. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  42852. // "location": "query",
  42853. // "type": "string"
  42854. // },
  42855. // "maxResults": {
  42856. // "default": "500",
  42857. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42858. // "format": "uint32",
  42859. // "location": "query",
  42860. // "minimum": "0",
  42861. // "type": "integer"
  42862. // },
  42863. // "orderBy": {
  42864. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42865. // "location": "query",
  42866. // "type": "string"
  42867. // },
  42868. // "pageToken": {
  42869. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42870. // "location": "query",
  42871. // "type": "string"
  42872. // },
  42873. // "project": {
  42874. // "description": "Project ID for this request.",
  42875. // "location": "path",
  42876. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42877. // "required": true,
  42878. // "type": "string"
  42879. // }
  42880. // },
  42881. // "path": "{project}/aggregated/diskTypes",
  42882. // "response": {
  42883. // "$ref": "DiskTypeAggregatedList"
  42884. // },
  42885. // "scopes": [
  42886. // "https://www.googleapis.com/auth/cloud-platform",
  42887. // "https://www.googleapis.com/auth/compute",
  42888. // "https://www.googleapis.com/auth/compute.readonly"
  42889. // ]
  42890. // }
  42891. }
  42892. // Pages invokes f for each page of results.
  42893. // A non-nil error returned from f will halt the iteration.
  42894. // The provided context supersedes any context provided to the Context method.
  42895. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  42896. c.ctx_ = ctx
  42897. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42898. for {
  42899. x, err := c.Do()
  42900. if err != nil {
  42901. return err
  42902. }
  42903. if err := f(x); err != nil {
  42904. return err
  42905. }
  42906. if x.NextPageToken == "" {
  42907. return nil
  42908. }
  42909. c.PageToken(x.NextPageToken)
  42910. }
  42911. }
  42912. // method id "compute.diskTypes.get":
  42913. type DiskTypesGetCall struct {
  42914. s *Service
  42915. project string
  42916. zone string
  42917. diskType string
  42918. urlParams_ gensupport.URLParams
  42919. ifNoneMatch_ string
  42920. ctx_ context.Context
  42921. header_ http.Header
  42922. }
  42923. // Get: Returns the specified disk type. Gets a list of available disk
  42924. // types by making a list() request.
  42925. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  42926. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  42927. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42928. c.project = project
  42929. c.zone = zone
  42930. c.diskType = diskType
  42931. return c
  42932. }
  42933. // Fields allows partial responses to be retrieved. See
  42934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42935. // for more information.
  42936. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  42937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42938. return c
  42939. }
  42940. // IfNoneMatch sets the optional parameter which makes the operation
  42941. // fail if the object's ETag matches the given value. This is useful for
  42942. // getting updates only after the object has changed since the last
  42943. // request. Use googleapi.IsNotModified to check whether the response
  42944. // error from Do is the result of In-None-Match.
  42945. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  42946. c.ifNoneMatch_ = entityTag
  42947. return c
  42948. }
  42949. // Context sets the context to be used in this call's Do method. Any
  42950. // pending HTTP request will be aborted if the provided context is
  42951. // canceled.
  42952. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  42953. c.ctx_ = ctx
  42954. return c
  42955. }
  42956. // Header returns an http.Header that can be modified by the caller to
  42957. // add HTTP headers to the request.
  42958. func (c *DiskTypesGetCall) Header() http.Header {
  42959. if c.header_ == nil {
  42960. c.header_ = make(http.Header)
  42961. }
  42962. return c.header_
  42963. }
  42964. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  42965. reqHeaders := make(http.Header)
  42966. for k, v := range c.header_ {
  42967. reqHeaders[k] = v
  42968. }
  42969. reqHeaders.Set("User-Agent", c.s.userAgent())
  42970. if c.ifNoneMatch_ != "" {
  42971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42972. }
  42973. var body io.Reader = nil
  42974. c.urlParams_.Set("alt", alt)
  42975. c.urlParams_.Set("prettyPrint", "false")
  42976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  42977. urls += "?" + c.urlParams_.Encode()
  42978. req, err := http.NewRequest("GET", urls, body)
  42979. if err != nil {
  42980. return nil, err
  42981. }
  42982. req.Header = reqHeaders
  42983. googleapi.Expand(req.URL, map[string]string{
  42984. "project": c.project,
  42985. "zone": c.zone,
  42986. "diskType": c.diskType,
  42987. })
  42988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42989. }
  42990. // Do executes the "compute.diskTypes.get" call.
  42991. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  42992. // code is an error. Response headers are in either
  42993. // *DiskType.ServerResponse.Header or (if a response was returned at
  42994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42995. // to check whether the returned error was because
  42996. // http.StatusNotModified was returned.
  42997. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  42998. gensupport.SetOptions(c.urlParams_, opts...)
  42999. res, err := c.doRequest("json")
  43000. if res != nil && res.StatusCode == http.StatusNotModified {
  43001. if res.Body != nil {
  43002. res.Body.Close()
  43003. }
  43004. return nil, &googleapi.Error{
  43005. Code: res.StatusCode,
  43006. Header: res.Header,
  43007. }
  43008. }
  43009. if err != nil {
  43010. return nil, err
  43011. }
  43012. defer googleapi.CloseBody(res)
  43013. if err := googleapi.CheckResponse(res); err != nil {
  43014. return nil, err
  43015. }
  43016. ret := &DiskType{
  43017. ServerResponse: googleapi.ServerResponse{
  43018. Header: res.Header,
  43019. HTTPStatusCode: res.StatusCode,
  43020. },
  43021. }
  43022. target := &ret
  43023. if err := gensupport.DecodeResponse(target, res); err != nil {
  43024. return nil, err
  43025. }
  43026. return ret, nil
  43027. // {
  43028. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  43029. // "httpMethod": "GET",
  43030. // "id": "compute.diskTypes.get",
  43031. // "parameterOrder": [
  43032. // "project",
  43033. // "zone",
  43034. // "diskType"
  43035. // ],
  43036. // "parameters": {
  43037. // "diskType": {
  43038. // "description": "Name of the disk type to return.",
  43039. // "location": "path",
  43040. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43041. // "required": true,
  43042. // "type": "string"
  43043. // },
  43044. // "project": {
  43045. // "description": "Project ID for this request.",
  43046. // "location": "path",
  43047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43048. // "required": true,
  43049. // "type": "string"
  43050. // },
  43051. // "zone": {
  43052. // "description": "The name of the zone for this request.",
  43053. // "location": "path",
  43054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43055. // "required": true,
  43056. // "type": "string"
  43057. // }
  43058. // },
  43059. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  43060. // "response": {
  43061. // "$ref": "DiskType"
  43062. // },
  43063. // "scopes": [
  43064. // "https://www.googleapis.com/auth/cloud-platform",
  43065. // "https://www.googleapis.com/auth/compute",
  43066. // "https://www.googleapis.com/auth/compute.readonly"
  43067. // ]
  43068. // }
  43069. }
  43070. // method id "compute.diskTypes.list":
  43071. type DiskTypesListCall struct {
  43072. s *Service
  43073. project string
  43074. zone string
  43075. urlParams_ gensupport.URLParams
  43076. ifNoneMatch_ string
  43077. ctx_ context.Context
  43078. header_ http.Header
  43079. }
  43080. // List: Retrieves a list of disk types available to the specified
  43081. // project.
  43082. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  43083. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  43084. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43085. c.project = project
  43086. c.zone = zone
  43087. return c
  43088. }
  43089. // Filter sets the optional parameter "filter": A filter expression that
  43090. // filters resources listed in the response. The expression must specify
  43091. // the field name, a comparison operator, and the value that you want to
  43092. // use for filtering. The value must be a string, a number, or a
  43093. // boolean. The comparison operator must be either =, !=, >, or <.
  43094. //
  43095. // For example, if you are filtering Compute Engine instances, you can
  43096. // exclude instances named example-instance by specifying name !=
  43097. // example-instance.
  43098. //
  43099. // You can also filter nested fields. For example, you could specify
  43100. // scheduling.automaticRestart = false to include instances only if they
  43101. // are not scheduled for automatic restarts. You can use filtering on
  43102. // nested fields to filter based on resource labels.
  43103. //
  43104. // To filter on multiple expressions, provide each separate expression
  43105. // within parentheses. For example, (scheduling.automaticRestart = true)
  43106. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43107. // AND expression. However, you can include AND and OR expressions
  43108. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43109. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43110. // true).
  43111. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  43112. c.urlParams_.Set("filter", filter)
  43113. return c
  43114. }
  43115. // MaxResults sets the optional parameter "maxResults": The maximum
  43116. // number of results per page that should be returned. If the number of
  43117. // available results is larger than maxResults, Compute Engine returns a
  43118. // nextPageToken that can be used to get the next page of results in
  43119. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43120. // (Default: 500)
  43121. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  43122. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43123. return c
  43124. }
  43125. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43126. // a certain order. By default, results are returned in alphanumerical
  43127. // order based on the resource name.
  43128. //
  43129. // You can also sort results in descending order based on the creation
  43130. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43131. // based on the creationTimestamp field in reverse chronological order
  43132. // (newest result first). Use this to sort resources like operations so
  43133. // that the newest operation is returned first.
  43134. //
  43135. // Currently, only sorting by name or creationTimestamp desc is
  43136. // supported.
  43137. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  43138. c.urlParams_.Set("orderBy", orderBy)
  43139. return c
  43140. }
  43141. // PageToken sets the optional parameter "pageToken": Specifies a page
  43142. // token to use. Set pageToken to the nextPageToken returned by a
  43143. // previous list request to get the next page of results.
  43144. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  43145. c.urlParams_.Set("pageToken", pageToken)
  43146. return c
  43147. }
  43148. // Fields allows partial responses to be retrieved. See
  43149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43150. // for more information.
  43151. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  43152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43153. return c
  43154. }
  43155. // IfNoneMatch sets the optional parameter which makes the operation
  43156. // fail if the object's ETag matches the given value. This is useful for
  43157. // getting updates only after the object has changed since the last
  43158. // request. Use googleapi.IsNotModified to check whether the response
  43159. // error from Do is the result of In-None-Match.
  43160. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  43161. c.ifNoneMatch_ = entityTag
  43162. return c
  43163. }
  43164. // Context sets the context to be used in this call's Do method. Any
  43165. // pending HTTP request will be aborted if the provided context is
  43166. // canceled.
  43167. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  43168. c.ctx_ = ctx
  43169. return c
  43170. }
  43171. // Header returns an http.Header that can be modified by the caller to
  43172. // add HTTP headers to the request.
  43173. func (c *DiskTypesListCall) Header() http.Header {
  43174. if c.header_ == nil {
  43175. c.header_ = make(http.Header)
  43176. }
  43177. return c.header_
  43178. }
  43179. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  43180. reqHeaders := make(http.Header)
  43181. for k, v := range c.header_ {
  43182. reqHeaders[k] = v
  43183. }
  43184. reqHeaders.Set("User-Agent", c.s.userAgent())
  43185. if c.ifNoneMatch_ != "" {
  43186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43187. }
  43188. var body io.Reader = nil
  43189. c.urlParams_.Set("alt", alt)
  43190. c.urlParams_.Set("prettyPrint", "false")
  43191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  43192. urls += "?" + c.urlParams_.Encode()
  43193. req, err := http.NewRequest("GET", urls, body)
  43194. if err != nil {
  43195. return nil, err
  43196. }
  43197. req.Header = reqHeaders
  43198. googleapi.Expand(req.URL, map[string]string{
  43199. "project": c.project,
  43200. "zone": c.zone,
  43201. })
  43202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43203. }
  43204. // Do executes the "compute.diskTypes.list" call.
  43205. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  43206. // status code is an error. Response headers are in either
  43207. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  43208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43209. // to check whether the returned error was because
  43210. // http.StatusNotModified was returned.
  43211. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  43212. gensupport.SetOptions(c.urlParams_, opts...)
  43213. res, err := c.doRequest("json")
  43214. if res != nil && res.StatusCode == http.StatusNotModified {
  43215. if res.Body != nil {
  43216. res.Body.Close()
  43217. }
  43218. return nil, &googleapi.Error{
  43219. Code: res.StatusCode,
  43220. Header: res.Header,
  43221. }
  43222. }
  43223. if err != nil {
  43224. return nil, err
  43225. }
  43226. defer googleapi.CloseBody(res)
  43227. if err := googleapi.CheckResponse(res); err != nil {
  43228. return nil, err
  43229. }
  43230. ret := &DiskTypeList{
  43231. ServerResponse: googleapi.ServerResponse{
  43232. Header: res.Header,
  43233. HTTPStatusCode: res.StatusCode,
  43234. },
  43235. }
  43236. target := &ret
  43237. if err := gensupport.DecodeResponse(target, res); err != nil {
  43238. return nil, err
  43239. }
  43240. return ret, nil
  43241. // {
  43242. // "description": "Retrieves a list of disk types available to the specified project.",
  43243. // "httpMethod": "GET",
  43244. // "id": "compute.diskTypes.list",
  43245. // "parameterOrder": [
  43246. // "project",
  43247. // "zone"
  43248. // ],
  43249. // "parameters": {
  43250. // "filter": {
  43251. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43252. // "location": "query",
  43253. // "type": "string"
  43254. // },
  43255. // "maxResults": {
  43256. // "default": "500",
  43257. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43258. // "format": "uint32",
  43259. // "location": "query",
  43260. // "minimum": "0",
  43261. // "type": "integer"
  43262. // },
  43263. // "orderBy": {
  43264. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43265. // "location": "query",
  43266. // "type": "string"
  43267. // },
  43268. // "pageToken": {
  43269. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43270. // "location": "query",
  43271. // "type": "string"
  43272. // },
  43273. // "project": {
  43274. // "description": "Project ID for this request.",
  43275. // "location": "path",
  43276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43277. // "required": true,
  43278. // "type": "string"
  43279. // },
  43280. // "zone": {
  43281. // "description": "The name of the zone for this request.",
  43282. // "location": "path",
  43283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43284. // "required": true,
  43285. // "type": "string"
  43286. // }
  43287. // },
  43288. // "path": "{project}/zones/{zone}/diskTypes",
  43289. // "response": {
  43290. // "$ref": "DiskTypeList"
  43291. // },
  43292. // "scopes": [
  43293. // "https://www.googleapis.com/auth/cloud-platform",
  43294. // "https://www.googleapis.com/auth/compute",
  43295. // "https://www.googleapis.com/auth/compute.readonly"
  43296. // ]
  43297. // }
  43298. }
  43299. // Pages invokes f for each page of results.
  43300. // A non-nil error returned from f will halt the iteration.
  43301. // The provided context supersedes any context provided to the Context method.
  43302. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  43303. c.ctx_ = ctx
  43304. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43305. for {
  43306. x, err := c.Do()
  43307. if err != nil {
  43308. return err
  43309. }
  43310. if err := f(x); err != nil {
  43311. return err
  43312. }
  43313. if x.NextPageToken == "" {
  43314. return nil
  43315. }
  43316. c.PageToken(x.NextPageToken)
  43317. }
  43318. }
  43319. // method id "compute.disks.addResourcePolicies":
  43320. type DisksAddResourcePoliciesCall struct {
  43321. s *Service
  43322. project string
  43323. zone string
  43324. disk string
  43325. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  43326. urlParams_ gensupport.URLParams
  43327. ctx_ context.Context
  43328. header_ http.Header
  43329. }
  43330. // AddResourcePolicies: Adds existing resource policies to a disk. You
  43331. // can only add one policy which will be applied to this disk for
  43332. // scheduling snapshot creation.
  43333. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  43334. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43335. c.project = project
  43336. c.zone = zone
  43337. c.disk = disk
  43338. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  43339. return c
  43340. }
  43341. // RequestId sets the optional parameter "requestId": An optional
  43342. // request ID to identify requests. Specify a unique request ID so that
  43343. // if you must retry your request, the server will know to ignore the
  43344. // request if it has already been completed.
  43345. //
  43346. // For example, consider a situation where you make an initial request
  43347. // and the request times out. If you make the request again with the
  43348. // same request ID, the server can check if original operation with the
  43349. // same request ID was received, and if so, will ignore the second
  43350. // request. This prevents clients from accidentally creating duplicate
  43351. // commitments.
  43352. //
  43353. // The request ID must be a valid UUID with the exception that zero UUID
  43354. // is not supported (00000000-0000-0000-0000-000000000000).
  43355. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  43356. c.urlParams_.Set("requestId", requestId)
  43357. return c
  43358. }
  43359. // Fields allows partial responses to be retrieved. See
  43360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43361. // for more information.
  43362. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  43363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43364. return c
  43365. }
  43366. // Context sets the context to be used in this call's Do method. Any
  43367. // pending HTTP request will be aborted if the provided context is
  43368. // canceled.
  43369. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  43370. c.ctx_ = ctx
  43371. return c
  43372. }
  43373. // Header returns an http.Header that can be modified by the caller to
  43374. // add HTTP headers to the request.
  43375. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  43376. if c.header_ == nil {
  43377. c.header_ = make(http.Header)
  43378. }
  43379. return c.header_
  43380. }
  43381. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  43382. reqHeaders := make(http.Header)
  43383. for k, v := range c.header_ {
  43384. reqHeaders[k] = v
  43385. }
  43386. reqHeaders.Set("User-Agent", c.s.userAgent())
  43387. var body io.Reader = nil
  43388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  43389. if err != nil {
  43390. return nil, err
  43391. }
  43392. reqHeaders.Set("Content-Type", "application/json")
  43393. c.urlParams_.Set("alt", alt)
  43394. c.urlParams_.Set("prettyPrint", "false")
  43395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  43396. urls += "?" + c.urlParams_.Encode()
  43397. req, err := http.NewRequest("POST", urls, body)
  43398. if err != nil {
  43399. return nil, err
  43400. }
  43401. req.Header = reqHeaders
  43402. googleapi.Expand(req.URL, map[string]string{
  43403. "project": c.project,
  43404. "zone": c.zone,
  43405. "disk": c.disk,
  43406. })
  43407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43408. }
  43409. // Do executes the "compute.disks.addResourcePolicies" call.
  43410. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43411. // status code is an error. Response headers are in either
  43412. // *Operation.ServerResponse.Header or (if a response was returned at
  43413. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43414. // to check whether the returned error was because
  43415. // http.StatusNotModified was returned.
  43416. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43417. gensupport.SetOptions(c.urlParams_, opts...)
  43418. res, err := c.doRequest("json")
  43419. if res != nil && res.StatusCode == http.StatusNotModified {
  43420. if res.Body != nil {
  43421. res.Body.Close()
  43422. }
  43423. return nil, &googleapi.Error{
  43424. Code: res.StatusCode,
  43425. Header: res.Header,
  43426. }
  43427. }
  43428. if err != nil {
  43429. return nil, err
  43430. }
  43431. defer googleapi.CloseBody(res)
  43432. if err := googleapi.CheckResponse(res); err != nil {
  43433. return nil, err
  43434. }
  43435. ret := &Operation{
  43436. ServerResponse: googleapi.ServerResponse{
  43437. Header: res.Header,
  43438. HTTPStatusCode: res.StatusCode,
  43439. },
  43440. }
  43441. target := &ret
  43442. if err := gensupport.DecodeResponse(target, res); err != nil {
  43443. return nil, err
  43444. }
  43445. return ret, nil
  43446. // {
  43447. // "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.",
  43448. // "httpMethod": "POST",
  43449. // "id": "compute.disks.addResourcePolicies",
  43450. // "parameterOrder": [
  43451. // "project",
  43452. // "zone",
  43453. // "disk"
  43454. // ],
  43455. // "parameters": {
  43456. // "disk": {
  43457. // "description": "The disk name for this request.",
  43458. // "location": "path",
  43459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43460. // "required": true,
  43461. // "type": "string"
  43462. // },
  43463. // "project": {
  43464. // "description": "Project ID for this request.",
  43465. // "location": "path",
  43466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43467. // "required": true,
  43468. // "type": "string"
  43469. // },
  43470. // "requestId": {
  43471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43472. // "location": "query",
  43473. // "type": "string"
  43474. // },
  43475. // "zone": {
  43476. // "description": "The name of the zone for this request.",
  43477. // "location": "path",
  43478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43479. // "required": true,
  43480. // "type": "string"
  43481. // }
  43482. // },
  43483. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  43484. // "request": {
  43485. // "$ref": "DisksAddResourcePoliciesRequest"
  43486. // },
  43487. // "response": {
  43488. // "$ref": "Operation"
  43489. // },
  43490. // "scopes": [
  43491. // "https://www.googleapis.com/auth/cloud-platform",
  43492. // "https://www.googleapis.com/auth/compute"
  43493. // ]
  43494. // }
  43495. }
  43496. // method id "compute.disks.aggregatedList":
  43497. type DisksAggregatedListCall struct {
  43498. s *Service
  43499. project string
  43500. urlParams_ gensupport.URLParams
  43501. ifNoneMatch_ string
  43502. ctx_ context.Context
  43503. header_ http.Header
  43504. }
  43505. // AggregatedList: Retrieves an aggregated list of persistent disks.
  43506. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  43507. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  43508. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43509. c.project = project
  43510. return c
  43511. }
  43512. // Filter sets the optional parameter "filter": A filter expression that
  43513. // filters resources listed in the response. The expression must specify
  43514. // the field name, a comparison operator, and the value that you want to
  43515. // use for filtering. The value must be a string, a number, or a
  43516. // boolean. The comparison operator must be either =, !=, >, or <.
  43517. //
  43518. // For example, if you are filtering Compute Engine instances, you can
  43519. // exclude instances named example-instance by specifying name !=
  43520. // example-instance.
  43521. //
  43522. // You can also filter nested fields. For example, you could specify
  43523. // scheduling.automaticRestart = false to include instances only if they
  43524. // are not scheduled for automatic restarts. You can use filtering on
  43525. // nested fields to filter based on resource labels.
  43526. //
  43527. // To filter on multiple expressions, provide each separate expression
  43528. // within parentheses. For example, (scheduling.automaticRestart = true)
  43529. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43530. // AND expression. However, you can include AND and OR expressions
  43531. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43532. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43533. // true).
  43534. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  43535. c.urlParams_.Set("filter", filter)
  43536. return c
  43537. }
  43538. // MaxResults sets the optional parameter "maxResults": The maximum
  43539. // number of results per page that should be returned. If the number of
  43540. // available results is larger than maxResults, Compute Engine returns a
  43541. // nextPageToken that can be used to get the next page of results in
  43542. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43543. // (Default: 500)
  43544. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  43545. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43546. return c
  43547. }
  43548. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43549. // a certain order. By default, results are returned in alphanumerical
  43550. // order based on the resource name.
  43551. //
  43552. // You can also sort results in descending order based on the creation
  43553. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43554. // based on the creationTimestamp field in reverse chronological order
  43555. // (newest result first). Use this to sort resources like operations so
  43556. // that the newest operation is returned first.
  43557. //
  43558. // Currently, only sorting by name or creationTimestamp desc is
  43559. // supported.
  43560. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  43561. c.urlParams_.Set("orderBy", orderBy)
  43562. return c
  43563. }
  43564. // PageToken sets the optional parameter "pageToken": Specifies a page
  43565. // token to use. Set pageToken to the nextPageToken returned by a
  43566. // previous list request to get the next page of results.
  43567. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  43568. c.urlParams_.Set("pageToken", pageToken)
  43569. return c
  43570. }
  43571. // Fields allows partial responses to be retrieved. See
  43572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43573. // for more information.
  43574. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  43575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43576. return c
  43577. }
  43578. // IfNoneMatch sets the optional parameter which makes the operation
  43579. // fail if the object's ETag matches the given value. This is useful for
  43580. // getting updates only after the object has changed since the last
  43581. // request. Use googleapi.IsNotModified to check whether the response
  43582. // error from Do is the result of In-None-Match.
  43583. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  43584. c.ifNoneMatch_ = entityTag
  43585. return c
  43586. }
  43587. // Context sets the context to be used in this call's Do method. Any
  43588. // pending HTTP request will be aborted if the provided context is
  43589. // canceled.
  43590. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  43591. c.ctx_ = ctx
  43592. return c
  43593. }
  43594. // Header returns an http.Header that can be modified by the caller to
  43595. // add HTTP headers to the request.
  43596. func (c *DisksAggregatedListCall) Header() http.Header {
  43597. if c.header_ == nil {
  43598. c.header_ = make(http.Header)
  43599. }
  43600. return c.header_
  43601. }
  43602. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  43603. reqHeaders := make(http.Header)
  43604. for k, v := range c.header_ {
  43605. reqHeaders[k] = v
  43606. }
  43607. reqHeaders.Set("User-Agent", c.s.userAgent())
  43608. if c.ifNoneMatch_ != "" {
  43609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43610. }
  43611. var body io.Reader = nil
  43612. c.urlParams_.Set("alt", alt)
  43613. c.urlParams_.Set("prettyPrint", "false")
  43614. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  43615. urls += "?" + c.urlParams_.Encode()
  43616. req, err := http.NewRequest("GET", urls, body)
  43617. if err != nil {
  43618. return nil, err
  43619. }
  43620. req.Header = reqHeaders
  43621. googleapi.Expand(req.URL, map[string]string{
  43622. "project": c.project,
  43623. })
  43624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43625. }
  43626. // Do executes the "compute.disks.aggregatedList" call.
  43627. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  43628. // non-2xx status code is an error. Response headers are in either
  43629. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  43630. // returned at all) in error.(*googleapi.Error).Header. Use
  43631. // googleapi.IsNotModified to check whether the returned error was
  43632. // because http.StatusNotModified was returned.
  43633. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  43634. gensupport.SetOptions(c.urlParams_, opts...)
  43635. res, err := c.doRequest("json")
  43636. if res != nil && res.StatusCode == http.StatusNotModified {
  43637. if res.Body != nil {
  43638. res.Body.Close()
  43639. }
  43640. return nil, &googleapi.Error{
  43641. Code: res.StatusCode,
  43642. Header: res.Header,
  43643. }
  43644. }
  43645. if err != nil {
  43646. return nil, err
  43647. }
  43648. defer googleapi.CloseBody(res)
  43649. if err := googleapi.CheckResponse(res); err != nil {
  43650. return nil, err
  43651. }
  43652. ret := &DiskAggregatedList{
  43653. ServerResponse: googleapi.ServerResponse{
  43654. Header: res.Header,
  43655. HTTPStatusCode: res.StatusCode,
  43656. },
  43657. }
  43658. target := &ret
  43659. if err := gensupport.DecodeResponse(target, res); err != nil {
  43660. return nil, err
  43661. }
  43662. return ret, nil
  43663. // {
  43664. // "description": "Retrieves an aggregated list of persistent disks.",
  43665. // "httpMethod": "GET",
  43666. // "id": "compute.disks.aggregatedList",
  43667. // "parameterOrder": [
  43668. // "project"
  43669. // ],
  43670. // "parameters": {
  43671. // "filter": {
  43672. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43673. // "location": "query",
  43674. // "type": "string"
  43675. // },
  43676. // "maxResults": {
  43677. // "default": "500",
  43678. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43679. // "format": "uint32",
  43680. // "location": "query",
  43681. // "minimum": "0",
  43682. // "type": "integer"
  43683. // },
  43684. // "orderBy": {
  43685. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43686. // "location": "query",
  43687. // "type": "string"
  43688. // },
  43689. // "pageToken": {
  43690. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43691. // "location": "query",
  43692. // "type": "string"
  43693. // },
  43694. // "project": {
  43695. // "description": "Project ID for this request.",
  43696. // "location": "path",
  43697. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43698. // "required": true,
  43699. // "type": "string"
  43700. // }
  43701. // },
  43702. // "path": "{project}/aggregated/disks",
  43703. // "response": {
  43704. // "$ref": "DiskAggregatedList"
  43705. // },
  43706. // "scopes": [
  43707. // "https://www.googleapis.com/auth/cloud-platform",
  43708. // "https://www.googleapis.com/auth/compute",
  43709. // "https://www.googleapis.com/auth/compute.readonly"
  43710. // ]
  43711. // }
  43712. }
  43713. // Pages invokes f for each page of results.
  43714. // A non-nil error returned from f will halt the iteration.
  43715. // The provided context supersedes any context provided to the Context method.
  43716. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  43717. c.ctx_ = ctx
  43718. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43719. for {
  43720. x, err := c.Do()
  43721. if err != nil {
  43722. return err
  43723. }
  43724. if err := f(x); err != nil {
  43725. return err
  43726. }
  43727. if x.NextPageToken == "" {
  43728. return nil
  43729. }
  43730. c.PageToken(x.NextPageToken)
  43731. }
  43732. }
  43733. // method id "compute.disks.createSnapshot":
  43734. type DisksCreateSnapshotCall struct {
  43735. s *Service
  43736. project string
  43737. zone string
  43738. disk string
  43739. snapshot *Snapshot
  43740. urlParams_ gensupport.URLParams
  43741. ctx_ context.Context
  43742. header_ http.Header
  43743. }
  43744. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  43745. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  43746. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  43747. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43748. c.project = project
  43749. c.zone = zone
  43750. c.disk = disk
  43751. c.snapshot = snapshot
  43752. return c
  43753. }
  43754. // GuestFlush sets the optional parameter "guestFlush":
  43755. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  43756. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  43757. return c
  43758. }
  43759. // RequestId sets the optional parameter "requestId": An optional
  43760. // request ID to identify requests. Specify a unique request ID so that
  43761. // if you must retry your request, the server will know to ignore the
  43762. // request if it has already been completed.
  43763. //
  43764. // For example, consider a situation where you make an initial request
  43765. // and the request times out. If you make the request again with the
  43766. // same request ID, the server can check if original operation with the
  43767. // same request ID was received, and if so, will ignore the second
  43768. // request. This prevents clients from accidentally creating duplicate
  43769. // commitments.
  43770. //
  43771. // The request ID must be a valid UUID with the exception that zero UUID
  43772. // is not supported (00000000-0000-0000-0000-000000000000).
  43773. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  43774. c.urlParams_.Set("requestId", requestId)
  43775. return c
  43776. }
  43777. // Fields allows partial responses to be retrieved. See
  43778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43779. // for more information.
  43780. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  43781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43782. return c
  43783. }
  43784. // Context sets the context to be used in this call's Do method. Any
  43785. // pending HTTP request will be aborted if the provided context is
  43786. // canceled.
  43787. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  43788. c.ctx_ = ctx
  43789. return c
  43790. }
  43791. // Header returns an http.Header that can be modified by the caller to
  43792. // add HTTP headers to the request.
  43793. func (c *DisksCreateSnapshotCall) Header() http.Header {
  43794. if c.header_ == nil {
  43795. c.header_ = make(http.Header)
  43796. }
  43797. return c.header_
  43798. }
  43799. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  43800. reqHeaders := make(http.Header)
  43801. for k, v := range c.header_ {
  43802. reqHeaders[k] = v
  43803. }
  43804. reqHeaders.Set("User-Agent", c.s.userAgent())
  43805. var body io.Reader = nil
  43806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  43807. if err != nil {
  43808. return nil, err
  43809. }
  43810. reqHeaders.Set("Content-Type", "application/json")
  43811. c.urlParams_.Set("alt", alt)
  43812. c.urlParams_.Set("prettyPrint", "false")
  43813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  43814. urls += "?" + c.urlParams_.Encode()
  43815. req, err := http.NewRequest("POST", urls, body)
  43816. if err != nil {
  43817. return nil, err
  43818. }
  43819. req.Header = reqHeaders
  43820. googleapi.Expand(req.URL, map[string]string{
  43821. "project": c.project,
  43822. "zone": c.zone,
  43823. "disk": c.disk,
  43824. })
  43825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43826. }
  43827. // Do executes the "compute.disks.createSnapshot" call.
  43828. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43829. // status code is an error. Response headers are in either
  43830. // *Operation.ServerResponse.Header or (if a response was returned at
  43831. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43832. // to check whether the returned error was because
  43833. // http.StatusNotModified was returned.
  43834. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43835. gensupport.SetOptions(c.urlParams_, opts...)
  43836. res, err := c.doRequest("json")
  43837. if res != nil && res.StatusCode == http.StatusNotModified {
  43838. if res.Body != nil {
  43839. res.Body.Close()
  43840. }
  43841. return nil, &googleapi.Error{
  43842. Code: res.StatusCode,
  43843. Header: res.Header,
  43844. }
  43845. }
  43846. if err != nil {
  43847. return nil, err
  43848. }
  43849. defer googleapi.CloseBody(res)
  43850. if err := googleapi.CheckResponse(res); err != nil {
  43851. return nil, err
  43852. }
  43853. ret := &Operation{
  43854. ServerResponse: googleapi.ServerResponse{
  43855. Header: res.Header,
  43856. HTTPStatusCode: res.StatusCode,
  43857. },
  43858. }
  43859. target := &ret
  43860. if err := gensupport.DecodeResponse(target, res); err != nil {
  43861. return nil, err
  43862. }
  43863. return ret, nil
  43864. // {
  43865. // "description": "Creates a snapshot of a specified persistent disk.",
  43866. // "httpMethod": "POST",
  43867. // "id": "compute.disks.createSnapshot",
  43868. // "parameterOrder": [
  43869. // "project",
  43870. // "zone",
  43871. // "disk"
  43872. // ],
  43873. // "parameters": {
  43874. // "disk": {
  43875. // "description": "Name of the persistent disk to snapshot.",
  43876. // "location": "path",
  43877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43878. // "required": true,
  43879. // "type": "string"
  43880. // },
  43881. // "guestFlush": {
  43882. // "location": "query",
  43883. // "type": "boolean"
  43884. // },
  43885. // "project": {
  43886. // "description": "Project ID for this request.",
  43887. // "location": "path",
  43888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43889. // "required": true,
  43890. // "type": "string"
  43891. // },
  43892. // "requestId": {
  43893. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43894. // "location": "query",
  43895. // "type": "string"
  43896. // },
  43897. // "zone": {
  43898. // "description": "The name of the zone for this request.",
  43899. // "location": "path",
  43900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43901. // "required": true,
  43902. // "type": "string"
  43903. // }
  43904. // },
  43905. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  43906. // "request": {
  43907. // "$ref": "Snapshot"
  43908. // },
  43909. // "response": {
  43910. // "$ref": "Operation"
  43911. // },
  43912. // "scopes": [
  43913. // "https://www.googleapis.com/auth/cloud-platform",
  43914. // "https://www.googleapis.com/auth/compute"
  43915. // ]
  43916. // }
  43917. }
  43918. // method id "compute.disks.delete":
  43919. type DisksDeleteCall struct {
  43920. s *Service
  43921. project string
  43922. zone string
  43923. disk string
  43924. urlParams_ gensupport.URLParams
  43925. ctx_ context.Context
  43926. header_ http.Header
  43927. }
  43928. // Delete: Deletes the specified persistent disk. Deleting a disk
  43929. // removes its data permanently and is irreversible. However, deleting a
  43930. // disk does not delete any snapshots previously made from the disk. You
  43931. // must separately delete snapshots.
  43932. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  43933. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  43934. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43935. c.project = project
  43936. c.zone = zone
  43937. c.disk = disk
  43938. return c
  43939. }
  43940. // RequestId sets the optional parameter "requestId": An optional
  43941. // request ID to identify requests. Specify a unique request ID so that
  43942. // if you must retry your request, the server will know to ignore the
  43943. // request if it has already been completed.
  43944. //
  43945. // For example, consider a situation where you make an initial request
  43946. // and the request times out. If you make the request again with the
  43947. // same request ID, the server can check if original operation with the
  43948. // same request ID was received, and if so, will ignore the second
  43949. // request. This prevents clients from accidentally creating duplicate
  43950. // commitments.
  43951. //
  43952. // The request ID must be a valid UUID with the exception that zero UUID
  43953. // is not supported (00000000-0000-0000-0000-000000000000).
  43954. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  43955. c.urlParams_.Set("requestId", requestId)
  43956. return c
  43957. }
  43958. // Fields allows partial responses to be retrieved. See
  43959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43960. // for more information.
  43961. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  43962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43963. return c
  43964. }
  43965. // Context sets the context to be used in this call's Do method. Any
  43966. // pending HTTP request will be aborted if the provided context is
  43967. // canceled.
  43968. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  43969. c.ctx_ = ctx
  43970. return c
  43971. }
  43972. // Header returns an http.Header that can be modified by the caller to
  43973. // add HTTP headers to the request.
  43974. func (c *DisksDeleteCall) Header() http.Header {
  43975. if c.header_ == nil {
  43976. c.header_ = make(http.Header)
  43977. }
  43978. return c.header_
  43979. }
  43980. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  43981. reqHeaders := make(http.Header)
  43982. for k, v := range c.header_ {
  43983. reqHeaders[k] = v
  43984. }
  43985. reqHeaders.Set("User-Agent", c.s.userAgent())
  43986. var body io.Reader = nil
  43987. c.urlParams_.Set("alt", alt)
  43988. c.urlParams_.Set("prettyPrint", "false")
  43989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  43990. urls += "?" + c.urlParams_.Encode()
  43991. req, err := http.NewRequest("DELETE", urls, body)
  43992. if err != nil {
  43993. return nil, err
  43994. }
  43995. req.Header = reqHeaders
  43996. googleapi.Expand(req.URL, map[string]string{
  43997. "project": c.project,
  43998. "zone": c.zone,
  43999. "disk": c.disk,
  44000. })
  44001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44002. }
  44003. // Do executes the "compute.disks.delete" call.
  44004. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44005. // status code is an error. Response headers are in either
  44006. // *Operation.ServerResponse.Header or (if a response was returned at
  44007. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44008. // to check whether the returned error was because
  44009. // http.StatusNotModified was returned.
  44010. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44011. gensupport.SetOptions(c.urlParams_, opts...)
  44012. res, err := c.doRequest("json")
  44013. if res != nil && res.StatusCode == http.StatusNotModified {
  44014. if res.Body != nil {
  44015. res.Body.Close()
  44016. }
  44017. return nil, &googleapi.Error{
  44018. Code: res.StatusCode,
  44019. Header: res.Header,
  44020. }
  44021. }
  44022. if err != nil {
  44023. return nil, err
  44024. }
  44025. defer googleapi.CloseBody(res)
  44026. if err := googleapi.CheckResponse(res); err != nil {
  44027. return nil, err
  44028. }
  44029. ret := &Operation{
  44030. ServerResponse: googleapi.ServerResponse{
  44031. Header: res.Header,
  44032. HTTPStatusCode: res.StatusCode,
  44033. },
  44034. }
  44035. target := &ret
  44036. if err := gensupport.DecodeResponse(target, res); err != nil {
  44037. return nil, err
  44038. }
  44039. return ret, nil
  44040. // {
  44041. // "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.",
  44042. // "httpMethod": "DELETE",
  44043. // "id": "compute.disks.delete",
  44044. // "parameterOrder": [
  44045. // "project",
  44046. // "zone",
  44047. // "disk"
  44048. // ],
  44049. // "parameters": {
  44050. // "disk": {
  44051. // "description": "Name of the persistent disk to delete.",
  44052. // "location": "path",
  44053. // "required": true,
  44054. // "type": "string"
  44055. // },
  44056. // "project": {
  44057. // "description": "Project ID for this request.",
  44058. // "location": "path",
  44059. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44060. // "required": true,
  44061. // "type": "string"
  44062. // },
  44063. // "requestId": {
  44064. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44065. // "location": "query",
  44066. // "type": "string"
  44067. // },
  44068. // "zone": {
  44069. // "description": "The name of the zone for this request.",
  44070. // "location": "path",
  44071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44072. // "required": true,
  44073. // "type": "string"
  44074. // }
  44075. // },
  44076. // "path": "{project}/zones/{zone}/disks/{disk}",
  44077. // "response": {
  44078. // "$ref": "Operation"
  44079. // },
  44080. // "scopes": [
  44081. // "https://www.googleapis.com/auth/cloud-platform",
  44082. // "https://www.googleapis.com/auth/compute"
  44083. // ]
  44084. // }
  44085. }
  44086. // method id "compute.disks.get":
  44087. type DisksGetCall struct {
  44088. s *Service
  44089. project string
  44090. zone string
  44091. disk string
  44092. urlParams_ gensupport.URLParams
  44093. ifNoneMatch_ string
  44094. ctx_ context.Context
  44095. header_ http.Header
  44096. }
  44097. // Get: Returns a specified persistent disk. Gets a list of available
  44098. // persistent disks by making a list() request.
  44099. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  44100. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  44101. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44102. c.project = project
  44103. c.zone = zone
  44104. c.disk = disk
  44105. return c
  44106. }
  44107. // Fields allows partial responses to be retrieved. See
  44108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44109. // for more information.
  44110. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  44111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44112. return c
  44113. }
  44114. // IfNoneMatch sets the optional parameter which makes the operation
  44115. // fail if the object's ETag matches the given value. This is useful for
  44116. // getting updates only after the object has changed since the last
  44117. // request. Use googleapi.IsNotModified to check whether the response
  44118. // error from Do is the result of In-None-Match.
  44119. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  44120. c.ifNoneMatch_ = entityTag
  44121. return c
  44122. }
  44123. // Context sets the context to be used in this call's Do method. Any
  44124. // pending HTTP request will be aborted if the provided context is
  44125. // canceled.
  44126. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  44127. c.ctx_ = ctx
  44128. return c
  44129. }
  44130. // Header returns an http.Header that can be modified by the caller to
  44131. // add HTTP headers to the request.
  44132. func (c *DisksGetCall) Header() http.Header {
  44133. if c.header_ == nil {
  44134. c.header_ = make(http.Header)
  44135. }
  44136. return c.header_
  44137. }
  44138. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  44139. reqHeaders := make(http.Header)
  44140. for k, v := range c.header_ {
  44141. reqHeaders[k] = v
  44142. }
  44143. reqHeaders.Set("User-Agent", c.s.userAgent())
  44144. if c.ifNoneMatch_ != "" {
  44145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44146. }
  44147. var body io.Reader = nil
  44148. c.urlParams_.Set("alt", alt)
  44149. c.urlParams_.Set("prettyPrint", "false")
  44150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  44151. urls += "?" + c.urlParams_.Encode()
  44152. req, err := http.NewRequest("GET", urls, body)
  44153. if err != nil {
  44154. return nil, err
  44155. }
  44156. req.Header = reqHeaders
  44157. googleapi.Expand(req.URL, map[string]string{
  44158. "project": c.project,
  44159. "zone": c.zone,
  44160. "disk": c.disk,
  44161. })
  44162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44163. }
  44164. // Do executes the "compute.disks.get" call.
  44165. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  44166. // code is an error. Response headers are in either
  44167. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  44168. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44169. // whether the returned error was because http.StatusNotModified was
  44170. // returned.
  44171. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  44172. gensupport.SetOptions(c.urlParams_, opts...)
  44173. res, err := c.doRequest("json")
  44174. if res != nil && res.StatusCode == http.StatusNotModified {
  44175. if res.Body != nil {
  44176. res.Body.Close()
  44177. }
  44178. return nil, &googleapi.Error{
  44179. Code: res.StatusCode,
  44180. Header: res.Header,
  44181. }
  44182. }
  44183. if err != nil {
  44184. return nil, err
  44185. }
  44186. defer googleapi.CloseBody(res)
  44187. if err := googleapi.CheckResponse(res); err != nil {
  44188. return nil, err
  44189. }
  44190. ret := &Disk{
  44191. ServerResponse: googleapi.ServerResponse{
  44192. Header: res.Header,
  44193. HTTPStatusCode: res.StatusCode,
  44194. },
  44195. }
  44196. target := &ret
  44197. if err := gensupport.DecodeResponse(target, res); err != nil {
  44198. return nil, err
  44199. }
  44200. return ret, nil
  44201. // {
  44202. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  44203. // "httpMethod": "GET",
  44204. // "id": "compute.disks.get",
  44205. // "parameterOrder": [
  44206. // "project",
  44207. // "zone",
  44208. // "disk"
  44209. // ],
  44210. // "parameters": {
  44211. // "disk": {
  44212. // "description": "Name of the persistent disk to return.",
  44213. // "location": "path",
  44214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44215. // "required": true,
  44216. // "type": "string"
  44217. // },
  44218. // "project": {
  44219. // "description": "Project ID for this request.",
  44220. // "location": "path",
  44221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44222. // "required": true,
  44223. // "type": "string"
  44224. // },
  44225. // "zone": {
  44226. // "description": "The name of the zone for this request.",
  44227. // "location": "path",
  44228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44229. // "required": true,
  44230. // "type": "string"
  44231. // }
  44232. // },
  44233. // "path": "{project}/zones/{zone}/disks/{disk}",
  44234. // "response": {
  44235. // "$ref": "Disk"
  44236. // },
  44237. // "scopes": [
  44238. // "https://www.googleapis.com/auth/cloud-platform",
  44239. // "https://www.googleapis.com/auth/compute",
  44240. // "https://www.googleapis.com/auth/compute.readonly"
  44241. // ]
  44242. // }
  44243. }
  44244. // method id "compute.disks.getIamPolicy":
  44245. type DisksGetIamPolicyCall struct {
  44246. s *Service
  44247. project string
  44248. zone string
  44249. resource string
  44250. urlParams_ gensupport.URLParams
  44251. ifNoneMatch_ string
  44252. ctx_ context.Context
  44253. header_ http.Header
  44254. }
  44255. // GetIamPolicy: Gets the access control policy for a resource. May be
  44256. // empty if no such policy or resource exists.
  44257. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  44258. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44259. c.project = project
  44260. c.zone = zone
  44261. c.resource = resource
  44262. return c
  44263. }
  44264. // Fields allows partial responses to be retrieved. See
  44265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44266. // for more information.
  44267. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  44268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44269. return c
  44270. }
  44271. // IfNoneMatch sets the optional parameter which makes the operation
  44272. // fail if the object's ETag matches the given value. This is useful for
  44273. // getting updates only after the object has changed since the last
  44274. // request. Use googleapi.IsNotModified to check whether the response
  44275. // error from Do is the result of In-None-Match.
  44276. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  44277. c.ifNoneMatch_ = entityTag
  44278. return c
  44279. }
  44280. // Context sets the context to be used in this call's Do method. Any
  44281. // pending HTTP request will be aborted if the provided context is
  44282. // canceled.
  44283. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  44284. c.ctx_ = ctx
  44285. return c
  44286. }
  44287. // Header returns an http.Header that can be modified by the caller to
  44288. // add HTTP headers to the request.
  44289. func (c *DisksGetIamPolicyCall) Header() http.Header {
  44290. if c.header_ == nil {
  44291. c.header_ = make(http.Header)
  44292. }
  44293. return c.header_
  44294. }
  44295. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  44296. reqHeaders := make(http.Header)
  44297. for k, v := range c.header_ {
  44298. reqHeaders[k] = v
  44299. }
  44300. reqHeaders.Set("User-Agent", c.s.userAgent())
  44301. if c.ifNoneMatch_ != "" {
  44302. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44303. }
  44304. var body io.Reader = nil
  44305. c.urlParams_.Set("alt", alt)
  44306. c.urlParams_.Set("prettyPrint", "false")
  44307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  44308. urls += "?" + c.urlParams_.Encode()
  44309. req, err := http.NewRequest("GET", urls, body)
  44310. if err != nil {
  44311. return nil, err
  44312. }
  44313. req.Header = reqHeaders
  44314. googleapi.Expand(req.URL, map[string]string{
  44315. "project": c.project,
  44316. "zone": c.zone,
  44317. "resource": c.resource,
  44318. })
  44319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44320. }
  44321. // Do executes the "compute.disks.getIamPolicy" call.
  44322. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  44323. // code is an error. Response headers are in either
  44324. // *Policy.ServerResponse.Header or (if a response was returned at all)
  44325. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44326. // check whether the returned error was because http.StatusNotModified
  44327. // was returned.
  44328. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  44329. gensupport.SetOptions(c.urlParams_, opts...)
  44330. res, err := c.doRequest("json")
  44331. if res != nil && res.StatusCode == http.StatusNotModified {
  44332. if res.Body != nil {
  44333. res.Body.Close()
  44334. }
  44335. return nil, &googleapi.Error{
  44336. Code: res.StatusCode,
  44337. Header: res.Header,
  44338. }
  44339. }
  44340. if err != nil {
  44341. return nil, err
  44342. }
  44343. defer googleapi.CloseBody(res)
  44344. if err := googleapi.CheckResponse(res); err != nil {
  44345. return nil, err
  44346. }
  44347. ret := &Policy{
  44348. ServerResponse: googleapi.ServerResponse{
  44349. Header: res.Header,
  44350. HTTPStatusCode: res.StatusCode,
  44351. },
  44352. }
  44353. target := &ret
  44354. if err := gensupport.DecodeResponse(target, res); err != nil {
  44355. return nil, err
  44356. }
  44357. return ret, nil
  44358. // {
  44359. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  44360. // "httpMethod": "GET",
  44361. // "id": "compute.disks.getIamPolicy",
  44362. // "parameterOrder": [
  44363. // "project",
  44364. // "zone",
  44365. // "resource"
  44366. // ],
  44367. // "parameters": {
  44368. // "project": {
  44369. // "description": "Project ID for this request.",
  44370. // "location": "path",
  44371. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44372. // "required": true,
  44373. // "type": "string"
  44374. // },
  44375. // "resource": {
  44376. // "description": "Name or id of the resource for this request.",
  44377. // "location": "path",
  44378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44379. // "required": true,
  44380. // "type": "string"
  44381. // },
  44382. // "zone": {
  44383. // "description": "The name of the zone for this request.",
  44384. // "location": "path",
  44385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44386. // "required": true,
  44387. // "type": "string"
  44388. // }
  44389. // },
  44390. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  44391. // "response": {
  44392. // "$ref": "Policy"
  44393. // },
  44394. // "scopes": [
  44395. // "https://www.googleapis.com/auth/cloud-platform",
  44396. // "https://www.googleapis.com/auth/compute",
  44397. // "https://www.googleapis.com/auth/compute.readonly"
  44398. // ]
  44399. // }
  44400. }
  44401. // method id "compute.disks.insert":
  44402. type DisksInsertCall struct {
  44403. s *Service
  44404. project string
  44405. zone string
  44406. disk *Disk
  44407. urlParams_ gensupport.URLParams
  44408. ctx_ context.Context
  44409. header_ http.Header
  44410. }
  44411. // Insert: Creates a persistent disk in the specified project using the
  44412. // data in the request. You can create a disk with a sourceImage, a
  44413. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  44414. // properties. You can also create a disk that is larger than the
  44415. // default size by specifying the sizeGb property.
  44416. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  44417. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  44418. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44419. c.project = project
  44420. c.zone = zone
  44421. c.disk = disk
  44422. return c
  44423. }
  44424. // RequestId sets the optional parameter "requestId": An optional
  44425. // request ID to identify requests. Specify a unique request ID so that
  44426. // if you must retry your request, the server will know to ignore the
  44427. // request if it has already been completed.
  44428. //
  44429. // For example, consider a situation where you make an initial request
  44430. // and the request times out. If you make the request again with the
  44431. // same request ID, the server can check if original operation with the
  44432. // same request ID was received, and if so, will ignore the second
  44433. // request. This prevents clients from accidentally creating duplicate
  44434. // commitments.
  44435. //
  44436. // The request ID must be a valid UUID with the exception that zero UUID
  44437. // is not supported (00000000-0000-0000-0000-000000000000).
  44438. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  44439. c.urlParams_.Set("requestId", requestId)
  44440. return c
  44441. }
  44442. // SourceImage sets the optional parameter "sourceImage": Source image
  44443. // to restore onto a disk.
  44444. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  44445. c.urlParams_.Set("sourceImage", sourceImage)
  44446. return c
  44447. }
  44448. // Fields allows partial responses to be retrieved. See
  44449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44450. // for more information.
  44451. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  44452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44453. return c
  44454. }
  44455. // Context sets the context to be used in this call's Do method. Any
  44456. // pending HTTP request will be aborted if the provided context is
  44457. // canceled.
  44458. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  44459. c.ctx_ = ctx
  44460. return c
  44461. }
  44462. // Header returns an http.Header that can be modified by the caller to
  44463. // add HTTP headers to the request.
  44464. func (c *DisksInsertCall) Header() http.Header {
  44465. if c.header_ == nil {
  44466. c.header_ = make(http.Header)
  44467. }
  44468. return c.header_
  44469. }
  44470. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  44471. reqHeaders := make(http.Header)
  44472. for k, v := range c.header_ {
  44473. reqHeaders[k] = v
  44474. }
  44475. reqHeaders.Set("User-Agent", c.s.userAgent())
  44476. var body io.Reader = nil
  44477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  44478. if err != nil {
  44479. return nil, err
  44480. }
  44481. reqHeaders.Set("Content-Type", "application/json")
  44482. c.urlParams_.Set("alt", alt)
  44483. c.urlParams_.Set("prettyPrint", "false")
  44484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  44485. urls += "?" + c.urlParams_.Encode()
  44486. req, err := http.NewRequest("POST", urls, body)
  44487. if err != nil {
  44488. return nil, err
  44489. }
  44490. req.Header = reqHeaders
  44491. googleapi.Expand(req.URL, map[string]string{
  44492. "project": c.project,
  44493. "zone": c.zone,
  44494. })
  44495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44496. }
  44497. // Do executes the "compute.disks.insert" call.
  44498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44499. // status code is an error. Response headers are in either
  44500. // *Operation.ServerResponse.Header or (if a response was returned at
  44501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44502. // to check whether the returned error was because
  44503. // http.StatusNotModified was returned.
  44504. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44505. gensupport.SetOptions(c.urlParams_, opts...)
  44506. res, err := c.doRequest("json")
  44507. if res != nil && res.StatusCode == http.StatusNotModified {
  44508. if res.Body != nil {
  44509. res.Body.Close()
  44510. }
  44511. return nil, &googleapi.Error{
  44512. Code: res.StatusCode,
  44513. Header: res.Header,
  44514. }
  44515. }
  44516. if err != nil {
  44517. return nil, err
  44518. }
  44519. defer googleapi.CloseBody(res)
  44520. if err := googleapi.CheckResponse(res); err != nil {
  44521. return nil, err
  44522. }
  44523. ret := &Operation{
  44524. ServerResponse: googleapi.ServerResponse{
  44525. Header: res.Header,
  44526. HTTPStatusCode: res.StatusCode,
  44527. },
  44528. }
  44529. target := &ret
  44530. if err := gensupport.DecodeResponse(target, res); err != nil {
  44531. return nil, err
  44532. }
  44533. return ret, nil
  44534. // {
  44535. // "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.",
  44536. // "httpMethod": "POST",
  44537. // "id": "compute.disks.insert",
  44538. // "parameterOrder": [
  44539. // "project",
  44540. // "zone"
  44541. // ],
  44542. // "parameters": {
  44543. // "project": {
  44544. // "description": "Project ID for this request.",
  44545. // "location": "path",
  44546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44547. // "required": true,
  44548. // "type": "string"
  44549. // },
  44550. // "requestId": {
  44551. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44552. // "location": "query",
  44553. // "type": "string"
  44554. // },
  44555. // "sourceImage": {
  44556. // "description": "Optional. Source image to restore onto a disk.",
  44557. // "location": "query",
  44558. // "type": "string"
  44559. // },
  44560. // "zone": {
  44561. // "description": "The name of the zone for this request.",
  44562. // "location": "path",
  44563. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44564. // "required": true,
  44565. // "type": "string"
  44566. // }
  44567. // },
  44568. // "path": "{project}/zones/{zone}/disks",
  44569. // "request": {
  44570. // "$ref": "Disk"
  44571. // },
  44572. // "response": {
  44573. // "$ref": "Operation"
  44574. // },
  44575. // "scopes": [
  44576. // "https://www.googleapis.com/auth/cloud-platform",
  44577. // "https://www.googleapis.com/auth/compute"
  44578. // ]
  44579. // }
  44580. }
  44581. // method id "compute.disks.list":
  44582. type DisksListCall struct {
  44583. s *Service
  44584. project string
  44585. zone string
  44586. urlParams_ gensupport.URLParams
  44587. ifNoneMatch_ string
  44588. ctx_ context.Context
  44589. header_ http.Header
  44590. }
  44591. // List: Retrieves a list of persistent disks contained within the
  44592. // specified zone.
  44593. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  44594. func (r *DisksService) List(project string, zone string) *DisksListCall {
  44595. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44596. c.project = project
  44597. c.zone = zone
  44598. return c
  44599. }
  44600. // Filter sets the optional parameter "filter": A filter expression that
  44601. // filters resources listed in the response. The expression must specify
  44602. // the field name, a comparison operator, and the value that you want to
  44603. // use for filtering. The value must be a string, a number, or a
  44604. // boolean. The comparison operator must be either =, !=, >, or <.
  44605. //
  44606. // For example, if you are filtering Compute Engine instances, you can
  44607. // exclude instances named example-instance by specifying name !=
  44608. // example-instance.
  44609. //
  44610. // You can also filter nested fields. For example, you could specify
  44611. // scheduling.automaticRestart = false to include instances only if they
  44612. // are not scheduled for automatic restarts. You can use filtering on
  44613. // nested fields to filter based on resource labels.
  44614. //
  44615. // To filter on multiple expressions, provide each separate expression
  44616. // within parentheses. For example, (scheduling.automaticRestart = true)
  44617. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44618. // AND expression. However, you can include AND and OR expressions
  44619. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44620. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44621. // true).
  44622. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  44623. c.urlParams_.Set("filter", filter)
  44624. return c
  44625. }
  44626. // MaxResults sets the optional parameter "maxResults": The maximum
  44627. // number of results per page that should be returned. If the number of
  44628. // available results is larger than maxResults, Compute Engine returns a
  44629. // nextPageToken that can be used to get the next page of results in
  44630. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44631. // (Default: 500)
  44632. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  44633. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44634. return c
  44635. }
  44636. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44637. // a certain order. By default, results are returned in alphanumerical
  44638. // order based on the resource name.
  44639. //
  44640. // You can also sort results in descending order based on the creation
  44641. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44642. // based on the creationTimestamp field in reverse chronological order
  44643. // (newest result first). Use this to sort resources like operations so
  44644. // that the newest operation is returned first.
  44645. //
  44646. // Currently, only sorting by name or creationTimestamp desc is
  44647. // supported.
  44648. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  44649. c.urlParams_.Set("orderBy", orderBy)
  44650. return c
  44651. }
  44652. // PageToken sets the optional parameter "pageToken": Specifies a page
  44653. // token to use. Set pageToken to the nextPageToken returned by a
  44654. // previous list request to get the next page of results.
  44655. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  44656. c.urlParams_.Set("pageToken", pageToken)
  44657. return c
  44658. }
  44659. // Fields allows partial responses to be retrieved. See
  44660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44661. // for more information.
  44662. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  44663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44664. return c
  44665. }
  44666. // IfNoneMatch sets the optional parameter which makes the operation
  44667. // fail if the object's ETag matches the given value. This is useful for
  44668. // getting updates only after the object has changed since the last
  44669. // request. Use googleapi.IsNotModified to check whether the response
  44670. // error from Do is the result of In-None-Match.
  44671. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  44672. c.ifNoneMatch_ = entityTag
  44673. return c
  44674. }
  44675. // Context sets the context to be used in this call's Do method. Any
  44676. // pending HTTP request will be aborted if the provided context is
  44677. // canceled.
  44678. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  44679. c.ctx_ = ctx
  44680. return c
  44681. }
  44682. // Header returns an http.Header that can be modified by the caller to
  44683. // add HTTP headers to the request.
  44684. func (c *DisksListCall) Header() http.Header {
  44685. if c.header_ == nil {
  44686. c.header_ = make(http.Header)
  44687. }
  44688. return c.header_
  44689. }
  44690. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  44691. reqHeaders := make(http.Header)
  44692. for k, v := range c.header_ {
  44693. reqHeaders[k] = v
  44694. }
  44695. reqHeaders.Set("User-Agent", c.s.userAgent())
  44696. if c.ifNoneMatch_ != "" {
  44697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44698. }
  44699. var body io.Reader = nil
  44700. c.urlParams_.Set("alt", alt)
  44701. c.urlParams_.Set("prettyPrint", "false")
  44702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  44703. urls += "?" + c.urlParams_.Encode()
  44704. req, err := http.NewRequest("GET", urls, body)
  44705. if err != nil {
  44706. return nil, err
  44707. }
  44708. req.Header = reqHeaders
  44709. googleapi.Expand(req.URL, map[string]string{
  44710. "project": c.project,
  44711. "zone": c.zone,
  44712. })
  44713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44714. }
  44715. // Do executes the "compute.disks.list" call.
  44716. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  44717. // code is an error. Response headers are in either
  44718. // *DiskList.ServerResponse.Header or (if a response was returned at
  44719. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44720. // to check whether the returned error was because
  44721. // http.StatusNotModified was returned.
  44722. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  44723. gensupport.SetOptions(c.urlParams_, opts...)
  44724. res, err := c.doRequest("json")
  44725. if res != nil && res.StatusCode == http.StatusNotModified {
  44726. if res.Body != nil {
  44727. res.Body.Close()
  44728. }
  44729. return nil, &googleapi.Error{
  44730. Code: res.StatusCode,
  44731. Header: res.Header,
  44732. }
  44733. }
  44734. if err != nil {
  44735. return nil, err
  44736. }
  44737. defer googleapi.CloseBody(res)
  44738. if err := googleapi.CheckResponse(res); err != nil {
  44739. return nil, err
  44740. }
  44741. ret := &DiskList{
  44742. ServerResponse: googleapi.ServerResponse{
  44743. Header: res.Header,
  44744. HTTPStatusCode: res.StatusCode,
  44745. },
  44746. }
  44747. target := &ret
  44748. if err := gensupport.DecodeResponse(target, res); err != nil {
  44749. return nil, err
  44750. }
  44751. return ret, nil
  44752. // {
  44753. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  44754. // "httpMethod": "GET",
  44755. // "id": "compute.disks.list",
  44756. // "parameterOrder": [
  44757. // "project",
  44758. // "zone"
  44759. // ],
  44760. // "parameters": {
  44761. // "filter": {
  44762. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44763. // "location": "query",
  44764. // "type": "string"
  44765. // },
  44766. // "maxResults": {
  44767. // "default": "500",
  44768. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44769. // "format": "uint32",
  44770. // "location": "query",
  44771. // "minimum": "0",
  44772. // "type": "integer"
  44773. // },
  44774. // "orderBy": {
  44775. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44776. // "location": "query",
  44777. // "type": "string"
  44778. // },
  44779. // "pageToken": {
  44780. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44781. // "location": "query",
  44782. // "type": "string"
  44783. // },
  44784. // "project": {
  44785. // "description": "Project ID for this request.",
  44786. // "location": "path",
  44787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44788. // "required": true,
  44789. // "type": "string"
  44790. // },
  44791. // "zone": {
  44792. // "description": "The name of the zone for this request.",
  44793. // "location": "path",
  44794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44795. // "required": true,
  44796. // "type": "string"
  44797. // }
  44798. // },
  44799. // "path": "{project}/zones/{zone}/disks",
  44800. // "response": {
  44801. // "$ref": "DiskList"
  44802. // },
  44803. // "scopes": [
  44804. // "https://www.googleapis.com/auth/cloud-platform",
  44805. // "https://www.googleapis.com/auth/compute",
  44806. // "https://www.googleapis.com/auth/compute.readonly"
  44807. // ]
  44808. // }
  44809. }
  44810. // Pages invokes f for each page of results.
  44811. // A non-nil error returned from f will halt the iteration.
  44812. // The provided context supersedes any context provided to the Context method.
  44813. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  44814. c.ctx_ = ctx
  44815. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44816. for {
  44817. x, err := c.Do()
  44818. if err != nil {
  44819. return err
  44820. }
  44821. if err := f(x); err != nil {
  44822. return err
  44823. }
  44824. if x.NextPageToken == "" {
  44825. return nil
  44826. }
  44827. c.PageToken(x.NextPageToken)
  44828. }
  44829. }
  44830. // method id "compute.disks.removeResourcePolicies":
  44831. type DisksRemoveResourcePoliciesCall struct {
  44832. s *Service
  44833. project string
  44834. zone string
  44835. disk string
  44836. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  44837. urlParams_ gensupport.URLParams
  44838. ctx_ context.Context
  44839. header_ http.Header
  44840. }
  44841. // RemoveResourcePolicies: Removes resource policies from a disk.
  44842. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  44843. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44844. c.project = project
  44845. c.zone = zone
  44846. c.disk = disk
  44847. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  44848. return c
  44849. }
  44850. // RequestId sets the optional parameter "requestId": An optional
  44851. // request ID to identify requests. Specify a unique request ID so that
  44852. // if you must retry your request, the server will know to ignore the
  44853. // request if it has already been completed.
  44854. //
  44855. // For example, consider a situation where you make an initial request
  44856. // and the request times out. If you make the request again with the
  44857. // same request ID, the server can check if original operation with the
  44858. // same request ID was received, and if so, will ignore the second
  44859. // request. This prevents clients from accidentally creating duplicate
  44860. // commitments.
  44861. //
  44862. // The request ID must be a valid UUID with the exception that zero UUID
  44863. // is not supported (00000000-0000-0000-0000-000000000000).
  44864. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  44865. c.urlParams_.Set("requestId", requestId)
  44866. return c
  44867. }
  44868. // Fields allows partial responses to be retrieved. See
  44869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44870. // for more information.
  44871. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  44872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44873. return c
  44874. }
  44875. // Context sets the context to be used in this call's Do method. Any
  44876. // pending HTTP request will be aborted if the provided context is
  44877. // canceled.
  44878. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  44879. c.ctx_ = ctx
  44880. return c
  44881. }
  44882. // Header returns an http.Header that can be modified by the caller to
  44883. // add HTTP headers to the request.
  44884. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  44885. if c.header_ == nil {
  44886. c.header_ = make(http.Header)
  44887. }
  44888. return c.header_
  44889. }
  44890. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  44891. reqHeaders := make(http.Header)
  44892. for k, v := range c.header_ {
  44893. reqHeaders[k] = v
  44894. }
  44895. reqHeaders.Set("User-Agent", c.s.userAgent())
  44896. var body io.Reader = nil
  44897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  44898. if err != nil {
  44899. return nil, err
  44900. }
  44901. reqHeaders.Set("Content-Type", "application/json")
  44902. c.urlParams_.Set("alt", alt)
  44903. c.urlParams_.Set("prettyPrint", "false")
  44904. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  44905. urls += "?" + c.urlParams_.Encode()
  44906. req, err := http.NewRequest("POST", urls, body)
  44907. if err != nil {
  44908. return nil, err
  44909. }
  44910. req.Header = reqHeaders
  44911. googleapi.Expand(req.URL, map[string]string{
  44912. "project": c.project,
  44913. "zone": c.zone,
  44914. "disk": c.disk,
  44915. })
  44916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44917. }
  44918. // Do executes the "compute.disks.removeResourcePolicies" call.
  44919. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44920. // status code is an error. Response headers are in either
  44921. // *Operation.ServerResponse.Header or (if a response was returned at
  44922. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44923. // to check whether the returned error was because
  44924. // http.StatusNotModified was returned.
  44925. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44926. gensupport.SetOptions(c.urlParams_, opts...)
  44927. res, err := c.doRequest("json")
  44928. if res != nil && res.StatusCode == http.StatusNotModified {
  44929. if res.Body != nil {
  44930. res.Body.Close()
  44931. }
  44932. return nil, &googleapi.Error{
  44933. Code: res.StatusCode,
  44934. Header: res.Header,
  44935. }
  44936. }
  44937. if err != nil {
  44938. return nil, err
  44939. }
  44940. defer googleapi.CloseBody(res)
  44941. if err := googleapi.CheckResponse(res); err != nil {
  44942. return nil, err
  44943. }
  44944. ret := &Operation{
  44945. ServerResponse: googleapi.ServerResponse{
  44946. Header: res.Header,
  44947. HTTPStatusCode: res.StatusCode,
  44948. },
  44949. }
  44950. target := &ret
  44951. if err := gensupport.DecodeResponse(target, res); err != nil {
  44952. return nil, err
  44953. }
  44954. return ret, nil
  44955. // {
  44956. // "description": "Removes resource policies from a disk.",
  44957. // "httpMethod": "POST",
  44958. // "id": "compute.disks.removeResourcePolicies",
  44959. // "parameterOrder": [
  44960. // "project",
  44961. // "zone",
  44962. // "disk"
  44963. // ],
  44964. // "parameters": {
  44965. // "disk": {
  44966. // "description": "The disk name for this request.",
  44967. // "location": "path",
  44968. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44969. // "required": true,
  44970. // "type": "string"
  44971. // },
  44972. // "project": {
  44973. // "description": "Project ID for this request.",
  44974. // "location": "path",
  44975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44976. // "required": true,
  44977. // "type": "string"
  44978. // },
  44979. // "requestId": {
  44980. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44981. // "location": "query",
  44982. // "type": "string"
  44983. // },
  44984. // "zone": {
  44985. // "description": "The name of the zone for this request.",
  44986. // "location": "path",
  44987. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44988. // "required": true,
  44989. // "type": "string"
  44990. // }
  44991. // },
  44992. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  44993. // "request": {
  44994. // "$ref": "DisksRemoveResourcePoliciesRequest"
  44995. // },
  44996. // "response": {
  44997. // "$ref": "Operation"
  44998. // },
  44999. // "scopes": [
  45000. // "https://www.googleapis.com/auth/cloud-platform",
  45001. // "https://www.googleapis.com/auth/compute"
  45002. // ]
  45003. // }
  45004. }
  45005. // method id "compute.disks.resize":
  45006. type DisksResizeCall struct {
  45007. s *Service
  45008. project string
  45009. zone string
  45010. disk string
  45011. disksresizerequest *DisksResizeRequest
  45012. urlParams_ gensupport.URLParams
  45013. ctx_ context.Context
  45014. header_ http.Header
  45015. }
  45016. // Resize: Resizes the specified persistent disk. You can only increase
  45017. // the size of the disk.
  45018. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  45019. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45020. c.project = project
  45021. c.zone = zone
  45022. c.disk = disk
  45023. c.disksresizerequest = disksresizerequest
  45024. return c
  45025. }
  45026. // RequestId sets the optional parameter "requestId": An optional
  45027. // request ID to identify requests. Specify a unique request ID so that
  45028. // if you must retry your request, the server will know to ignore the
  45029. // request if it has already been completed.
  45030. //
  45031. // For example, consider a situation where you make an initial request
  45032. // and the request times out. If you make the request again with the
  45033. // same request ID, the server can check if original operation with the
  45034. // same request ID was received, and if so, will ignore the second
  45035. // request. This prevents clients from accidentally creating duplicate
  45036. // commitments.
  45037. //
  45038. // The request ID must be a valid UUID with the exception that zero UUID
  45039. // is not supported (00000000-0000-0000-0000-000000000000).
  45040. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  45041. c.urlParams_.Set("requestId", requestId)
  45042. return c
  45043. }
  45044. // Fields allows partial responses to be retrieved. See
  45045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45046. // for more information.
  45047. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  45048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45049. return c
  45050. }
  45051. // Context sets the context to be used in this call's Do method. Any
  45052. // pending HTTP request will be aborted if the provided context is
  45053. // canceled.
  45054. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  45055. c.ctx_ = ctx
  45056. return c
  45057. }
  45058. // Header returns an http.Header that can be modified by the caller to
  45059. // add HTTP headers to the request.
  45060. func (c *DisksResizeCall) Header() http.Header {
  45061. if c.header_ == nil {
  45062. c.header_ = make(http.Header)
  45063. }
  45064. return c.header_
  45065. }
  45066. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  45067. reqHeaders := make(http.Header)
  45068. for k, v := range c.header_ {
  45069. reqHeaders[k] = v
  45070. }
  45071. reqHeaders.Set("User-Agent", c.s.userAgent())
  45072. var body io.Reader = nil
  45073. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  45074. if err != nil {
  45075. return nil, err
  45076. }
  45077. reqHeaders.Set("Content-Type", "application/json")
  45078. c.urlParams_.Set("alt", alt)
  45079. c.urlParams_.Set("prettyPrint", "false")
  45080. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  45081. urls += "?" + c.urlParams_.Encode()
  45082. req, err := http.NewRequest("POST", urls, body)
  45083. if err != nil {
  45084. return nil, err
  45085. }
  45086. req.Header = reqHeaders
  45087. googleapi.Expand(req.URL, map[string]string{
  45088. "project": c.project,
  45089. "zone": c.zone,
  45090. "disk": c.disk,
  45091. })
  45092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45093. }
  45094. // Do executes the "compute.disks.resize" call.
  45095. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45096. // status code is an error. Response headers are in either
  45097. // *Operation.ServerResponse.Header or (if a response was returned at
  45098. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45099. // to check whether the returned error was because
  45100. // http.StatusNotModified was returned.
  45101. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45102. gensupport.SetOptions(c.urlParams_, opts...)
  45103. res, err := c.doRequest("json")
  45104. if res != nil && res.StatusCode == http.StatusNotModified {
  45105. if res.Body != nil {
  45106. res.Body.Close()
  45107. }
  45108. return nil, &googleapi.Error{
  45109. Code: res.StatusCode,
  45110. Header: res.Header,
  45111. }
  45112. }
  45113. if err != nil {
  45114. return nil, err
  45115. }
  45116. defer googleapi.CloseBody(res)
  45117. if err := googleapi.CheckResponse(res); err != nil {
  45118. return nil, err
  45119. }
  45120. ret := &Operation{
  45121. ServerResponse: googleapi.ServerResponse{
  45122. Header: res.Header,
  45123. HTTPStatusCode: res.StatusCode,
  45124. },
  45125. }
  45126. target := &ret
  45127. if err := gensupport.DecodeResponse(target, res); err != nil {
  45128. return nil, err
  45129. }
  45130. return ret, nil
  45131. // {
  45132. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  45133. // "httpMethod": "POST",
  45134. // "id": "compute.disks.resize",
  45135. // "parameterOrder": [
  45136. // "project",
  45137. // "zone",
  45138. // "disk"
  45139. // ],
  45140. // "parameters": {
  45141. // "disk": {
  45142. // "description": "The name of the persistent disk.",
  45143. // "location": "path",
  45144. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45145. // "required": true,
  45146. // "type": "string"
  45147. // },
  45148. // "project": {
  45149. // "description": "Project ID for this request.",
  45150. // "location": "path",
  45151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45152. // "required": true,
  45153. // "type": "string"
  45154. // },
  45155. // "requestId": {
  45156. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45157. // "location": "query",
  45158. // "type": "string"
  45159. // },
  45160. // "zone": {
  45161. // "description": "The name of the zone for this request.",
  45162. // "location": "path",
  45163. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45164. // "required": true,
  45165. // "type": "string"
  45166. // }
  45167. // },
  45168. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  45169. // "request": {
  45170. // "$ref": "DisksResizeRequest"
  45171. // },
  45172. // "response": {
  45173. // "$ref": "Operation"
  45174. // },
  45175. // "scopes": [
  45176. // "https://www.googleapis.com/auth/cloud-platform",
  45177. // "https://www.googleapis.com/auth/compute"
  45178. // ]
  45179. // }
  45180. }
  45181. // method id "compute.disks.setIamPolicy":
  45182. type DisksSetIamPolicyCall struct {
  45183. s *Service
  45184. project string
  45185. zone string
  45186. resource string
  45187. zonesetpolicyrequest *ZoneSetPolicyRequest
  45188. urlParams_ gensupport.URLParams
  45189. ctx_ context.Context
  45190. header_ http.Header
  45191. }
  45192. // SetIamPolicy: Sets the access control policy on the specified
  45193. // resource. Replaces any existing policy.
  45194. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  45195. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45196. c.project = project
  45197. c.zone = zone
  45198. c.resource = resource
  45199. c.zonesetpolicyrequest = zonesetpolicyrequest
  45200. return c
  45201. }
  45202. // Fields allows partial responses to be retrieved. See
  45203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45204. // for more information.
  45205. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  45206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45207. return c
  45208. }
  45209. // Context sets the context to be used in this call's Do method. Any
  45210. // pending HTTP request will be aborted if the provided context is
  45211. // canceled.
  45212. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  45213. c.ctx_ = ctx
  45214. return c
  45215. }
  45216. // Header returns an http.Header that can be modified by the caller to
  45217. // add HTTP headers to the request.
  45218. func (c *DisksSetIamPolicyCall) Header() http.Header {
  45219. if c.header_ == nil {
  45220. c.header_ = make(http.Header)
  45221. }
  45222. return c.header_
  45223. }
  45224. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  45225. reqHeaders := make(http.Header)
  45226. for k, v := range c.header_ {
  45227. reqHeaders[k] = v
  45228. }
  45229. reqHeaders.Set("User-Agent", c.s.userAgent())
  45230. var body io.Reader = nil
  45231. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  45232. if err != nil {
  45233. return nil, err
  45234. }
  45235. reqHeaders.Set("Content-Type", "application/json")
  45236. c.urlParams_.Set("alt", alt)
  45237. c.urlParams_.Set("prettyPrint", "false")
  45238. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  45239. urls += "?" + c.urlParams_.Encode()
  45240. req, err := http.NewRequest("POST", urls, body)
  45241. if err != nil {
  45242. return nil, err
  45243. }
  45244. req.Header = reqHeaders
  45245. googleapi.Expand(req.URL, map[string]string{
  45246. "project": c.project,
  45247. "zone": c.zone,
  45248. "resource": c.resource,
  45249. })
  45250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45251. }
  45252. // Do executes the "compute.disks.setIamPolicy" call.
  45253. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  45254. // code is an error. Response headers are in either
  45255. // *Policy.ServerResponse.Header or (if a response was returned at all)
  45256. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  45257. // check whether the returned error was because http.StatusNotModified
  45258. // was returned.
  45259. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  45260. gensupport.SetOptions(c.urlParams_, opts...)
  45261. res, err := c.doRequest("json")
  45262. if res != nil && res.StatusCode == http.StatusNotModified {
  45263. if res.Body != nil {
  45264. res.Body.Close()
  45265. }
  45266. return nil, &googleapi.Error{
  45267. Code: res.StatusCode,
  45268. Header: res.Header,
  45269. }
  45270. }
  45271. if err != nil {
  45272. return nil, err
  45273. }
  45274. defer googleapi.CloseBody(res)
  45275. if err := googleapi.CheckResponse(res); err != nil {
  45276. return nil, err
  45277. }
  45278. ret := &Policy{
  45279. ServerResponse: googleapi.ServerResponse{
  45280. Header: res.Header,
  45281. HTTPStatusCode: res.StatusCode,
  45282. },
  45283. }
  45284. target := &ret
  45285. if err := gensupport.DecodeResponse(target, res); err != nil {
  45286. return nil, err
  45287. }
  45288. return ret, nil
  45289. // {
  45290. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  45291. // "httpMethod": "POST",
  45292. // "id": "compute.disks.setIamPolicy",
  45293. // "parameterOrder": [
  45294. // "project",
  45295. // "zone",
  45296. // "resource"
  45297. // ],
  45298. // "parameters": {
  45299. // "project": {
  45300. // "description": "Project ID for this request.",
  45301. // "location": "path",
  45302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45303. // "required": true,
  45304. // "type": "string"
  45305. // },
  45306. // "resource": {
  45307. // "description": "Name or id of the resource for this request.",
  45308. // "location": "path",
  45309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45310. // "required": true,
  45311. // "type": "string"
  45312. // },
  45313. // "zone": {
  45314. // "description": "The name of the zone for this request.",
  45315. // "location": "path",
  45316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45317. // "required": true,
  45318. // "type": "string"
  45319. // }
  45320. // },
  45321. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  45322. // "request": {
  45323. // "$ref": "ZoneSetPolicyRequest"
  45324. // },
  45325. // "response": {
  45326. // "$ref": "Policy"
  45327. // },
  45328. // "scopes": [
  45329. // "https://www.googleapis.com/auth/cloud-platform",
  45330. // "https://www.googleapis.com/auth/compute"
  45331. // ]
  45332. // }
  45333. }
  45334. // method id "compute.disks.setLabels":
  45335. type DisksSetLabelsCall struct {
  45336. s *Service
  45337. project string
  45338. zone string
  45339. resource string
  45340. zonesetlabelsrequest *ZoneSetLabelsRequest
  45341. urlParams_ gensupport.URLParams
  45342. ctx_ context.Context
  45343. header_ http.Header
  45344. }
  45345. // SetLabels: Sets the labels on a disk. To learn more about labels,
  45346. // read the Labeling Resources documentation.
  45347. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  45348. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45349. c.project = project
  45350. c.zone = zone
  45351. c.resource = resource
  45352. c.zonesetlabelsrequest = zonesetlabelsrequest
  45353. return c
  45354. }
  45355. // RequestId sets the optional parameter "requestId": An optional
  45356. // request ID to identify requests. Specify a unique request ID so that
  45357. // if you must retry your request, the server will know to ignore the
  45358. // request if it has already been completed.
  45359. //
  45360. // For example, consider a situation where you make an initial request
  45361. // and the request times out. If you make the request again with the
  45362. // same request ID, the server can check if original operation with the
  45363. // same request ID was received, and if so, will ignore the second
  45364. // request. This prevents clients from accidentally creating duplicate
  45365. // commitments.
  45366. //
  45367. // The request ID must be a valid UUID with the exception that zero UUID
  45368. // is not supported (00000000-0000-0000-0000-000000000000).
  45369. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  45370. c.urlParams_.Set("requestId", requestId)
  45371. return c
  45372. }
  45373. // Fields allows partial responses to be retrieved. See
  45374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45375. // for more information.
  45376. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  45377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45378. return c
  45379. }
  45380. // Context sets the context to be used in this call's Do method. Any
  45381. // pending HTTP request will be aborted if the provided context is
  45382. // canceled.
  45383. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  45384. c.ctx_ = ctx
  45385. return c
  45386. }
  45387. // Header returns an http.Header that can be modified by the caller to
  45388. // add HTTP headers to the request.
  45389. func (c *DisksSetLabelsCall) Header() http.Header {
  45390. if c.header_ == nil {
  45391. c.header_ = make(http.Header)
  45392. }
  45393. return c.header_
  45394. }
  45395. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  45396. reqHeaders := make(http.Header)
  45397. for k, v := range c.header_ {
  45398. reqHeaders[k] = v
  45399. }
  45400. reqHeaders.Set("User-Agent", c.s.userAgent())
  45401. var body io.Reader = nil
  45402. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  45403. if err != nil {
  45404. return nil, err
  45405. }
  45406. reqHeaders.Set("Content-Type", "application/json")
  45407. c.urlParams_.Set("alt", alt)
  45408. c.urlParams_.Set("prettyPrint", "false")
  45409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  45410. urls += "?" + c.urlParams_.Encode()
  45411. req, err := http.NewRequest("POST", urls, body)
  45412. if err != nil {
  45413. return nil, err
  45414. }
  45415. req.Header = reqHeaders
  45416. googleapi.Expand(req.URL, map[string]string{
  45417. "project": c.project,
  45418. "zone": c.zone,
  45419. "resource": c.resource,
  45420. })
  45421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45422. }
  45423. // Do executes the "compute.disks.setLabels" call.
  45424. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45425. // status code is an error. Response headers are in either
  45426. // *Operation.ServerResponse.Header or (if a response was returned at
  45427. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45428. // to check whether the returned error was because
  45429. // http.StatusNotModified was returned.
  45430. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45431. gensupport.SetOptions(c.urlParams_, opts...)
  45432. res, err := c.doRequest("json")
  45433. if res != nil && res.StatusCode == http.StatusNotModified {
  45434. if res.Body != nil {
  45435. res.Body.Close()
  45436. }
  45437. return nil, &googleapi.Error{
  45438. Code: res.StatusCode,
  45439. Header: res.Header,
  45440. }
  45441. }
  45442. if err != nil {
  45443. return nil, err
  45444. }
  45445. defer googleapi.CloseBody(res)
  45446. if err := googleapi.CheckResponse(res); err != nil {
  45447. return nil, err
  45448. }
  45449. ret := &Operation{
  45450. ServerResponse: googleapi.ServerResponse{
  45451. Header: res.Header,
  45452. HTTPStatusCode: res.StatusCode,
  45453. },
  45454. }
  45455. target := &ret
  45456. if err := gensupport.DecodeResponse(target, res); err != nil {
  45457. return nil, err
  45458. }
  45459. return ret, nil
  45460. // {
  45461. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  45462. // "httpMethod": "POST",
  45463. // "id": "compute.disks.setLabels",
  45464. // "parameterOrder": [
  45465. // "project",
  45466. // "zone",
  45467. // "resource"
  45468. // ],
  45469. // "parameters": {
  45470. // "project": {
  45471. // "description": "Project ID for this request.",
  45472. // "location": "path",
  45473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45474. // "required": true,
  45475. // "type": "string"
  45476. // },
  45477. // "requestId": {
  45478. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45479. // "location": "query",
  45480. // "type": "string"
  45481. // },
  45482. // "resource": {
  45483. // "description": "Name or id of the resource for this request.",
  45484. // "location": "path",
  45485. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45486. // "required": true,
  45487. // "type": "string"
  45488. // },
  45489. // "zone": {
  45490. // "description": "The name of the zone for this request.",
  45491. // "location": "path",
  45492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45493. // "required": true,
  45494. // "type": "string"
  45495. // }
  45496. // },
  45497. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  45498. // "request": {
  45499. // "$ref": "ZoneSetLabelsRequest"
  45500. // },
  45501. // "response": {
  45502. // "$ref": "Operation"
  45503. // },
  45504. // "scopes": [
  45505. // "https://www.googleapis.com/auth/cloud-platform",
  45506. // "https://www.googleapis.com/auth/compute"
  45507. // ]
  45508. // }
  45509. }
  45510. // method id "compute.disks.testIamPermissions":
  45511. type DisksTestIamPermissionsCall struct {
  45512. s *Service
  45513. project string
  45514. zone string
  45515. resource string
  45516. testpermissionsrequest *TestPermissionsRequest
  45517. urlParams_ gensupport.URLParams
  45518. ctx_ context.Context
  45519. header_ http.Header
  45520. }
  45521. // TestIamPermissions: Returns permissions that a caller has on the
  45522. // specified resource.
  45523. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  45524. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45525. c.project = project
  45526. c.zone = zone
  45527. c.resource = resource
  45528. c.testpermissionsrequest = testpermissionsrequest
  45529. return c
  45530. }
  45531. // Fields allows partial responses to be retrieved. See
  45532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45533. // for more information.
  45534. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  45535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45536. return c
  45537. }
  45538. // Context sets the context to be used in this call's Do method. Any
  45539. // pending HTTP request will be aborted if the provided context is
  45540. // canceled.
  45541. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  45542. c.ctx_ = ctx
  45543. return c
  45544. }
  45545. // Header returns an http.Header that can be modified by the caller to
  45546. // add HTTP headers to the request.
  45547. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  45548. if c.header_ == nil {
  45549. c.header_ = make(http.Header)
  45550. }
  45551. return c.header_
  45552. }
  45553. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45554. reqHeaders := make(http.Header)
  45555. for k, v := range c.header_ {
  45556. reqHeaders[k] = v
  45557. }
  45558. reqHeaders.Set("User-Agent", c.s.userAgent())
  45559. var body io.Reader = nil
  45560. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45561. if err != nil {
  45562. return nil, err
  45563. }
  45564. reqHeaders.Set("Content-Type", "application/json")
  45565. c.urlParams_.Set("alt", alt)
  45566. c.urlParams_.Set("prettyPrint", "false")
  45567. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  45568. urls += "?" + c.urlParams_.Encode()
  45569. req, err := http.NewRequest("POST", urls, body)
  45570. if err != nil {
  45571. return nil, err
  45572. }
  45573. req.Header = reqHeaders
  45574. googleapi.Expand(req.URL, map[string]string{
  45575. "project": c.project,
  45576. "zone": c.zone,
  45577. "resource": c.resource,
  45578. })
  45579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45580. }
  45581. // Do executes the "compute.disks.testIamPermissions" call.
  45582. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45583. // non-2xx status code is an error. Response headers are in either
  45584. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45585. // returned at all) in error.(*googleapi.Error).Header. Use
  45586. // googleapi.IsNotModified to check whether the returned error was
  45587. // because http.StatusNotModified was returned.
  45588. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45589. gensupport.SetOptions(c.urlParams_, opts...)
  45590. res, err := c.doRequest("json")
  45591. if res != nil && res.StatusCode == http.StatusNotModified {
  45592. if res.Body != nil {
  45593. res.Body.Close()
  45594. }
  45595. return nil, &googleapi.Error{
  45596. Code: res.StatusCode,
  45597. Header: res.Header,
  45598. }
  45599. }
  45600. if err != nil {
  45601. return nil, err
  45602. }
  45603. defer googleapi.CloseBody(res)
  45604. if err := googleapi.CheckResponse(res); err != nil {
  45605. return nil, err
  45606. }
  45607. ret := &TestPermissionsResponse{
  45608. ServerResponse: googleapi.ServerResponse{
  45609. Header: res.Header,
  45610. HTTPStatusCode: res.StatusCode,
  45611. },
  45612. }
  45613. target := &ret
  45614. if err := gensupport.DecodeResponse(target, res); err != nil {
  45615. return nil, err
  45616. }
  45617. return ret, nil
  45618. // {
  45619. // "description": "Returns permissions that a caller has on the specified resource.",
  45620. // "httpMethod": "POST",
  45621. // "id": "compute.disks.testIamPermissions",
  45622. // "parameterOrder": [
  45623. // "project",
  45624. // "zone",
  45625. // "resource"
  45626. // ],
  45627. // "parameters": {
  45628. // "project": {
  45629. // "description": "Project ID for this request.",
  45630. // "location": "path",
  45631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45632. // "required": true,
  45633. // "type": "string"
  45634. // },
  45635. // "resource": {
  45636. // "description": "Name or id of the resource for this request.",
  45637. // "location": "path",
  45638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45639. // "required": true,
  45640. // "type": "string"
  45641. // },
  45642. // "zone": {
  45643. // "description": "The name of the zone for this request.",
  45644. // "location": "path",
  45645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45646. // "required": true,
  45647. // "type": "string"
  45648. // }
  45649. // },
  45650. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  45651. // "request": {
  45652. // "$ref": "TestPermissionsRequest"
  45653. // },
  45654. // "response": {
  45655. // "$ref": "TestPermissionsResponse"
  45656. // },
  45657. // "scopes": [
  45658. // "https://www.googleapis.com/auth/cloud-platform",
  45659. // "https://www.googleapis.com/auth/compute",
  45660. // "https://www.googleapis.com/auth/compute.readonly"
  45661. // ]
  45662. // }
  45663. }
  45664. // method id "compute.firewalls.delete":
  45665. type FirewallsDeleteCall struct {
  45666. s *Service
  45667. project string
  45668. firewall string
  45669. urlParams_ gensupport.URLParams
  45670. ctx_ context.Context
  45671. header_ http.Header
  45672. }
  45673. // Delete: Deletes the specified firewall.
  45674. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  45675. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  45676. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45677. c.project = project
  45678. c.firewall = firewall
  45679. return c
  45680. }
  45681. // RequestId sets the optional parameter "requestId": An optional
  45682. // request ID to identify requests. Specify a unique request ID so that
  45683. // if you must retry your request, the server will know to ignore the
  45684. // request if it has already been completed.
  45685. //
  45686. // For example, consider a situation where you make an initial request
  45687. // and the request times out. If you make the request again with the
  45688. // same request ID, the server can check if original operation with the
  45689. // same request ID was received, and if so, will ignore the second
  45690. // request. This prevents clients from accidentally creating duplicate
  45691. // commitments.
  45692. //
  45693. // The request ID must be a valid UUID with the exception that zero UUID
  45694. // is not supported (00000000-0000-0000-0000-000000000000).
  45695. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  45696. c.urlParams_.Set("requestId", requestId)
  45697. return c
  45698. }
  45699. // Fields allows partial responses to be retrieved. See
  45700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45701. // for more information.
  45702. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  45703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45704. return c
  45705. }
  45706. // Context sets the context to be used in this call's Do method. Any
  45707. // pending HTTP request will be aborted if the provided context is
  45708. // canceled.
  45709. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  45710. c.ctx_ = ctx
  45711. return c
  45712. }
  45713. // Header returns an http.Header that can be modified by the caller to
  45714. // add HTTP headers to the request.
  45715. func (c *FirewallsDeleteCall) Header() http.Header {
  45716. if c.header_ == nil {
  45717. c.header_ = make(http.Header)
  45718. }
  45719. return c.header_
  45720. }
  45721. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  45722. reqHeaders := make(http.Header)
  45723. for k, v := range c.header_ {
  45724. reqHeaders[k] = v
  45725. }
  45726. reqHeaders.Set("User-Agent", c.s.userAgent())
  45727. var body io.Reader = nil
  45728. c.urlParams_.Set("alt", alt)
  45729. c.urlParams_.Set("prettyPrint", "false")
  45730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  45731. urls += "?" + c.urlParams_.Encode()
  45732. req, err := http.NewRequest("DELETE", urls, body)
  45733. if err != nil {
  45734. return nil, err
  45735. }
  45736. req.Header = reqHeaders
  45737. googleapi.Expand(req.URL, map[string]string{
  45738. "project": c.project,
  45739. "firewall": c.firewall,
  45740. })
  45741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45742. }
  45743. // Do executes the "compute.firewalls.delete" call.
  45744. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45745. // status code is an error. Response headers are in either
  45746. // *Operation.ServerResponse.Header or (if a response was returned at
  45747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45748. // to check whether the returned error was because
  45749. // http.StatusNotModified was returned.
  45750. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45751. gensupport.SetOptions(c.urlParams_, opts...)
  45752. res, err := c.doRequest("json")
  45753. if res != nil && res.StatusCode == http.StatusNotModified {
  45754. if res.Body != nil {
  45755. res.Body.Close()
  45756. }
  45757. return nil, &googleapi.Error{
  45758. Code: res.StatusCode,
  45759. Header: res.Header,
  45760. }
  45761. }
  45762. if err != nil {
  45763. return nil, err
  45764. }
  45765. defer googleapi.CloseBody(res)
  45766. if err := googleapi.CheckResponse(res); err != nil {
  45767. return nil, err
  45768. }
  45769. ret := &Operation{
  45770. ServerResponse: googleapi.ServerResponse{
  45771. Header: res.Header,
  45772. HTTPStatusCode: res.StatusCode,
  45773. },
  45774. }
  45775. target := &ret
  45776. if err := gensupport.DecodeResponse(target, res); err != nil {
  45777. return nil, err
  45778. }
  45779. return ret, nil
  45780. // {
  45781. // "description": "Deletes the specified firewall.",
  45782. // "httpMethod": "DELETE",
  45783. // "id": "compute.firewalls.delete",
  45784. // "parameterOrder": [
  45785. // "project",
  45786. // "firewall"
  45787. // ],
  45788. // "parameters": {
  45789. // "firewall": {
  45790. // "description": "Name of the firewall rule to delete.",
  45791. // "location": "path",
  45792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45793. // "required": true,
  45794. // "type": "string"
  45795. // },
  45796. // "project": {
  45797. // "description": "Project ID for this request.",
  45798. // "location": "path",
  45799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45800. // "required": true,
  45801. // "type": "string"
  45802. // },
  45803. // "requestId": {
  45804. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45805. // "location": "query",
  45806. // "type": "string"
  45807. // }
  45808. // },
  45809. // "path": "{project}/global/firewalls/{firewall}",
  45810. // "response": {
  45811. // "$ref": "Operation"
  45812. // },
  45813. // "scopes": [
  45814. // "https://www.googleapis.com/auth/cloud-platform",
  45815. // "https://www.googleapis.com/auth/compute"
  45816. // ]
  45817. // }
  45818. }
  45819. // method id "compute.firewalls.get":
  45820. type FirewallsGetCall struct {
  45821. s *Service
  45822. project string
  45823. firewall string
  45824. urlParams_ gensupport.URLParams
  45825. ifNoneMatch_ string
  45826. ctx_ context.Context
  45827. header_ http.Header
  45828. }
  45829. // Get: Returns the specified firewall.
  45830. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  45831. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  45832. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45833. c.project = project
  45834. c.firewall = firewall
  45835. return c
  45836. }
  45837. // Fields allows partial responses to be retrieved. See
  45838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45839. // for more information.
  45840. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  45841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45842. return c
  45843. }
  45844. // IfNoneMatch sets the optional parameter which makes the operation
  45845. // fail if the object's ETag matches the given value. This is useful for
  45846. // getting updates only after the object has changed since the last
  45847. // request. Use googleapi.IsNotModified to check whether the response
  45848. // error from Do is the result of In-None-Match.
  45849. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  45850. c.ifNoneMatch_ = entityTag
  45851. return c
  45852. }
  45853. // Context sets the context to be used in this call's Do method. Any
  45854. // pending HTTP request will be aborted if the provided context is
  45855. // canceled.
  45856. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  45857. c.ctx_ = ctx
  45858. return c
  45859. }
  45860. // Header returns an http.Header that can be modified by the caller to
  45861. // add HTTP headers to the request.
  45862. func (c *FirewallsGetCall) Header() http.Header {
  45863. if c.header_ == nil {
  45864. c.header_ = make(http.Header)
  45865. }
  45866. return c.header_
  45867. }
  45868. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  45869. reqHeaders := make(http.Header)
  45870. for k, v := range c.header_ {
  45871. reqHeaders[k] = v
  45872. }
  45873. reqHeaders.Set("User-Agent", c.s.userAgent())
  45874. if c.ifNoneMatch_ != "" {
  45875. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45876. }
  45877. var body io.Reader = nil
  45878. c.urlParams_.Set("alt", alt)
  45879. c.urlParams_.Set("prettyPrint", "false")
  45880. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  45881. urls += "?" + c.urlParams_.Encode()
  45882. req, err := http.NewRequest("GET", urls, body)
  45883. if err != nil {
  45884. return nil, err
  45885. }
  45886. req.Header = reqHeaders
  45887. googleapi.Expand(req.URL, map[string]string{
  45888. "project": c.project,
  45889. "firewall": c.firewall,
  45890. })
  45891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45892. }
  45893. // Do executes the "compute.firewalls.get" call.
  45894. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  45895. // code is an error. Response headers are in either
  45896. // *Firewall.ServerResponse.Header or (if a response was returned at
  45897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45898. // to check whether the returned error was because
  45899. // http.StatusNotModified was returned.
  45900. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  45901. gensupport.SetOptions(c.urlParams_, opts...)
  45902. res, err := c.doRequest("json")
  45903. if res != nil && res.StatusCode == http.StatusNotModified {
  45904. if res.Body != nil {
  45905. res.Body.Close()
  45906. }
  45907. return nil, &googleapi.Error{
  45908. Code: res.StatusCode,
  45909. Header: res.Header,
  45910. }
  45911. }
  45912. if err != nil {
  45913. return nil, err
  45914. }
  45915. defer googleapi.CloseBody(res)
  45916. if err := googleapi.CheckResponse(res); err != nil {
  45917. return nil, err
  45918. }
  45919. ret := &Firewall{
  45920. ServerResponse: googleapi.ServerResponse{
  45921. Header: res.Header,
  45922. HTTPStatusCode: res.StatusCode,
  45923. },
  45924. }
  45925. target := &ret
  45926. if err := gensupport.DecodeResponse(target, res); err != nil {
  45927. return nil, err
  45928. }
  45929. return ret, nil
  45930. // {
  45931. // "description": "Returns the specified firewall.",
  45932. // "httpMethod": "GET",
  45933. // "id": "compute.firewalls.get",
  45934. // "parameterOrder": [
  45935. // "project",
  45936. // "firewall"
  45937. // ],
  45938. // "parameters": {
  45939. // "firewall": {
  45940. // "description": "Name of the firewall rule to return.",
  45941. // "location": "path",
  45942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45943. // "required": true,
  45944. // "type": "string"
  45945. // },
  45946. // "project": {
  45947. // "description": "Project ID for this request.",
  45948. // "location": "path",
  45949. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45950. // "required": true,
  45951. // "type": "string"
  45952. // }
  45953. // },
  45954. // "path": "{project}/global/firewalls/{firewall}",
  45955. // "response": {
  45956. // "$ref": "Firewall"
  45957. // },
  45958. // "scopes": [
  45959. // "https://www.googleapis.com/auth/cloud-platform",
  45960. // "https://www.googleapis.com/auth/compute",
  45961. // "https://www.googleapis.com/auth/compute.readonly"
  45962. // ]
  45963. // }
  45964. }
  45965. // method id "compute.firewalls.insert":
  45966. type FirewallsInsertCall struct {
  45967. s *Service
  45968. project string
  45969. firewall *Firewall
  45970. urlParams_ gensupport.URLParams
  45971. ctx_ context.Context
  45972. header_ http.Header
  45973. }
  45974. // Insert: Creates a firewall rule in the specified project using the
  45975. // data included in the request.
  45976. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  45977. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  45978. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45979. c.project = project
  45980. c.firewall = firewall
  45981. return c
  45982. }
  45983. // RequestId sets the optional parameter "requestId": An optional
  45984. // request ID to identify requests. Specify a unique request ID so that
  45985. // if you must retry your request, the server will know to ignore the
  45986. // request if it has already been completed.
  45987. //
  45988. // For example, consider a situation where you make an initial request
  45989. // and the request times out. If you make the request again with the
  45990. // same request ID, the server can check if original operation with the
  45991. // same request ID was received, and if so, will ignore the second
  45992. // request. This prevents clients from accidentally creating duplicate
  45993. // commitments.
  45994. //
  45995. // The request ID must be a valid UUID with the exception that zero UUID
  45996. // is not supported (00000000-0000-0000-0000-000000000000).
  45997. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  45998. c.urlParams_.Set("requestId", requestId)
  45999. return c
  46000. }
  46001. // Fields allows partial responses to be retrieved. See
  46002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46003. // for more information.
  46004. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  46005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46006. return c
  46007. }
  46008. // Context sets the context to be used in this call's Do method. Any
  46009. // pending HTTP request will be aborted if the provided context is
  46010. // canceled.
  46011. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  46012. c.ctx_ = ctx
  46013. return c
  46014. }
  46015. // Header returns an http.Header that can be modified by the caller to
  46016. // add HTTP headers to the request.
  46017. func (c *FirewallsInsertCall) Header() http.Header {
  46018. if c.header_ == nil {
  46019. c.header_ = make(http.Header)
  46020. }
  46021. return c.header_
  46022. }
  46023. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  46024. reqHeaders := make(http.Header)
  46025. for k, v := range c.header_ {
  46026. reqHeaders[k] = v
  46027. }
  46028. reqHeaders.Set("User-Agent", c.s.userAgent())
  46029. var body io.Reader = nil
  46030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  46031. if err != nil {
  46032. return nil, err
  46033. }
  46034. reqHeaders.Set("Content-Type", "application/json")
  46035. c.urlParams_.Set("alt", alt)
  46036. c.urlParams_.Set("prettyPrint", "false")
  46037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  46038. urls += "?" + c.urlParams_.Encode()
  46039. req, err := http.NewRequest("POST", urls, body)
  46040. if err != nil {
  46041. return nil, err
  46042. }
  46043. req.Header = reqHeaders
  46044. googleapi.Expand(req.URL, map[string]string{
  46045. "project": c.project,
  46046. })
  46047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46048. }
  46049. // Do executes the "compute.firewalls.insert" call.
  46050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46051. // status code is an error. Response headers are in either
  46052. // *Operation.ServerResponse.Header or (if a response was returned at
  46053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46054. // to check whether the returned error was because
  46055. // http.StatusNotModified was returned.
  46056. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46057. gensupport.SetOptions(c.urlParams_, opts...)
  46058. res, err := c.doRequest("json")
  46059. if res != nil && res.StatusCode == http.StatusNotModified {
  46060. if res.Body != nil {
  46061. res.Body.Close()
  46062. }
  46063. return nil, &googleapi.Error{
  46064. Code: res.StatusCode,
  46065. Header: res.Header,
  46066. }
  46067. }
  46068. if err != nil {
  46069. return nil, err
  46070. }
  46071. defer googleapi.CloseBody(res)
  46072. if err := googleapi.CheckResponse(res); err != nil {
  46073. return nil, err
  46074. }
  46075. ret := &Operation{
  46076. ServerResponse: googleapi.ServerResponse{
  46077. Header: res.Header,
  46078. HTTPStatusCode: res.StatusCode,
  46079. },
  46080. }
  46081. target := &ret
  46082. if err := gensupport.DecodeResponse(target, res); err != nil {
  46083. return nil, err
  46084. }
  46085. return ret, nil
  46086. // {
  46087. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  46088. // "httpMethod": "POST",
  46089. // "id": "compute.firewalls.insert",
  46090. // "parameterOrder": [
  46091. // "project"
  46092. // ],
  46093. // "parameters": {
  46094. // "project": {
  46095. // "description": "Project ID for this request.",
  46096. // "location": "path",
  46097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46098. // "required": true,
  46099. // "type": "string"
  46100. // },
  46101. // "requestId": {
  46102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46103. // "location": "query",
  46104. // "type": "string"
  46105. // }
  46106. // },
  46107. // "path": "{project}/global/firewalls",
  46108. // "request": {
  46109. // "$ref": "Firewall"
  46110. // },
  46111. // "response": {
  46112. // "$ref": "Operation"
  46113. // },
  46114. // "scopes": [
  46115. // "https://www.googleapis.com/auth/cloud-platform",
  46116. // "https://www.googleapis.com/auth/compute"
  46117. // ]
  46118. // }
  46119. }
  46120. // method id "compute.firewalls.list":
  46121. type FirewallsListCall struct {
  46122. s *Service
  46123. project string
  46124. urlParams_ gensupport.URLParams
  46125. ifNoneMatch_ string
  46126. ctx_ context.Context
  46127. header_ http.Header
  46128. }
  46129. // List: Retrieves the list of firewall rules available to the specified
  46130. // project.
  46131. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  46132. func (r *FirewallsService) List(project string) *FirewallsListCall {
  46133. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46134. c.project = project
  46135. return c
  46136. }
  46137. // Filter sets the optional parameter "filter": A filter expression that
  46138. // filters resources listed in the response. The expression must specify
  46139. // the field name, a comparison operator, and the value that you want to
  46140. // use for filtering. The value must be a string, a number, or a
  46141. // boolean. The comparison operator must be either =, !=, >, or <.
  46142. //
  46143. // For example, if you are filtering Compute Engine instances, you can
  46144. // exclude instances named example-instance by specifying name !=
  46145. // example-instance.
  46146. //
  46147. // You can also filter nested fields. For example, you could specify
  46148. // scheduling.automaticRestart = false to include instances only if they
  46149. // are not scheduled for automatic restarts. You can use filtering on
  46150. // nested fields to filter based on resource labels.
  46151. //
  46152. // To filter on multiple expressions, provide each separate expression
  46153. // within parentheses. For example, (scheduling.automaticRestart = true)
  46154. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46155. // AND expression. However, you can include AND and OR expressions
  46156. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46157. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46158. // true).
  46159. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  46160. c.urlParams_.Set("filter", filter)
  46161. return c
  46162. }
  46163. // MaxResults sets the optional parameter "maxResults": The maximum
  46164. // number of results per page that should be returned. If the number of
  46165. // available results is larger than maxResults, Compute Engine returns a
  46166. // nextPageToken that can be used to get the next page of results in
  46167. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46168. // (Default: 500)
  46169. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  46170. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46171. return c
  46172. }
  46173. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46174. // a certain order. By default, results are returned in alphanumerical
  46175. // order based on the resource name.
  46176. //
  46177. // You can also sort results in descending order based on the creation
  46178. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46179. // based on the creationTimestamp field in reverse chronological order
  46180. // (newest result first). Use this to sort resources like operations so
  46181. // that the newest operation is returned first.
  46182. //
  46183. // Currently, only sorting by name or creationTimestamp desc is
  46184. // supported.
  46185. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  46186. c.urlParams_.Set("orderBy", orderBy)
  46187. return c
  46188. }
  46189. // PageToken sets the optional parameter "pageToken": Specifies a page
  46190. // token to use. Set pageToken to the nextPageToken returned by a
  46191. // previous list request to get the next page of results.
  46192. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  46193. c.urlParams_.Set("pageToken", pageToken)
  46194. return c
  46195. }
  46196. // Fields allows partial responses to be retrieved. See
  46197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46198. // for more information.
  46199. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  46200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46201. return c
  46202. }
  46203. // IfNoneMatch sets the optional parameter which makes the operation
  46204. // fail if the object's ETag matches the given value. This is useful for
  46205. // getting updates only after the object has changed since the last
  46206. // request. Use googleapi.IsNotModified to check whether the response
  46207. // error from Do is the result of In-None-Match.
  46208. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  46209. c.ifNoneMatch_ = entityTag
  46210. return c
  46211. }
  46212. // Context sets the context to be used in this call's Do method. Any
  46213. // pending HTTP request will be aborted if the provided context is
  46214. // canceled.
  46215. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  46216. c.ctx_ = ctx
  46217. return c
  46218. }
  46219. // Header returns an http.Header that can be modified by the caller to
  46220. // add HTTP headers to the request.
  46221. func (c *FirewallsListCall) Header() http.Header {
  46222. if c.header_ == nil {
  46223. c.header_ = make(http.Header)
  46224. }
  46225. return c.header_
  46226. }
  46227. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  46228. reqHeaders := make(http.Header)
  46229. for k, v := range c.header_ {
  46230. reqHeaders[k] = v
  46231. }
  46232. reqHeaders.Set("User-Agent", c.s.userAgent())
  46233. if c.ifNoneMatch_ != "" {
  46234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46235. }
  46236. var body io.Reader = nil
  46237. c.urlParams_.Set("alt", alt)
  46238. c.urlParams_.Set("prettyPrint", "false")
  46239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  46240. urls += "?" + c.urlParams_.Encode()
  46241. req, err := http.NewRequest("GET", urls, body)
  46242. if err != nil {
  46243. return nil, err
  46244. }
  46245. req.Header = reqHeaders
  46246. googleapi.Expand(req.URL, map[string]string{
  46247. "project": c.project,
  46248. })
  46249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46250. }
  46251. // Do executes the "compute.firewalls.list" call.
  46252. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  46253. // status code is an error. Response headers are in either
  46254. // *FirewallList.ServerResponse.Header or (if a response was returned at
  46255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46256. // to check whether the returned error was because
  46257. // http.StatusNotModified was returned.
  46258. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  46259. gensupport.SetOptions(c.urlParams_, opts...)
  46260. res, err := c.doRequest("json")
  46261. if res != nil && res.StatusCode == http.StatusNotModified {
  46262. if res.Body != nil {
  46263. res.Body.Close()
  46264. }
  46265. return nil, &googleapi.Error{
  46266. Code: res.StatusCode,
  46267. Header: res.Header,
  46268. }
  46269. }
  46270. if err != nil {
  46271. return nil, err
  46272. }
  46273. defer googleapi.CloseBody(res)
  46274. if err := googleapi.CheckResponse(res); err != nil {
  46275. return nil, err
  46276. }
  46277. ret := &FirewallList{
  46278. ServerResponse: googleapi.ServerResponse{
  46279. Header: res.Header,
  46280. HTTPStatusCode: res.StatusCode,
  46281. },
  46282. }
  46283. target := &ret
  46284. if err := gensupport.DecodeResponse(target, res); err != nil {
  46285. return nil, err
  46286. }
  46287. return ret, nil
  46288. // {
  46289. // "description": "Retrieves the list of firewall rules available to the specified project.",
  46290. // "httpMethod": "GET",
  46291. // "id": "compute.firewalls.list",
  46292. // "parameterOrder": [
  46293. // "project"
  46294. // ],
  46295. // "parameters": {
  46296. // "filter": {
  46297. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46298. // "location": "query",
  46299. // "type": "string"
  46300. // },
  46301. // "maxResults": {
  46302. // "default": "500",
  46303. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46304. // "format": "uint32",
  46305. // "location": "query",
  46306. // "minimum": "0",
  46307. // "type": "integer"
  46308. // },
  46309. // "orderBy": {
  46310. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46311. // "location": "query",
  46312. // "type": "string"
  46313. // },
  46314. // "pageToken": {
  46315. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46316. // "location": "query",
  46317. // "type": "string"
  46318. // },
  46319. // "project": {
  46320. // "description": "Project ID for this request.",
  46321. // "location": "path",
  46322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46323. // "required": true,
  46324. // "type": "string"
  46325. // }
  46326. // },
  46327. // "path": "{project}/global/firewalls",
  46328. // "response": {
  46329. // "$ref": "FirewallList"
  46330. // },
  46331. // "scopes": [
  46332. // "https://www.googleapis.com/auth/cloud-platform",
  46333. // "https://www.googleapis.com/auth/compute",
  46334. // "https://www.googleapis.com/auth/compute.readonly"
  46335. // ]
  46336. // }
  46337. }
  46338. // Pages invokes f for each page of results.
  46339. // A non-nil error returned from f will halt the iteration.
  46340. // The provided context supersedes any context provided to the Context method.
  46341. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  46342. c.ctx_ = ctx
  46343. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46344. for {
  46345. x, err := c.Do()
  46346. if err != nil {
  46347. return err
  46348. }
  46349. if err := f(x); err != nil {
  46350. return err
  46351. }
  46352. if x.NextPageToken == "" {
  46353. return nil
  46354. }
  46355. c.PageToken(x.NextPageToken)
  46356. }
  46357. }
  46358. // method id "compute.firewalls.patch":
  46359. type FirewallsPatchCall struct {
  46360. s *Service
  46361. project string
  46362. firewall string
  46363. firewall2 *Firewall
  46364. urlParams_ gensupport.URLParams
  46365. ctx_ context.Context
  46366. header_ http.Header
  46367. }
  46368. // Patch: Updates the specified firewall rule with the data included in
  46369. // the request. This method supports PATCH semantics and uses the JSON
  46370. // merge patch format and processing rules.
  46371. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  46372. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  46373. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46374. c.project = project
  46375. c.firewall = firewall
  46376. c.firewall2 = firewall2
  46377. return c
  46378. }
  46379. // RequestId sets the optional parameter "requestId": An optional
  46380. // request ID to identify requests. Specify a unique request ID so that
  46381. // if you must retry your request, the server will know to ignore the
  46382. // request if it has already been completed.
  46383. //
  46384. // For example, consider a situation where you make an initial request
  46385. // and the request times out. If you make the request again with the
  46386. // same request ID, the server can check if original operation with the
  46387. // same request ID was received, and if so, will ignore the second
  46388. // request. This prevents clients from accidentally creating duplicate
  46389. // commitments.
  46390. //
  46391. // The request ID must be a valid UUID with the exception that zero UUID
  46392. // is not supported (00000000-0000-0000-0000-000000000000).
  46393. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  46394. c.urlParams_.Set("requestId", requestId)
  46395. return c
  46396. }
  46397. // Fields allows partial responses to be retrieved. See
  46398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46399. // for more information.
  46400. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  46401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46402. return c
  46403. }
  46404. // Context sets the context to be used in this call's Do method. Any
  46405. // pending HTTP request will be aborted if the provided context is
  46406. // canceled.
  46407. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  46408. c.ctx_ = ctx
  46409. return c
  46410. }
  46411. // Header returns an http.Header that can be modified by the caller to
  46412. // add HTTP headers to the request.
  46413. func (c *FirewallsPatchCall) Header() http.Header {
  46414. if c.header_ == nil {
  46415. c.header_ = make(http.Header)
  46416. }
  46417. return c.header_
  46418. }
  46419. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  46420. reqHeaders := make(http.Header)
  46421. for k, v := range c.header_ {
  46422. reqHeaders[k] = v
  46423. }
  46424. reqHeaders.Set("User-Agent", c.s.userAgent())
  46425. var body io.Reader = nil
  46426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  46427. if err != nil {
  46428. return nil, err
  46429. }
  46430. reqHeaders.Set("Content-Type", "application/json")
  46431. c.urlParams_.Set("alt", alt)
  46432. c.urlParams_.Set("prettyPrint", "false")
  46433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  46434. urls += "?" + c.urlParams_.Encode()
  46435. req, err := http.NewRequest("PATCH", urls, body)
  46436. if err != nil {
  46437. return nil, err
  46438. }
  46439. req.Header = reqHeaders
  46440. googleapi.Expand(req.URL, map[string]string{
  46441. "project": c.project,
  46442. "firewall": c.firewall,
  46443. })
  46444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46445. }
  46446. // Do executes the "compute.firewalls.patch" call.
  46447. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46448. // status code is an error. Response headers are in either
  46449. // *Operation.ServerResponse.Header or (if a response was returned at
  46450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46451. // to check whether the returned error was because
  46452. // http.StatusNotModified was returned.
  46453. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46454. gensupport.SetOptions(c.urlParams_, opts...)
  46455. res, err := c.doRequest("json")
  46456. if res != nil && res.StatusCode == http.StatusNotModified {
  46457. if res.Body != nil {
  46458. res.Body.Close()
  46459. }
  46460. return nil, &googleapi.Error{
  46461. Code: res.StatusCode,
  46462. Header: res.Header,
  46463. }
  46464. }
  46465. if err != nil {
  46466. return nil, err
  46467. }
  46468. defer googleapi.CloseBody(res)
  46469. if err := googleapi.CheckResponse(res); err != nil {
  46470. return nil, err
  46471. }
  46472. ret := &Operation{
  46473. ServerResponse: googleapi.ServerResponse{
  46474. Header: res.Header,
  46475. HTTPStatusCode: res.StatusCode,
  46476. },
  46477. }
  46478. target := &ret
  46479. if err := gensupport.DecodeResponse(target, res); err != nil {
  46480. return nil, err
  46481. }
  46482. return ret, nil
  46483. // {
  46484. // "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.",
  46485. // "httpMethod": "PATCH",
  46486. // "id": "compute.firewalls.patch",
  46487. // "parameterOrder": [
  46488. // "project",
  46489. // "firewall"
  46490. // ],
  46491. // "parameters": {
  46492. // "firewall": {
  46493. // "description": "Name of the firewall rule to patch.",
  46494. // "location": "path",
  46495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46496. // "required": true,
  46497. // "type": "string"
  46498. // },
  46499. // "project": {
  46500. // "description": "Project ID for this request.",
  46501. // "location": "path",
  46502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46503. // "required": true,
  46504. // "type": "string"
  46505. // },
  46506. // "requestId": {
  46507. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46508. // "location": "query",
  46509. // "type": "string"
  46510. // }
  46511. // },
  46512. // "path": "{project}/global/firewalls/{firewall}",
  46513. // "request": {
  46514. // "$ref": "Firewall"
  46515. // },
  46516. // "response": {
  46517. // "$ref": "Operation"
  46518. // },
  46519. // "scopes": [
  46520. // "https://www.googleapis.com/auth/cloud-platform",
  46521. // "https://www.googleapis.com/auth/compute"
  46522. // ]
  46523. // }
  46524. }
  46525. // method id "compute.firewalls.testIamPermissions":
  46526. type FirewallsTestIamPermissionsCall struct {
  46527. s *Service
  46528. project string
  46529. resource string
  46530. testpermissionsrequest *TestPermissionsRequest
  46531. urlParams_ gensupport.URLParams
  46532. ctx_ context.Context
  46533. header_ http.Header
  46534. }
  46535. // TestIamPermissions: Returns permissions that a caller has on the
  46536. // specified resource.
  46537. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  46538. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46539. c.project = project
  46540. c.resource = resource
  46541. c.testpermissionsrequest = testpermissionsrequest
  46542. return c
  46543. }
  46544. // Fields allows partial responses to be retrieved. See
  46545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46546. // for more information.
  46547. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  46548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46549. return c
  46550. }
  46551. // Context sets the context to be used in this call's Do method. Any
  46552. // pending HTTP request will be aborted if the provided context is
  46553. // canceled.
  46554. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  46555. c.ctx_ = ctx
  46556. return c
  46557. }
  46558. // Header returns an http.Header that can be modified by the caller to
  46559. // add HTTP headers to the request.
  46560. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  46561. if c.header_ == nil {
  46562. c.header_ = make(http.Header)
  46563. }
  46564. return c.header_
  46565. }
  46566. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  46567. reqHeaders := make(http.Header)
  46568. for k, v := range c.header_ {
  46569. reqHeaders[k] = v
  46570. }
  46571. reqHeaders.Set("User-Agent", c.s.userAgent())
  46572. var body io.Reader = nil
  46573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  46574. if err != nil {
  46575. return nil, err
  46576. }
  46577. reqHeaders.Set("Content-Type", "application/json")
  46578. c.urlParams_.Set("alt", alt)
  46579. c.urlParams_.Set("prettyPrint", "false")
  46580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  46581. urls += "?" + c.urlParams_.Encode()
  46582. req, err := http.NewRequest("POST", urls, body)
  46583. if err != nil {
  46584. return nil, err
  46585. }
  46586. req.Header = reqHeaders
  46587. googleapi.Expand(req.URL, map[string]string{
  46588. "project": c.project,
  46589. "resource": c.resource,
  46590. })
  46591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46592. }
  46593. // Do executes the "compute.firewalls.testIamPermissions" call.
  46594. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  46595. // non-2xx status code is an error. Response headers are in either
  46596. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  46597. // returned at all) in error.(*googleapi.Error).Header. Use
  46598. // googleapi.IsNotModified to check whether the returned error was
  46599. // because http.StatusNotModified was returned.
  46600. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  46601. gensupport.SetOptions(c.urlParams_, opts...)
  46602. res, err := c.doRequest("json")
  46603. if res != nil && res.StatusCode == http.StatusNotModified {
  46604. if res.Body != nil {
  46605. res.Body.Close()
  46606. }
  46607. return nil, &googleapi.Error{
  46608. Code: res.StatusCode,
  46609. Header: res.Header,
  46610. }
  46611. }
  46612. if err != nil {
  46613. return nil, err
  46614. }
  46615. defer googleapi.CloseBody(res)
  46616. if err := googleapi.CheckResponse(res); err != nil {
  46617. return nil, err
  46618. }
  46619. ret := &TestPermissionsResponse{
  46620. ServerResponse: googleapi.ServerResponse{
  46621. Header: res.Header,
  46622. HTTPStatusCode: res.StatusCode,
  46623. },
  46624. }
  46625. target := &ret
  46626. if err := gensupport.DecodeResponse(target, res); err != nil {
  46627. return nil, err
  46628. }
  46629. return ret, nil
  46630. // {
  46631. // "description": "Returns permissions that a caller has on the specified resource.",
  46632. // "httpMethod": "POST",
  46633. // "id": "compute.firewalls.testIamPermissions",
  46634. // "parameterOrder": [
  46635. // "project",
  46636. // "resource"
  46637. // ],
  46638. // "parameters": {
  46639. // "project": {
  46640. // "description": "Project ID for this request.",
  46641. // "location": "path",
  46642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46643. // "required": true,
  46644. // "type": "string"
  46645. // },
  46646. // "resource": {
  46647. // "description": "Name or id of the resource for this request.",
  46648. // "location": "path",
  46649. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46650. // "required": true,
  46651. // "type": "string"
  46652. // }
  46653. // },
  46654. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  46655. // "request": {
  46656. // "$ref": "TestPermissionsRequest"
  46657. // },
  46658. // "response": {
  46659. // "$ref": "TestPermissionsResponse"
  46660. // },
  46661. // "scopes": [
  46662. // "https://www.googleapis.com/auth/cloud-platform",
  46663. // "https://www.googleapis.com/auth/compute",
  46664. // "https://www.googleapis.com/auth/compute.readonly"
  46665. // ]
  46666. // }
  46667. }
  46668. // method id "compute.firewalls.update":
  46669. type FirewallsUpdateCall struct {
  46670. s *Service
  46671. project string
  46672. firewall string
  46673. firewall2 *Firewall
  46674. urlParams_ gensupport.URLParams
  46675. ctx_ context.Context
  46676. header_ http.Header
  46677. }
  46678. // Update: Updates the specified firewall rule with the data included in
  46679. // the request. The PUT method can only update the following fields of
  46680. // firewall rule: allowed, description, sourceRanges, sourceTags,
  46681. // targetTags.
  46682. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  46683. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  46684. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46685. c.project = project
  46686. c.firewall = firewall
  46687. c.firewall2 = firewall2
  46688. return c
  46689. }
  46690. // RequestId sets the optional parameter "requestId": An optional
  46691. // request ID to identify requests. Specify a unique request ID so that
  46692. // if you must retry your request, the server will know to ignore the
  46693. // request if it has already been completed.
  46694. //
  46695. // For example, consider a situation where you make an initial request
  46696. // and the request times out. If you make the request again with the
  46697. // same request ID, the server can check if original operation with the
  46698. // same request ID was received, and if so, will ignore the second
  46699. // request. This prevents clients from accidentally creating duplicate
  46700. // commitments.
  46701. //
  46702. // The request ID must be a valid UUID with the exception that zero UUID
  46703. // is not supported (00000000-0000-0000-0000-000000000000).
  46704. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  46705. c.urlParams_.Set("requestId", requestId)
  46706. return c
  46707. }
  46708. // Fields allows partial responses to be retrieved. See
  46709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46710. // for more information.
  46711. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  46712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46713. return c
  46714. }
  46715. // Context sets the context to be used in this call's Do method. Any
  46716. // pending HTTP request will be aborted if the provided context is
  46717. // canceled.
  46718. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  46719. c.ctx_ = ctx
  46720. return c
  46721. }
  46722. // Header returns an http.Header that can be modified by the caller to
  46723. // add HTTP headers to the request.
  46724. func (c *FirewallsUpdateCall) Header() http.Header {
  46725. if c.header_ == nil {
  46726. c.header_ = make(http.Header)
  46727. }
  46728. return c.header_
  46729. }
  46730. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  46731. reqHeaders := make(http.Header)
  46732. for k, v := range c.header_ {
  46733. reqHeaders[k] = v
  46734. }
  46735. reqHeaders.Set("User-Agent", c.s.userAgent())
  46736. var body io.Reader = nil
  46737. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  46738. if err != nil {
  46739. return nil, err
  46740. }
  46741. reqHeaders.Set("Content-Type", "application/json")
  46742. c.urlParams_.Set("alt", alt)
  46743. c.urlParams_.Set("prettyPrint", "false")
  46744. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  46745. urls += "?" + c.urlParams_.Encode()
  46746. req, err := http.NewRequest("PUT", urls, body)
  46747. if err != nil {
  46748. return nil, err
  46749. }
  46750. req.Header = reqHeaders
  46751. googleapi.Expand(req.URL, map[string]string{
  46752. "project": c.project,
  46753. "firewall": c.firewall,
  46754. })
  46755. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46756. }
  46757. // Do executes the "compute.firewalls.update" call.
  46758. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46759. // status code is an error. Response headers are in either
  46760. // *Operation.ServerResponse.Header or (if a response was returned at
  46761. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46762. // to check whether the returned error was because
  46763. // http.StatusNotModified was returned.
  46764. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46765. gensupport.SetOptions(c.urlParams_, opts...)
  46766. res, err := c.doRequest("json")
  46767. if res != nil && res.StatusCode == http.StatusNotModified {
  46768. if res.Body != nil {
  46769. res.Body.Close()
  46770. }
  46771. return nil, &googleapi.Error{
  46772. Code: res.StatusCode,
  46773. Header: res.Header,
  46774. }
  46775. }
  46776. if err != nil {
  46777. return nil, err
  46778. }
  46779. defer googleapi.CloseBody(res)
  46780. if err := googleapi.CheckResponse(res); err != nil {
  46781. return nil, err
  46782. }
  46783. ret := &Operation{
  46784. ServerResponse: googleapi.ServerResponse{
  46785. Header: res.Header,
  46786. HTTPStatusCode: res.StatusCode,
  46787. },
  46788. }
  46789. target := &ret
  46790. if err := gensupport.DecodeResponse(target, res); err != nil {
  46791. return nil, err
  46792. }
  46793. return ret, nil
  46794. // {
  46795. // "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.",
  46796. // "httpMethod": "PUT",
  46797. // "id": "compute.firewalls.update",
  46798. // "parameterOrder": [
  46799. // "project",
  46800. // "firewall"
  46801. // ],
  46802. // "parameters": {
  46803. // "firewall": {
  46804. // "description": "Name of the firewall rule to update.",
  46805. // "location": "path",
  46806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46807. // "required": true,
  46808. // "type": "string"
  46809. // },
  46810. // "project": {
  46811. // "description": "Project ID for this request.",
  46812. // "location": "path",
  46813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46814. // "required": true,
  46815. // "type": "string"
  46816. // },
  46817. // "requestId": {
  46818. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46819. // "location": "query",
  46820. // "type": "string"
  46821. // }
  46822. // },
  46823. // "path": "{project}/global/firewalls/{firewall}",
  46824. // "request": {
  46825. // "$ref": "Firewall"
  46826. // },
  46827. // "response": {
  46828. // "$ref": "Operation"
  46829. // },
  46830. // "scopes": [
  46831. // "https://www.googleapis.com/auth/cloud-platform",
  46832. // "https://www.googleapis.com/auth/compute"
  46833. // ]
  46834. // }
  46835. }
  46836. // method id "compute.forwardingRules.aggregatedList":
  46837. type ForwardingRulesAggregatedListCall struct {
  46838. s *Service
  46839. project string
  46840. urlParams_ gensupport.URLParams
  46841. ifNoneMatch_ string
  46842. ctx_ context.Context
  46843. header_ http.Header
  46844. }
  46845. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  46846. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  46847. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  46848. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46849. c.project = project
  46850. return c
  46851. }
  46852. // Filter sets the optional parameter "filter": A filter expression that
  46853. // filters resources listed in the response. The expression must specify
  46854. // the field name, a comparison operator, and the value that you want to
  46855. // use for filtering. The value must be a string, a number, or a
  46856. // boolean. The comparison operator must be either =, !=, >, or <.
  46857. //
  46858. // For example, if you are filtering Compute Engine instances, you can
  46859. // exclude instances named example-instance by specifying name !=
  46860. // example-instance.
  46861. //
  46862. // You can also filter nested fields. For example, you could specify
  46863. // scheduling.automaticRestart = false to include instances only if they
  46864. // are not scheduled for automatic restarts. You can use filtering on
  46865. // nested fields to filter based on resource labels.
  46866. //
  46867. // To filter on multiple expressions, provide each separate expression
  46868. // within parentheses. For example, (scheduling.automaticRestart = true)
  46869. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46870. // AND expression. However, you can include AND and OR expressions
  46871. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46872. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46873. // true).
  46874. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  46875. c.urlParams_.Set("filter", filter)
  46876. return c
  46877. }
  46878. // MaxResults sets the optional parameter "maxResults": The maximum
  46879. // number of results per page that should be returned. If the number of
  46880. // available results is larger than maxResults, Compute Engine returns a
  46881. // nextPageToken that can be used to get the next page of results in
  46882. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46883. // (Default: 500)
  46884. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  46885. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46886. return c
  46887. }
  46888. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46889. // a certain order. By default, results are returned in alphanumerical
  46890. // order based on the resource name.
  46891. //
  46892. // You can also sort results in descending order based on the creation
  46893. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46894. // based on the creationTimestamp field in reverse chronological order
  46895. // (newest result first). Use this to sort resources like operations so
  46896. // that the newest operation is returned first.
  46897. //
  46898. // Currently, only sorting by name or creationTimestamp desc is
  46899. // supported.
  46900. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  46901. c.urlParams_.Set("orderBy", orderBy)
  46902. return c
  46903. }
  46904. // PageToken sets the optional parameter "pageToken": Specifies a page
  46905. // token to use. Set pageToken to the nextPageToken returned by a
  46906. // previous list request to get the next page of results.
  46907. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  46908. c.urlParams_.Set("pageToken", pageToken)
  46909. return c
  46910. }
  46911. // Fields allows partial responses to be retrieved. See
  46912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46913. // for more information.
  46914. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  46915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46916. return c
  46917. }
  46918. // IfNoneMatch sets the optional parameter which makes the operation
  46919. // fail if the object's ETag matches the given value. This is useful for
  46920. // getting updates only after the object has changed since the last
  46921. // request. Use googleapi.IsNotModified to check whether the response
  46922. // error from Do is the result of In-None-Match.
  46923. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  46924. c.ifNoneMatch_ = entityTag
  46925. return c
  46926. }
  46927. // Context sets the context to be used in this call's Do method. Any
  46928. // pending HTTP request will be aborted if the provided context is
  46929. // canceled.
  46930. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  46931. c.ctx_ = ctx
  46932. return c
  46933. }
  46934. // Header returns an http.Header that can be modified by the caller to
  46935. // add HTTP headers to the request.
  46936. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  46937. if c.header_ == nil {
  46938. c.header_ = make(http.Header)
  46939. }
  46940. return c.header_
  46941. }
  46942. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46943. reqHeaders := make(http.Header)
  46944. for k, v := range c.header_ {
  46945. reqHeaders[k] = v
  46946. }
  46947. reqHeaders.Set("User-Agent", c.s.userAgent())
  46948. if c.ifNoneMatch_ != "" {
  46949. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46950. }
  46951. var body io.Reader = nil
  46952. c.urlParams_.Set("alt", alt)
  46953. c.urlParams_.Set("prettyPrint", "false")
  46954. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  46955. urls += "?" + c.urlParams_.Encode()
  46956. req, err := http.NewRequest("GET", urls, body)
  46957. if err != nil {
  46958. return nil, err
  46959. }
  46960. req.Header = reqHeaders
  46961. googleapi.Expand(req.URL, map[string]string{
  46962. "project": c.project,
  46963. })
  46964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46965. }
  46966. // Do executes the "compute.forwardingRules.aggregatedList" call.
  46967. // Exactly one of *ForwardingRuleAggregatedList or error will be
  46968. // non-nil. Any non-2xx status code is an error. Response headers are in
  46969. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  46970. // response was returned at all) in error.(*googleapi.Error).Header. Use
  46971. // googleapi.IsNotModified to check whether the returned error was
  46972. // because http.StatusNotModified was returned.
  46973. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  46974. gensupport.SetOptions(c.urlParams_, opts...)
  46975. res, err := c.doRequest("json")
  46976. if res != nil && res.StatusCode == http.StatusNotModified {
  46977. if res.Body != nil {
  46978. res.Body.Close()
  46979. }
  46980. return nil, &googleapi.Error{
  46981. Code: res.StatusCode,
  46982. Header: res.Header,
  46983. }
  46984. }
  46985. if err != nil {
  46986. return nil, err
  46987. }
  46988. defer googleapi.CloseBody(res)
  46989. if err := googleapi.CheckResponse(res); err != nil {
  46990. return nil, err
  46991. }
  46992. ret := &ForwardingRuleAggregatedList{
  46993. ServerResponse: googleapi.ServerResponse{
  46994. Header: res.Header,
  46995. HTTPStatusCode: res.StatusCode,
  46996. },
  46997. }
  46998. target := &ret
  46999. if err := gensupport.DecodeResponse(target, res); err != nil {
  47000. return nil, err
  47001. }
  47002. return ret, nil
  47003. // {
  47004. // "description": "Retrieves an aggregated list of forwarding rules.",
  47005. // "httpMethod": "GET",
  47006. // "id": "compute.forwardingRules.aggregatedList",
  47007. // "parameterOrder": [
  47008. // "project"
  47009. // ],
  47010. // "parameters": {
  47011. // "filter": {
  47012. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47013. // "location": "query",
  47014. // "type": "string"
  47015. // },
  47016. // "maxResults": {
  47017. // "default": "500",
  47018. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47019. // "format": "uint32",
  47020. // "location": "query",
  47021. // "minimum": "0",
  47022. // "type": "integer"
  47023. // },
  47024. // "orderBy": {
  47025. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47026. // "location": "query",
  47027. // "type": "string"
  47028. // },
  47029. // "pageToken": {
  47030. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47031. // "location": "query",
  47032. // "type": "string"
  47033. // },
  47034. // "project": {
  47035. // "description": "Project ID for this request.",
  47036. // "location": "path",
  47037. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47038. // "required": true,
  47039. // "type": "string"
  47040. // }
  47041. // },
  47042. // "path": "{project}/aggregated/forwardingRules",
  47043. // "response": {
  47044. // "$ref": "ForwardingRuleAggregatedList"
  47045. // },
  47046. // "scopes": [
  47047. // "https://www.googleapis.com/auth/cloud-platform",
  47048. // "https://www.googleapis.com/auth/compute",
  47049. // "https://www.googleapis.com/auth/compute.readonly"
  47050. // ]
  47051. // }
  47052. }
  47053. // Pages invokes f for each page of results.
  47054. // A non-nil error returned from f will halt the iteration.
  47055. // The provided context supersedes any context provided to the Context method.
  47056. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  47057. c.ctx_ = ctx
  47058. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47059. for {
  47060. x, err := c.Do()
  47061. if err != nil {
  47062. return err
  47063. }
  47064. if err := f(x); err != nil {
  47065. return err
  47066. }
  47067. if x.NextPageToken == "" {
  47068. return nil
  47069. }
  47070. c.PageToken(x.NextPageToken)
  47071. }
  47072. }
  47073. // method id "compute.forwardingRules.delete":
  47074. type ForwardingRulesDeleteCall struct {
  47075. s *Service
  47076. project string
  47077. region string
  47078. forwardingRule string
  47079. urlParams_ gensupport.URLParams
  47080. ctx_ context.Context
  47081. header_ http.Header
  47082. }
  47083. // Delete: Deletes the specified ForwardingRule resource.
  47084. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  47085. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  47086. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47087. c.project = project
  47088. c.region = region
  47089. c.forwardingRule = forwardingRule
  47090. return c
  47091. }
  47092. // RequestId sets the optional parameter "requestId": An optional
  47093. // request ID to identify requests. Specify a unique request ID so that
  47094. // if you must retry your request, the server will know to ignore the
  47095. // request if it has already been completed.
  47096. //
  47097. // For example, consider a situation where you make an initial request
  47098. // and the request times out. If you make the request again with the
  47099. // same request ID, the server can check if original operation with the
  47100. // same request ID was received, and if so, will ignore the second
  47101. // request. This prevents clients from accidentally creating duplicate
  47102. // commitments.
  47103. //
  47104. // The request ID must be a valid UUID with the exception that zero UUID
  47105. // is not supported (00000000-0000-0000-0000-000000000000).
  47106. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  47107. c.urlParams_.Set("requestId", requestId)
  47108. return c
  47109. }
  47110. // Fields allows partial responses to be retrieved. See
  47111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47112. // for more information.
  47113. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  47114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47115. return c
  47116. }
  47117. // Context sets the context to be used in this call's Do method. Any
  47118. // pending HTTP request will be aborted if the provided context is
  47119. // canceled.
  47120. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  47121. c.ctx_ = ctx
  47122. return c
  47123. }
  47124. // Header returns an http.Header that can be modified by the caller to
  47125. // add HTTP headers to the request.
  47126. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  47127. if c.header_ == nil {
  47128. c.header_ = make(http.Header)
  47129. }
  47130. return c.header_
  47131. }
  47132. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  47133. reqHeaders := make(http.Header)
  47134. for k, v := range c.header_ {
  47135. reqHeaders[k] = v
  47136. }
  47137. reqHeaders.Set("User-Agent", c.s.userAgent())
  47138. var body io.Reader = nil
  47139. c.urlParams_.Set("alt", alt)
  47140. c.urlParams_.Set("prettyPrint", "false")
  47141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  47142. urls += "?" + c.urlParams_.Encode()
  47143. req, err := http.NewRequest("DELETE", urls, body)
  47144. if err != nil {
  47145. return nil, err
  47146. }
  47147. req.Header = reqHeaders
  47148. googleapi.Expand(req.URL, map[string]string{
  47149. "project": c.project,
  47150. "region": c.region,
  47151. "forwardingRule": c.forwardingRule,
  47152. })
  47153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47154. }
  47155. // Do executes the "compute.forwardingRules.delete" call.
  47156. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47157. // status code is an error. Response headers are in either
  47158. // *Operation.ServerResponse.Header or (if a response was returned at
  47159. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47160. // to check whether the returned error was because
  47161. // http.StatusNotModified was returned.
  47162. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47163. gensupport.SetOptions(c.urlParams_, opts...)
  47164. res, err := c.doRequest("json")
  47165. if res != nil && res.StatusCode == http.StatusNotModified {
  47166. if res.Body != nil {
  47167. res.Body.Close()
  47168. }
  47169. return nil, &googleapi.Error{
  47170. Code: res.StatusCode,
  47171. Header: res.Header,
  47172. }
  47173. }
  47174. if err != nil {
  47175. return nil, err
  47176. }
  47177. defer googleapi.CloseBody(res)
  47178. if err := googleapi.CheckResponse(res); err != nil {
  47179. return nil, err
  47180. }
  47181. ret := &Operation{
  47182. ServerResponse: googleapi.ServerResponse{
  47183. Header: res.Header,
  47184. HTTPStatusCode: res.StatusCode,
  47185. },
  47186. }
  47187. target := &ret
  47188. if err := gensupport.DecodeResponse(target, res); err != nil {
  47189. return nil, err
  47190. }
  47191. return ret, nil
  47192. // {
  47193. // "description": "Deletes the specified ForwardingRule resource.",
  47194. // "httpMethod": "DELETE",
  47195. // "id": "compute.forwardingRules.delete",
  47196. // "parameterOrder": [
  47197. // "project",
  47198. // "region",
  47199. // "forwardingRule"
  47200. // ],
  47201. // "parameters": {
  47202. // "forwardingRule": {
  47203. // "description": "Name of the ForwardingRule resource to delete.",
  47204. // "location": "path",
  47205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47206. // "required": true,
  47207. // "type": "string"
  47208. // },
  47209. // "project": {
  47210. // "description": "Project ID for this request.",
  47211. // "location": "path",
  47212. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47213. // "required": true,
  47214. // "type": "string"
  47215. // },
  47216. // "region": {
  47217. // "description": "Name of the region scoping this request.",
  47218. // "location": "path",
  47219. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47220. // "required": true,
  47221. // "type": "string"
  47222. // },
  47223. // "requestId": {
  47224. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47225. // "location": "query",
  47226. // "type": "string"
  47227. // }
  47228. // },
  47229. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  47230. // "response": {
  47231. // "$ref": "Operation"
  47232. // },
  47233. // "scopes": [
  47234. // "https://www.googleapis.com/auth/cloud-platform",
  47235. // "https://www.googleapis.com/auth/compute"
  47236. // ]
  47237. // }
  47238. }
  47239. // method id "compute.forwardingRules.get":
  47240. type ForwardingRulesGetCall struct {
  47241. s *Service
  47242. project string
  47243. region string
  47244. forwardingRule string
  47245. urlParams_ gensupport.URLParams
  47246. ifNoneMatch_ string
  47247. ctx_ context.Context
  47248. header_ http.Header
  47249. }
  47250. // Get: Returns the specified ForwardingRule resource.
  47251. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  47252. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  47253. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47254. c.project = project
  47255. c.region = region
  47256. c.forwardingRule = forwardingRule
  47257. return c
  47258. }
  47259. // Fields allows partial responses to be retrieved. See
  47260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47261. // for more information.
  47262. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  47263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47264. return c
  47265. }
  47266. // IfNoneMatch sets the optional parameter which makes the operation
  47267. // fail if the object's ETag matches the given value. This is useful for
  47268. // getting updates only after the object has changed since the last
  47269. // request. Use googleapi.IsNotModified to check whether the response
  47270. // error from Do is the result of In-None-Match.
  47271. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  47272. c.ifNoneMatch_ = entityTag
  47273. return c
  47274. }
  47275. // Context sets the context to be used in this call's Do method. Any
  47276. // pending HTTP request will be aborted if the provided context is
  47277. // canceled.
  47278. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  47279. c.ctx_ = ctx
  47280. return c
  47281. }
  47282. // Header returns an http.Header that can be modified by the caller to
  47283. // add HTTP headers to the request.
  47284. func (c *ForwardingRulesGetCall) Header() http.Header {
  47285. if c.header_ == nil {
  47286. c.header_ = make(http.Header)
  47287. }
  47288. return c.header_
  47289. }
  47290. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  47291. reqHeaders := make(http.Header)
  47292. for k, v := range c.header_ {
  47293. reqHeaders[k] = v
  47294. }
  47295. reqHeaders.Set("User-Agent", c.s.userAgent())
  47296. if c.ifNoneMatch_ != "" {
  47297. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47298. }
  47299. var body io.Reader = nil
  47300. c.urlParams_.Set("alt", alt)
  47301. c.urlParams_.Set("prettyPrint", "false")
  47302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  47303. urls += "?" + c.urlParams_.Encode()
  47304. req, err := http.NewRequest("GET", urls, body)
  47305. if err != nil {
  47306. return nil, err
  47307. }
  47308. req.Header = reqHeaders
  47309. googleapi.Expand(req.URL, map[string]string{
  47310. "project": c.project,
  47311. "region": c.region,
  47312. "forwardingRule": c.forwardingRule,
  47313. })
  47314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47315. }
  47316. // Do executes the "compute.forwardingRules.get" call.
  47317. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  47318. // status code is an error. Response headers are in either
  47319. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  47320. // at all) in error.(*googleapi.Error).Header. Use
  47321. // googleapi.IsNotModified to check whether the returned error was
  47322. // because http.StatusNotModified was returned.
  47323. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  47324. gensupport.SetOptions(c.urlParams_, opts...)
  47325. res, err := c.doRequest("json")
  47326. if res != nil && res.StatusCode == http.StatusNotModified {
  47327. if res.Body != nil {
  47328. res.Body.Close()
  47329. }
  47330. return nil, &googleapi.Error{
  47331. Code: res.StatusCode,
  47332. Header: res.Header,
  47333. }
  47334. }
  47335. if err != nil {
  47336. return nil, err
  47337. }
  47338. defer googleapi.CloseBody(res)
  47339. if err := googleapi.CheckResponse(res); err != nil {
  47340. return nil, err
  47341. }
  47342. ret := &ForwardingRule{
  47343. ServerResponse: googleapi.ServerResponse{
  47344. Header: res.Header,
  47345. HTTPStatusCode: res.StatusCode,
  47346. },
  47347. }
  47348. target := &ret
  47349. if err := gensupport.DecodeResponse(target, res); err != nil {
  47350. return nil, err
  47351. }
  47352. return ret, nil
  47353. // {
  47354. // "description": "Returns the specified ForwardingRule resource.",
  47355. // "httpMethod": "GET",
  47356. // "id": "compute.forwardingRules.get",
  47357. // "parameterOrder": [
  47358. // "project",
  47359. // "region",
  47360. // "forwardingRule"
  47361. // ],
  47362. // "parameters": {
  47363. // "forwardingRule": {
  47364. // "description": "Name of the ForwardingRule 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. // "region": {
  47378. // "description": "Name of the region scoping this request.",
  47379. // "location": "path",
  47380. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47381. // "required": true,
  47382. // "type": "string"
  47383. // }
  47384. // },
  47385. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  47386. // "response": {
  47387. // "$ref": "ForwardingRule"
  47388. // },
  47389. // "scopes": [
  47390. // "https://www.googleapis.com/auth/cloud-platform",
  47391. // "https://www.googleapis.com/auth/compute",
  47392. // "https://www.googleapis.com/auth/compute.readonly"
  47393. // ]
  47394. // }
  47395. }
  47396. // method id "compute.forwardingRules.insert":
  47397. type ForwardingRulesInsertCall struct {
  47398. s *Service
  47399. project string
  47400. region string
  47401. forwardingrule *ForwardingRule
  47402. urlParams_ gensupport.URLParams
  47403. ctx_ context.Context
  47404. header_ http.Header
  47405. }
  47406. // Insert: Creates a ForwardingRule resource in the specified project
  47407. // and region using the data included in the request.
  47408. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  47409. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  47410. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47411. c.project = project
  47412. c.region = region
  47413. c.forwardingrule = forwardingrule
  47414. return c
  47415. }
  47416. // RequestId sets the optional parameter "requestId": An optional
  47417. // request ID to identify requests. Specify a unique request ID so that
  47418. // if you must retry your request, the server will know to ignore the
  47419. // request if it has already been completed.
  47420. //
  47421. // For example, consider a situation where you make an initial request
  47422. // and the request times out. If you make the request again with the
  47423. // same request ID, the server can check if original operation with the
  47424. // same request ID was received, and if so, will ignore the second
  47425. // request. This prevents clients from accidentally creating duplicate
  47426. // commitments.
  47427. //
  47428. // The request ID must be a valid UUID with the exception that zero UUID
  47429. // is not supported (00000000-0000-0000-0000-000000000000).
  47430. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  47431. c.urlParams_.Set("requestId", requestId)
  47432. return c
  47433. }
  47434. // Fields allows partial responses to be retrieved. See
  47435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47436. // for more information.
  47437. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  47438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47439. return c
  47440. }
  47441. // Context sets the context to be used in this call's Do method. Any
  47442. // pending HTTP request will be aborted if the provided context is
  47443. // canceled.
  47444. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  47445. c.ctx_ = ctx
  47446. return c
  47447. }
  47448. // Header returns an http.Header that can be modified by the caller to
  47449. // add HTTP headers to the request.
  47450. func (c *ForwardingRulesInsertCall) Header() http.Header {
  47451. if c.header_ == nil {
  47452. c.header_ = make(http.Header)
  47453. }
  47454. return c.header_
  47455. }
  47456. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  47457. reqHeaders := make(http.Header)
  47458. for k, v := range c.header_ {
  47459. reqHeaders[k] = v
  47460. }
  47461. reqHeaders.Set("User-Agent", c.s.userAgent())
  47462. var body io.Reader = nil
  47463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  47464. if err != nil {
  47465. return nil, err
  47466. }
  47467. reqHeaders.Set("Content-Type", "application/json")
  47468. c.urlParams_.Set("alt", alt)
  47469. c.urlParams_.Set("prettyPrint", "false")
  47470. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  47471. urls += "?" + c.urlParams_.Encode()
  47472. req, err := http.NewRequest("POST", urls, body)
  47473. if err != nil {
  47474. return nil, err
  47475. }
  47476. req.Header = reqHeaders
  47477. googleapi.Expand(req.URL, map[string]string{
  47478. "project": c.project,
  47479. "region": c.region,
  47480. })
  47481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47482. }
  47483. // Do executes the "compute.forwardingRules.insert" call.
  47484. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47485. // status code is an error. Response headers are in either
  47486. // *Operation.ServerResponse.Header or (if a response was returned at
  47487. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47488. // to check whether the returned error was because
  47489. // http.StatusNotModified was returned.
  47490. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47491. gensupport.SetOptions(c.urlParams_, opts...)
  47492. res, err := c.doRequest("json")
  47493. if res != nil && res.StatusCode == http.StatusNotModified {
  47494. if res.Body != nil {
  47495. res.Body.Close()
  47496. }
  47497. return nil, &googleapi.Error{
  47498. Code: res.StatusCode,
  47499. Header: res.Header,
  47500. }
  47501. }
  47502. if err != nil {
  47503. return nil, err
  47504. }
  47505. defer googleapi.CloseBody(res)
  47506. if err := googleapi.CheckResponse(res); err != nil {
  47507. return nil, err
  47508. }
  47509. ret := &Operation{
  47510. ServerResponse: googleapi.ServerResponse{
  47511. Header: res.Header,
  47512. HTTPStatusCode: res.StatusCode,
  47513. },
  47514. }
  47515. target := &ret
  47516. if err := gensupport.DecodeResponse(target, res); err != nil {
  47517. return nil, err
  47518. }
  47519. return ret, nil
  47520. // {
  47521. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  47522. // "httpMethod": "POST",
  47523. // "id": "compute.forwardingRules.insert",
  47524. // "parameterOrder": [
  47525. // "project",
  47526. // "region"
  47527. // ],
  47528. // "parameters": {
  47529. // "project": {
  47530. // "description": "Project ID for this request.",
  47531. // "location": "path",
  47532. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47533. // "required": true,
  47534. // "type": "string"
  47535. // },
  47536. // "region": {
  47537. // "description": "Name of the region scoping this request.",
  47538. // "location": "path",
  47539. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47540. // "required": true,
  47541. // "type": "string"
  47542. // },
  47543. // "requestId": {
  47544. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47545. // "location": "query",
  47546. // "type": "string"
  47547. // }
  47548. // },
  47549. // "path": "{project}/regions/{region}/forwardingRules",
  47550. // "request": {
  47551. // "$ref": "ForwardingRule"
  47552. // },
  47553. // "response": {
  47554. // "$ref": "Operation"
  47555. // },
  47556. // "scopes": [
  47557. // "https://www.googleapis.com/auth/cloud-platform",
  47558. // "https://www.googleapis.com/auth/compute"
  47559. // ]
  47560. // }
  47561. }
  47562. // method id "compute.forwardingRules.list":
  47563. type ForwardingRulesListCall struct {
  47564. s *Service
  47565. project string
  47566. region string
  47567. urlParams_ gensupport.URLParams
  47568. ifNoneMatch_ string
  47569. ctx_ context.Context
  47570. header_ http.Header
  47571. }
  47572. // List: Retrieves a list of ForwardingRule resources available to the
  47573. // specified project and region.
  47574. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  47575. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  47576. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47577. c.project = project
  47578. c.region = region
  47579. return c
  47580. }
  47581. // Filter sets the optional parameter "filter": A filter expression that
  47582. // filters resources listed in the response. The expression must specify
  47583. // the field name, a comparison operator, and the value that you want to
  47584. // use for filtering. The value must be a string, a number, or a
  47585. // boolean. The comparison operator must be either =, !=, >, or <.
  47586. //
  47587. // For example, if you are filtering Compute Engine instances, you can
  47588. // exclude instances named example-instance by specifying name !=
  47589. // example-instance.
  47590. //
  47591. // You can also filter nested fields. For example, you could specify
  47592. // scheduling.automaticRestart = false to include instances only if they
  47593. // are not scheduled for automatic restarts. You can use filtering on
  47594. // nested fields to filter based on resource labels.
  47595. //
  47596. // To filter on multiple expressions, provide each separate expression
  47597. // within parentheses. For example, (scheduling.automaticRestart = true)
  47598. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47599. // AND expression. However, you can include AND and OR expressions
  47600. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47601. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47602. // true).
  47603. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  47604. c.urlParams_.Set("filter", filter)
  47605. return c
  47606. }
  47607. // MaxResults sets the optional parameter "maxResults": The maximum
  47608. // number of results per page that should be returned. If the number of
  47609. // available results is larger than maxResults, Compute Engine returns a
  47610. // nextPageToken that can be used to get the next page of results in
  47611. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47612. // (Default: 500)
  47613. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  47614. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47615. return c
  47616. }
  47617. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47618. // a certain order. By default, results are returned in alphanumerical
  47619. // order based on the resource name.
  47620. //
  47621. // You can also sort results in descending order based on the creation
  47622. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47623. // based on the creationTimestamp field in reverse chronological order
  47624. // (newest result first). Use this to sort resources like operations so
  47625. // that the newest operation is returned first.
  47626. //
  47627. // Currently, only sorting by name or creationTimestamp desc is
  47628. // supported.
  47629. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  47630. c.urlParams_.Set("orderBy", orderBy)
  47631. return c
  47632. }
  47633. // PageToken sets the optional parameter "pageToken": Specifies a page
  47634. // token to use. Set pageToken to the nextPageToken returned by a
  47635. // previous list request to get the next page of results.
  47636. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  47637. c.urlParams_.Set("pageToken", pageToken)
  47638. return c
  47639. }
  47640. // Fields allows partial responses to be retrieved. See
  47641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47642. // for more information.
  47643. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  47644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47645. return c
  47646. }
  47647. // IfNoneMatch sets the optional parameter which makes the operation
  47648. // fail if the object's ETag matches the given value. This is useful for
  47649. // getting updates only after the object has changed since the last
  47650. // request. Use googleapi.IsNotModified to check whether the response
  47651. // error from Do is the result of In-None-Match.
  47652. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  47653. c.ifNoneMatch_ = entityTag
  47654. return c
  47655. }
  47656. // Context sets the context to be used in this call's Do method. Any
  47657. // pending HTTP request will be aborted if the provided context is
  47658. // canceled.
  47659. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  47660. c.ctx_ = ctx
  47661. return c
  47662. }
  47663. // Header returns an http.Header that can be modified by the caller to
  47664. // add HTTP headers to the request.
  47665. func (c *ForwardingRulesListCall) Header() http.Header {
  47666. if c.header_ == nil {
  47667. c.header_ = make(http.Header)
  47668. }
  47669. return c.header_
  47670. }
  47671. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  47672. reqHeaders := make(http.Header)
  47673. for k, v := range c.header_ {
  47674. reqHeaders[k] = v
  47675. }
  47676. reqHeaders.Set("User-Agent", c.s.userAgent())
  47677. if c.ifNoneMatch_ != "" {
  47678. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47679. }
  47680. var body io.Reader = nil
  47681. c.urlParams_.Set("alt", alt)
  47682. c.urlParams_.Set("prettyPrint", "false")
  47683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  47684. urls += "?" + c.urlParams_.Encode()
  47685. req, err := http.NewRequest("GET", urls, body)
  47686. if err != nil {
  47687. return nil, err
  47688. }
  47689. req.Header = reqHeaders
  47690. googleapi.Expand(req.URL, map[string]string{
  47691. "project": c.project,
  47692. "region": c.region,
  47693. })
  47694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47695. }
  47696. // Do executes the "compute.forwardingRules.list" call.
  47697. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  47698. // non-2xx status code is an error. Response headers are in either
  47699. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  47700. // returned at all) in error.(*googleapi.Error).Header. Use
  47701. // googleapi.IsNotModified to check whether the returned error was
  47702. // because http.StatusNotModified was returned.
  47703. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  47704. gensupport.SetOptions(c.urlParams_, opts...)
  47705. res, err := c.doRequest("json")
  47706. if res != nil && res.StatusCode == http.StatusNotModified {
  47707. if res.Body != nil {
  47708. res.Body.Close()
  47709. }
  47710. return nil, &googleapi.Error{
  47711. Code: res.StatusCode,
  47712. Header: res.Header,
  47713. }
  47714. }
  47715. if err != nil {
  47716. return nil, err
  47717. }
  47718. defer googleapi.CloseBody(res)
  47719. if err := googleapi.CheckResponse(res); err != nil {
  47720. return nil, err
  47721. }
  47722. ret := &ForwardingRuleList{
  47723. ServerResponse: googleapi.ServerResponse{
  47724. Header: res.Header,
  47725. HTTPStatusCode: res.StatusCode,
  47726. },
  47727. }
  47728. target := &ret
  47729. if err := gensupport.DecodeResponse(target, res); err != nil {
  47730. return nil, err
  47731. }
  47732. return ret, nil
  47733. // {
  47734. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  47735. // "httpMethod": "GET",
  47736. // "id": "compute.forwardingRules.list",
  47737. // "parameterOrder": [
  47738. // "project",
  47739. // "region"
  47740. // ],
  47741. // "parameters": {
  47742. // "filter": {
  47743. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47744. // "location": "query",
  47745. // "type": "string"
  47746. // },
  47747. // "maxResults": {
  47748. // "default": "500",
  47749. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47750. // "format": "uint32",
  47751. // "location": "query",
  47752. // "minimum": "0",
  47753. // "type": "integer"
  47754. // },
  47755. // "orderBy": {
  47756. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47757. // "location": "query",
  47758. // "type": "string"
  47759. // },
  47760. // "pageToken": {
  47761. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47762. // "location": "query",
  47763. // "type": "string"
  47764. // },
  47765. // "project": {
  47766. // "description": "Project ID for this request.",
  47767. // "location": "path",
  47768. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47769. // "required": true,
  47770. // "type": "string"
  47771. // },
  47772. // "region": {
  47773. // "description": "Name of the region scoping this request.",
  47774. // "location": "path",
  47775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47776. // "required": true,
  47777. // "type": "string"
  47778. // }
  47779. // },
  47780. // "path": "{project}/regions/{region}/forwardingRules",
  47781. // "response": {
  47782. // "$ref": "ForwardingRuleList"
  47783. // },
  47784. // "scopes": [
  47785. // "https://www.googleapis.com/auth/cloud-platform",
  47786. // "https://www.googleapis.com/auth/compute",
  47787. // "https://www.googleapis.com/auth/compute.readonly"
  47788. // ]
  47789. // }
  47790. }
  47791. // Pages invokes f for each page of results.
  47792. // A non-nil error returned from f will halt the iteration.
  47793. // The provided context supersedes any context provided to the Context method.
  47794. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  47795. c.ctx_ = ctx
  47796. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47797. for {
  47798. x, err := c.Do()
  47799. if err != nil {
  47800. return err
  47801. }
  47802. if err := f(x); err != nil {
  47803. return err
  47804. }
  47805. if x.NextPageToken == "" {
  47806. return nil
  47807. }
  47808. c.PageToken(x.NextPageToken)
  47809. }
  47810. }
  47811. // method id "compute.forwardingRules.patch":
  47812. type ForwardingRulesPatchCall struct {
  47813. s *Service
  47814. project string
  47815. region string
  47816. forwardingRule string
  47817. forwardingrule *ForwardingRule
  47818. urlParams_ gensupport.URLParams
  47819. ctx_ context.Context
  47820. header_ http.Header
  47821. }
  47822. // Patch: Updates the specified forwarding rule with the data included
  47823. // in the request. This method supports PATCH semantics and uses the
  47824. // JSON merge patch format and processing rules. Currently, you can only
  47825. // patch the network_tier field.
  47826. func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
  47827. c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47828. c.project = project
  47829. c.region = region
  47830. c.forwardingRule = forwardingRule
  47831. c.forwardingrule = forwardingrule
  47832. return c
  47833. }
  47834. // RequestId sets the optional parameter "requestId": An optional
  47835. // request ID to identify requests. Specify a unique request ID so that
  47836. // if you must retry your request, the server will know to ignore the
  47837. // request if it has already been completed.
  47838. //
  47839. // For example, consider a situation where you make an initial request
  47840. // and the request times out. If you make the request again with the
  47841. // same request ID, the server can check if original operation with the
  47842. // same request ID was received, and if so, will ignore the second
  47843. // request. This prevents clients from accidentally creating duplicate
  47844. // commitments.
  47845. //
  47846. // The request ID must be a valid UUID with the exception that zero UUID
  47847. // is not supported (00000000-0000-0000-0000-000000000000).
  47848. func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
  47849. c.urlParams_.Set("requestId", requestId)
  47850. return c
  47851. }
  47852. // Fields allows partial responses to be retrieved. See
  47853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47854. // for more information.
  47855. func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
  47856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47857. return c
  47858. }
  47859. // Context sets the context to be used in this call's Do method. Any
  47860. // pending HTTP request will be aborted if the provided context is
  47861. // canceled.
  47862. func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
  47863. c.ctx_ = ctx
  47864. return c
  47865. }
  47866. // Header returns an http.Header that can be modified by the caller to
  47867. // add HTTP headers to the request.
  47868. func (c *ForwardingRulesPatchCall) Header() http.Header {
  47869. if c.header_ == nil {
  47870. c.header_ = make(http.Header)
  47871. }
  47872. return c.header_
  47873. }
  47874. func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  47875. reqHeaders := make(http.Header)
  47876. for k, v := range c.header_ {
  47877. reqHeaders[k] = v
  47878. }
  47879. reqHeaders.Set("User-Agent", c.s.userAgent())
  47880. var body io.Reader = nil
  47881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  47882. if err != nil {
  47883. return nil, err
  47884. }
  47885. reqHeaders.Set("Content-Type", "application/json")
  47886. c.urlParams_.Set("alt", alt)
  47887. c.urlParams_.Set("prettyPrint", "false")
  47888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  47889. urls += "?" + c.urlParams_.Encode()
  47890. req, err := http.NewRequest("PATCH", urls, body)
  47891. if err != nil {
  47892. return nil, err
  47893. }
  47894. req.Header = reqHeaders
  47895. googleapi.Expand(req.URL, map[string]string{
  47896. "project": c.project,
  47897. "region": c.region,
  47898. "forwardingRule": c.forwardingRule,
  47899. })
  47900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47901. }
  47902. // Do executes the "compute.forwardingRules.patch" call.
  47903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47904. // status code is an error. Response headers are in either
  47905. // *Operation.ServerResponse.Header or (if a response was returned at
  47906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47907. // to check whether the returned error was because
  47908. // http.StatusNotModified was returned.
  47909. func (c *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47910. gensupport.SetOptions(c.urlParams_, opts...)
  47911. res, err := c.doRequest("json")
  47912. if res != nil && res.StatusCode == http.StatusNotModified {
  47913. if res.Body != nil {
  47914. res.Body.Close()
  47915. }
  47916. return nil, &googleapi.Error{
  47917. Code: res.StatusCode,
  47918. Header: res.Header,
  47919. }
  47920. }
  47921. if err != nil {
  47922. return nil, err
  47923. }
  47924. defer googleapi.CloseBody(res)
  47925. if err := googleapi.CheckResponse(res); err != nil {
  47926. return nil, err
  47927. }
  47928. ret := &Operation{
  47929. ServerResponse: googleapi.ServerResponse{
  47930. Header: res.Header,
  47931. HTTPStatusCode: res.StatusCode,
  47932. },
  47933. }
  47934. target := &ret
  47935. if err := gensupport.DecodeResponse(target, res); err != nil {
  47936. return nil, err
  47937. }
  47938. return ret, nil
  47939. // {
  47940. // "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
  47941. // "httpMethod": "PATCH",
  47942. // "id": "compute.forwardingRules.patch",
  47943. // "parameterOrder": [
  47944. // "project",
  47945. // "region",
  47946. // "forwardingRule"
  47947. // ],
  47948. // "parameters": {
  47949. // "forwardingRule": {
  47950. // "description": "Name of the ForwardingRule resource to patch.",
  47951. // "location": "path",
  47952. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47953. // "required": true,
  47954. // "type": "string"
  47955. // },
  47956. // "project": {
  47957. // "description": "Project ID for this request.",
  47958. // "location": "path",
  47959. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47960. // "required": true,
  47961. // "type": "string"
  47962. // },
  47963. // "region": {
  47964. // "description": "Name of the region scoping this request.",
  47965. // "location": "path",
  47966. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47967. // "required": true,
  47968. // "type": "string"
  47969. // },
  47970. // "requestId": {
  47971. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47972. // "location": "query",
  47973. // "type": "string"
  47974. // }
  47975. // },
  47976. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  47977. // "request": {
  47978. // "$ref": "ForwardingRule"
  47979. // },
  47980. // "response": {
  47981. // "$ref": "Operation"
  47982. // },
  47983. // "scopes": [
  47984. // "https://www.googleapis.com/auth/cloud-platform",
  47985. // "https://www.googleapis.com/auth/compute"
  47986. // ]
  47987. // }
  47988. }
  47989. // method id "compute.forwardingRules.setLabels":
  47990. type ForwardingRulesSetLabelsCall struct {
  47991. s *Service
  47992. project string
  47993. region string
  47994. resource string
  47995. regionsetlabelsrequest *RegionSetLabelsRequest
  47996. urlParams_ gensupport.URLParams
  47997. ctx_ context.Context
  47998. header_ http.Header
  47999. }
  48000. // SetLabels: Sets the labels on the specified resource. To learn more
  48001. // about labels, read the Labeling Resources documentation.
  48002. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  48003. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48004. c.project = project
  48005. c.region = region
  48006. c.resource = resource
  48007. c.regionsetlabelsrequest = regionsetlabelsrequest
  48008. return c
  48009. }
  48010. // RequestId sets the optional parameter "requestId": An optional
  48011. // request ID to identify requests. Specify a unique request ID so that
  48012. // if you must retry your request, the server will know to ignore the
  48013. // request if it has already been completed.
  48014. //
  48015. // For example, consider a situation where you make an initial request
  48016. // and the request times out. If you make the request again with the
  48017. // same request ID, the server can check if original operation with the
  48018. // same request ID was received, and if so, will ignore the second
  48019. // request. This prevents clients from accidentally creating duplicate
  48020. // commitments.
  48021. //
  48022. // The request ID must be a valid UUID with the exception that zero UUID
  48023. // is not supported (00000000-0000-0000-0000-000000000000).
  48024. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  48025. c.urlParams_.Set("requestId", requestId)
  48026. return c
  48027. }
  48028. // Fields allows partial responses to be retrieved. See
  48029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48030. // for more information.
  48031. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  48032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48033. return c
  48034. }
  48035. // Context sets the context to be used in this call's Do method. Any
  48036. // pending HTTP request will be aborted if the provided context is
  48037. // canceled.
  48038. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  48039. c.ctx_ = ctx
  48040. return c
  48041. }
  48042. // Header returns an http.Header that can be modified by the caller to
  48043. // add HTTP headers to the request.
  48044. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  48045. if c.header_ == nil {
  48046. c.header_ = make(http.Header)
  48047. }
  48048. return c.header_
  48049. }
  48050. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  48051. reqHeaders := make(http.Header)
  48052. for k, v := range c.header_ {
  48053. reqHeaders[k] = v
  48054. }
  48055. reqHeaders.Set("User-Agent", c.s.userAgent())
  48056. var body io.Reader = nil
  48057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  48058. if err != nil {
  48059. return nil, err
  48060. }
  48061. reqHeaders.Set("Content-Type", "application/json")
  48062. c.urlParams_.Set("alt", alt)
  48063. c.urlParams_.Set("prettyPrint", "false")
  48064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  48065. urls += "?" + c.urlParams_.Encode()
  48066. req, err := http.NewRequest("POST", urls, body)
  48067. if err != nil {
  48068. return nil, err
  48069. }
  48070. req.Header = reqHeaders
  48071. googleapi.Expand(req.URL, map[string]string{
  48072. "project": c.project,
  48073. "region": c.region,
  48074. "resource": c.resource,
  48075. })
  48076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48077. }
  48078. // Do executes the "compute.forwardingRules.setLabels" call.
  48079. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48080. // status code is an error. Response headers are in either
  48081. // *Operation.ServerResponse.Header or (if a response was returned at
  48082. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48083. // to check whether the returned error was because
  48084. // http.StatusNotModified was returned.
  48085. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48086. gensupport.SetOptions(c.urlParams_, opts...)
  48087. res, err := c.doRequest("json")
  48088. if res != nil && res.StatusCode == http.StatusNotModified {
  48089. if res.Body != nil {
  48090. res.Body.Close()
  48091. }
  48092. return nil, &googleapi.Error{
  48093. Code: res.StatusCode,
  48094. Header: res.Header,
  48095. }
  48096. }
  48097. if err != nil {
  48098. return nil, err
  48099. }
  48100. defer googleapi.CloseBody(res)
  48101. if err := googleapi.CheckResponse(res); err != nil {
  48102. return nil, err
  48103. }
  48104. ret := &Operation{
  48105. ServerResponse: googleapi.ServerResponse{
  48106. Header: res.Header,
  48107. HTTPStatusCode: res.StatusCode,
  48108. },
  48109. }
  48110. target := &ret
  48111. if err := gensupport.DecodeResponse(target, res); err != nil {
  48112. return nil, err
  48113. }
  48114. return ret, nil
  48115. // {
  48116. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  48117. // "httpMethod": "POST",
  48118. // "id": "compute.forwardingRules.setLabels",
  48119. // "parameterOrder": [
  48120. // "project",
  48121. // "region",
  48122. // "resource"
  48123. // ],
  48124. // "parameters": {
  48125. // "project": {
  48126. // "description": "Project ID for this request.",
  48127. // "location": "path",
  48128. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48129. // "required": true,
  48130. // "type": "string"
  48131. // },
  48132. // "region": {
  48133. // "description": "The region for this request.",
  48134. // "location": "path",
  48135. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48136. // "required": true,
  48137. // "type": "string"
  48138. // },
  48139. // "requestId": {
  48140. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48141. // "location": "query",
  48142. // "type": "string"
  48143. // },
  48144. // "resource": {
  48145. // "description": "Name or id of the resource for this request.",
  48146. // "location": "path",
  48147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48148. // "required": true,
  48149. // "type": "string"
  48150. // }
  48151. // },
  48152. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  48153. // "request": {
  48154. // "$ref": "RegionSetLabelsRequest"
  48155. // },
  48156. // "response": {
  48157. // "$ref": "Operation"
  48158. // },
  48159. // "scopes": [
  48160. // "https://www.googleapis.com/auth/cloud-platform",
  48161. // "https://www.googleapis.com/auth/compute"
  48162. // ]
  48163. // }
  48164. }
  48165. // method id "compute.forwardingRules.setTarget":
  48166. type ForwardingRulesSetTargetCall struct {
  48167. s *Service
  48168. project string
  48169. region string
  48170. forwardingRule string
  48171. targetreference *TargetReference
  48172. urlParams_ gensupport.URLParams
  48173. ctx_ context.Context
  48174. header_ http.Header
  48175. }
  48176. // SetTarget: Changes target URL for forwarding rule. The new target
  48177. // should be of the same type as the old target.
  48178. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  48179. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  48180. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48181. c.project = project
  48182. c.region = region
  48183. c.forwardingRule = forwardingRule
  48184. c.targetreference = targetreference
  48185. return c
  48186. }
  48187. // RequestId sets the optional parameter "requestId": An optional
  48188. // request ID to identify requests. Specify a unique request ID so that
  48189. // if you must retry your request, the server will know to ignore the
  48190. // request if it has already been completed.
  48191. //
  48192. // For example, consider a situation where you make an initial request
  48193. // and the request times out. If you make the request again with the
  48194. // same request ID, the server can check if original operation with the
  48195. // same request ID was received, and if so, will ignore the second
  48196. // request. This prevents clients from accidentally creating duplicate
  48197. // commitments.
  48198. //
  48199. // The request ID must be a valid UUID with the exception that zero UUID
  48200. // is not supported (00000000-0000-0000-0000-000000000000).
  48201. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  48202. c.urlParams_.Set("requestId", requestId)
  48203. return c
  48204. }
  48205. // Fields allows partial responses to be retrieved. See
  48206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48207. // for more information.
  48208. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  48209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48210. return c
  48211. }
  48212. // Context sets the context to be used in this call's Do method. Any
  48213. // pending HTTP request will be aborted if the provided context is
  48214. // canceled.
  48215. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  48216. c.ctx_ = ctx
  48217. return c
  48218. }
  48219. // Header returns an http.Header that can be modified by the caller to
  48220. // add HTTP headers to the request.
  48221. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  48222. if c.header_ == nil {
  48223. c.header_ = make(http.Header)
  48224. }
  48225. return c.header_
  48226. }
  48227. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  48228. reqHeaders := make(http.Header)
  48229. for k, v := range c.header_ {
  48230. reqHeaders[k] = v
  48231. }
  48232. reqHeaders.Set("User-Agent", c.s.userAgent())
  48233. var body io.Reader = nil
  48234. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  48235. if err != nil {
  48236. return nil, err
  48237. }
  48238. reqHeaders.Set("Content-Type", "application/json")
  48239. c.urlParams_.Set("alt", alt)
  48240. c.urlParams_.Set("prettyPrint", "false")
  48241. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  48242. urls += "?" + c.urlParams_.Encode()
  48243. req, err := http.NewRequest("POST", urls, body)
  48244. if err != nil {
  48245. return nil, err
  48246. }
  48247. req.Header = reqHeaders
  48248. googleapi.Expand(req.URL, map[string]string{
  48249. "project": c.project,
  48250. "region": c.region,
  48251. "forwardingRule": c.forwardingRule,
  48252. })
  48253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48254. }
  48255. // Do executes the "compute.forwardingRules.setTarget" call.
  48256. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48257. // status code is an error. Response headers are in either
  48258. // *Operation.ServerResponse.Header or (if a response was returned at
  48259. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48260. // to check whether the returned error was because
  48261. // http.StatusNotModified was returned.
  48262. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48263. gensupport.SetOptions(c.urlParams_, opts...)
  48264. res, err := c.doRequest("json")
  48265. if res != nil && res.StatusCode == http.StatusNotModified {
  48266. if res.Body != nil {
  48267. res.Body.Close()
  48268. }
  48269. return nil, &googleapi.Error{
  48270. Code: res.StatusCode,
  48271. Header: res.Header,
  48272. }
  48273. }
  48274. if err != nil {
  48275. return nil, err
  48276. }
  48277. defer googleapi.CloseBody(res)
  48278. if err := googleapi.CheckResponse(res); err != nil {
  48279. return nil, err
  48280. }
  48281. ret := &Operation{
  48282. ServerResponse: googleapi.ServerResponse{
  48283. Header: res.Header,
  48284. HTTPStatusCode: res.StatusCode,
  48285. },
  48286. }
  48287. target := &ret
  48288. if err := gensupport.DecodeResponse(target, res); err != nil {
  48289. return nil, err
  48290. }
  48291. return ret, nil
  48292. // {
  48293. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  48294. // "httpMethod": "POST",
  48295. // "id": "compute.forwardingRules.setTarget",
  48296. // "parameterOrder": [
  48297. // "project",
  48298. // "region",
  48299. // "forwardingRule"
  48300. // ],
  48301. // "parameters": {
  48302. // "forwardingRule": {
  48303. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  48304. // "location": "path",
  48305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48306. // "required": true,
  48307. // "type": "string"
  48308. // },
  48309. // "project": {
  48310. // "description": "Project ID for this request.",
  48311. // "location": "path",
  48312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48313. // "required": true,
  48314. // "type": "string"
  48315. // },
  48316. // "region": {
  48317. // "description": "Name of the region scoping this request.",
  48318. // "location": "path",
  48319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48320. // "required": true,
  48321. // "type": "string"
  48322. // },
  48323. // "requestId": {
  48324. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48325. // "location": "query",
  48326. // "type": "string"
  48327. // }
  48328. // },
  48329. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  48330. // "request": {
  48331. // "$ref": "TargetReference"
  48332. // },
  48333. // "response": {
  48334. // "$ref": "Operation"
  48335. // },
  48336. // "scopes": [
  48337. // "https://www.googleapis.com/auth/cloud-platform",
  48338. // "https://www.googleapis.com/auth/compute"
  48339. // ]
  48340. // }
  48341. }
  48342. // method id "compute.forwardingRules.testIamPermissions":
  48343. type ForwardingRulesTestIamPermissionsCall struct {
  48344. s *Service
  48345. project string
  48346. region string
  48347. resource string
  48348. testpermissionsrequest *TestPermissionsRequest
  48349. urlParams_ gensupport.URLParams
  48350. ctx_ context.Context
  48351. header_ http.Header
  48352. }
  48353. // TestIamPermissions: Returns permissions that a caller has on the
  48354. // specified resource.
  48355. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  48356. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48357. c.project = project
  48358. c.region = region
  48359. c.resource = resource
  48360. c.testpermissionsrequest = testpermissionsrequest
  48361. return c
  48362. }
  48363. // Fields allows partial responses to be retrieved. See
  48364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48365. // for more information.
  48366. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  48367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48368. return c
  48369. }
  48370. // Context sets the context to be used in this call's Do method. Any
  48371. // pending HTTP request will be aborted if the provided context is
  48372. // canceled.
  48373. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  48374. c.ctx_ = ctx
  48375. return c
  48376. }
  48377. // Header returns an http.Header that can be modified by the caller to
  48378. // add HTTP headers to the request.
  48379. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  48380. if c.header_ == nil {
  48381. c.header_ = make(http.Header)
  48382. }
  48383. return c.header_
  48384. }
  48385. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  48386. reqHeaders := make(http.Header)
  48387. for k, v := range c.header_ {
  48388. reqHeaders[k] = v
  48389. }
  48390. reqHeaders.Set("User-Agent", c.s.userAgent())
  48391. var body io.Reader = nil
  48392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  48393. if err != nil {
  48394. return nil, err
  48395. }
  48396. reqHeaders.Set("Content-Type", "application/json")
  48397. c.urlParams_.Set("alt", alt)
  48398. c.urlParams_.Set("prettyPrint", "false")
  48399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  48400. urls += "?" + c.urlParams_.Encode()
  48401. req, err := http.NewRequest("POST", urls, body)
  48402. if err != nil {
  48403. return nil, err
  48404. }
  48405. req.Header = reqHeaders
  48406. googleapi.Expand(req.URL, map[string]string{
  48407. "project": c.project,
  48408. "region": c.region,
  48409. "resource": c.resource,
  48410. })
  48411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48412. }
  48413. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  48414. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  48415. // non-2xx status code is an error. Response headers are in either
  48416. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  48417. // returned at all) in error.(*googleapi.Error).Header. Use
  48418. // googleapi.IsNotModified to check whether the returned error was
  48419. // because http.StatusNotModified was returned.
  48420. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  48421. gensupport.SetOptions(c.urlParams_, opts...)
  48422. res, err := c.doRequest("json")
  48423. if res != nil && res.StatusCode == http.StatusNotModified {
  48424. if res.Body != nil {
  48425. res.Body.Close()
  48426. }
  48427. return nil, &googleapi.Error{
  48428. Code: res.StatusCode,
  48429. Header: res.Header,
  48430. }
  48431. }
  48432. if err != nil {
  48433. return nil, err
  48434. }
  48435. defer googleapi.CloseBody(res)
  48436. if err := googleapi.CheckResponse(res); err != nil {
  48437. return nil, err
  48438. }
  48439. ret := &TestPermissionsResponse{
  48440. ServerResponse: googleapi.ServerResponse{
  48441. Header: res.Header,
  48442. HTTPStatusCode: res.StatusCode,
  48443. },
  48444. }
  48445. target := &ret
  48446. if err := gensupport.DecodeResponse(target, res); err != nil {
  48447. return nil, err
  48448. }
  48449. return ret, nil
  48450. // {
  48451. // "description": "Returns permissions that a caller has on the specified resource.",
  48452. // "httpMethod": "POST",
  48453. // "id": "compute.forwardingRules.testIamPermissions",
  48454. // "parameterOrder": [
  48455. // "project",
  48456. // "region",
  48457. // "resource"
  48458. // ],
  48459. // "parameters": {
  48460. // "project": {
  48461. // "description": "Project ID for this request.",
  48462. // "location": "path",
  48463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48464. // "required": true,
  48465. // "type": "string"
  48466. // },
  48467. // "region": {
  48468. // "description": "The name of the region for this request.",
  48469. // "location": "path",
  48470. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48471. // "required": true,
  48472. // "type": "string"
  48473. // },
  48474. // "resource": {
  48475. // "description": "Name or id of the resource for this request.",
  48476. // "location": "path",
  48477. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48478. // "required": true,
  48479. // "type": "string"
  48480. // }
  48481. // },
  48482. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  48483. // "request": {
  48484. // "$ref": "TestPermissionsRequest"
  48485. // },
  48486. // "response": {
  48487. // "$ref": "TestPermissionsResponse"
  48488. // },
  48489. // "scopes": [
  48490. // "https://www.googleapis.com/auth/cloud-platform",
  48491. // "https://www.googleapis.com/auth/compute",
  48492. // "https://www.googleapis.com/auth/compute.readonly"
  48493. // ]
  48494. // }
  48495. }
  48496. // method id "compute.globalAddresses.delete":
  48497. type GlobalAddressesDeleteCall struct {
  48498. s *Service
  48499. project string
  48500. address string
  48501. urlParams_ gensupport.URLParams
  48502. ctx_ context.Context
  48503. header_ http.Header
  48504. }
  48505. // Delete: Deletes the specified address resource.
  48506. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  48507. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  48508. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48509. c.project = project
  48510. c.address = address
  48511. return c
  48512. }
  48513. // RequestId sets the optional parameter "requestId": An optional
  48514. // request ID to identify requests. Specify a unique request ID so that
  48515. // if you must retry your request, the server will know to ignore the
  48516. // request if it has already been completed.
  48517. //
  48518. // For example, consider a situation where you make an initial request
  48519. // and the request times out. If you make the request again with the
  48520. // same request ID, the server can check if original operation with the
  48521. // same request ID was received, and if so, will ignore the second
  48522. // request. This prevents clients from accidentally creating duplicate
  48523. // commitments.
  48524. //
  48525. // The request ID must be a valid UUID with the exception that zero UUID
  48526. // is not supported (00000000-0000-0000-0000-000000000000).
  48527. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  48528. c.urlParams_.Set("requestId", requestId)
  48529. return c
  48530. }
  48531. // Fields allows partial responses to be retrieved. See
  48532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48533. // for more information.
  48534. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  48535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48536. return c
  48537. }
  48538. // Context sets the context to be used in this call's Do method. Any
  48539. // pending HTTP request will be aborted if the provided context is
  48540. // canceled.
  48541. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  48542. c.ctx_ = ctx
  48543. return c
  48544. }
  48545. // Header returns an http.Header that can be modified by the caller to
  48546. // add HTTP headers to the request.
  48547. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  48548. if c.header_ == nil {
  48549. c.header_ = make(http.Header)
  48550. }
  48551. return c.header_
  48552. }
  48553. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  48554. reqHeaders := make(http.Header)
  48555. for k, v := range c.header_ {
  48556. reqHeaders[k] = v
  48557. }
  48558. reqHeaders.Set("User-Agent", c.s.userAgent())
  48559. var body io.Reader = nil
  48560. c.urlParams_.Set("alt", alt)
  48561. c.urlParams_.Set("prettyPrint", "false")
  48562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  48563. urls += "?" + c.urlParams_.Encode()
  48564. req, err := http.NewRequest("DELETE", urls, body)
  48565. if err != nil {
  48566. return nil, err
  48567. }
  48568. req.Header = reqHeaders
  48569. googleapi.Expand(req.URL, map[string]string{
  48570. "project": c.project,
  48571. "address": c.address,
  48572. })
  48573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48574. }
  48575. // Do executes the "compute.globalAddresses.delete" call.
  48576. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48577. // status code is an error. Response headers are in either
  48578. // *Operation.ServerResponse.Header or (if a response was returned at
  48579. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48580. // to check whether the returned error was because
  48581. // http.StatusNotModified was returned.
  48582. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48583. gensupport.SetOptions(c.urlParams_, opts...)
  48584. res, err := c.doRequest("json")
  48585. if res != nil && res.StatusCode == http.StatusNotModified {
  48586. if res.Body != nil {
  48587. res.Body.Close()
  48588. }
  48589. return nil, &googleapi.Error{
  48590. Code: res.StatusCode,
  48591. Header: res.Header,
  48592. }
  48593. }
  48594. if err != nil {
  48595. return nil, err
  48596. }
  48597. defer googleapi.CloseBody(res)
  48598. if err := googleapi.CheckResponse(res); err != nil {
  48599. return nil, err
  48600. }
  48601. ret := &Operation{
  48602. ServerResponse: googleapi.ServerResponse{
  48603. Header: res.Header,
  48604. HTTPStatusCode: res.StatusCode,
  48605. },
  48606. }
  48607. target := &ret
  48608. if err := gensupport.DecodeResponse(target, res); err != nil {
  48609. return nil, err
  48610. }
  48611. return ret, nil
  48612. // {
  48613. // "description": "Deletes the specified address resource.",
  48614. // "httpMethod": "DELETE",
  48615. // "id": "compute.globalAddresses.delete",
  48616. // "parameterOrder": [
  48617. // "project",
  48618. // "address"
  48619. // ],
  48620. // "parameters": {
  48621. // "address": {
  48622. // "description": "Name of the address resource to delete.",
  48623. // "location": "path",
  48624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48625. // "required": true,
  48626. // "type": "string"
  48627. // },
  48628. // "project": {
  48629. // "description": "Project ID for this request.",
  48630. // "location": "path",
  48631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48632. // "required": true,
  48633. // "type": "string"
  48634. // },
  48635. // "requestId": {
  48636. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48637. // "location": "query",
  48638. // "type": "string"
  48639. // }
  48640. // },
  48641. // "path": "{project}/global/addresses/{address}",
  48642. // "response": {
  48643. // "$ref": "Operation"
  48644. // },
  48645. // "scopes": [
  48646. // "https://www.googleapis.com/auth/cloud-platform",
  48647. // "https://www.googleapis.com/auth/compute"
  48648. // ]
  48649. // }
  48650. }
  48651. // method id "compute.globalAddresses.get":
  48652. type GlobalAddressesGetCall struct {
  48653. s *Service
  48654. project string
  48655. address string
  48656. urlParams_ gensupport.URLParams
  48657. ifNoneMatch_ string
  48658. ctx_ context.Context
  48659. header_ http.Header
  48660. }
  48661. // Get: Returns the specified address resource. Gets a list of available
  48662. // addresses by making a list() request.
  48663. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  48664. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  48665. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48666. c.project = project
  48667. c.address = address
  48668. return c
  48669. }
  48670. // Fields allows partial responses to be retrieved. See
  48671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48672. // for more information.
  48673. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  48674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48675. return c
  48676. }
  48677. // IfNoneMatch sets the optional parameter which makes the operation
  48678. // fail if the object's ETag matches the given value. This is useful for
  48679. // getting updates only after the object has changed since the last
  48680. // request. Use googleapi.IsNotModified to check whether the response
  48681. // error from Do is the result of In-None-Match.
  48682. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  48683. c.ifNoneMatch_ = entityTag
  48684. return c
  48685. }
  48686. // Context sets the context to be used in this call's Do method. Any
  48687. // pending HTTP request will be aborted if the provided context is
  48688. // canceled.
  48689. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  48690. c.ctx_ = ctx
  48691. return c
  48692. }
  48693. // Header returns an http.Header that can be modified by the caller to
  48694. // add HTTP headers to the request.
  48695. func (c *GlobalAddressesGetCall) Header() http.Header {
  48696. if c.header_ == nil {
  48697. c.header_ = make(http.Header)
  48698. }
  48699. return c.header_
  48700. }
  48701. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  48702. reqHeaders := make(http.Header)
  48703. for k, v := range c.header_ {
  48704. reqHeaders[k] = v
  48705. }
  48706. reqHeaders.Set("User-Agent", c.s.userAgent())
  48707. if c.ifNoneMatch_ != "" {
  48708. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48709. }
  48710. var body io.Reader = nil
  48711. c.urlParams_.Set("alt", alt)
  48712. c.urlParams_.Set("prettyPrint", "false")
  48713. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  48714. urls += "?" + c.urlParams_.Encode()
  48715. req, err := http.NewRequest("GET", urls, body)
  48716. if err != nil {
  48717. return nil, err
  48718. }
  48719. req.Header = reqHeaders
  48720. googleapi.Expand(req.URL, map[string]string{
  48721. "project": c.project,
  48722. "address": c.address,
  48723. })
  48724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48725. }
  48726. // Do executes the "compute.globalAddresses.get" call.
  48727. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  48728. // code is an error. Response headers are in either
  48729. // *Address.ServerResponse.Header or (if a response was returned at all)
  48730. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48731. // check whether the returned error was because http.StatusNotModified
  48732. // was returned.
  48733. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  48734. gensupport.SetOptions(c.urlParams_, opts...)
  48735. res, err := c.doRequest("json")
  48736. if res != nil && res.StatusCode == http.StatusNotModified {
  48737. if res.Body != nil {
  48738. res.Body.Close()
  48739. }
  48740. return nil, &googleapi.Error{
  48741. Code: res.StatusCode,
  48742. Header: res.Header,
  48743. }
  48744. }
  48745. if err != nil {
  48746. return nil, err
  48747. }
  48748. defer googleapi.CloseBody(res)
  48749. if err := googleapi.CheckResponse(res); err != nil {
  48750. return nil, err
  48751. }
  48752. ret := &Address{
  48753. ServerResponse: googleapi.ServerResponse{
  48754. Header: res.Header,
  48755. HTTPStatusCode: res.StatusCode,
  48756. },
  48757. }
  48758. target := &ret
  48759. if err := gensupport.DecodeResponse(target, res); err != nil {
  48760. return nil, err
  48761. }
  48762. return ret, nil
  48763. // {
  48764. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  48765. // "httpMethod": "GET",
  48766. // "id": "compute.globalAddresses.get",
  48767. // "parameterOrder": [
  48768. // "project",
  48769. // "address"
  48770. // ],
  48771. // "parameters": {
  48772. // "address": {
  48773. // "description": "Name of the address resource to return.",
  48774. // "location": "path",
  48775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48776. // "required": true,
  48777. // "type": "string"
  48778. // },
  48779. // "project": {
  48780. // "description": "Project ID for this request.",
  48781. // "location": "path",
  48782. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48783. // "required": true,
  48784. // "type": "string"
  48785. // }
  48786. // },
  48787. // "path": "{project}/global/addresses/{address}",
  48788. // "response": {
  48789. // "$ref": "Address"
  48790. // },
  48791. // "scopes": [
  48792. // "https://www.googleapis.com/auth/cloud-platform",
  48793. // "https://www.googleapis.com/auth/compute",
  48794. // "https://www.googleapis.com/auth/compute.readonly"
  48795. // ]
  48796. // }
  48797. }
  48798. // method id "compute.globalAddresses.insert":
  48799. type GlobalAddressesInsertCall struct {
  48800. s *Service
  48801. project string
  48802. address *Address
  48803. urlParams_ gensupport.URLParams
  48804. ctx_ context.Context
  48805. header_ http.Header
  48806. }
  48807. // Insert: Creates an address resource in the specified project using
  48808. // the data included in the request.
  48809. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  48810. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  48811. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48812. c.project = project
  48813. c.address = address
  48814. return c
  48815. }
  48816. // RequestId sets the optional parameter "requestId": An optional
  48817. // request ID to identify requests. Specify a unique request ID so that
  48818. // if you must retry your request, the server will know to ignore the
  48819. // request if it has already been completed.
  48820. //
  48821. // For example, consider a situation where you make an initial request
  48822. // and the request times out. If you make the request again with the
  48823. // same request ID, the server can check if original operation with the
  48824. // same request ID was received, and if so, will ignore the second
  48825. // request. This prevents clients from accidentally creating duplicate
  48826. // commitments.
  48827. //
  48828. // The request ID must be a valid UUID with the exception that zero UUID
  48829. // is not supported (00000000-0000-0000-0000-000000000000).
  48830. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  48831. c.urlParams_.Set("requestId", requestId)
  48832. return c
  48833. }
  48834. // Fields allows partial responses to be retrieved. See
  48835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48836. // for more information.
  48837. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  48838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48839. return c
  48840. }
  48841. // Context sets the context to be used in this call's Do method. Any
  48842. // pending HTTP request will be aborted if the provided context is
  48843. // canceled.
  48844. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  48845. c.ctx_ = ctx
  48846. return c
  48847. }
  48848. // Header returns an http.Header that can be modified by the caller to
  48849. // add HTTP headers to the request.
  48850. func (c *GlobalAddressesInsertCall) Header() http.Header {
  48851. if c.header_ == nil {
  48852. c.header_ = make(http.Header)
  48853. }
  48854. return c.header_
  48855. }
  48856. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  48857. reqHeaders := make(http.Header)
  48858. for k, v := range c.header_ {
  48859. reqHeaders[k] = v
  48860. }
  48861. reqHeaders.Set("User-Agent", c.s.userAgent())
  48862. var body io.Reader = nil
  48863. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  48864. if err != nil {
  48865. return nil, err
  48866. }
  48867. reqHeaders.Set("Content-Type", "application/json")
  48868. c.urlParams_.Set("alt", alt)
  48869. c.urlParams_.Set("prettyPrint", "false")
  48870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  48871. urls += "?" + c.urlParams_.Encode()
  48872. req, err := http.NewRequest("POST", urls, body)
  48873. if err != nil {
  48874. return nil, err
  48875. }
  48876. req.Header = reqHeaders
  48877. googleapi.Expand(req.URL, map[string]string{
  48878. "project": c.project,
  48879. })
  48880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48881. }
  48882. // Do executes the "compute.globalAddresses.insert" call.
  48883. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48884. // status code is an error. Response headers are in either
  48885. // *Operation.ServerResponse.Header or (if a response was returned at
  48886. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48887. // to check whether the returned error was because
  48888. // http.StatusNotModified was returned.
  48889. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48890. gensupport.SetOptions(c.urlParams_, opts...)
  48891. res, err := c.doRequest("json")
  48892. if res != nil && res.StatusCode == http.StatusNotModified {
  48893. if res.Body != nil {
  48894. res.Body.Close()
  48895. }
  48896. return nil, &googleapi.Error{
  48897. Code: res.StatusCode,
  48898. Header: res.Header,
  48899. }
  48900. }
  48901. if err != nil {
  48902. return nil, err
  48903. }
  48904. defer googleapi.CloseBody(res)
  48905. if err := googleapi.CheckResponse(res); err != nil {
  48906. return nil, err
  48907. }
  48908. ret := &Operation{
  48909. ServerResponse: googleapi.ServerResponse{
  48910. Header: res.Header,
  48911. HTTPStatusCode: res.StatusCode,
  48912. },
  48913. }
  48914. target := &ret
  48915. if err := gensupport.DecodeResponse(target, res); err != nil {
  48916. return nil, err
  48917. }
  48918. return ret, nil
  48919. // {
  48920. // "description": "Creates an address resource in the specified project using the data included in the request.",
  48921. // "httpMethod": "POST",
  48922. // "id": "compute.globalAddresses.insert",
  48923. // "parameterOrder": [
  48924. // "project"
  48925. // ],
  48926. // "parameters": {
  48927. // "project": {
  48928. // "description": "Project ID for this request.",
  48929. // "location": "path",
  48930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48931. // "required": true,
  48932. // "type": "string"
  48933. // },
  48934. // "requestId": {
  48935. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48936. // "location": "query",
  48937. // "type": "string"
  48938. // }
  48939. // },
  48940. // "path": "{project}/global/addresses",
  48941. // "request": {
  48942. // "$ref": "Address"
  48943. // },
  48944. // "response": {
  48945. // "$ref": "Operation"
  48946. // },
  48947. // "scopes": [
  48948. // "https://www.googleapis.com/auth/cloud-platform",
  48949. // "https://www.googleapis.com/auth/compute"
  48950. // ]
  48951. // }
  48952. }
  48953. // method id "compute.globalAddresses.list":
  48954. type GlobalAddressesListCall struct {
  48955. s *Service
  48956. project string
  48957. urlParams_ gensupport.URLParams
  48958. ifNoneMatch_ string
  48959. ctx_ context.Context
  48960. header_ http.Header
  48961. }
  48962. // List: Retrieves a list of global addresses.
  48963. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  48964. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  48965. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48966. c.project = project
  48967. return c
  48968. }
  48969. // Filter sets the optional parameter "filter": A filter expression that
  48970. // filters resources listed in the response. The expression must specify
  48971. // the field name, a comparison operator, and the value that you want to
  48972. // use for filtering. The value must be a string, a number, or a
  48973. // boolean. The comparison operator must be either =, !=, >, or <.
  48974. //
  48975. // For example, if you are filtering Compute Engine instances, you can
  48976. // exclude instances named example-instance by specifying name !=
  48977. // example-instance.
  48978. //
  48979. // You can also filter nested fields. For example, you could specify
  48980. // scheduling.automaticRestart = false to include instances only if they
  48981. // are not scheduled for automatic restarts. You can use filtering on
  48982. // nested fields to filter based on resource labels.
  48983. //
  48984. // To filter on multiple expressions, provide each separate expression
  48985. // within parentheses. For example, (scheduling.automaticRestart = true)
  48986. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48987. // AND expression. However, you can include AND and OR expressions
  48988. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48989. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48990. // true).
  48991. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  48992. c.urlParams_.Set("filter", filter)
  48993. return c
  48994. }
  48995. // MaxResults sets the optional parameter "maxResults": The maximum
  48996. // number of results per page that should be returned. If the number of
  48997. // available results is larger than maxResults, Compute Engine returns a
  48998. // nextPageToken that can be used to get the next page of results in
  48999. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49000. // (Default: 500)
  49001. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  49002. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49003. return c
  49004. }
  49005. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49006. // a certain order. By default, results are returned in alphanumerical
  49007. // order based on the resource name.
  49008. //
  49009. // You can also sort results in descending order based on the creation
  49010. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49011. // based on the creationTimestamp field in reverse chronological order
  49012. // (newest result first). Use this to sort resources like operations so
  49013. // that the newest operation is returned first.
  49014. //
  49015. // Currently, only sorting by name or creationTimestamp desc is
  49016. // supported.
  49017. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  49018. c.urlParams_.Set("orderBy", orderBy)
  49019. return c
  49020. }
  49021. // PageToken sets the optional parameter "pageToken": Specifies a page
  49022. // token to use. Set pageToken to the nextPageToken returned by a
  49023. // previous list request to get the next page of results.
  49024. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  49025. c.urlParams_.Set("pageToken", pageToken)
  49026. return c
  49027. }
  49028. // Fields allows partial responses to be retrieved. See
  49029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49030. // for more information.
  49031. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  49032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49033. return c
  49034. }
  49035. // IfNoneMatch sets the optional parameter which makes the operation
  49036. // fail if the object's ETag matches the given value. This is useful for
  49037. // getting updates only after the object has changed since the last
  49038. // request. Use googleapi.IsNotModified to check whether the response
  49039. // error from Do is the result of In-None-Match.
  49040. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  49041. c.ifNoneMatch_ = entityTag
  49042. return c
  49043. }
  49044. // Context sets the context to be used in this call's Do method. Any
  49045. // pending HTTP request will be aborted if the provided context is
  49046. // canceled.
  49047. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  49048. c.ctx_ = ctx
  49049. return c
  49050. }
  49051. // Header returns an http.Header that can be modified by the caller to
  49052. // add HTTP headers to the request.
  49053. func (c *GlobalAddressesListCall) Header() http.Header {
  49054. if c.header_ == nil {
  49055. c.header_ = make(http.Header)
  49056. }
  49057. return c.header_
  49058. }
  49059. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  49060. reqHeaders := make(http.Header)
  49061. for k, v := range c.header_ {
  49062. reqHeaders[k] = v
  49063. }
  49064. reqHeaders.Set("User-Agent", c.s.userAgent())
  49065. if c.ifNoneMatch_ != "" {
  49066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49067. }
  49068. var body io.Reader = nil
  49069. c.urlParams_.Set("alt", alt)
  49070. c.urlParams_.Set("prettyPrint", "false")
  49071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  49072. urls += "?" + c.urlParams_.Encode()
  49073. req, err := http.NewRequest("GET", urls, body)
  49074. if err != nil {
  49075. return nil, err
  49076. }
  49077. req.Header = reqHeaders
  49078. googleapi.Expand(req.URL, map[string]string{
  49079. "project": c.project,
  49080. })
  49081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49082. }
  49083. // Do executes the "compute.globalAddresses.list" call.
  49084. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  49085. // status code is an error. Response headers are in either
  49086. // *AddressList.ServerResponse.Header or (if a response was returned at
  49087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49088. // to check whether the returned error was because
  49089. // http.StatusNotModified was returned.
  49090. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  49091. gensupport.SetOptions(c.urlParams_, opts...)
  49092. res, err := c.doRequest("json")
  49093. if res != nil && res.StatusCode == http.StatusNotModified {
  49094. if res.Body != nil {
  49095. res.Body.Close()
  49096. }
  49097. return nil, &googleapi.Error{
  49098. Code: res.StatusCode,
  49099. Header: res.Header,
  49100. }
  49101. }
  49102. if err != nil {
  49103. return nil, err
  49104. }
  49105. defer googleapi.CloseBody(res)
  49106. if err := googleapi.CheckResponse(res); err != nil {
  49107. return nil, err
  49108. }
  49109. ret := &AddressList{
  49110. ServerResponse: googleapi.ServerResponse{
  49111. Header: res.Header,
  49112. HTTPStatusCode: res.StatusCode,
  49113. },
  49114. }
  49115. target := &ret
  49116. if err := gensupport.DecodeResponse(target, res); err != nil {
  49117. return nil, err
  49118. }
  49119. return ret, nil
  49120. // {
  49121. // "description": "Retrieves a list of global addresses.",
  49122. // "httpMethod": "GET",
  49123. // "id": "compute.globalAddresses.list",
  49124. // "parameterOrder": [
  49125. // "project"
  49126. // ],
  49127. // "parameters": {
  49128. // "filter": {
  49129. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49130. // "location": "query",
  49131. // "type": "string"
  49132. // },
  49133. // "maxResults": {
  49134. // "default": "500",
  49135. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49136. // "format": "uint32",
  49137. // "location": "query",
  49138. // "minimum": "0",
  49139. // "type": "integer"
  49140. // },
  49141. // "orderBy": {
  49142. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49143. // "location": "query",
  49144. // "type": "string"
  49145. // },
  49146. // "pageToken": {
  49147. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49148. // "location": "query",
  49149. // "type": "string"
  49150. // },
  49151. // "project": {
  49152. // "description": "Project ID for this request.",
  49153. // "location": "path",
  49154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49155. // "required": true,
  49156. // "type": "string"
  49157. // }
  49158. // },
  49159. // "path": "{project}/global/addresses",
  49160. // "response": {
  49161. // "$ref": "AddressList"
  49162. // },
  49163. // "scopes": [
  49164. // "https://www.googleapis.com/auth/cloud-platform",
  49165. // "https://www.googleapis.com/auth/compute",
  49166. // "https://www.googleapis.com/auth/compute.readonly"
  49167. // ]
  49168. // }
  49169. }
  49170. // Pages invokes f for each page of results.
  49171. // A non-nil error returned from f will halt the iteration.
  49172. // The provided context supersedes any context provided to the Context method.
  49173. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  49174. c.ctx_ = ctx
  49175. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49176. for {
  49177. x, err := c.Do()
  49178. if err != nil {
  49179. return err
  49180. }
  49181. if err := f(x); err != nil {
  49182. return err
  49183. }
  49184. if x.NextPageToken == "" {
  49185. return nil
  49186. }
  49187. c.PageToken(x.NextPageToken)
  49188. }
  49189. }
  49190. // method id "compute.globalAddresses.setLabels":
  49191. type GlobalAddressesSetLabelsCall struct {
  49192. s *Service
  49193. project string
  49194. resource string
  49195. globalsetlabelsrequest *GlobalSetLabelsRequest
  49196. urlParams_ gensupport.URLParams
  49197. ctx_ context.Context
  49198. header_ http.Header
  49199. }
  49200. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  49201. // labels, read the Labeling Resources documentation.
  49202. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  49203. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49204. c.project = project
  49205. c.resource = resource
  49206. c.globalsetlabelsrequest = globalsetlabelsrequest
  49207. return c
  49208. }
  49209. // Fields allows partial responses to be retrieved. See
  49210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49211. // for more information.
  49212. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  49213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49214. return c
  49215. }
  49216. // Context sets the context to be used in this call's Do method. Any
  49217. // pending HTTP request will be aborted if the provided context is
  49218. // canceled.
  49219. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  49220. c.ctx_ = ctx
  49221. return c
  49222. }
  49223. // Header returns an http.Header that can be modified by the caller to
  49224. // add HTTP headers to the request.
  49225. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  49226. if c.header_ == nil {
  49227. c.header_ = make(http.Header)
  49228. }
  49229. return c.header_
  49230. }
  49231. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  49232. reqHeaders := make(http.Header)
  49233. for k, v := range c.header_ {
  49234. reqHeaders[k] = v
  49235. }
  49236. reqHeaders.Set("User-Agent", c.s.userAgent())
  49237. var body io.Reader = nil
  49238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  49239. if err != nil {
  49240. return nil, err
  49241. }
  49242. reqHeaders.Set("Content-Type", "application/json")
  49243. c.urlParams_.Set("alt", alt)
  49244. c.urlParams_.Set("prettyPrint", "false")
  49245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  49246. urls += "?" + c.urlParams_.Encode()
  49247. req, err := http.NewRequest("POST", urls, body)
  49248. if err != nil {
  49249. return nil, err
  49250. }
  49251. req.Header = reqHeaders
  49252. googleapi.Expand(req.URL, map[string]string{
  49253. "project": c.project,
  49254. "resource": c.resource,
  49255. })
  49256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49257. }
  49258. // Do executes the "compute.globalAddresses.setLabels" call.
  49259. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49260. // status code is an error. Response headers are in either
  49261. // *Operation.ServerResponse.Header or (if a response was returned at
  49262. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49263. // to check whether the returned error was because
  49264. // http.StatusNotModified was returned.
  49265. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49266. gensupport.SetOptions(c.urlParams_, opts...)
  49267. res, err := c.doRequest("json")
  49268. if res != nil && res.StatusCode == http.StatusNotModified {
  49269. if res.Body != nil {
  49270. res.Body.Close()
  49271. }
  49272. return nil, &googleapi.Error{
  49273. Code: res.StatusCode,
  49274. Header: res.Header,
  49275. }
  49276. }
  49277. if err != nil {
  49278. return nil, err
  49279. }
  49280. defer googleapi.CloseBody(res)
  49281. if err := googleapi.CheckResponse(res); err != nil {
  49282. return nil, err
  49283. }
  49284. ret := &Operation{
  49285. ServerResponse: googleapi.ServerResponse{
  49286. Header: res.Header,
  49287. HTTPStatusCode: res.StatusCode,
  49288. },
  49289. }
  49290. target := &ret
  49291. if err := gensupport.DecodeResponse(target, res); err != nil {
  49292. return nil, err
  49293. }
  49294. return ret, nil
  49295. // {
  49296. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  49297. // "httpMethod": "POST",
  49298. // "id": "compute.globalAddresses.setLabels",
  49299. // "parameterOrder": [
  49300. // "project",
  49301. // "resource"
  49302. // ],
  49303. // "parameters": {
  49304. // "project": {
  49305. // "description": "Project ID for this request.",
  49306. // "location": "path",
  49307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49308. // "required": true,
  49309. // "type": "string"
  49310. // },
  49311. // "resource": {
  49312. // "description": "Name or id of the resource for this request.",
  49313. // "location": "path",
  49314. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49315. // "required": true,
  49316. // "type": "string"
  49317. // }
  49318. // },
  49319. // "path": "{project}/global/addresses/{resource}/setLabels",
  49320. // "request": {
  49321. // "$ref": "GlobalSetLabelsRequest"
  49322. // },
  49323. // "response": {
  49324. // "$ref": "Operation"
  49325. // },
  49326. // "scopes": [
  49327. // "https://www.googleapis.com/auth/cloud-platform",
  49328. // "https://www.googleapis.com/auth/compute"
  49329. // ]
  49330. // }
  49331. }
  49332. // method id "compute.globalAddresses.testIamPermissions":
  49333. type GlobalAddressesTestIamPermissionsCall struct {
  49334. s *Service
  49335. project string
  49336. resource string
  49337. testpermissionsrequest *TestPermissionsRequest
  49338. urlParams_ gensupport.URLParams
  49339. ctx_ context.Context
  49340. header_ http.Header
  49341. }
  49342. // TestIamPermissions: Returns permissions that a caller has on the
  49343. // specified resource.
  49344. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  49345. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49346. c.project = project
  49347. c.resource = resource
  49348. c.testpermissionsrequest = testpermissionsrequest
  49349. return c
  49350. }
  49351. // Fields allows partial responses to be retrieved. See
  49352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49353. // for more information.
  49354. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  49355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49356. return c
  49357. }
  49358. // Context sets the context to be used in this call's Do method. Any
  49359. // pending HTTP request will be aborted if the provided context is
  49360. // canceled.
  49361. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  49362. c.ctx_ = ctx
  49363. return c
  49364. }
  49365. // Header returns an http.Header that can be modified by the caller to
  49366. // add HTTP headers to the request.
  49367. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  49368. if c.header_ == nil {
  49369. c.header_ = make(http.Header)
  49370. }
  49371. return c.header_
  49372. }
  49373. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49374. reqHeaders := make(http.Header)
  49375. for k, v := range c.header_ {
  49376. reqHeaders[k] = v
  49377. }
  49378. reqHeaders.Set("User-Agent", c.s.userAgent())
  49379. var body io.Reader = nil
  49380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49381. if err != nil {
  49382. return nil, err
  49383. }
  49384. reqHeaders.Set("Content-Type", "application/json")
  49385. c.urlParams_.Set("alt", alt)
  49386. c.urlParams_.Set("prettyPrint", "false")
  49387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  49388. urls += "?" + c.urlParams_.Encode()
  49389. req, err := http.NewRequest("POST", urls, body)
  49390. if err != nil {
  49391. return nil, err
  49392. }
  49393. req.Header = reqHeaders
  49394. googleapi.Expand(req.URL, map[string]string{
  49395. "project": c.project,
  49396. "resource": c.resource,
  49397. })
  49398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49399. }
  49400. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  49401. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49402. // non-2xx status code is an error. Response headers are in either
  49403. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49404. // returned at all) in error.(*googleapi.Error).Header. Use
  49405. // googleapi.IsNotModified to check whether the returned error was
  49406. // because http.StatusNotModified was returned.
  49407. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49408. gensupport.SetOptions(c.urlParams_, opts...)
  49409. res, err := c.doRequest("json")
  49410. if res != nil && res.StatusCode == http.StatusNotModified {
  49411. if res.Body != nil {
  49412. res.Body.Close()
  49413. }
  49414. return nil, &googleapi.Error{
  49415. Code: res.StatusCode,
  49416. Header: res.Header,
  49417. }
  49418. }
  49419. if err != nil {
  49420. return nil, err
  49421. }
  49422. defer googleapi.CloseBody(res)
  49423. if err := googleapi.CheckResponse(res); err != nil {
  49424. return nil, err
  49425. }
  49426. ret := &TestPermissionsResponse{
  49427. ServerResponse: googleapi.ServerResponse{
  49428. Header: res.Header,
  49429. HTTPStatusCode: res.StatusCode,
  49430. },
  49431. }
  49432. target := &ret
  49433. if err := gensupport.DecodeResponse(target, res); err != nil {
  49434. return nil, err
  49435. }
  49436. return ret, nil
  49437. // {
  49438. // "description": "Returns permissions that a caller has on the specified resource.",
  49439. // "httpMethod": "POST",
  49440. // "id": "compute.globalAddresses.testIamPermissions",
  49441. // "parameterOrder": [
  49442. // "project",
  49443. // "resource"
  49444. // ],
  49445. // "parameters": {
  49446. // "project": {
  49447. // "description": "Project ID for this request.",
  49448. // "location": "path",
  49449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49450. // "required": true,
  49451. // "type": "string"
  49452. // },
  49453. // "resource": {
  49454. // "description": "Name or id of the resource for this request.",
  49455. // "location": "path",
  49456. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49457. // "required": true,
  49458. // "type": "string"
  49459. // }
  49460. // },
  49461. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  49462. // "request": {
  49463. // "$ref": "TestPermissionsRequest"
  49464. // },
  49465. // "response": {
  49466. // "$ref": "TestPermissionsResponse"
  49467. // },
  49468. // "scopes": [
  49469. // "https://www.googleapis.com/auth/cloud-platform",
  49470. // "https://www.googleapis.com/auth/compute",
  49471. // "https://www.googleapis.com/auth/compute.readonly"
  49472. // ]
  49473. // }
  49474. }
  49475. // method id "compute.globalForwardingRules.delete":
  49476. type GlobalForwardingRulesDeleteCall struct {
  49477. s *Service
  49478. project string
  49479. forwardingRule string
  49480. urlParams_ gensupport.URLParams
  49481. ctx_ context.Context
  49482. header_ http.Header
  49483. }
  49484. // Delete: Deletes the specified GlobalForwardingRule resource.
  49485. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  49486. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  49487. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49488. c.project = project
  49489. c.forwardingRule = forwardingRule
  49490. return c
  49491. }
  49492. // RequestId sets the optional parameter "requestId": An optional
  49493. // request ID to identify requests. Specify a unique request ID so that
  49494. // if you must retry your request, the server will know to ignore the
  49495. // request if it has already been completed.
  49496. //
  49497. // For example, consider a situation where you make an initial request
  49498. // and the request times out. If you make the request again with the
  49499. // same request ID, the server can check if original operation with the
  49500. // same request ID was received, and if so, will ignore the second
  49501. // request. This prevents clients from accidentally creating duplicate
  49502. // commitments.
  49503. //
  49504. // The request ID must be a valid UUID with the exception that zero UUID
  49505. // is not supported (00000000-0000-0000-0000-000000000000).
  49506. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  49507. c.urlParams_.Set("requestId", requestId)
  49508. return c
  49509. }
  49510. // Fields allows partial responses to be retrieved. See
  49511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49512. // for more information.
  49513. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  49514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49515. return c
  49516. }
  49517. // Context sets the context to be used in this call's Do method. Any
  49518. // pending HTTP request will be aborted if the provided context is
  49519. // canceled.
  49520. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  49521. c.ctx_ = ctx
  49522. return c
  49523. }
  49524. // Header returns an http.Header that can be modified by the caller to
  49525. // add HTTP headers to the request.
  49526. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  49527. if c.header_ == nil {
  49528. c.header_ = make(http.Header)
  49529. }
  49530. return c.header_
  49531. }
  49532. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49533. reqHeaders := make(http.Header)
  49534. for k, v := range c.header_ {
  49535. reqHeaders[k] = v
  49536. }
  49537. reqHeaders.Set("User-Agent", c.s.userAgent())
  49538. var body io.Reader = nil
  49539. c.urlParams_.Set("alt", alt)
  49540. c.urlParams_.Set("prettyPrint", "false")
  49541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  49542. urls += "?" + c.urlParams_.Encode()
  49543. req, err := http.NewRequest("DELETE", urls, body)
  49544. if err != nil {
  49545. return nil, err
  49546. }
  49547. req.Header = reqHeaders
  49548. googleapi.Expand(req.URL, map[string]string{
  49549. "project": c.project,
  49550. "forwardingRule": c.forwardingRule,
  49551. })
  49552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49553. }
  49554. // Do executes the "compute.globalForwardingRules.delete" call.
  49555. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49556. // status code is an error. Response headers are in either
  49557. // *Operation.ServerResponse.Header or (if a response was returned at
  49558. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49559. // to check whether the returned error was because
  49560. // http.StatusNotModified was returned.
  49561. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49562. gensupport.SetOptions(c.urlParams_, opts...)
  49563. res, err := c.doRequest("json")
  49564. if res != nil && res.StatusCode == http.StatusNotModified {
  49565. if res.Body != nil {
  49566. res.Body.Close()
  49567. }
  49568. return nil, &googleapi.Error{
  49569. Code: res.StatusCode,
  49570. Header: res.Header,
  49571. }
  49572. }
  49573. if err != nil {
  49574. return nil, err
  49575. }
  49576. defer googleapi.CloseBody(res)
  49577. if err := googleapi.CheckResponse(res); err != nil {
  49578. return nil, err
  49579. }
  49580. ret := &Operation{
  49581. ServerResponse: googleapi.ServerResponse{
  49582. Header: res.Header,
  49583. HTTPStatusCode: res.StatusCode,
  49584. },
  49585. }
  49586. target := &ret
  49587. if err := gensupport.DecodeResponse(target, res); err != nil {
  49588. return nil, err
  49589. }
  49590. return ret, nil
  49591. // {
  49592. // "description": "Deletes the specified GlobalForwardingRule resource.",
  49593. // "httpMethod": "DELETE",
  49594. // "id": "compute.globalForwardingRules.delete",
  49595. // "parameterOrder": [
  49596. // "project",
  49597. // "forwardingRule"
  49598. // ],
  49599. // "parameters": {
  49600. // "forwardingRule": {
  49601. // "description": "Name of the ForwardingRule resource to delete.",
  49602. // "location": "path",
  49603. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49604. // "required": true,
  49605. // "type": "string"
  49606. // },
  49607. // "project": {
  49608. // "description": "Project ID for this request.",
  49609. // "location": "path",
  49610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49611. // "required": true,
  49612. // "type": "string"
  49613. // },
  49614. // "requestId": {
  49615. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49616. // "location": "query",
  49617. // "type": "string"
  49618. // }
  49619. // },
  49620. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  49621. // "response": {
  49622. // "$ref": "Operation"
  49623. // },
  49624. // "scopes": [
  49625. // "https://www.googleapis.com/auth/cloud-platform",
  49626. // "https://www.googleapis.com/auth/compute"
  49627. // ]
  49628. // }
  49629. }
  49630. // method id "compute.globalForwardingRules.get":
  49631. type GlobalForwardingRulesGetCall struct {
  49632. s *Service
  49633. project string
  49634. forwardingRule string
  49635. urlParams_ gensupport.URLParams
  49636. ifNoneMatch_ string
  49637. ctx_ context.Context
  49638. header_ http.Header
  49639. }
  49640. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  49641. // of available forwarding rules by making a list() request.
  49642. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  49643. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  49644. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49645. c.project = project
  49646. c.forwardingRule = forwardingRule
  49647. return c
  49648. }
  49649. // Fields allows partial responses to be retrieved. See
  49650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49651. // for more information.
  49652. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  49653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49654. return c
  49655. }
  49656. // IfNoneMatch sets the optional parameter which makes the operation
  49657. // fail if the object's ETag matches the given value. This is useful for
  49658. // getting updates only after the object has changed since the last
  49659. // request. Use googleapi.IsNotModified to check whether the response
  49660. // error from Do is the result of In-None-Match.
  49661. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  49662. c.ifNoneMatch_ = entityTag
  49663. return c
  49664. }
  49665. // Context sets the context to be used in this call's Do method. Any
  49666. // pending HTTP request will be aborted if the provided context is
  49667. // canceled.
  49668. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  49669. c.ctx_ = ctx
  49670. return c
  49671. }
  49672. // Header returns an http.Header that can be modified by the caller to
  49673. // add HTTP headers to the request.
  49674. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  49675. if c.header_ == nil {
  49676. c.header_ = make(http.Header)
  49677. }
  49678. return c.header_
  49679. }
  49680. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  49681. reqHeaders := make(http.Header)
  49682. for k, v := range c.header_ {
  49683. reqHeaders[k] = v
  49684. }
  49685. reqHeaders.Set("User-Agent", c.s.userAgent())
  49686. if c.ifNoneMatch_ != "" {
  49687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49688. }
  49689. var body io.Reader = nil
  49690. c.urlParams_.Set("alt", alt)
  49691. c.urlParams_.Set("prettyPrint", "false")
  49692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  49693. urls += "?" + c.urlParams_.Encode()
  49694. req, err := http.NewRequest("GET", urls, body)
  49695. if err != nil {
  49696. return nil, err
  49697. }
  49698. req.Header = reqHeaders
  49699. googleapi.Expand(req.URL, map[string]string{
  49700. "project": c.project,
  49701. "forwardingRule": c.forwardingRule,
  49702. })
  49703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49704. }
  49705. // Do executes the "compute.globalForwardingRules.get" call.
  49706. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  49707. // status code is an error. Response headers are in either
  49708. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  49709. // at all) in error.(*googleapi.Error).Header. Use
  49710. // googleapi.IsNotModified to check whether the returned error was
  49711. // because http.StatusNotModified was returned.
  49712. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  49713. gensupport.SetOptions(c.urlParams_, opts...)
  49714. res, err := c.doRequest("json")
  49715. if res != nil && res.StatusCode == http.StatusNotModified {
  49716. if res.Body != nil {
  49717. res.Body.Close()
  49718. }
  49719. return nil, &googleapi.Error{
  49720. Code: res.StatusCode,
  49721. Header: res.Header,
  49722. }
  49723. }
  49724. if err != nil {
  49725. return nil, err
  49726. }
  49727. defer googleapi.CloseBody(res)
  49728. if err := googleapi.CheckResponse(res); err != nil {
  49729. return nil, err
  49730. }
  49731. ret := &ForwardingRule{
  49732. ServerResponse: googleapi.ServerResponse{
  49733. Header: res.Header,
  49734. HTTPStatusCode: res.StatusCode,
  49735. },
  49736. }
  49737. target := &ret
  49738. if err := gensupport.DecodeResponse(target, res); err != nil {
  49739. return nil, err
  49740. }
  49741. return ret, nil
  49742. // {
  49743. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  49744. // "httpMethod": "GET",
  49745. // "id": "compute.globalForwardingRules.get",
  49746. // "parameterOrder": [
  49747. // "project",
  49748. // "forwardingRule"
  49749. // ],
  49750. // "parameters": {
  49751. // "forwardingRule": {
  49752. // "description": "Name of the ForwardingRule resource to return.",
  49753. // "location": "path",
  49754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49755. // "required": true,
  49756. // "type": "string"
  49757. // },
  49758. // "project": {
  49759. // "description": "Project ID for this request.",
  49760. // "location": "path",
  49761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49762. // "required": true,
  49763. // "type": "string"
  49764. // }
  49765. // },
  49766. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  49767. // "response": {
  49768. // "$ref": "ForwardingRule"
  49769. // },
  49770. // "scopes": [
  49771. // "https://www.googleapis.com/auth/cloud-platform",
  49772. // "https://www.googleapis.com/auth/compute",
  49773. // "https://www.googleapis.com/auth/compute.readonly"
  49774. // ]
  49775. // }
  49776. }
  49777. // method id "compute.globalForwardingRules.insert":
  49778. type GlobalForwardingRulesInsertCall struct {
  49779. s *Service
  49780. project string
  49781. forwardingrule *ForwardingRule
  49782. urlParams_ gensupport.URLParams
  49783. ctx_ context.Context
  49784. header_ http.Header
  49785. }
  49786. // Insert: Creates a GlobalForwardingRule resource in the specified
  49787. // project using the data included in the request.
  49788. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  49789. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  49790. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49791. c.project = project
  49792. c.forwardingrule = forwardingrule
  49793. return c
  49794. }
  49795. // RequestId sets the optional parameter "requestId": An optional
  49796. // request ID to identify requests. Specify a unique request ID so that
  49797. // if you must retry your request, the server will know to ignore the
  49798. // request if it has already been completed.
  49799. //
  49800. // For example, consider a situation where you make an initial request
  49801. // and the request times out. If you make the request again with the
  49802. // same request ID, the server can check if original operation with the
  49803. // same request ID was received, and if so, will ignore the second
  49804. // request. This prevents clients from accidentally creating duplicate
  49805. // commitments.
  49806. //
  49807. // The request ID must be a valid UUID with the exception that zero UUID
  49808. // is not supported (00000000-0000-0000-0000-000000000000).
  49809. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  49810. c.urlParams_.Set("requestId", requestId)
  49811. return c
  49812. }
  49813. // Fields allows partial responses to be retrieved. See
  49814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49815. // for more information.
  49816. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  49817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49818. return c
  49819. }
  49820. // Context sets the context to be used in this call's Do method. Any
  49821. // pending HTTP request will be aborted if the provided context is
  49822. // canceled.
  49823. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  49824. c.ctx_ = ctx
  49825. return c
  49826. }
  49827. // Header returns an http.Header that can be modified by the caller to
  49828. // add HTTP headers to the request.
  49829. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  49830. if c.header_ == nil {
  49831. c.header_ = make(http.Header)
  49832. }
  49833. return c.header_
  49834. }
  49835. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  49836. reqHeaders := make(http.Header)
  49837. for k, v := range c.header_ {
  49838. reqHeaders[k] = v
  49839. }
  49840. reqHeaders.Set("User-Agent", c.s.userAgent())
  49841. var body io.Reader = nil
  49842. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  49843. if err != nil {
  49844. return nil, err
  49845. }
  49846. reqHeaders.Set("Content-Type", "application/json")
  49847. c.urlParams_.Set("alt", alt)
  49848. c.urlParams_.Set("prettyPrint", "false")
  49849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  49850. urls += "?" + c.urlParams_.Encode()
  49851. req, err := http.NewRequest("POST", urls, body)
  49852. if err != nil {
  49853. return nil, err
  49854. }
  49855. req.Header = reqHeaders
  49856. googleapi.Expand(req.URL, map[string]string{
  49857. "project": c.project,
  49858. })
  49859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49860. }
  49861. // Do executes the "compute.globalForwardingRules.insert" call.
  49862. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49863. // status code is an error. Response headers are in either
  49864. // *Operation.ServerResponse.Header or (if a response was returned at
  49865. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49866. // to check whether the returned error was because
  49867. // http.StatusNotModified was returned.
  49868. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49869. gensupport.SetOptions(c.urlParams_, opts...)
  49870. res, err := c.doRequest("json")
  49871. if res != nil && res.StatusCode == http.StatusNotModified {
  49872. if res.Body != nil {
  49873. res.Body.Close()
  49874. }
  49875. return nil, &googleapi.Error{
  49876. Code: res.StatusCode,
  49877. Header: res.Header,
  49878. }
  49879. }
  49880. if err != nil {
  49881. return nil, err
  49882. }
  49883. defer googleapi.CloseBody(res)
  49884. if err := googleapi.CheckResponse(res); err != nil {
  49885. return nil, err
  49886. }
  49887. ret := &Operation{
  49888. ServerResponse: googleapi.ServerResponse{
  49889. Header: res.Header,
  49890. HTTPStatusCode: res.StatusCode,
  49891. },
  49892. }
  49893. target := &ret
  49894. if err := gensupport.DecodeResponse(target, res); err != nil {
  49895. return nil, err
  49896. }
  49897. return ret, nil
  49898. // {
  49899. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  49900. // "httpMethod": "POST",
  49901. // "id": "compute.globalForwardingRules.insert",
  49902. // "parameterOrder": [
  49903. // "project"
  49904. // ],
  49905. // "parameters": {
  49906. // "project": {
  49907. // "description": "Project ID for this request.",
  49908. // "location": "path",
  49909. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49910. // "required": true,
  49911. // "type": "string"
  49912. // },
  49913. // "requestId": {
  49914. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49915. // "location": "query",
  49916. // "type": "string"
  49917. // }
  49918. // },
  49919. // "path": "{project}/global/forwardingRules",
  49920. // "request": {
  49921. // "$ref": "ForwardingRule"
  49922. // },
  49923. // "response": {
  49924. // "$ref": "Operation"
  49925. // },
  49926. // "scopes": [
  49927. // "https://www.googleapis.com/auth/cloud-platform",
  49928. // "https://www.googleapis.com/auth/compute"
  49929. // ]
  49930. // }
  49931. }
  49932. // method id "compute.globalForwardingRules.list":
  49933. type GlobalForwardingRulesListCall struct {
  49934. s *Service
  49935. project string
  49936. urlParams_ gensupport.URLParams
  49937. ifNoneMatch_ string
  49938. ctx_ context.Context
  49939. header_ http.Header
  49940. }
  49941. // List: Retrieves a list of GlobalForwardingRule resources available to
  49942. // the specified project.
  49943. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  49944. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  49945. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49946. c.project = project
  49947. return c
  49948. }
  49949. // Filter sets the optional parameter "filter": A filter expression that
  49950. // filters resources listed in the response. The expression must specify
  49951. // the field name, a comparison operator, and the value that you want to
  49952. // use for filtering. The value must be a string, a number, or a
  49953. // boolean. The comparison operator must be either =, !=, >, or <.
  49954. //
  49955. // For example, if you are filtering Compute Engine instances, you can
  49956. // exclude instances named example-instance by specifying name !=
  49957. // example-instance.
  49958. //
  49959. // You can also filter nested fields. For example, you could specify
  49960. // scheduling.automaticRestart = false to include instances only if they
  49961. // are not scheduled for automatic restarts. You can use filtering on
  49962. // nested fields to filter based on resource labels.
  49963. //
  49964. // To filter on multiple expressions, provide each separate expression
  49965. // within parentheses. For example, (scheduling.automaticRestart = true)
  49966. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49967. // AND expression. However, you can include AND and OR expressions
  49968. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49969. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49970. // true).
  49971. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  49972. c.urlParams_.Set("filter", filter)
  49973. return c
  49974. }
  49975. // MaxResults sets the optional parameter "maxResults": The maximum
  49976. // number of results per page that should be returned. If the number of
  49977. // available results is larger than maxResults, Compute Engine returns a
  49978. // nextPageToken that can be used to get the next page of results in
  49979. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49980. // (Default: 500)
  49981. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  49982. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49983. return c
  49984. }
  49985. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49986. // a certain order. By default, results are returned in alphanumerical
  49987. // order based on the resource name.
  49988. //
  49989. // You can also sort results in descending order based on the creation
  49990. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49991. // based on the creationTimestamp field in reverse chronological order
  49992. // (newest result first). Use this to sort resources like operations so
  49993. // that the newest operation is returned first.
  49994. //
  49995. // Currently, only sorting by name or creationTimestamp desc is
  49996. // supported.
  49997. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  49998. c.urlParams_.Set("orderBy", orderBy)
  49999. return c
  50000. }
  50001. // PageToken sets the optional parameter "pageToken": Specifies a page
  50002. // token to use. Set pageToken to the nextPageToken returned by a
  50003. // previous list request to get the next page of results.
  50004. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  50005. c.urlParams_.Set("pageToken", pageToken)
  50006. return c
  50007. }
  50008. // Fields allows partial responses to be retrieved. See
  50009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50010. // for more information.
  50011. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  50012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50013. return c
  50014. }
  50015. // IfNoneMatch sets the optional parameter which makes the operation
  50016. // fail if the object's ETag matches the given value. This is useful for
  50017. // getting updates only after the object has changed since the last
  50018. // request. Use googleapi.IsNotModified to check whether the response
  50019. // error from Do is the result of In-None-Match.
  50020. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  50021. c.ifNoneMatch_ = entityTag
  50022. return c
  50023. }
  50024. // Context sets the context to be used in this call's Do method. Any
  50025. // pending HTTP request will be aborted if the provided context is
  50026. // canceled.
  50027. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  50028. c.ctx_ = ctx
  50029. return c
  50030. }
  50031. // Header returns an http.Header that can be modified by the caller to
  50032. // add HTTP headers to the request.
  50033. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  50034. if c.header_ == nil {
  50035. c.header_ = make(http.Header)
  50036. }
  50037. return c.header_
  50038. }
  50039. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  50040. reqHeaders := make(http.Header)
  50041. for k, v := range c.header_ {
  50042. reqHeaders[k] = v
  50043. }
  50044. reqHeaders.Set("User-Agent", c.s.userAgent())
  50045. if c.ifNoneMatch_ != "" {
  50046. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50047. }
  50048. var body io.Reader = nil
  50049. c.urlParams_.Set("alt", alt)
  50050. c.urlParams_.Set("prettyPrint", "false")
  50051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  50052. urls += "?" + c.urlParams_.Encode()
  50053. req, err := http.NewRequest("GET", urls, body)
  50054. if err != nil {
  50055. return nil, err
  50056. }
  50057. req.Header = reqHeaders
  50058. googleapi.Expand(req.URL, map[string]string{
  50059. "project": c.project,
  50060. })
  50061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50062. }
  50063. // Do executes the "compute.globalForwardingRules.list" call.
  50064. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  50065. // non-2xx status code is an error. Response headers are in either
  50066. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  50067. // returned at all) in error.(*googleapi.Error).Header. Use
  50068. // googleapi.IsNotModified to check whether the returned error was
  50069. // because http.StatusNotModified was returned.
  50070. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  50071. gensupport.SetOptions(c.urlParams_, opts...)
  50072. res, err := c.doRequest("json")
  50073. if res != nil && res.StatusCode == http.StatusNotModified {
  50074. if res.Body != nil {
  50075. res.Body.Close()
  50076. }
  50077. return nil, &googleapi.Error{
  50078. Code: res.StatusCode,
  50079. Header: res.Header,
  50080. }
  50081. }
  50082. if err != nil {
  50083. return nil, err
  50084. }
  50085. defer googleapi.CloseBody(res)
  50086. if err := googleapi.CheckResponse(res); err != nil {
  50087. return nil, err
  50088. }
  50089. ret := &ForwardingRuleList{
  50090. ServerResponse: googleapi.ServerResponse{
  50091. Header: res.Header,
  50092. HTTPStatusCode: res.StatusCode,
  50093. },
  50094. }
  50095. target := &ret
  50096. if err := gensupport.DecodeResponse(target, res); err != nil {
  50097. return nil, err
  50098. }
  50099. return ret, nil
  50100. // {
  50101. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  50102. // "httpMethod": "GET",
  50103. // "id": "compute.globalForwardingRules.list",
  50104. // "parameterOrder": [
  50105. // "project"
  50106. // ],
  50107. // "parameters": {
  50108. // "filter": {
  50109. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50110. // "location": "query",
  50111. // "type": "string"
  50112. // },
  50113. // "maxResults": {
  50114. // "default": "500",
  50115. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50116. // "format": "uint32",
  50117. // "location": "query",
  50118. // "minimum": "0",
  50119. // "type": "integer"
  50120. // },
  50121. // "orderBy": {
  50122. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50123. // "location": "query",
  50124. // "type": "string"
  50125. // },
  50126. // "pageToken": {
  50127. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50128. // "location": "query",
  50129. // "type": "string"
  50130. // },
  50131. // "project": {
  50132. // "description": "Project ID for this request.",
  50133. // "location": "path",
  50134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50135. // "required": true,
  50136. // "type": "string"
  50137. // }
  50138. // },
  50139. // "path": "{project}/global/forwardingRules",
  50140. // "response": {
  50141. // "$ref": "ForwardingRuleList"
  50142. // },
  50143. // "scopes": [
  50144. // "https://www.googleapis.com/auth/cloud-platform",
  50145. // "https://www.googleapis.com/auth/compute",
  50146. // "https://www.googleapis.com/auth/compute.readonly"
  50147. // ]
  50148. // }
  50149. }
  50150. // Pages invokes f for each page of results.
  50151. // A non-nil error returned from f will halt the iteration.
  50152. // The provided context supersedes any context provided to the Context method.
  50153. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  50154. c.ctx_ = ctx
  50155. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50156. for {
  50157. x, err := c.Do()
  50158. if err != nil {
  50159. return err
  50160. }
  50161. if err := f(x); err != nil {
  50162. return err
  50163. }
  50164. if x.NextPageToken == "" {
  50165. return nil
  50166. }
  50167. c.PageToken(x.NextPageToken)
  50168. }
  50169. }
  50170. // method id "compute.globalForwardingRules.patch":
  50171. type GlobalForwardingRulesPatchCall struct {
  50172. s *Service
  50173. project string
  50174. forwardingRule string
  50175. forwardingrule *ForwardingRule
  50176. urlParams_ gensupport.URLParams
  50177. ctx_ context.Context
  50178. header_ http.Header
  50179. }
  50180. // Patch: Updates the specified forwarding rule with the data included
  50181. // in the request. This method supports PATCH semantics and uses the
  50182. // JSON merge patch format and processing rules. Currently, you can only
  50183. // patch the network_tier field.
  50184. func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
  50185. c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50186. c.project = project
  50187. c.forwardingRule = forwardingRule
  50188. c.forwardingrule = forwardingrule
  50189. return c
  50190. }
  50191. // RequestId sets the optional parameter "requestId": An optional
  50192. // request ID to identify requests. Specify a unique request ID so that
  50193. // if you must retry your request, the server will know to ignore the
  50194. // request if it has already been completed.
  50195. //
  50196. // For example, consider a situation where you make an initial request
  50197. // and the request times out. If you make the request again with the
  50198. // same request ID, the server can check if original operation with the
  50199. // same request ID was received, and if so, will ignore the second
  50200. // request. This prevents clients from accidentally creating duplicate
  50201. // commitments.
  50202. //
  50203. // The request ID must be a valid UUID with the exception that zero UUID
  50204. // is not supported (00000000-0000-0000-0000-000000000000).
  50205. func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
  50206. c.urlParams_.Set("requestId", requestId)
  50207. return c
  50208. }
  50209. // Fields allows partial responses to be retrieved. See
  50210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50211. // for more information.
  50212. func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
  50213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50214. return c
  50215. }
  50216. // Context sets the context to be used in this call's Do method. Any
  50217. // pending HTTP request will be aborted if the provided context is
  50218. // canceled.
  50219. func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
  50220. c.ctx_ = ctx
  50221. return c
  50222. }
  50223. // Header returns an http.Header that can be modified by the caller to
  50224. // add HTTP headers to the request.
  50225. func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
  50226. if c.header_ == nil {
  50227. c.header_ = make(http.Header)
  50228. }
  50229. return c.header_
  50230. }
  50231. func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  50232. reqHeaders := make(http.Header)
  50233. for k, v := range c.header_ {
  50234. reqHeaders[k] = v
  50235. }
  50236. reqHeaders.Set("User-Agent", c.s.userAgent())
  50237. var body io.Reader = nil
  50238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  50239. if err != nil {
  50240. return nil, err
  50241. }
  50242. reqHeaders.Set("Content-Type", "application/json")
  50243. c.urlParams_.Set("alt", alt)
  50244. c.urlParams_.Set("prettyPrint", "false")
  50245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  50246. urls += "?" + c.urlParams_.Encode()
  50247. req, err := http.NewRequest("PATCH", urls, body)
  50248. if err != nil {
  50249. return nil, err
  50250. }
  50251. req.Header = reqHeaders
  50252. googleapi.Expand(req.URL, map[string]string{
  50253. "project": c.project,
  50254. "forwardingRule": c.forwardingRule,
  50255. })
  50256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50257. }
  50258. // Do executes the "compute.globalForwardingRules.patch" call.
  50259. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50260. // status code is an error. Response headers are in either
  50261. // *Operation.ServerResponse.Header or (if a response was returned at
  50262. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50263. // to check whether the returned error was because
  50264. // http.StatusNotModified was returned.
  50265. func (c *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50266. gensupport.SetOptions(c.urlParams_, opts...)
  50267. res, err := c.doRequest("json")
  50268. if res != nil && res.StatusCode == http.StatusNotModified {
  50269. if res.Body != nil {
  50270. res.Body.Close()
  50271. }
  50272. return nil, &googleapi.Error{
  50273. Code: res.StatusCode,
  50274. Header: res.Header,
  50275. }
  50276. }
  50277. if err != nil {
  50278. return nil, err
  50279. }
  50280. defer googleapi.CloseBody(res)
  50281. if err := googleapi.CheckResponse(res); err != nil {
  50282. return nil, err
  50283. }
  50284. ret := &Operation{
  50285. ServerResponse: googleapi.ServerResponse{
  50286. Header: res.Header,
  50287. HTTPStatusCode: res.StatusCode,
  50288. },
  50289. }
  50290. target := &ret
  50291. if err := gensupport.DecodeResponse(target, res); err != nil {
  50292. return nil, err
  50293. }
  50294. return ret, nil
  50295. // {
  50296. // "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
  50297. // "httpMethod": "PATCH",
  50298. // "id": "compute.globalForwardingRules.patch",
  50299. // "parameterOrder": [
  50300. // "project",
  50301. // "forwardingRule"
  50302. // ],
  50303. // "parameters": {
  50304. // "forwardingRule": {
  50305. // "description": "Name of the ForwardingRule resource to patch.",
  50306. // "location": "path",
  50307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50308. // "required": true,
  50309. // "type": "string"
  50310. // },
  50311. // "project": {
  50312. // "description": "Project ID for this request.",
  50313. // "location": "path",
  50314. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50315. // "required": true,
  50316. // "type": "string"
  50317. // },
  50318. // "requestId": {
  50319. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50320. // "location": "query",
  50321. // "type": "string"
  50322. // }
  50323. // },
  50324. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  50325. // "request": {
  50326. // "$ref": "ForwardingRule"
  50327. // },
  50328. // "response": {
  50329. // "$ref": "Operation"
  50330. // },
  50331. // "scopes": [
  50332. // "https://www.googleapis.com/auth/cloud-platform",
  50333. // "https://www.googleapis.com/auth/compute"
  50334. // ]
  50335. // }
  50336. }
  50337. // method id "compute.globalForwardingRules.setLabels":
  50338. type GlobalForwardingRulesSetLabelsCall struct {
  50339. s *Service
  50340. project string
  50341. resource string
  50342. globalsetlabelsrequest *GlobalSetLabelsRequest
  50343. urlParams_ gensupport.URLParams
  50344. ctx_ context.Context
  50345. header_ http.Header
  50346. }
  50347. // SetLabels: Sets the labels on the specified resource. To learn more
  50348. // about labels, read the Labeling Resources documentation.
  50349. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  50350. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50351. c.project = project
  50352. c.resource = resource
  50353. c.globalsetlabelsrequest = globalsetlabelsrequest
  50354. return c
  50355. }
  50356. // Fields allows partial responses to be retrieved. See
  50357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50358. // for more information.
  50359. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  50360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50361. return c
  50362. }
  50363. // Context sets the context to be used in this call's Do method. Any
  50364. // pending HTTP request will be aborted if the provided context is
  50365. // canceled.
  50366. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  50367. c.ctx_ = ctx
  50368. return c
  50369. }
  50370. // Header returns an http.Header that can be modified by the caller to
  50371. // add HTTP headers to the request.
  50372. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  50373. if c.header_ == nil {
  50374. c.header_ = make(http.Header)
  50375. }
  50376. return c.header_
  50377. }
  50378. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  50379. reqHeaders := make(http.Header)
  50380. for k, v := range c.header_ {
  50381. reqHeaders[k] = v
  50382. }
  50383. reqHeaders.Set("User-Agent", c.s.userAgent())
  50384. var body io.Reader = nil
  50385. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  50386. if err != nil {
  50387. return nil, err
  50388. }
  50389. reqHeaders.Set("Content-Type", "application/json")
  50390. c.urlParams_.Set("alt", alt)
  50391. c.urlParams_.Set("prettyPrint", "false")
  50392. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  50393. urls += "?" + c.urlParams_.Encode()
  50394. req, err := http.NewRequest("POST", urls, body)
  50395. if err != nil {
  50396. return nil, err
  50397. }
  50398. req.Header = reqHeaders
  50399. googleapi.Expand(req.URL, map[string]string{
  50400. "project": c.project,
  50401. "resource": c.resource,
  50402. })
  50403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50404. }
  50405. // Do executes the "compute.globalForwardingRules.setLabels" call.
  50406. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50407. // status code is an error. Response headers are in either
  50408. // *Operation.ServerResponse.Header or (if a response was returned at
  50409. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50410. // to check whether the returned error was because
  50411. // http.StatusNotModified was returned.
  50412. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50413. gensupport.SetOptions(c.urlParams_, opts...)
  50414. res, err := c.doRequest("json")
  50415. if res != nil && res.StatusCode == http.StatusNotModified {
  50416. if res.Body != nil {
  50417. res.Body.Close()
  50418. }
  50419. return nil, &googleapi.Error{
  50420. Code: res.StatusCode,
  50421. Header: res.Header,
  50422. }
  50423. }
  50424. if err != nil {
  50425. return nil, err
  50426. }
  50427. defer googleapi.CloseBody(res)
  50428. if err := googleapi.CheckResponse(res); err != nil {
  50429. return nil, err
  50430. }
  50431. ret := &Operation{
  50432. ServerResponse: googleapi.ServerResponse{
  50433. Header: res.Header,
  50434. HTTPStatusCode: res.StatusCode,
  50435. },
  50436. }
  50437. target := &ret
  50438. if err := gensupport.DecodeResponse(target, res); err != nil {
  50439. return nil, err
  50440. }
  50441. return ret, nil
  50442. // {
  50443. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  50444. // "httpMethod": "POST",
  50445. // "id": "compute.globalForwardingRules.setLabels",
  50446. // "parameterOrder": [
  50447. // "project",
  50448. // "resource"
  50449. // ],
  50450. // "parameters": {
  50451. // "project": {
  50452. // "description": "Project ID for this request.",
  50453. // "location": "path",
  50454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50455. // "required": true,
  50456. // "type": "string"
  50457. // },
  50458. // "resource": {
  50459. // "description": "Name or id of the resource for this request.",
  50460. // "location": "path",
  50461. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50462. // "required": true,
  50463. // "type": "string"
  50464. // }
  50465. // },
  50466. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  50467. // "request": {
  50468. // "$ref": "GlobalSetLabelsRequest"
  50469. // },
  50470. // "response": {
  50471. // "$ref": "Operation"
  50472. // },
  50473. // "scopes": [
  50474. // "https://www.googleapis.com/auth/cloud-platform",
  50475. // "https://www.googleapis.com/auth/compute"
  50476. // ]
  50477. // }
  50478. }
  50479. // method id "compute.globalForwardingRules.setTarget":
  50480. type GlobalForwardingRulesSetTargetCall struct {
  50481. s *Service
  50482. project string
  50483. forwardingRule string
  50484. targetreference *TargetReference
  50485. urlParams_ gensupport.URLParams
  50486. ctx_ context.Context
  50487. header_ http.Header
  50488. }
  50489. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  50490. // The new target should be of the same type as the old target.
  50491. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  50492. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  50493. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50494. c.project = project
  50495. c.forwardingRule = forwardingRule
  50496. c.targetreference = targetreference
  50497. return c
  50498. }
  50499. // RequestId sets the optional parameter "requestId": An optional
  50500. // request ID to identify requests. Specify a unique request ID so that
  50501. // if you must retry your request, the server will know to ignore the
  50502. // request if it has already been completed.
  50503. //
  50504. // For example, consider a situation where you make an initial request
  50505. // and the request times out. If you make the request again with the
  50506. // same request ID, the server can check if original operation with the
  50507. // same request ID was received, and if so, will ignore the second
  50508. // request. This prevents clients from accidentally creating duplicate
  50509. // commitments.
  50510. //
  50511. // The request ID must be a valid UUID with the exception that zero UUID
  50512. // is not supported (00000000-0000-0000-0000-000000000000).
  50513. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  50514. c.urlParams_.Set("requestId", requestId)
  50515. return c
  50516. }
  50517. // Fields allows partial responses to be retrieved. See
  50518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50519. // for more information.
  50520. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  50521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50522. return c
  50523. }
  50524. // Context sets the context to be used in this call's Do method. Any
  50525. // pending HTTP request will be aborted if the provided context is
  50526. // canceled.
  50527. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  50528. c.ctx_ = ctx
  50529. return c
  50530. }
  50531. // Header returns an http.Header that can be modified by the caller to
  50532. // add HTTP headers to the request.
  50533. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  50534. if c.header_ == nil {
  50535. c.header_ = make(http.Header)
  50536. }
  50537. return c.header_
  50538. }
  50539. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  50540. reqHeaders := make(http.Header)
  50541. for k, v := range c.header_ {
  50542. reqHeaders[k] = v
  50543. }
  50544. reqHeaders.Set("User-Agent", c.s.userAgent())
  50545. var body io.Reader = nil
  50546. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  50547. if err != nil {
  50548. return nil, err
  50549. }
  50550. reqHeaders.Set("Content-Type", "application/json")
  50551. c.urlParams_.Set("alt", alt)
  50552. c.urlParams_.Set("prettyPrint", "false")
  50553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  50554. urls += "?" + c.urlParams_.Encode()
  50555. req, err := http.NewRequest("POST", urls, body)
  50556. if err != nil {
  50557. return nil, err
  50558. }
  50559. req.Header = reqHeaders
  50560. googleapi.Expand(req.URL, map[string]string{
  50561. "project": c.project,
  50562. "forwardingRule": c.forwardingRule,
  50563. })
  50564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50565. }
  50566. // Do executes the "compute.globalForwardingRules.setTarget" call.
  50567. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50568. // status code is an error. Response headers are in either
  50569. // *Operation.ServerResponse.Header or (if a response was returned at
  50570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50571. // to check whether the returned error was because
  50572. // http.StatusNotModified was returned.
  50573. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50574. gensupport.SetOptions(c.urlParams_, opts...)
  50575. res, err := c.doRequest("json")
  50576. if res != nil && res.StatusCode == http.StatusNotModified {
  50577. if res.Body != nil {
  50578. res.Body.Close()
  50579. }
  50580. return nil, &googleapi.Error{
  50581. Code: res.StatusCode,
  50582. Header: res.Header,
  50583. }
  50584. }
  50585. if err != nil {
  50586. return nil, err
  50587. }
  50588. defer googleapi.CloseBody(res)
  50589. if err := googleapi.CheckResponse(res); err != nil {
  50590. return nil, err
  50591. }
  50592. ret := &Operation{
  50593. ServerResponse: googleapi.ServerResponse{
  50594. Header: res.Header,
  50595. HTTPStatusCode: res.StatusCode,
  50596. },
  50597. }
  50598. target := &ret
  50599. if err := gensupport.DecodeResponse(target, res); err != nil {
  50600. return nil, err
  50601. }
  50602. return ret, nil
  50603. // {
  50604. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  50605. // "httpMethod": "POST",
  50606. // "id": "compute.globalForwardingRules.setTarget",
  50607. // "parameterOrder": [
  50608. // "project",
  50609. // "forwardingRule"
  50610. // ],
  50611. // "parameters": {
  50612. // "forwardingRule": {
  50613. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  50614. // "location": "path",
  50615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50616. // "required": true,
  50617. // "type": "string"
  50618. // },
  50619. // "project": {
  50620. // "description": "Project ID for this request.",
  50621. // "location": "path",
  50622. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50623. // "required": true,
  50624. // "type": "string"
  50625. // },
  50626. // "requestId": {
  50627. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50628. // "location": "query",
  50629. // "type": "string"
  50630. // }
  50631. // },
  50632. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  50633. // "request": {
  50634. // "$ref": "TargetReference"
  50635. // },
  50636. // "response": {
  50637. // "$ref": "Operation"
  50638. // },
  50639. // "scopes": [
  50640. // "https://www.googleapis.com/auth/cloud-platform",
  50641. // "https://www.googleapis.com/auth/compute"
  50642. // ]
  50643. // }
  50644. }
  50645. // method id "compute.globalForwardingRules.testIamPermissions":
  50646. type GlobalForwardingRulesTestIamPermissionsCall struct {
  50647. s *Service
  50648. project string
  50649. resource string
  50650. testpermissionsrequest *TestPermissionsRequest
  50651. urlParams_ gensupport.URLParams
  50652. ctx_ context.Context
  50653. header_ http.Header
  50654. }
  50655. // TestIamPermissions: Returns permissions that a caller has on the
  50656. // specified resource.
  50657. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  50658. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50659. c.project = project
  50660. c.resource = resource
  50661. c.testpermissionsrequest = testpermissionsrequest
  50662. return c
  50663. }
  50664. // Fields allows partial responses to be retrieved. See
  50665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50666. // for more information.
  50667. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  50668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50669. return c
  50670. }
  50671. // Context sets the context to be used in this call's Do method. Any
  50672. // pending HTTP request will be aborted if the provided context is
  50673. // canceled.
  50674. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  50675. c.ctx_ = ctx
  50676. return c
  50677. }
  50678. // Header returns an http.Header that can be modified by the caller to
  50679. // add HTTP headers to the request.
  50680. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  50681. if c.header_ == nil {
  50682. c.header_ = make(http.Header)
  50683. }
  50684. return c.header_
  50685. }
  50686. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50687. reqHeaders := make(http.Header)
  50688. for k, v := range c.header_ {
  50689. reqHeaders[k] = v
  50690. }
  50691. reqHeaders.Set("User-Agent", c.s.userAgent())
  50692. var body io.Reader = nil
  50693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50694. if err != nil {
  50695. return nil, err
  50696. }
  50697. reqHeaders.Set("Content-Type", "application/json")
  50698. c.urlParams_.Set("alt", alt)
  50699. c.urlParams_.Set("prettyPrint", "false")
  50700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  50701. urls += "?" + c.urlParams_.Encode()
  50702. req, err := http.NewRequest("POST", urls, body)
  50703. if err != nil {
  50704. return nil, err
  50705. }
  50706. req.Header = reqHeaders
  50707. googleapi.Expand(req.URL, map[string]string{
  50708. "project": c.project,
  50709. "resource": c.resource,
  50710. })
  50711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50712. }
  50713. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  50714. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50715. // non-2xx status code is an error. Response headers are in either
  50716. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50717. // returned at all) in error.(*googleapi.Error).Header. Use
  50718. // googleapi.IsNotModified to check whether the returned error was
  50719. // because http.StatusNotModified was returned.
  50720. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50721. gensupport.SetOptions(c.urlParams_, opts...)
  50722. res, err := c.doRequest("json")
  50723. if res != nil && res.StatusCode == http.StatusNotModified {
  50724. if res.Body != nil {
  50725. res.Body.Close()
  50726. }
  50727. return nil, &googleapi.Error{
  50728. Code: res.StatusCode,
  50729. Header: res.Header,
  50730. }
  50731. }
  50732. if err != nil {
  50733. return nil, err
  50734. }
  50735. defer googleapi.CloseBody(res)
  50736. if err := googleapi.CheckResponse(res); err != nil {
  50737. return nil, err
  50738. }
  50739. ret := &TestPermissionsResponse{
  50740. ServerResponse: googleapi.ServerResponse{
  50741. Header: res.Header,
  50742. HTTPStatusCode: res.StatusCode,
  50743. },
  50744. }
  50745. target := &ret
  50746. if err := gensupport.DecodeResponse(target, res); err != nil {
  50747. return nil, err
  50748. }
  50749. return ret, nil
  50750. // {
  50751. // "description": "Returns permissions that a caller has on the specified resource.",
  50752. // "httpMethod": "POST",
  50753. // "id": "compute.globalForwardingRules.testIamPermissions",
  50754. // "parameterOrder": [
  50755. // "project",
  50756. // "resource"
  50757. // ],
  50758. // "parameters": {
  50759. // "project": {
  50760. // "description": "Project ID for this request.",
  50761. // "location": "path",
  50762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50763. // "required": true,
  50764. // "type": "string"
  50765. // },
  50766. // "resource": {
  50767. // "description": "Name or id of the resource for this request.",
  50768. // "location": "path",
  50769. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50770. // "required": true,
  50771. // "type": "string"
  50772. // }
  50773. // },
  50774. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  50775. // "request": {
  50776. // "$ref": "TestPermissionsRequest"
  50777. // },
  50778. // "response": {
  50779. // "$ref": "TestPermissionsResponse"
  50780. // },
  50781. // "scopes": [
  50782. // "https://www.googleapis.com/auth/cloud-platform",
  50783. // "https://www.googleapis.com/auth/compute",
  50784. // "https://www.googleapis.com/auth/compute.readonly"
  50785. // ]
  50786. // }
  50787. }
  50788. // method id "compute.globalOperations.aggregatedList":
  50789. type GlobalOperationsAggregatedListCall struct {
  50790. s *Service
  50791. project string
  50792. urlParams_ gensupport.URLParams
  50793. ifNoneMatch_ string
  50794. ctx_ context.Context
  50795. header_ http.Header
  50796. }
  50797. // AggregatedList: Retrieves an aggregated list of all operations.
  50798. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  50799. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  50800. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50801. c.project = project
  50802. return c
  50803. }
  50804. // Filter sets the optional parameter "filter": A filter expression that
  50805. // filters resources listed in the response. The expression must specify
  50806. // the field name, a comparison operator, and the value that you want to
  50807. // use for filtering. The value must be a string, a number, or a
  50808. // boolean. The comparison operator must be either =, !=, >, or <.
  50809. //
  50810. // For example, if you are filtering Compute Engine instances, you can
  50811. // exclude instances named example-instance by specifying name !=
  50812. // example-instance.
  50813. //
  50814. // You can also filter nested fields. For example, you could specify
  50815. // scheduling.automaticRestart = false to include instances only if they
  50816. // are not scheduled for automatic restarts. You can use filtering on
  50817. // nested fields to filter based on resource labels.
  50818. //
  50819. // To filter on multiple expressions, provide each separate expression
  50820. // within parentheses. For example, (scheduling.automaticRestart = true)
  50821. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50822. // AND expression. However, you can include AND and OR expressions
  50823. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50824. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50825. // true).
  50826. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  50827. c.urlParams_.Set("filter", filter)
  50828. return c
  50829. }
  50830. // MaxResults sets the optional parameter "maxResults": The maximum
  50831. // number of results per page that should be returned. If the number of
  50832. // available results is larger than maxResults, Compute Engine returns a
  50833. // nextPageToken that can be used to get the next page of results in
  50834. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50835. // (Default: 500)
  50836. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  50837. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50838. return c
  50839. }
  50840. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50841. // a certain order. By default, results are returned in alphanumerical
  50842. // order based on the resource name.
  50843. //
  50844. // You can also sort results in descending order based on the creation
  50845. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50846. // based on the creationTimestamp field in reverse chronological order
  50847. // (newest result first). Use this to sort resources like operations so
  50848. // that the newest operation is returned first.
  50849. //
  50850. // Currently, only sorting by name or creationTimestamp desc is
  50851. // supported.
  50852. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  50853. c.urlParams_.Set("orderBy", orderBy)
  50854. return c
  50855. }
  50856. // PageToken sets the optional parameter "pageToken": Specifies a page
  50857. // token to use. Set pageToken to the nextPageToken returned by a
  50858. // previous list request to get the next page of results.
  50859. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  50860. c.urlParams_.Set("pageToken", pageToken)
  50861. return c
  50862. }
  50863. // Fields allows partial responses to be retrieved. See
  50864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50865. // for more information.
  50866. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  50867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50868. return c
  50869. }
  50870. // IfNoneMatch sets the optional parameter which makes the operation
  50871. // fail if the object's ETag matches the given value. This is useful for
  50872. // getting updates only after the object has changed since the last
  50873. // request. Use googleapi.IsNotModified to check whether the response
  50874. // error from Do is the result of In-None-Match.
  50875. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  50876. c.ifNoneMatch_ = entityTag
  50877. return c
  50878. }
  50879. // Context sets the context to be used in this call's Do method. Any
  50880. // pending HTTP request will be aborted if the provided context is
  50881. // canceled.
  50882. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  50883. c.ctx_ = ctx
  50884. return c
  50885. }
  50886. // Header returns an http.Header that can be modified by the caller to
  50887. // add HTTP headers to the request.
  50888. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  50889. if c.header_ == nil {
  50890. c.header_ = make(http.Header)
  50891. }
  50892. return c.header_
  50893. }
  50894. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  50895. reqHeaders := make(http.Header)
  50896. for k, v := range c.header_ {
  50897. reqHeaders[k] = v
  50898. }
  50899. reqHeaders.Set("User-Agent", c.s.userAgent())
  50900. if c.ifNoneMatch_ != "" {
  50901. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50902. }
  50903. var body io.Reader = nil
  50904. c.urlParams_.Set("alt", alt)
  50905. c.urlParams_.Set("prettyPrint", "false")
  50906. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  50907. urls += "?" + c.urlParams_.Encode()
  50908. req, err := http.NewRequest("GET", urls, body)
  50909. if err != nil {
  50910. return nil, err
  50911. }
  50912. req.Header = reqHeaders
  50913. googleapi.Expand(req.URL, map[string]string{
  50914. "project": c.project,
  50915. })
  50916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50917. }
  50918. // Do executes the "compute.globalOperations.aggregatedList" call.
  50919. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  50920. // non-2xx status code is an error. Response headers are in either
  50921. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  50922. // returned at all) in error.(*googleapi.Error).Header. Use
  50923. // googleapi.IsNotModified to check whether the returned error was
  50924. // because http.StatusNotModified was returned.
  50925. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  50926. gensupport.SetOptions(c.urlParams_, opts...)
  50927. res, err := c.doRequest("json")
  50928. if res != nil && res.StatusCode == http.StatusNotModified {
  50929. if res.Body != nil {
  50930. res.Body.Close()
  50931. }
  50932. return nil, &googleapi.Error{
  50933. Code: res.StatusCode,
  50934. Header: res.Header,
  50935. }
  50936. }
  50937. if err != nil {
  50938. return nil, err
  50939. }
  50940. defer googleapi.CloseBody(res)
  50941. if err := googleapi.CheckResponse(res); err != nil {
  50942. return nil, err
  50943. }
  50944. ret := &OperationAggregatedList{
  50945. ServerResponse: googleapi.ServerResponse{
  50946. Header: res.Header,
  50947. HTTPStatusCode: res.StatusCode,
  50948. },
  50949. }
  50950. target := &ret
  50951. if err := gensupport.DecodeResponse(target, res); err != nil {
  50952. return nil, err
  50953. }
  50954. return ret, nil
  50955. // {
  50956. // "description": "Retrieves an aggregated list of all operations.",
  50957. // "httpMethod": "GET",
  50958. // "id": "compute.globalOperations.aggregatedList",
  50959. // "parameterOrder": [
  50960. // "project"
  50961. // ],
  50962. // "parameters": {
  50963. // "filter": {
  50964. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50965. // "location": "query",
  50966. // "type": "string"
  50967. // },
  50968. // "maxResults": {
  50969. // "default": "500",
  50970. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50971. // "format": "uint32",
  50972. // "location": "query",
  50973. // "minimum": "0",
  50974. // "type": "integer"
  50975. // },
  50976. // "orderBy": {
  50977. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50978. // "location": "query",
  50979. // "type": "string"
  50980. // },
  50981. // "pageToken": {
  50982. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50983. // "location": "query",
  50984. // "type": "string"
  50985. // },
  50986. // "project": {
  50987. // "description": "Project ID for this request.",
  50988. // "location": "path",
  50989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50990. // "required": true,
  50991. // "type": "string"
  50992. // }
  50993. // },
  50994. // "path": "{project}/aggregated/operations",
  50995. // "response": {
  50996. // "$ref": "OperationAggregatedList"
  50997. // },
  50998. // "scopes": [
  50999. // "https://www.googleapis.com/auth/cloud-platform",
  51000. // "https://www.googleapis.com/auth/compute",
  51001. // "https://www.googleapis.com/auth/compute.readonly"
  51002. // ]
  51003. // }
  51004. }
  51005. // Pages invokes f for each page of results.
  51006. // A non-nil error returned from f will halt the iteration.
  51007. // The provided context supersedes any context provided to the Context method.
  51008. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  51009. c.ctx_ = ctx
  51010. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51011. for {
  51012. x, err := c.Do()
  51013. if err != nil {
  51014. return err
  51015. }
  51016. if err := f(x); err != nil {
  51017. return err
  51018. }
  51019. if x.NextPageToken == "" {
  51020. return nil
  51021. }
  51022. c.PageToken(x.NextPageToken)
  51023. }
  51024. }
  51025. // method id "compute.globalOperations.delete":
  51026. type GlobalOperationsDeleteCall struct {
  51027. s *Service
  51028. project string
  51029. operation string
  51030. urlParams_ gensupport.URLParams
  51031. ctx_ context.Context
  51032. header_ http.Header
  51033. }
  51034. // Delete: Deletes the specified Operations resource.
  51035. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  51036. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  51037. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51038. c.project = project
  51039. c.operation = operation
  51040. return c
  51041. }
  51042. // Fields allows partial responses to be retrieved. See
  51043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51044. // for more information.
  51045. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  51046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51047. return c
  51048. }
  51049. // Context sets the context to be used in this call's Do method. Any
  51050. // pending HTTP request will be aborted if the provided context is
  51051. // canceled.
  51052. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  51053. c.ctx_ = ctx
  51054. return c
  51055. }
  51056. // Header returns an http.Header that can be modified by the caller to
  51057. // add HTTP headers to the request.
  51058. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  51059. if c.header_ == nil {
  51060. c.header_ = make(http.Header)
  51061. }
  51062. return c.header_
  51063. }
  51064. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  51065. reqHeaders := make(http.Header)
  51066. for k, v := range c.header_ {
  51067. reqHeaders[k] = v
  51068. }
  51069. reqHeaders.Set("User-Agent", c.s.userAgent())
  51070. var body io.Reader = nil
  51071. c.urlParams_.Set("alt", alt)
  51072. c.urlParams_.Set("prettyPrint", "false")
  51073. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  51074. urls += "?" + c.urlParams_.Encode()
  51075. req, err := http.NewRequest("DELETE", urls, body)
  51076. if err != nil {
  51077. return nil, err
  51078. }
  51079. req.Header = reqHeaders
  51080. googleapi.Expand(req.URL, map[string]string{
  51081. "project": c.project,
  51082. "operation": c.operation,
  51083. })
  51084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51085. }
  51086. // Do executes the "compute.globalOperations.delete" call.
  51087. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  51088. gensupport.SetOptions(c.urlParams_, opts...)
  51089. res, err := c.doRequest("json")
  51090. if err != nil {
  51091. return err
  51092. }
  51093. defer googleapi.CloseBody(res)
  51094. if err := googleapi.CheckResponse(res); err != nil {
  51095. return err
  51096. }
  51097. return nil
  51098. // {
  51099. // "description": "Deletes the specified Operations resource.",
  51100. // "httpMethod": "DELETE",
  51101. // "id": "compute.globalOperations.delete",
  51102. // "parameterOrder": [
  51103. // "project",
  51104. // "operation"
  51105. // ],
  51106. // "parameters": {
  51107. // "operation": {
  51108. // "description": "Name of the Operations resource to delete.",
  51109. // "location": "path",
  51110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51111. // "required": true,
  51112. // "type": "string"
  51113. // },
  51114. // "project": {
  51115. // "description": "Project ID for this request.",
  51116. // "location": "path",
  51117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51118. // "required": true,
  51119. // "type": "string"
  51120. // }
  51121. // },
  51122. // "path": "{project}/global/operations/{operation}",
  51123. // "scopes": [
  51124. // "https://www.googleapis.com/auth/cloud-platform",
  51125. // "https://www.googleapis.com/auth/compute"
  51126. // ]
  51127. // }
  51128. }
  51129. // method id "compute.globalOperations.get":
  51130. type GlobalOperationsGetCall struct {
  51131. s *Service
  51132. project string
  51133. operation string
  51134. urlParams_ gensupport.URLParams
  51135. ifNoneMatch_ string
  51136. ctx_ context.Context
  51137. header_ http.Header
  51138. }
  51139. // Get: Retrieves the specified Operations resource. Gets a list of
  51140. // operations by making a list() request.
  51141. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  51142. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  51143. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51144. c.project = project
  51145. c.operation = operation
  51146. return c
  51147. }
  51148. // Fields allows partial responses to be retrieved. See
  51149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51150. // for more information.
  51151. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  51152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51153. return c
  51154. }
  51155. // IfNoneMatch sets the optional parameter which makes the operation
  51156. // fail if the object's ETag matches the given value. This is useful for
  51157. // getting updates only after the object has changed since the last
  51158. // request. Use googleapi.IsNotModified to check whether the response
  51159. // error from Do is the result of In-None-Match.
  51160. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  51161. c.ifNoneMatch_ = entityTag
  51162. return c
  51163. }
  51164. // Context sets the context to be used in this call's Do method. Any
  51165. // pending HTTP request will be aborted if the provided context is
  51166. // canceled.
  51167. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  51168. c.ctx_ = ctx
  51169. return c
  51170. }
  51171. // Header returns an http.Header that can be modified by the caller to
  51172. // add HTTP headers to the request.
  51173. func (c *GlobalOperationsGetCall) Header() http.Header {
  51174. if c.header_ == nil {
  51175. c.header_ = make(http.Header)
  51176. }
  51177. return c.header_
  51178. }
  51179. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  51180. reqHeaders := make(http.Header)
  51181. for k, v := range c.header_ {
  51182. reqHeaders[k] = v
  51183. }
  51184. reqHeaders.Set("User-Agent", c.s.userAgent())
  51185. if c.ifNoneMatch_ != "" {
  51186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51187. }
  51188. var body io.Reader = nil
  51189. c.urlParams_.Set("alt", alt)
  51190. c.urlParams_.Set("prettyPrint", "false")
  51191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  51192. urls += "?" + c.urlParams_.Encode()
  51193. req, err := http.NewRequest("GET", urls, body)
  51194. if err != nil {
  51195. return nil, err
  51196. }
  51197. req.Header = reqHeaders
  51198. googleapi.Expand(req.URL, map[string]string{
  51199. "project": c.project,
  51200. "operation": c.operation,
  51201. })
  51202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51203. }
  51204. // Do executes the "compute.globalOperations.get" call.
  51205. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51206. // status code is an error. Response headers are in either
  51207. // *Operation.ServerResponse.Header or (if a response was returned at
  51208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51209. // to check whether the returned error was because
  51210. // http.StatusNotModified was returned.
  51211. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51212. gensupport.SetOptions(c.urlParams_, opts...)
  51213. res, err := c.doRequest("json")
  51214. if res != nil && res.StatusCode == http.StatusNotModified {
  51215. if res.Body != nil {
  51216. res.Body.Close()
  51217. }
  51218. return nil, &googleapi.Error{
  51219. Code: res.StatusCode,
  51220. Header: res.Header,
  51221. }
  51222. }
  51223. if err != nil {
  51224. return nil, err
  51225. }
  51226. defer googleapi.CloseBody(res)
  51227. if err := googleapi.CheckResponse(res); err != nil {
  51228. return nil, err
  51229. }
  51230. ret := &Operation{
  51231. ServerResponse: googleapi.ServerResponse{
  51232. Header: res.Header,
  51233. HTTPStatusCode: res.StatusCode,
  51234. },
  51235. }
  51236. target := &ret
  51237. if err := gensupport.DecodeResponse(target, res); err != nil {
  51238. return nil, err
  51239. }
  51240. return ret, nil
  51241. // {
  51242. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  51243. // "httpMethod": "GET",
  51244. // "id": "compute.globalOperations.get",
  51245. // "parameterOrder": [
  51246. // "project",
  51247. // "operation"
  51248. // ],
  51249. // "parameters": {
  51250. // "operation": {
  51251. // "description": "Name of the Operations resource to return.",
  51252. // "location": "path",
  51253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51254. // "required": true,
  51255. // "type": "string"
  51256. // },
  51257. // "project": {
  51258. // "description": "Project ID for this request.",
  51259. // "location": "path",
  51260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51261. // "required": true,
  51262. // "type": "string"
  51263. // }
  51264. // },
  51265. // "path": "{project}/global/operations/{operation}",
  51266. // "response": {
  51267. // "$ref": "Operation"
  51268. // },
  51269. // "scopes": [
  51270. // "https://www.googleapis.com/auth/cloud-platform",
  51271. // "https://www.googleapis.com/auth/compute",
  51272. // "https://www.googleapis.com/auth/compute.readonly"
  51273. // ]
  51274. // }
  51275. }
  51276. // method id "compute.globalOperations.list":
  51277. type GlobalOperationsListCall struct {
  51278. s *Service
  51279. project string
  51280. urlParams_ gensupport.URLParams
  51281. ifNoneMatch_ string
  51282. ctx_ context.Context
  51283. header_ http.Header
  51284. }
  51285. // List: Retrieves a list of Operation resources contained within the
  51286. // specified project.
  51287. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  51288. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  51289. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51290. c.project = project
  51291. return c
  51292. }
  51293. // Filter sets the optional parameter "filter": A filter expression that
  51294. // filters resources listed in the response. The expression must specify
  51295. // the field name, a comparison operator, and the value that you want to
  51296. // use for filtering. The value must be a string, a number, or a
  51297. // boolean. The comparison operator must be either =, !=, >, or <.
  51298. //
  51299. // For example, if you are filtering Compute Engine instances, you can
  51300. // exclude instances named example-instance by specifying name !=
  51301. // example-instance.
  51302. //
  51303. // You can also filter nested fields. For example, you could specify
  51304. // scheduling.automaticRestart = false to include instances only if they
  51305. // are not scheduled for automatic restarts. You can use filtering on
  51306. // nested fields to filter based on resource labels.
  51307. //
  51308. // To filter on multiple expressions, provide each separate expression
  51309. // within parentheses. For example, (scheduling.automaticRestart = true)
  51310. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51311. // AND expression. However, you can include AND and OR expressions
  51312. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51313. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51314. // true).
  51315. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  51316. c.urlParams_.Set("filter", filter)
  51317. return c
  51318. }
  51319. // MaxResults sets the optional parameter "maxResults": The maximum
  51320. // number of results per page that should be returned. If the number of
  51321. // available results is larger than maxResults, Compute Engine returns a
  51322. // nextPageToken that can be used to get the next page of results in
  51323. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51324. // (Default: 500)
  51325. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  51326. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51327. return c
  51328. }
  51329. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51330. // a certain order. By default, results are returned in alphanumerical
  51331. // order based on the resource name.
  51332. //
  51333. // You can also sort results in descending order based on the creation
  51334. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51335. // based on the creationTimestamp field in reverse chronological order
  51336. // (newest result first). Use this to sort resources like operations so
  51337. // that the newest operation is returned first.
  51338. //
  51339. // Currently, only sorting by name or creationTimestamp desc is
  51340. // supported.
  51341. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  51342. c.urlParams_.Set("orderBy", orderBy)
  51343. return c
  51344. }
  51345. // PageToken sets the optional parameter "pageToken": Specifies a page
  51346. // token to use. Set pageToken to the nextPageToken returned by a
  51347. // previous list request to get the next page of results.
  51348. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  51349. c.urlParams_.Set("pageToken", pageToken)
  51350. return c
  51351. }
  51352. // Fields allows partial responses to be retrieved. See
  51353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51354. // for more information.
  51355. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  51356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51357. return c
  51358. }
  51359. // IfNoneMatch sets the optional parameter which makes the operation
  51360. // fail if the object's ETag matches the given value. This is useful for
  51361. // getting updates only after the object has changed since the last
  51362. // request. Use googleapi.IsNotModified to check whether the response
  51363. // error from Do is the result of In-None-Match.
  51364. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  51365. c.ifNoneMatch_ = entityTag
  51366. return c
  51367. }
  51368. // Context sets the context to be used in this call's Do method. Any
  51369. // pending HTTP request will be aborted if the provided context is
  51370. // canceled.
  51371. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  51372. c.ctx_ = ctx
  51373. return c
  51374. }
  51375. // Header returns an http.Header that can be modified by the caller to
  51376. // add HTTP headers to the request.
  51377. func (c *GlobalOperationsListCall) Header() http.Header {
  51378. if c.header_ == nil {
  51379. c.header_ = make(http.Header)
  51380. }
  51381. return c.header_
  51382. }
  51383. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  51384. reqHeaders := make(http.Header)
  51385. for k, v := range c.header_ {
  51386. reqHeaders[k] = v
  51387. }
  51388. reqHeaders.Set("User-Agent", c.s.userAgent())
  51389. if c.ifNoneMatch_ != "" {
  51390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51391. }
  51392. var body io.Reader = nil
  51393. c.urlParams_.Set("alt", alt)
  51394. c.urlParams_.Set("prettyPrint", "false")
  51395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  51396. urls += "?" + c.urlParams_.Encode()
  51397. req, err := http.NewRequest("GET", urls, body)
  51398. if err != nil {
  51399. return nil, err
  51400. }
  51401. req.Header = reqHeaders
  51402. googleapi.Expand(req.URL, map[string]string{
  51403. "project": c.project,
  51404. })
  51405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51406. }
  51407. // Do executes the "compute.globalOperations.list" call.
  51408. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  51409. // status code is an error. Response headers are in either
  51410. // *OperationList.ServerResponse.Header or (if a response was returned
  51411. // at all) in error.(*googleapi.Error).Header. Use
  51412. // googleapi.IsNotModified to check whether the returned error was
  51413. // because http.StatusNotModified was returned.
  51414. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  51415. gensupport.SetOptions(c.urlParams_, opts...)
  51416. res, err := c.doRequest("json")
  51417. if res != nil && res.StatusCode == http.StatusNotModified {
  51418. if res.Body != nil {
  51419. res.Body.Close()
  51420. }
  51421. return nil, &googleapi.Error{
  51422. Code: res.StatusCode,
  51423. Header: res.Header,
  51424. }
  51425. }
  51426. if err != nil {
  51427. return nil, err
  51428. }
  51429. defer googleapi.CloseBody(res)
  51430. if err := googleapi.CheckResponse(res); err != nil {
  51431. return nil, err
  51432. }
  51433. ret := &OperationList{
  51434. ServerResponse: googleapi.ServerResponse{
  51435. Header: res.Header,
  51436. HTTPStatusCode: res.StatusCode,
  51437. },
  51438. }
  51439. target := &ret
  51440. if err := gensupport.DecodeResponse(target, res); err != nil {
  51441. return nil, err
  51442. }
  51443. return ret, nil
  51444. // {
  51445. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  51446. // "httpMethod": "GET",
  51447. // "id": "compute.globalOperations.list",
  51448. // "parameterOrder": [
  51449. // "project"
  51450. // ],
  51451. // "parameters": {
  51452. // "filter": {
  51453. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51454. // "location": "query",
  51455. // "type": "string"
  51456. // },
  51457. // "maxResults": {
  51458. // "default": "500",
  51459. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51460. // "format": "uint32",
  51461. // "location": "query",
  51462. // "minimum": "0",
  51463. // "type": "integer"
  51464. // },
  51465. // "orderBy": {
  51466. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51467. // "location": "query",
  51468. // "type": "string"
  51469. // },
  51470. // "pageToken": {
  51471. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51472. // "location": "query",
  51473. // "type": "string"
  51474. // },
  51475. // "project": {
  51476. // "description": "Project ID for this request.",
  51477. // "location": "path",
  51478. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51479. // "required": true,
  51480. // "type": "string"
  51481. // }
  51482. // },
  51483. // "path": "{project}/global/operations",
  51484. // "response": {
  51485. // "$ref": "OperationList"
  51486. // },
  51487. // "scopes": [
  51488. // "https://www.googleapis.com/auth/cloud-platform",
  51489. // "https://www.googleapis.com/auth/compute",
  51490. // "https://www.googleapis.com/auth/compute.readonly"
  51491. // ]
  51492. // }
  51493. }
  51494. // Pages invokes f for each page of results.
  51495. // A non-nil error returned from f will halt the iteration.
  51496. // The provided context supersedes any context provided to the Context method.
  51497. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  51498. c.ctx_ = ctx
  51499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51500. for {
  51501. x, err := c.Do()
  51502. if err != nil {
  51503. return err
  51504. }
  51505. if err := f(x); err != nil {
  51506. return err
  51507. }
  51508. if x.NextPageToken == "" {
  51509. return nil
  51510. }
  51511. c.PageToken(x.NextPageToken)
  51512. }
  51513. }
  51514. // method id "compute.globalOperations.wait":
  51515. type GlobalOperationsWaitCall struct {
  51516. s *Service
  51517. project string
  51518. operation string
  51519. urlParams_ gensupport.URLParams
  51520. ctx_ context.Context
  51521. header_ http.Header
  51522. }
  51523. // Wait: Waits for the specified Operations resource until it is done or
  51524. // timeout, and retrieves the specified Operations resource. 1.
  51525. // Immediately returns when the operation is already done. 2. Waits for
  51526. // no more than the default deadline (2 minutes, subject to change) and
  51527. // then returns the current state of the operation, which may be DONE or
  51528. // still in progress. 3. Is best-effort: a. The server can wait less
  51529. // than the default deadline or zero seconds, in overload situations. b.
  51530. // There is no guarantee that the operation is actually done when
  51531. // returns. 4. User should be prepared to retry if the operation is not
  51532. // DONE.
  51533. func (r *GlobalOperationsService) Wait(project string, operation string) *GlobalOperationsWaitCall {
  51534. c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51535. c.project = project
  51536. c.operation = operation
  51537. return c
  51538. }
  51539. // Fields allows partial responses to be retrieved. See
  51540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51541. // for more information.
  51542. func (c *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
  51543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51544. return c
  51545. }
  51546. // Context sets the context to be used in this call's Do method. Any
  51547. // pending HTTP request will be aborted if the provided context is
  51548. // canceled.
  51549. func (c *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
  51550. c.ctx_ = ctx
  51551. return c
  51552. }
  51553. // Header returns an http.Header that can be modified by the caller to
  51554. // add HTTP headers to the request.
  51555. func (c *GlobalOperationsWaitCall) Header() http.Header {
  51556. if c.header_ == nil {
  51557. c.header_ = make(http.Header)
  51558. }
  51559. return c.header_
  51560. }
  51561. func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  51562. reqHeaders := make(http.Header)
  51563. for k, v := range c.header_ {
  51564. reqHeaders[k] = v
  51565. }
  51566. reqHeaders.Set("User-Agent", c.s.userAgent())
  51567. var body io.Reader = nil
  51568. c.urlParams_.Set("alt", alt)
  51569. c.urlParams_.Set("prettyPrint", "false")
  51570. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}/wait")
  51571. urls += "?" + c.urlParams_.Encode()
  51572. req, err := http.NewRequest("POST", urls, body)
  51573. if err != nil {
  51574. return nil, err
  51575. }
  51576. req.Header = reqHeaders
  51577. googleapi.Expand(req.URL, map[string]string{
  51578. "project": c.project,
  51579. "operation": c.operation,
  51580. })
  51581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51582. }
  51583. // Do executes the "compute.globalOperations.wait" call.
  51584. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51585. // status code is an error. Response headers are in either
  51586. // *Operation.ServerResponse.Header or (if a response was returned at
  51587. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51588. // to check whether the returned error was because
  51589. // http.StatusNotModified was returned.
  51590. func (c *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51591. gensupport.SetOptions(c.urlParams_, opts...)
  51592. res, err := c.doRequest("json")
  51593. if res != nil && res.StatusCode == http.StatusNotModified {
  51594. if res.Body != nil {
  51595. res.Body.Close()
  51596. }
  51597. return nil, &googleapi.Error{
  51598. Code: res.StatusCode,
  51599. Header: res.Header,
  51600. }
  51601. }
  51602. if err != nil {
  51603. return nil, err
  51604. }
  51605. defer googleapi.CloseBody(res)
  51606. if err := googleapi.CheckResponse(res); err != nil {
  51607. return nil, err
  51608. }
  51609. ret := &Operation{
  51610. ServerResponse: googleapi.ServerResponse{
  51611. Header: res.Header,
  51612. HTTPStatusCode: res.StatusCode,
  51613. },
  51614. }
  51615. target := &ret
  51616. if err := gensupport.DecodeResponse(target, res); err != nil {
  51617. return nil, err
  51618. }
  51619. return ret, nil
  51620. // {
  51621. // "description": "Waits for the specified Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  51622. // "httpMethod": "POST",
  51623. // "id": "compute.globalOperations.wait",
  51624. // "parameterOrder": [
  51625. // "project",
  51626. // "operation"
  51627. // ],
  51628. // "parameters": {
  51629. // "operation": {
  51630. // "description": "Name of the Operations resource to return.",
  51631. // "location": "path",
  51632. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51633. // "required": true,
  51634. // "type": "string"
  51635. // },
  51636. // "project": {
  51637. // "description": "Project ID for this request.",
  51638. // "location": "path",
  51639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51640. // "required": true,
  51641. // "type": "string"
  51642. // }
  51643. // },
  51644. // "path": "{project}/global/operations/{operation}/wait",
  51645. // "response": {
  51646. // "$ref": "Operation"
  51647. // },
  51648. // "scopes": [
  51649. // "https://www.googleapis.com/auth/cloud-platform",
  51650. // "https://www.googleapis.com/auth/compute",
  51651. // "https://www.googleapis.com/auth/compute.readonly"
  51652. // ]
  51653. // }
  51654. }
  51655. // method id "compute.globalOrganizationOperations.delete":
  51656. type GlobalOrganizationOperationsDeleteCall struct {
  51657. s *Service
  51658. operation string
  51659. urlParams_ gensupport.URLParams
  51660. ctx_ context.Context
  51661. header_ http.Header
  51662. }
  51663. // Delete: Deletes the specified Operations resource.
  51664. func (r *GlobalOrganizationOperationsService) Delete(operation string) *GlobalOrganizationOperationsDeleteCall {
  51665. c := &GlobalOrganizationOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51666. c.operation = operation
  51667. return c
  51668. }
  51669. // ParentId sets the optional parameter "parentId": Parent ID for this
  51670. // request.
  51671. func (c *GlobalOrganizationOperationsDeleteCall) ParentId(parentId string) *GlobalOrganizationOperationsDeleteCall {
  51672. c.urlParams_.Set("parentId", parentId)
  51673. return c
  51674. }
  51675. // Fields allows partial responses to be retrieved. See
  51676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51677. // for more information.
  51678. func (c *GlobalOrganizationOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsDeleteCall {
  51679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51680. return c
  51681. }
  51682. // Context sets the context to be used in this call's Do method. Any
  51683. // pending HTTP request will be aborted if the provided context is
  51684. // canceled.
  51685. func (c *GlobalOrganizationOperationsDeleteCall) Context(ctx context.Context) *GlobalOrganizationOperationsDeleteCall {
  51686. c.ctx_ = ctx
  51687. return c
  51688. }
  51689. // Header returns an http.Header that can be modified by the caller to
  51690. // add HTTP headers to the request.
  51691. func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header {
  51692. if c.header_ == nil {
  51693. c.header_ = make(http.Header)
  51694. }
  51695. return c.header_
  51696. }
  51697. func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  51698. reqHeaders := make(http.Header)
  51699. for k, v := range c.header_ {
  51700. reqHeaders[k] = v
  51701. }
  51702. reqHeaders.Set("User-Agent", c.s.userAgent())
  51703. var body io.Reader = nil
  51704. c.urlParams_.Set("alt", alt)
  51705. c.urlParams_.Set("prettyPrint", "false")
  51706. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  51707. urls += "?" + c.urlParams_.Encode()
  51708. req, err := http.NewRequest("DELETE", urls, body)
  51709. if err != nil {
  51710. return nil, err
  51711. }
  51712. req.Header = reqHeaders
  51713. googleapi.Expand(req.URL, map[string]string{
  51714. "operation": c.operation,
  51715. })
  51716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51717. }
  51718. // Do executes the "compute.globalOrganizationOperations.delete" call.
  51719. func (c *GlobalOrganizationOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  51720. gensupport.SetOptions(c.urlParams_, opts...)
  51721. res, err := c.doRequest("json")
  51722. if err != nil {
  51723. return err
  51724. }
  51725. defer googleapi.CloseBody(res)
  51726. if err := googleapi.CheckResponse(res); err != nil {
  51727. return err
  51728. }
  51729. return nil
  51730. // {
  51731. // "description": "Deletes the specified Operations resource.",
  51732. // "httpMethod": "DELETE",
  51733. // "id": "compute.globalOrganizationOperations.delete",
  51734. // "parameterOrder": [
  51735. // "operation"
  51736. // ],
  51737. // "parameters": {
  51738. // "operation": {
  51739. // "description": "Name of the Operations resource to delete.",
  51740. // "location": "path",
  51741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51742. // "required": true,
  51743. // "type": "string"
  51744. // },
  51745. // "parentId": {
  51746. // "description": "Parent ID for this request.",
  51747. // "location": "query",
  51748. // "type": "string"
  51749. // }
  51750. // },
  51751. // "path": "locations/global/operations/{operation}",
  51752. // "scopes": [
  51753. // "https://www.googleapis.com/auth/cloud-platform",
  51754. // "https://www.googleapis.com/auth/compute"
  51755. // ]
  51756. // }
  51757. }
  51758. // method id "compute.globalOrganizationOperations.get":
  51759. type GlobalOrganizationOperationsGetCall struct {
  51760. s *Service
  51761. operation string
  51762. urlParams_ gensupport.URLParams
  51763. ifNoneMatch_ string
  51764. ctx_ context.Context
  51765. header_ http.Header
  51766. }
  51767. // Get: Retrieves the specified Operations resource. Gets a list of
  51768. // operations by making a list() request.
  51769. func (r *GlobalOrganizationOperationsService) Get(operation string) *GlobalOrganizationOperationsGetCall {
  51770. c := &GlobalOrganizationOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51771. c.operation = operation
  51772. return c
  51773. }
  51774. // ParentId sets the optional parameter "parentId": Parent ID for this
  51775. // request.
  51776. func (c *GlobalOrganizationOperationsGetCall) ParentId(parentId string) *GlobalOrganizationOperationsGetCall {
  51777. c.urlParams_.Set("parentId", parentId)
  51778. return c
  51779. }
  51780. // Fields allows partial responses to be retrieved. See
  51781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51782. // for more information.
  51783. func (c *GlobalOrganizationOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsGetCall {
  51784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51785. return c
  51786. }
  51787. // IfNoneMatch sets the optional parameter which makes the operation
  51788. // fail if the object's ETag matches the given value. This is useful for
  51789. // getting updates only after the object has changed since the last
  51790. // request. Use googleapi.IsNotModified to check whether the response
  51791. // error from Do is the result of In-None-Match.
  51792. func (c *GlobalOrganizationOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsGetCall {
  51793. c.ifNoneMatch_ = entityTag
  51794. return c
  51795. }
  51796. // Context sets the context to be used in this call's Do method. Any
  51797. // pending HTTP request will be aborted if the provided context is
  51798. // canceled.
  51799. func (c *GlobalOrganizationOperationsGetCall) Context(ctx context.Context) *GlobalOrganizationOperationsGetCall {
  51800. c.ctx_ = ctx
  51801. return c
  51802. }
  51803. // Header returns an http.Header that can be modified by the caller to
  51804. // add HTTP headers to the request.
  51805. func (c *GlobalOrganizationOperationsGetCall) Header() http.Header {
  51806. if c.header_ == nil {
  51807. c.header_ = make(http.Header)
  51808. }
  51809. return c.header_
  51810. }
  51811. func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  51812. reqHeaders := make(http.Header)
  51813. for k, v := range c.header_ {
  51814. reqHeaders[k] = v
  51815. }
  51816. reqHeaders.Set("User-Agent", c.s.userAgent())
  51817. if c.ifNoneMatch_ != "" {
  51818. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51819. }
  51820. var body io.Reader = nil
  51821. c.urlParams_.Set("alt", alt)
  51822. c.urlParams_.Set("prettyPrint", "false")
  51823. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  51824. urls += "?" + c.urlParams_.Encode()
  51825. req, err := http.NewRequest("GET", urls, body)
  51826. if err != nil {
  51827. return nil, err
  51828. }
  51829. req.Header = reqHeaders
  51830. googleapi.Expand(req.URL, map[string]string{
  51831. "operation": c.operation,
  51832. })
  51833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51834. }
  51835. // Do executes the "compute.globalOrganizationOperations.get" call.
  51836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51837. // status code is an error. Response headers are in either
  51838. // *Operation.ServerResponse.Header or (if a response was returned at
  51839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51840. // to check whether the returned error was because
  51841. // http.StatusNotModified was returned.
  51842. func (c *GlobalOrganizationOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51843. gensupport.SetOptions(c.urlParams_, opts...)
  51844. res, err := c.doRequest("json")
  51845. if res != nil && res.StatusCode == http.StatusNotModified {
  51846. if res.Body != nil {
  51847. res.Body.Close()
  51848. }
  51849. return nil, &googleapi.Error{
  51850. Code: res.StatusCode,
  51851. Header: res.Header,
  51852. }
  51853. }
  51854. if err != nil {
  51855. return nil, err
  51856. }
  51857. defer googleapi.CloseBody(res)
  51858. if err := googleapi.CheckResponse(res); err != nil {
  51859. return nil, err
  51860. }
  51861. ret := &Operation{
  51862. ServerResponse: googleapi.ServerResponse{
  51863. Header: res.Header,
  51864. HTTPStatusCode: res.StatusCode,
  51865. },
  51866. }
  51867. target := &ret
  51868. if err := gensupport.DecodeResponse(target, res); err != nil {
  51869. return nil, err
  51870. }
  51871. return ret, nil
  51872. // {
  51873. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  51874. // "httpMethod": "GET",
  51875. // "id": "compute.globalOrganizationOperations.get",
  51876. // "parameterOrder": [
  51877. // "operation"
  51878. // ],
  51879. // "parameters": {
  51880. // "operation": {
  51881. // "description": "Name of the Operations resource to return.",
  51882. // "location": "path",
  51883. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51884. // "required": true,
  51885. // "type": "string"
  51886. // },
  51887. // "parentId": {
  51888. // "description": "Parent ID for this request.",
  51889. // "location": "query",
  51890. // "type": "string"
  51891. // }
  51892. // },
  51893. // "path": "locations/global/operations/{operation}",
  51894. // "response": {
  51895. // "$ref": "Operation"
  51896. // },
  51897. // "scopes": [
  51898. // "https://www.googleapis.com/auth/cloud-platform",
  51899. // "https://www.googleapis.com/auth/compute",
  51900. // "https://www.googleapis.com/auth/compute.readonly"
  51901. // ]
  51902. // }
  51903. }
  51904. // method id "compute.globalOrganizationOperations.list":
  51905. type GlobalOrganizationOperationsListCall struct {
  51906. s *Service
  51907. urlParams_ gensupport.URLParams
  51908. ifNoneMatch_ string
  51909. ctx_ context.Context
  51910. header_ http.Header
  51911. }
  51912. // List: Retrieves a list of Operation resources contained within the
  51913. // specified organization.
  51914. func (r *GlobalOrganizationOperationsService) List() *GlobalOrganizationOperationsListCall {
  51915. c := &GlobalOrganizationOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51916. return c
  51917. }
  51918. // Filter sets the optional parameter "filter": A filter expression that
  51919. // filters resources listed in the response. The expression must specify
  51920. // the field name, a comparison operator, and the value that you want to
  51921. // use for filtering. The value must be a string, a number, or a
  51922. // boolean. The comparison operator must be either =, !=, >, or <.
  51923. //
  51924. // For example, if you are filtering Compute Engine instances, you can
  51925. // exclude instances named example-instance by specifying name !=
  51926. // example-instance.
  51927. //
  51928. // You can also filter nested fields. For example, you could specify
  51929. // scheduling.automaticRestart = false to include instances only if they
  51930. // are not scheduled for automatic restarts. You can use filtering on
  51931. // nested fields to filter based on resource labels.
  51932. //
  51933. // To filter on multiple expressions, provide each separate expression
  51934. // within parentheses. For example, (scheduling.automaticRestart = true)
  51935. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51936. // AND expression. However, you can include AND and OR expressions
  51937. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51938. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51939. // true).
  51940. func (c *GlobalOrganizationOperationsListCall) Filter(filter string) *GlobalOrganizationOperationsListCall {
  51941. c.urlParams_.Set("filter", filter)
  51942. return c
  51943. }
  51944. // MaxResults sets the optional parameter "maxResults": The maximum
  51945. // number of results per page that should be returned. If the number of
  51946. // available results is larger than maxResults, Compute Engine returns a
  51947. // nextPageToken that can be used to get the next page of results in
  51948. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51949. // (Default: 500)
  51950. func (c *GlobalOrganizationOperationsListCall) MaxResults(maxResults int64) *GlobalOrganizationOperationsListCall {
  51951. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51952. return c
  51953. }
  51954. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51955. // a certain order. By default, results are returned in alphanumerical
  51956. // order based on the resource name.
  51957. //
  51958. // You can also sort results in descending order based on the creation
  51959. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51960. // based on the creationTimestamp field in reverse chronological order
  51961. // (newest result first). Use this to sort resources like operations so
  51962. // that the newest operation is returned first.
  51963. //
  51964. // Currently, only sorting by name or creationTimestamp desc is
  51965. // supported.
  51966. func (c *GlobalOrganizationOperationsListCall) OrderBy(orderBy string) *GlobalOrganizationOperationsListCall {
  51967. c.urlParams_.Set("orderBy", orderBy)
  51968. return c
  51969. }
  51970. // PageToken sets the optional parameter "pageToken": Specifies a page
  51971. // token to use. Set pageToken to the nextPageToken returned by a
  51972. // previous list request to get the next page of results.
  51973. func (c *GlobalOrganizationOperationsListCall) PageToken(pageToken string) *GlobalOrganizationOperationsListCall {
  51974. c.urlParams_.Set("pageToken", pageToken)
  51975. return c
  51976. }
  51977. // ParentId sets the optional parameter "parentId": Parent ID for this
  51978. // request.
  51979. func (c *GlobalOrganizationOperationsListCall) ParentId(parentId string) *GlobalOrganizationOperationsListCall {
  51980. c.urlParams_.Set("parentId", parentId)
  51981. return c
  51982. }
  51983. // Fields allows partial responses to be retrieved. See
  51984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51985. // for more information.
  51986. func (c *GlobalOrganizationOperationsListCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsListCall {
  51987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51988. return c
  51989. }
  51990. // IfNoneMatch sets the optional parameter which makes the operation
  51991. // fail if the object's ETag matches the given value. This is useful for
  51992. // getting updates only after the object has changed since the last
  51993. // request. Use googleapi.IsNotModified to check whether the response
  51994. // error from Do is the result of In-None-Match.
  51995. func (c *GlobalOrganizationOperationsListCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsListCall {
  51996. c.ifNoneMatch_ = entityTag
  51997. return c
  51998. }
  51999. // Context sets the context to be used in this call's Do method. Any
  52000. // pending HTTP request will be aborted if the provided context is
  52001. // canceled.
  52002. func (c *GlobalOrganizationOperationsListCall) Context(ctx context.Context) *GlobalOrganizationOperationsListCall {
  52003. c.ctx_ = ctx
  52004. return c
  52005. }
  52006. // Header returns an http.Header that can be modified by the caller to
  52007. // add HTTP headers to the request.
  52008. func (c *GlobalOrganizationOperationsListCall) Header() http.Header {
  52009. if c.header_ == nil {
  52010. c.header_ = make(http.Header)
  52011. }
  52012. return c.header_
  52013. }
  52014. func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Response, error) {
  52015. reqHeaders := make(http.Header)
  52016. for k, v := range c.header_ {
  52017. reqHeaders[k] = v
  52018. }
  52019. reqHeaders.Set("User-Agent", c.s.userAgent())
  52020. if c.ifNoneMatch_ != "" {
  52021. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52022. }
  52023. var body io.Reader = nil
  52024. c.urlParams_.Set("alt", alt)
  52025. c.urlParams_.Set("prettyPrint", "false")
  52026. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations")
  52027. urls += "?" + c.urlParams_.Encode()
  52028. req, err := http.NewRequest("GET", urls, body)
  52029. if err != nil {
  52030. return nil, err
  52031. }
  52032. req.Header = reqHeaders
  52033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52034. }
  52035. // Do executes the "compute.globalOrganizationOperations.list" call.
  52036. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  52037. // status code is an error. Response headers are in either
  52038. // *OperationList.ServerResponse.Header or (if a response was returned
  52039. // at all) in error.(*googleapi.Error).Header. Use
  52040. // googleapi.IsNotModified to check whether the returned error was
  52041. // because http.StatusNotModified was returned.
  52042. func (c *GlobalOrganizationOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  52043. gensupport.SetOptions(c.urlParams_, opts...)
  52044. res, err := c.doRequest("json")
  52045. if res != nil && res.StatusCode == http.StatusNotModified {
  52046. if res.Body != nil {
  52047. res.Body.Close()
  52048. }
  52049. return nil, &googleapi.Error{
  52050. Code: res.StatusCode,
  52051. Header: res.Header,
  52052. }
  52053. }
  52054. if err != nil {
  52055. return nil, err
  52056. }
  52057. defer googleapi.CloseBody(res)
  52058. if err := googleapi.CheckResponse(res); err != nil {
  52059. return nil, err
  52060. }
  52061. ret := &OperationList{
  52062. ServerResponse: googleapi.ServerResponse{
  52063. Header: res.Header,
  52064. HTTPStatusCode: res.StatusCode,
  52065. },
  52066. }
  52067. target := &ret
  52068. if err := gensupport.DecodeResponse(target, res); err != nil {
  52069. return nil, err
  52070. }
  52071. return ret, nil
  52072. // {
  52073. // "description": "Retrieves a list of Operation resources contained within the specified organization.",
  52074. // "httpMethod": "GET",
  52075. // "id": "compute.globalOrganizationOperations.list",
  52076. // "parameters": {
  52077. // "filter": {
  52078. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  52079. // "location": "query",
  52080. // "type": "string"
  52081. // },
  52082. // "maxResults": {
  52083. // "default": "500",
  52084. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  52085. // "format": "uint32",
  52086. // "location": "query",
  52087. // "minimum": "0",
  52088. // "type": "integer"
  52089. // },
  52090. // "orderBy": {
  52091. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  52092. // "location": "query",
  52093. // "type": "string"
  52094. // },
  52095. // "pageToken": {
  52096. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  52097. // "location": "query",
  52098. // "type": "string"
  52099. // },
  52100. // "parentId": {
  52101. // "description": "Parent ID for this request.",
  52102. // "location": "query",
  52103. // "type": "string"
  52104. // }
  52105. // },
  52106. // "path": "locations/global/operations",
  52107. // "response": {
  52108. // "$ref": "OperationList"
  52109. // },
  52110. // "scopes": [
  52111. // "https://www.googleapis.com/auth/cloud-platform",
  52112. // "https://www.googleapis.com/auth/compute",
  52113. // "https://www.googleapis.com/auth/compute.readonly"
  52114. // ]
  52115. // }
  52116. }
  52117. // Pages invokes f for each page of results.
  52118. // A non-nil error returned from f will halt the iteration.
  52119. // The provided context supersedes any context provided to the Context method.
  52120. func (c *GlobalOrganizationOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  52121. c.ctx_ = ctx
  52122. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52123. for {
  52124. x, err := c.Do()
  52125. if err != nil {
  52126. return err
  52127. }
  52128. if err := f(x); err != nil {
  52129. return err
  52130. }
  52131. if x.NextPageToken == "" {
  52132. return nil
  52133. }
  52134. c.PageToken(x.NextPageToken)
  52135. }
  52136. }
  52137. // method id "compute.globalOrganizationOperations.wait":
  52138. type GlobalOrganizationOperationsWaitCall struct {
  52139. s *Service
  52140. operation string
  52141. urlParams_ gensupport.URLParams
  52142. ctx_ context.Context
  52143. header_ http.Header
  52144. }
  52145. // Wait: Waits for the specified Operations resource until it is done or
  52146. // timeout, and retrieves the specified Operations resource. 1.
  52147. // Immediately returns when the operation is already done. 2. Waits for
  52148. // no more than the default deadline (2 minutes, subject to change) and
  52149. // then returns the current state of the operation, which may be DONE or
  52150. // still in progress. 3. Is best-effort: a. The server can wait less
  52151. // than the default deadline or zero seconds, in overload situations. b.
  52152. // There is no guarantee that the operation is actually done when
  52153. // returns. 4. User should be prepared to retry if the operation is not
  52154. // DONE.
  52155. func (r *GlobalOrganizationOperationsService) Wait(operation string) *GlobalOrganizationOperationsWaitCall {
  52156. c := &GlobalOrganizationOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52157. c.operation = operation
  52158. return c
  52159. }
  52160. // ParentId sets the optional parameter "parentId": Parent ID for this
  52161. // request.
  52162. func (c *GlobalOrganizationOperationsWaitCall) ParentId(parentId string) *GlobalOrganizationOperationsWaitCall {
  52163. c.urlParams_.Set("parentId", parentId)
  52164. return c
  52165. }
  52166. // Fields allows partial responses to be retrieved. See
  52167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52168. // for more information.
  52169. func (c *GlobalOrganizationOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsWaitCall {
  52170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52171. return c
  52172. }
  52173. // Context sets the context to be used in this call's Do method. Any
  52174. // pending HTTP request will be aborted if the provided context is
  52175. // canceled.
  52176. func (c *GlobalOrganizationOperationsWaitCall) Context(ctx context.Context) *GlobalOrganizationOperationsWaitCall {
  52177. c.ctx_ = ctx
  52178. return c
  52179. }
  52180. // Header returns an http.Header that can be modified by the caller to
  52181. // add HTTP headers to the request.
  52182. func (c *GlobalOrganizationOperationsWaitCall) Header() http.Header {
  52183. if c.header_ == nil {
  52184. c.header_ = make(http.Header)
  52185. }
  52186. return c.header_
  52187. }
  52188. func (c *GlobalOrganizationOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  52189. reqHeaders := make(http.Header)
  52190. for k, v := range c.header_ {
  52191. reqHeaders[k] = v
  52192. }
  52193. reqHeaders.Set("User-Agent", c.s.userAgent())
  52194. var body io.Reader = nil
  52195. c.urlParams_.Set("alt", alt)
  52196. c.urlParams_.Set("prettyPrint", "false")
  52197. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}/wait")
  52198. urls += "?" + c.urlParams_.Encode()
  52199. req, err := http.NewRequest("POST", urls, body)
  52200. if err != nil {
  52201. return nil, err
  52202. }
  52203. req.Header = reqHeaders
  52204. googleapi.Expand(req.URL, map[string]string{
  52205. "operation": c.operation,
  52206. })
  52207. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52208. }
  52209. // Do executes the "compute.globalOrganizationOperations.wait" call.
  52210. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52211. // status code is an error. Response headers are in either
  52212. // *Operation.ServerResponse.Header or (if a response was returned at
  52213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52214. // to check whether the returned error was because
  52215. // http.StatusNotModified was returned.
  52216. func (c *GlobalOrganizationOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52217. gensupport.SetOptions(c.urlParams_, opts...)
  52218. res, err := c.doRequest("json")
  52219. if res != nil && res.StatusCode == http.StatusNotModified {
  52220. if res.Body != nil {
  52221. res.Body.Close()
  52222. }
  52223. return nil, &googleapi.Error{
  52224. Code: res.StatusCode,
  52225. Header: res.Header,
  52226. }
  52227. }
  52228. if err != nil {
  52229. return nil, err
  52230. }
  52231. defer googleapi.CloseBody(res)
  52232. if err := googleapi.CheckResponse(res); err != nil {
  52233. return nil, err
  52234. }
  52235. ret := &Operation{
  52236. ServerResponse: googleapi.ServerResponse{
  52237. Header: res.Header,
  52238. HTTPStatusCode: res.StatusCode,
  52239. },
  52240. }
  52241. target := &ret
  52242. if err := gensupport.DecodeResponse(target, res); err != nil {
  52243. return nil, err
  52244. }
  52245. return ret, nil
  52246. // {
  52247. // "description": "Waits for the specified Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  52248. // "httpMethod": "POST",
  52249. // "id": "compute.globalOrganizationOperations.wait",
  52250. // "parameterOrder": [
  52251. // "operation"
  52252. // ],
  52253. // "parameters": {
  52254. // "operation": {
  52255. // "description": "Name of the Operations resource to return.",
  52256. // "location": "path",
  52257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52258. // "required": true,
  52259. // "type": "string"
  52260. // },
  52261. // "parentId": {
  52262. // "description": "Parent ID for this request.",
  52263. // "location": "query",
  52264. // "type": "string"
  52265. // }
  52266. // },
  52267. // "path": "locations/global/operations/{operation}/wait",
  52268. // "response": {
  52269. // "$ref": "Operation"
  52270. // },
  52271. // "scopes": [
  52272. // "https://www.googleapis.com/auth/cloud-platform",
  52273. // "https://www.googleapis.com/auth/compute",
  52274. // "https://www.googleapis.com/auth/compute.readonly"
  52275. // ]
  52276. // }
  52277. }
  52278. // method id "compute.healthChecks.aggregatedList":
  52279. type HealthChecksAggregatedListCall struct {
  52280. s *Service
  52281. project string
  52282. urlParams_ gensupport.URLParams
  52283. ifNoneMatch_ string
  52284. ctx_ context.Context
  52285. header_ http.Header
  52286. }
  52287. // AggregatedList: Retrieves the list of all HealthCheck resources,
  52288. // regional and global, available to the specified project.
  52289. func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
  52290. c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52291. c.project = project
  52292. return c
  52293. }
  52294. // Filter sets the optional parameter "filter": A filter expression that
  52295. // filters resources listed in the response. The expression must specify
  52296. // the field name, a comparison operator, and the value that you want to
  52297. // use for filtering. The value must be a string, a number, or a
  52298. // boolean. The comparison operator must be either =, !=, >, or <.
  52299. //
  52300. // For example, if you are filtering Compute Engine instances, you can
  52301. // exclude instances named example-instance by specifying name !=
  52302. // example-instance.
  52303. //
  52304. // You can also filter nested fields. For example, you could specify
  52305. // scheduling.automaticRestart = false to include instances only if they
  52306. // are not scheduled for automatic restarts. You can use filtering on
  52307. // nested fields to filter based on resource labels.
  52308. //
  52309. // To filter on multiple expressions, provide each separate expression
  52310. // within parentheses. For example, (scheduling.automaticRestart = true)
  52311. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52312. // AND expression. However, you can include AND and OR expressions
  52313. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52314. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52315. // true).
  52316. func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
  52317. c.urlParams_.Set("filter", filter)
  52318. return c
  52319. }
  52320. // MaxResults sets the optional parameter "maxResults": The maximum
  52321. // number of results per page that should be returned. If the number of
  52322. // available results is larger than maxResults, Compute Engine returns a
  52323. // nextPageToken that can be used to get the next page of results in
  52324. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52325. // (Default: 500)
  52326. func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
  52327. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52328. return c
  52329. }
  52330. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52331. // a certain order. By default, results are returned in alphanumerical
  52332. // order based on the resource name.
  52333. //
  52334. // You can also sort results in descending order based on the creation
  52335. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52336. // based on the creationTimestamp field in reverse chronological order
  52337. // (newest result first). Use this to sort resources like operations so
  52338. // that the newest operation is returned first.
  52339. //
  52340. // Currently, only sorting by name or creationTimestamp desc is
  52341. // supported.
  52342. func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
  52343. c.urlParams_.Set("orderBy", orderBy)
  52344. return c
  52345. }
  52346. // PageToken sets the optional parameter "pageToken": Specifies a page
  52347. // token to use. Set pageToken to the nextPageToken returned by a
  52348. // previous list request to get the next page of results.
  52349. func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
  52350. c.urlParams_.Set("pageToken", pageToken)
  52351. return c
  52352. }
  52353. // Fields allows partial responses to be retrieved. See
  52354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52355. // for more information.
  52356. func (c *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
  52357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52358. return c
  52359. }
  52360. // IfNoneMatch sets the optional parameter which makes the operation
  52361. // fail if the object's ETag matches the given value. This is useful for
  52362. // getting updates only after the object has changed since the last
  52363. // request. Use googleapi.IsNotModified to check whether the response
  52364. // error from Do is the result of In-None-Match.
  52365. func (c *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
  52366. c.ifNoneMatch_ = entityTag
  52367. return c
  52368. }
  52369. // Context sets the context to be used in this call's Do method. Any
  52370. // pending HTTP request will be aborted if the provided context is
  52371. // canceled.
  52372. func (c *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
  52373. c.ctx_ = ctx
  52374. return c
  52375. }
  52376. // Header returns an http.Header that can be modified by the caller to
  52377. // add HTTP headers to the request.
  52378. func (c *HealthChecksAggregatedListCall) Header() http.Header {
  52379. if c.header_ == nil {
  52380. c.header_ = make(http.Header)
  52381. }
  52382. return c.header_
  52383. }
  52384. func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  52385. reqHeaders := make(http.Header)
  52386. for k, v := range c.header_ {
  52387. reqHeaders[k] = v
  52388. }
  52389. reqHeaders.Set("User-Agent", c.s.userAgent())
  52390. if c.ifNoneMatch_ != "" {
  52391. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52392. }
  52393. var body io.Reader = nil
  52394. c.urlParams_.Set("alt", alt)
  52395. c.urlParams_.Set("prettyPrint", "false")
  52396. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/healthChecks")
  52397. urls += "?" + c.urlParams_.Encode()
  52398. req, err := http.NewRequest("GET", urls, body)
  52399. if err != nil {
  52400. return nil, err
  52401. }
  52402. req.Header = reqHeaders
  52403. googleapi.Expand(req.URL, map[string]string{
  52404. "project": c.project,
  52405. })
  52406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52407. }
  52408. // Do executes the "compute.healthChecks.aggregatedList" call.
  52409. // Exactly one of *HealthChecksAggregatedList or error will be non-nil.
  52410. // Any non-2xx status code is an error. Response headers are in either
  52411. // *HealthChecksAggregatedList.ServerResponse.Header or (if a response
  52412. // was returned at all) in error.(*googleapi.Error).Header. Use
  52413. // googleapi.IsNotModified to check whether the returned error was
  52414. // because http.StatusNotModified was returned.
  52415. func (c *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, error) {
  52416. gensupport.SetOptions(c.urlParams_, opts...)
  52417. res, err := c.doRequest("json")
  52418. if res != nil && res.StatusCode == http.StatusNotModified {
  52419. if res.Body != nil {
  52420. res.Body.Close()
  52421. }
  52422. return nil, &googleapi.Error{
  52423. Code: res.StatusCode,
  52424. Header: res.Header,
  52425. }
  52426. }
  52427. if err != nil {
  52428. return nil, err
  52429. }
  52430. defer googleapi.CloseBody(res)
  52431. if err := googleapi.CheckResponse(res); err != nil {
  52432. return nil, err
  52433. }
  52434. ret := &HealthChecksAggregatedList{
  52435. ServerResponse: googleapi.ServerResponse{
  52436. Header: res.Header,
  52437. HTTPStatusCode: res.StatusCode,
  52438. },
  52439. }
  52440. target := &ret
  52441. if err := gensupport.DecodeResponse(target, res); err != nil {
  52442. return nil, err
  52443. }
  52444. return ret, nil
  52445. // {
  52446. // "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
  52447. // "httpMethod": "GET",
  52448. // "id": "compute.healthChecks.aggregatedList",
  52449. // "parameterOrder": [
  52450. // "project"
  52451. // ],
  52452. // "parameters": {
  52453. // "filter": {
  52454. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  52455. // "location": "query",
  52456. // "type": "string"
  52457. // },
  52458. // "maxResults": {
  52459. // "default": "500",
  52460. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  52461. // "format": "uint32",
  52462. // "location": "query",
  52463. // "minimum": "0",
  52464. // "type": "integer"
  52465. // },
  52466. // "orderBy": {
  52467. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  52468. // "location": "query",
  52469. // "type": "string"
  52470. // },
  52471. // "pageToken": {
  52472. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  52473. // "location": "query",
  52474. // "type": "string"
  52475. // },
  52476. // "project": {
  52477. // "description": "Name of the project scoping this request.",
  52478. // "location": "path",
  52479. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52480. // "required": true,
  52481. // "type": "string"
  52482. // }
  52483. // },
  52484. // "path": "{project}/aggregated/healthChecks",
  52485. // "response": {
  52486. // "$ref": "HealthChecksAggregatedList"
  52487. // },
  52488. // "scopes": [
  52489. // "https://www.googleapis.com/auth/cloud-platform",
  52490. // "https://www.googleapis.com/auth/compute",
  52491. // "https://www.googleapis.com/auth/compute.readonly"
  52492. // ]
  52493. // }
  52494. }
  52495. // Pages invokes f for each page of results.
  52496. // A non-nil error returned from f will halt the iteration.
  52497. // The provided context supersedes any context provided to the Context method.
  52498. func (c *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) error) error {
  52499. c.ctx_ = ctx
  52500. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52501. for {
  52502. x, err := c.Do()
  52503. if err != nil {
  52504. return err
  52505. }
  52506. if err := f(x); err != nil {
  52507. return err
  52508. }
  52509. if x.NextPageToken == "" {
  52510. return nil
  52511. }
  52512. c.PageToken(x.NextPageToken)
  52513. }
  52514. }
  52515. // method id "compute.healthChecks.delete":
  52516. type HealthChecksDeleteCall struct {
  52517. s *Service
  52518. project string
  52519. healthCheck string
  52520. urlParams_ gensupport.URLParams
  52521. ctx_ context.Context
  52522. header_ http.Header
  52523. }
  52524. // Delete: Deletes the specified HealthCheck resource.
  52525. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  52526. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52527. c.project = project
  52528. c.healthCheck = healthCheck
  52529. return c
  52530. }
  52531. // RequestId sets the optional parameter "requestId": An optional
  52532. // request ID to identify requests. Specify a unique request ID so that
  52533. // if you must retry your request, the server will know to ignore the
  52534. // request if it has already been completed.
  52535. //
  52536. // For example, consider a situation where you make an initial request
  52537. // and the request times out. If you make the request again with the
  52538. // same request ID, the server can check if original operation with the
  52539. // same request ID was received, and if so, will ignore the second
  52540. // request. This prevents clients from accidentally creating duplicate
  52541. // commitments.
  52542. //
  52543. // The request ID must be a valid UUID with the exception that zero UUID
  52544. // is not supported (00000000-0000-0000-0000-000000000000).
  52545. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  52546. c.urlParams_.Set("requestId", requestId)
  52547. return c
  52548. }
  52549. // Fields allows partial responses to be retrieved. See
  52550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52551. // for more information.
  52552. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  52553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52554. return c
  52555. }
  52556. // Context sets the context to be used in this call's Do method. Any
  52557. // pending HTTP request will be aborted if the provided context is
  52558. // canceled.
  52559. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  52560. c.ctx_ = ctx
  52561. return c
  52562. }
  52563. // Header returns an http.Header that can be modified by the caller to
  52564. // add HTTP headers to the request.
  52565. func (c *HealthChecksDeleteCall) Header() http.Header {
  52566. if c.header_ == nil {
  52567. c.header_ = make(http.Header)
  52568. }
  52569. return c.header_
  52570. }
  52571. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  52572. reqHeaders := make(http.Header)
  52573. for k, v := range c.header_ {
  52574. reqHeaders[k] = v
  52575. }
  52576. reqHeaders.Set("User-Agent", c.s.userAgent())
  52577. var body io.Reader = nil
  52578. c.urlParams_.Set("alt", alt)
  52579. c.urlParams_.Set("prettyPrint", "false")
  52580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  52581. urls += "?" + c.urlParams_.Encode()
  52582. req, err := http.NewRequest("DELETE", urls, body)
  52583. if err != nil {
  52584. return nil, err
  52585. }
  52586. req.Header = reqHeaders
  52587. googleapi.Expand(req.URL, map[string]string{
  52588. "project": c.project,
  52589. "healthCheck": c.healthCheck,
  52590. })
  52591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52592. }
  52593. // Do executes the "compute.healthChecks.delete" call.
  52594. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52595. // status code is an error. Response headers are in either
  52596. // *Operation.ServerResponse.Header or (if a response was returned at
  52597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52598. // to check whether the returned error was because
  52599. // http.StatusNotModified was returned.
  52600. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52601. gensupport.SetOptions(c.urlParams_, opts...)
  52602. res, err := c.doRequest("json")
  52603. if res != nil && res.StatusCode == http.StatusNotModified {
  52604. if res.Body != nil {
  52605. res.Body.Close()
  52606. }
  52607. return nil, &googleapi.Error{
  52608. Code: res.StatusCode,
  52609. Header: res.Header,
  52610. }
  52611. }
  52612. if err != nil {
  52613. return nil, err
  52614. }
  52615. defer googleapi.CloseBody(res)
  52616. if err := googleapi.CheckResponse(res); err != nil {
  52617. return nil, err
  52618. }
  52619. ret := &Operation{
  52620. ServerResponse: googleapi.ServerResponse{
  52621. Header: res.Header,
  52622. HTTPStatusCode: res.StatusCode,
  52623. },
  52624. }
  52625. target := &ret
  52626. if err := gensupport.DecodeResponse(target, res); err != nil {
  52627. return nil, err
  52628. }
  52629. return ret, nil
  52630. // {
  52631. // "description": "Deletes the specified HealthCheck resource.",
  52632. // "httpMethod": "DELETE",
  52633. // "id": "compute.healthChecks.delete",
  52634. // "parameterOrder": [
  52635. // "project",
  52636. // "healthCheck"
  52637. // ],
  52638. // "parameters": {
  52639. // "healthCheck": {
  52640. // "description": "Name of the HealthCheck resource to delete.",
  52641. // "location": "path",
  52642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52643. // "required": true,
  52644. // "type": "string"
  52645. // },
  52646. // "project": {
  52647. // "description": "Project ID for this request.",
  52648. // "location": "path",
  52649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52650. // "required": true,
  52651. // "type": "string"
  52652. // },
  52653. // "requestId": {
  52654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52655. // "location": "query",
  52656. // "type": "string"
  52657. // }
  52658. // },
  52659. // "path": "{project}/global/healthChecks/{healthCheck}",
  52660. // "response": {
  52661. // "$ref": "Operation"
  52662. // },
  52663. // "scopes": [
  52664. // "https://www.googleapis.com/auth/cloud-platform",
  52665. // "https://www.googleapis.com/auth/compute"
  52666. // ]
  52667. // }
  52668. }
  52669. // method id "compute.healthChecks.get":
  52670. type HealthChecksGetCall struct {
  52671. s *Service
  52672. project string
  52673. healthCheck string
  52674. urlParams_ gensupport.URLParams
  52675. ifNoneMatch_ string
  52676. ctx_ context.Context
  52677. header_ http.Header
  52678. }
  52679. // Get: Returns the specified HealthCheck resource. Gets a list of
  52680. // available health checks by making a list() request.
  52681. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  52682. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52683. c.project = project
  52684. c.healthCheck = healthCheck
  52685. return c
  52686. }
  52687. // Fields allows partial responses to be retrieved. See
  52688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52689. // for more information.
  52690. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  52691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52692. return c
  52693. }
  52694. // IfNoneMatch sets the optional parameter which makes the operation
  52695. // fail if the object's ETag matches the given value. This is useful for
  52696. // getting updates only after the object has changed since the last
  52697. // request. Use googleapi.IsNotModified to check whether the response
  52698. // error from Do is the result of In-None-Match.
  52699. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  52700. c.ifNoneMatch_ = entityTag
  52701. return c
  52702. }
  52703. // Context sets the context to be used in this call's Do method. Any
  52704. // pending HTTP request will be aborted if the provided context is
  52705. // canceled.
  52706. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  52707. c.ctx_ = ctx
  52708. return c
  52709. }
  52710. // Header returns an http.Header that can be modified by the caller to
  52711. // add HTTP headers to the request.
  52712. func (c *HealthChecksGetCall) Header() http.Header {
  52713. if c.header_ == nil {
  52714. c.header_ = make(http.Header)
  52715. }
  52716. return c.header_
  52717. }
  52718. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  52719. reqHeaders := make(http.Header)
  52720. for k, v := range c.header_ {
  52721. reqHeaders[k] = v
  52722. }
  52723. reqHeaders.Set("User-Agent", c.s.userAgent())
  52724. if c.ifNoneMatch_ != "" {
  52725. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52726. }
  52727. var body io.Reader = nil
  52728. c.urlParams_.Set("alt", alt)
  52729. c.urlParams_.Set("prettyPrint", "false")
  52730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  52731. urls += "?" + c.urlParams_.Encode()
  52732. req, err := http.NewRequest("GET", urls, body)
  52733. if err != nil {
  52734. return nil, err
  52735. }
  52736. req.Header = reqHeaders
  52737. googleapi.Expand(req.URL, map[string]string{
  52738. "project": c.project,
  52739. "healthCheck": c.healthCheck,
  52740. })
  52741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52742. }
  52743. // Do executes the "compute.healthChecks.get" call.
  52744. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  52745. // status code is an error. Response headers are in either
  52746. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  52747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52748. // to check whether the returned error was because
  52749. // http.StatusNotModified was returned.
  52750. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  52751. gensupport.SetOptions(c.urlParams_, opts...)
  52752. res, err := c.doRequest("json")
  52753. if res != nil && res.StatusCode == http.StatusNotModified {
  52754. if res.Body != nil {
  52755. res.Body.Close()
  52756. }
  52757. return nil, &googleapi.Error{
  52758. Code: res.StatusCode,
  52759. Header: res.Header,
  52760. }
  52761. }
  52762. if err != nil {
  52763. return nil, err
  52764. }
  52765. defer googleapi.CloseBody(res)
  52766. if err := googleapi.CheckResponse(res); err != nil {
  52767. return nil, err
  52768. }
  52769. ret := &HealthCheck{
  52770. ServerResponse: googleapi.ServerResponse{
  52771. Header: res.Header,
  52772. HTTPStatusCode: res.StatusCode,
  52773. },
  52774. }
  52775. target := &ret
  52776. if err := gensupport.DecodeResponse(target, res); err != nil {
  52777. return nil, err
  52778. }
  52779. return ret, nil
  52780. // {
  52781. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  52782. // "httpMethod": "GET",
  52783. // "id": "compute.healthChecks.get",
  52784. // "parameterOrder": [
  52785. // "project",
  52786. // "healthCheck"
  52787. // ],
  52788. // "parameters": {
  52789. // "healthCheck": {
  52790. // "description": "Name of the HealthCheck resource to return.",
  52791. // "location": "path",
  52792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52793. // "required": true,
  52794. // "type": "string"
  52795. // },
  52796. // "project": {
  52797. // "description": "Project ID for this request.",
  52798. // "location": "path",
  52799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52800. // "required": true,
  52801. // "type": "string"
  52802. // }
  52803. // },
  52804. // "path": "{project}/global/healthChecks/{healthCheck}",
  52805. // "response": {
  52806. // "$ref": "HealthCheck"
  52807. // },
  52808. // "scopes": [
  52809. // "https://www.googleapis.com/auth/cloud-platform",
  52810. // "https://www.googleapis.com/auth/compute",
  52811. // "https://www.googleapis.com/auth/compute.readonly"
  52812. // ]
  52813. // }
  52814. }
  52815. // method id "compute.healthChecks.insert":
  52816. type HealthChecksInsertCall struct {
  52817. s *Service
  52818. project string
  52819. healthcheck *HealthCheck
  52820. urlParams_ gensupport.URLParams
  52821. ctx_ context.Context
  52822. header_ http.Header
  52823. }
  52824. // Insert: Creates a HealthCheck resource in the specified project using
  52825. // the data included in the request.
  52826. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  52827. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52828. c.project = project
  52829. c.healthcheck = healthcheck
  52830. return c
  52831. }
  52832. // RequestId sets the optional parameter "requestId": An optional
  52833. // request ID to identify requests. Specify a unique request ID so that
  52834. // if you must retry your request, the server will know to ignore the
  52835. // request if it has already been completed.
  52836. //
  52837. // For example, consider a situation where you make an initial request
  52838. // and the request times out. If you make the request again with the
  52839. // same request ID, the server can check if original operation with the
  52840. // same request ID was received, and if so, will ignore the second
  52841. // request. This prevents clients from accidentally creating duplicate
  52842. // commitments.
  52843. //
  52844. // The request ID must be a valid UUID with the exception that zero UUID
  52845. // is not supported (00000000-0000-0000-0000-000000000000).
  52846. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  52847. c.urlParams_.Set("requestId", requestId)
  52848. return c
  52849. }
  52850. // Fields allows partial responses to be retrieved. See
  52851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52852. // for more information.
  52853. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  52854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52855. return c
  52856. }
  52857. // Context sets the context to be used in this call's Do method. Any
  52858. // pending HTTP request will be aborted if the provided context is
  52859. // canceled.
  52860. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  52861. c.ctx_ = ctx
  52862. return c
  52863. }
  52864. // Header returns an http.Header that can be modified by the caller to
  52865. // add HTTP headers to the request.
  52866. func (c *HealthChecksInsertCall) Header() http.Header {
  52867. if c.header_ == nil {
  52868. c.header_ = make(http.Header)
  52869. }
  52870. return c.header_
  52871. }
  52872. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  52873. reqHeaders := make(http.Header)
  52874. for k, v := range c.header_ {
  52875. reqHeaders[k] = v
  52876. }
  52877. reqHeaders.Set("User-Agent", c.s.userAgent())
  52878. var body io.Reader = nil
  52879. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  52880. if err != nil {
  52881. return nil, err
  52882. }
  52883. reqHeaders.Set("Content-Type", "application/json")
  52884. c.urlParams_.Set("alt", alt)
  52885. c.urlParams_.Set("prettyPrint", "false")
  52886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  52887. urls += "?" + c.urlParams_.Encode()
  52888. req, err := http.NewRequest("POST", urls, body)
  52889. if err != nil {
  52890. return nil, err
  52891. }
  52892. req.Header = reqHeaders
  52893. googleapi.Expand(req.URL, map[string]string{
  52894. "project": c.project,
  52895. })
  52896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52897. }
  52898. // Do executes the "compute.healthChecks.insert" call.
  52899. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52900. // status code is an error. Response headers are in either
  52901. // *Operation.ServerResponse.Header or (if a response was returned at
  52902. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52903. // to check whether the returned error was because
  52904. // http.StatusNotModified was returned.
  52905. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52906. gensupport.SetOptions(c.urlParams_, opts...)
  52907. res, err := c.doRequest("json")
  52908. if res != nil && res.StatusCode == http.StatusNotModified {
  52909. if res.Body != nil {
  52910. res.Body.Close()
  52911. }
  52912. return nil, &googleapi.Error{
  52913. Code: res.StatusCode,
  52914. Header: res.Header,
  52915. }
  52916. }
  52917. if err != nil {
  52918. return nil, err
  52919. }
  52920. defer googleapi.CloseBody(res)
  52921. if err := googleapi.CheckResponse(res); err != nil {
  52922. return nil, err
  52923. }
  52924. ret := &Operation{
  52925. ServerResponse: googleapi.ServerResponse{
  52926. Header: res.Header,
  52927. HTTPStatusCode: res.StatusCode,
  52928. },
  52929. }
  52930. target := &ret
  52931. if err := gensupport.DecodeResponse(target, res); err != nil {
  52932. return nil, err
  52933. }
  52934. return ret, nil
  52935. // {
  52936. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  52937. // "httpMethod": "POST",
  52938. // "id": "compute.healthChecks.insert",
  52939. // "parameterOrder": [
  52940. // "project"
  52941. // ],
  52942. // "parameters": {
  52943. // "project": {
  52944. // "description": "Project ID for this request.",
  52945. // "location": "path",
  52946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52947. // "required": true,
  52948. // "type": "string"
  52949. // },
  52950. // "requestId": {
  52951. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52952. // "location": "query",
  52953. // "type": "string"
  52954. // }
  52955. // },
  52956. // "path": "{project}/global/healthChecks",
  52957. // "request": {
  52958. // "$ref": "HealthCheck"
  52959. // },
  52960. // "response": {
  52961. // "$ref": "Operation"
  52962. // },
  52963. // "scopes": [
  52964. // "https://www.googleapis.com/auth/cloud-platform",
  52965. // "https://www.googleapis.com/auth/compute"
  52966. // ]
  52967. // }
  52968. }
  52969. // method id "compute.healthChecks.list":
  52970. type HealthChecksListCall struct {
  52971. s *Service
  52972. project string
  52973. urlParams_ gensupport.URLParams
  52974. ifNoneMatch_ string
  52975. ctx_ context.Context
  52976. header_ http.Header
  52977. }
  52978. // List: Retrieves the list of HealthCheck resources available to the
  52979. // specified project.
  52980. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  52981. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52982. c.project = project
  52983. return c
  52984. }
  52985. // Filter sets the optional parameter "filter": A filter expression that
  52986. // filters resources listed in the response. The expression must specify
  52987. // the field name, a comparison operator, and the value that you want to
  52988. // use for filtering. The value must be a string, a number, or a
  52989. // boolean. The comparison operator must be either =, !=, >, or <.
  52990. //
  52991. // For example, if you are filtering Compute Engine instances, you can
  52992. // exclude instances named example-instance by specifying name !=
  52993. // example-instance.
  52994. //
  52995. // You can also filter nested fields. For example, you could specify
  52996. // scheduling.automaticRestart = false to include instances only if they
  52997. // are not scheduled for automatic restarts. You can use filtering on
  52998. // nested fields to filter based on resource labels.
  52999. //
  53000. // To filter on multiple expressions, provide each separate expression
  53001. // within parentheses. For example, (scheduling.automaticRestart = true)
  53002. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53003. // AND expression. However, you can include AND and OR expressions
  53004. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53005. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53006. // true).
  53007. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  53008. c.urlParams_.Set("filter", filter)
  53009. return c
  53010. }
  53011. // MaxResults sets the optional parameter "maxResults": The maximum
  53012. // number of results per page that should be returned. If the number of
  53013. // available results is larger than maxResults, Compute Engine returns a
  53014. // nextPageToken that can be used to get the next page of results in
  53015. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53016. // (Default: 500)
  53017. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  53018. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53019. return c
  53020. }
  53021. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53022. // a certain order. By default, results are returned in alphanumerical
  53023. // order based on the resource name.
  53024. //
  53025. // You can also sort results in descending order based on the creation
  53026. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53027. // based on the creationTimestamp field in reverse chronological order
  53028. // (newest result first). Use this to sort resources like operations so
  53029. // that the newest operation is returned first.
  53030. //
  53031. // Currently, only sorting by name or creationTimestamp desc is
  53032. // supported.
  53033. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  53034. c.urlParams_.Set("orderBy", orderBy)
  53035. return c
  53036. }
  53037. // PageToken sets the optional parameter "pageToken": Specifies a page
  53038. // token to use. Set pageToken to the nextPageToken returned by a
  53039. // previous list request to get the next page of results.
  53040. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  53041. c.urlParams_.Set("pageToken", pageToken)
  53042. return c
  53043. }
  53044. // Fields allows partial responses to be retrieved. See
  53045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53046. // for more information.
  53047. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  53048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53049. return c
  53050. }
  53051. // IfNoneMatch sets the optional parameter which makes the operation
  53052. // fail if the object's ETag matches the given value. This is useful for
  53053. // getting updates only after the object has changed since the last
  53054. // request. Use googleapi.IsNotModified to check whether the response
  53055. // error from Do is the result of In-None-Match.
  53056. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  53057. c.ifNoneMatch_ = entityTag
  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 *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  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 *HealthChecksListCall) Header() http.Header {
  53070. if c.header_ == nil {
  53071. c.header_ = make(http.Header)
  53072. }
  53073. return c.header_
  53074. }
  53075. func (c *HealthChecksListCall) 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. if c.ifNoneMatch_ != "" {
  53082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53083. }
  53084. var body io.Reader = nil
  53085. c.urlParams_.Set("alt", alt)
  53086. c.urlParams_.Set("prettyPrint", "false")
  53087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  53088. urls += "?" + c.urlParams_.Encode()
  53089. req, err := http.NewRequest("GET", urls, body)
  53090. if err != nil {
  53091. return nil, err
  53092. }
  53093. req.Header = reqHeaders
  53094. googleapi.Expand(req.URL, map[string]string{
  53095. "project": c.project,
  53096. })
  53097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53098. }
  53099. // Do executes the "compute.healthChecks.list" call.
  53100. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  53101. // status code is an error. Response headers are in either
  53102. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  53103. // at all) in error.(*googleapi.Error).Header. Use
  53104. // googleapi.IsNotModified to check whether the returned error was
  53105. // because http.StatusNotModified was returned.
  53106. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  53107. gensupport.SetOptions(c.urlParams_, opts...)
  53108. res, err := c.doRequest("json")
  53109. if res != nil && res.StatusCode == http.StatusNotModified {
  53110. if res.Body != nil {
  53111. res.Body.Close()
  53112. }
  53113. return nil, &googleapi.Error{
  53114. Code: res.StatusCode,
  53115. Header: res.Header,
  53116. }
  53117. }
  53118. if err != nil {
  53119. return nil, err
  53120. }
  53121. defer googleapi.CloseBody(res)
  53122. if err := googleapi.CheckResponse(res); err != nil {
  53123. return nil, err
  53124. }
  53125. ret := &HealthCheckList{
  53126. ServerResponse: googleapi.ServerResponse{
  53127. Header: res.Header,
  53128. HTTPStatusCode: res.StatusCode,
  53129. },
  53130. }
  53131. target := &ret
  53132. if err := gensupport.DecodeResponse(target, res); err != nil {
  53133. return nil, err
  53134. }
  53135. return ret, nil
  53136. // {
  53137. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  53138. // "httpMethod": "GET",
  53139. // "id": "compute.healthChecks.list",
  53140. // "parameterOrder": [
  53141. // "project"
  53142. // ],
  53143. // "parameters": {
  53144. // "filter": {
  53145. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  53146. // "location": "query",
  53147. // "type": "string"
  53148. // },
  53149. // "maxResults": {
  53150. // "default": "500",
  53151. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53152. // "format": "uint32",
  53153. // "location": "query",
  53154. // "minimum": "0",
  53155. // "type": "integer"
  53156. // },
  53157. // "orderBy": {
  53158. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53159. // "location": "query",
  53160. // "type": "string"
  53161. // },
  53162. // "pageToken": {
  53163. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53164. // "location": "query",
  53165. // "type": "string"
  53166. // },
  53167. // "project": {
  53168. // "description": "Project ID for this request.",
  53169. // "location": "path",
  53170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53171. // "required": true,
  53172. // "type": "string"
  53173. // }
  53174. // },
  53175. // "path": "{project}/global/healthChecks",
  53176. // "response": {
  53177. // "$ref": "HealthCheckList"
  53178. // },
  53179. // "scopes": [
  53180. // "https://www.googleapis.com/auth/cloud-platform",
  53181. // "https://www.googleapis.com/auth/compute",
  53182. // "https://www.googleapis.com/auth/compute.readonly"
  53183. // ]
  53184. // }
  53185. }
  53186. // Pages invokes f for each page of results.
  53187. // A non-nil error returned from f will halt the iteration.
  53188. // The provided context supersedes any context provided to the Context method.
  53189. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  53190. c.ctx_ = ctx
  53191. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53192. for {
  53193. x, err := c.Do()
  53194. if err != nil {
  53195. return err
  53196. }
  53197. if err := f(x); err != nil {
  53198. return err
  53199. }
  53200. if x.NextPageToken == "" {
  53201. return nil
  53202. }
  53203. c.PageToken(x.NextPageToken)
  53204. }
  53205. }
  53206. // method id "compute.healthChecks.patch":
  53207. type HealthChecksPatchCall struct {
  53208. s *Service
  53209. project string
  53210. healthCheck string
  53211. healthcheck *HealthCheck
  53212. urlParams_ gensupport.URLParams
  53213. ctx_ context.Context
  53214. header_ http.Header
  53215. }
  53216. // Patch: Updates a HealthCheck resource in the specified project using
  53217. // the data included in the request. This method supports PATCH
  53218. // semantics and uses the JSON merge patch format and processing rules.
  53219. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  53220. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53221. c.project = project
  53222. c.healthCheck = healthCheck
  53223. c.healthcheck = healthcheck
  53224. return c
  53225. }
  53226. // RequestId sets the optional parameter "requestId": An optional
  53227. // request ID to identify requests. Specify a unique request ID so that
  53228. // if you must retry your request, the server will know to ignore the
  53229. // request if it has already been completed.
  53230. //
  53231. // For example, consider a situation where you make an initial request
  53232. // and the request times out. If you make the request again with the
  53233. // same request ID, the server can check if original operation with the
  53234. // same request ID was received, and if so, will ignore the second
  53235. // request. This prevents clients from accidentally creating duplicate
  53236. // commitments.
  53237. //
  53238. // The request ID must be a valid UUID with the exception that zero UUID
  53239. // is not supported (00000000-0000-0000-0000-000000000000).
  53240. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  53241. c.urlParams_.Set("requestId", requestId)
  53242. return c
  53243. }
  53244. // Fields allows partial responses to be retrieved. See
  53245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53246. // for more information.
  53247. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  53248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53249. return c
  53250. }
  53251. // Context sets the context to be used in this call's Do method. Any
  53252. // pending HTTP request will be aborted if the provided context is
  53253. // canceled.
  53254. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  53255. c.ctx_ = ctx
  53256. return c
  53257. }
  53258. // Header returns an http.Header that can be modified by the caller to
  53259. // add HTTP headers to the request.
  53260. func (c *HealthChecksPatchCall) Header() http.Header {
  53261. if c.header_ == nil {
  53262. c.header_ = make(http.Header)
  53263. }
  53264. return c.header_
  53265. }
  53266. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  53267. reqHeaders := make(http.Header)
  53268. for k, v := range c.header_ {
  53269. reqHeaders[k] = v
  53270. }
  53271. reqHeaders.Set("User-Agent", c.s.userAgent())
  53272. var body io.Reader = nil
  53273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  53274. if err != nil {
  53275. return nil, err
  53276. }
  53277. reqHeaders.Set("Content-Type", "application/json")
  53278. c.urlParams_.Set("alt", alt)
  53279. c.urlParams_.Set("prettyPrint", "false")
  53280. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  53281. urls += "?" + c.urlParams_.Encode()
  53282. req, err := http.NewRequest("PATCH", urls, body)
  53283. if err != nil {
  53284. return nil, err
  53285. }
  53286. req.Header = reqHeaders
  53287. googleapi.Expand(req.URL, map[string]string{
  53288. "project": c.project,
  53289. "healthCheck": c.healthCheck,
  53290. })
  53291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53292. }
  53293. // Do executes the "compute.healthChecks.patch" call.
  53294. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53295. // status code is an error. Response headers are in either
  53296. // *Operation.ServerResponse.Header or (if a response was returned at
  53297. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53298. // to check whether the returned error was because
  53299. // http.StatusNotModified was returned.
  53300. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53301. gensupport.SetOptions(c.urlParams_, opts...)
  53302. res, err := c.doRequest("json")
  53303. if res != nil && res.StatusCode == http.StatusNotModified {
  53304. if res.Body != nil {
  53305. res.Body.Close()
  53306. }
  53307. return nil, &googleapi.Error{
  53308. Code: res.StatusCode,
  53309. Header: res.Header,
  53310. }
  53311. }
  53312. if err != nil {
  53313. return nil, err
  53314. }
  53315. defer googleapi.CloseBody(res)
  53316. if err := googleapi.CheckResponse(res); err != nil {
  53317. return nil, err
  53318. }
  53319. ret := &Operation{
  53320. ServerResponse: googleapi.ServerResponse{
  53321. Header: res.Header,
  53322. HTTPStatusCode: res.StatusCode,
  53323. },
  53324. }
  53325. target := &ret
  53326. if err := gensupport.DecodeResponse(target, res); err != nil {
  53327. return nil, err
  53328. }
  53329. return ret, nil
  53330. // {
  53331. // "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.",
  53332. // "httpMethod": "PATCH",
  53333. // "id": "compute.healthChecks.patch",
  53334. // "parameterOrder": [
  53335. // "project",
  53336. // "healthCheck"
  53337. // ],
  53338. // "parameters": {
  53339. // "healthCheck": {
  53340. // "description": "Name of the HealthCheck resource to patch.",
  53341. // "location": "path",
  53342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53343. // "required": true,
  53344. // "type": "string"
  53345. // },
  53346. // "project": {
  53347. // "description": "Project ID for this request.",
  53348. // "location": "path",
  53349. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53350. // "required": true,
  53351. // "type": "string"
  53352. // },
  53353. // "requestId": {
  53354. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53355. // "location": "query",
  53356. // "type": "string"
  53357. // }
  53358. // },
  53359. // "path": "{project}/global/healthChecks/{healthCheck}",
  53360. // "request": {
  53361. // "$ref": "HealthCheck"
  53362. // },
  53363. // "response": {
  53364. // "$ref": "Operation"
  53365. // },
  53366. // "scopes": [
  53367. // "https://www.googleapis.com/auth/cloud-platform",
  53368. // "https://www.googleapis.com/auth/compute"
  53369. // ]
  53370. // }
  53371. }
  53372. // method id "compute.healthChecks.testIamPermissions":
  53373. type HealthChecksTestIamPermissionsCall struct {
  53374. s *Service
  53375. project string
  53376. resource string
  53377. testpermissionsrequest *TestPermissionsRequest
  53378. urlParams_ gensupport.URLParams
  53379. ctx_ context.Context
  53380. header_ http.Header
  53381. }
  53382. // TestIamPermissions: Returns permissions that a caller has on the
  53383. // specified resource.
  53384. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  53385. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53386. c.project = project
  53387. c.resource = resource
  53388. c.testpermissionsrequest = testpermissionsrequest
  53389. return c
  53390. }
  53391. // Fields allows partial responses to be retrieved. See
  53392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53393. // for more information.
  53394. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  53395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53396. return c
  53397. }
  53398. // Context sets the context to be used in this call's Do method. Any
  53399. // pending HTTP request will be aborted if the provided context is
  53400. // canceled.
  53401. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  53402. c.ctx_ = ctx
  53403. return c
  53404. }
  53405. // Header returns an http.Header that can be modified by the caller to
  53406. // add HTTP headers to the request.
  53407. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  53408. if c.header_ == nil {
  53409. c.header_ = make(http.Header)
  53410. }
  53411. return c.header_
  53412. }
  53413. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53414. reqHeaders := make(http.Header)
  53415. for k, v := range c.header_ {
  53416. reqHeaders[k] = v
  53417. }
  53418. reqHeaders.Set("User-Agent", c.s.userAgent())
  53419. var body io.Reader = nil
  53420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53421. if err != nil {
  53422. return nil, err
  53423. }
  53424. reqHeaders.Set("Content-Type", "application/json")
  53425. c.urlParams_.Set("alt", alt)
  53426. c.urlParams_.Set("prettyPrint", "false")
  53427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  53428. urls += "?" + c.urlParams_.Encode()
  53429. req, err := http.NewRequest("POST", urls, body)
  53430. if err != nil {
  53431. return nil, err
  53432. }
  53433. req.Header = reqHeaders
  53434. googleapi.Expand(req.URL, map[string]string{
  53435. "project": c.project,
  53436. "resource": c.resource,
  53437. })
  53438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53439. }
  53440. // Do executes the "compute.healthChecks.testIamPermissions" call.
  53441. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53442. // non-2xx status code is an error. Response headers are in either
  53443. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53444. // returned at all) in error.(*googleapi.Error).Header. Use
  53445. // googleapi.IsNotModified to check whether the returned error was
  53446. // because http.StatusNotModified was returned.
  53447. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53448. gensupport.SetOptions(c.urlParams_, opts...)
  53449. res, err := c.doRequest("json")
  53450. if res != nil && res.StatusCode == http.StatusNotModified {
  53451. if res.Body != nil {
  53452. res.Body.Close()
  53453. }
  53454. return nil, &googleapi.Error{
  53455. Code: res.StatusCode,
  53456. Header: res.Header,
  53457. }
  53458. }
  53459. if err != nil {
  53460. return nil, err
  53461. }
  53462. defer googleapi.CloseBody(res)
  53463. if err := googleapi.CheckResponse(res); err != nil {
  53464. return nil, err
  53465. }
  53466. ret := &TestPermissionsResponse{
  53467. ServerResponse: googleapi.ServerResponse{
  53468. Header: res.Header,
  53469. HTTPStatusCode: res.StatusCode,
  53470. },
  53471. }
  53472. target := &ret
  53473. if err := gensupport.DecodeResponse(target, res); err != nil {
  53474. return nil, err
  53475. }
  53476. return ret, nil
  53477. // {
  53478. // "description": "Returns permissions that a caller has on the specified resource.",
  53479. // "httpMethod": "POST",
  53480. // "id": "compute.healthChecks.testIamPermissions",
  53481. // "parameterOrder": [
  53482. // "project",
  53483. // "resource"
  53484. // ],
  53485. // "parameters": {
  53486. // "project": {
  53487. // "description": "Project ID for this request.",
  53488. // "location": "path",
  53489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53490. // "required": true,
  53491. // "type": "string"
  53492. // },
  53493. // "resource": {
  53494. // "description": "Name or id of the resource for this request.",
  53495. // "location": "path",
  53496. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53497. // "required": true,
  53498. // "type": "string"
  53499. // }
  53500. // },
  53501. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  53502. // "request": {
  53503. // "$ref": "TestPermissionsRequest"
  53504. // },
  53505. // "response": {
  53506. // "$ref": "TestPermissionsResponse"
  53507. // },
  53508. // "scopes": [
  53509. // "https://www.googleapis.com/auth/cloud-platform",
  53510. // "https://www.googleapis.com/auth/compute",
  53511. // "https://www.googleapis.com/auth/compute.readonly"
  53512. // ]
  53513. // }
  53514. }
  53515. // method id "compute.healthChecks.update":
  53516. type HealthChecksUpdateCall struct {
  53517. s *Service
  53518. project string
  53519. healthCheck string
  53520. healthcheck *HealthCheck
  53521. urlParams_ gensupport.URLParams
  53522. ctx_ context.Context
  53523. header_ http.Header
  53524. }
  53525. // Update: Updates a HealthCheck resource in the specified project using
  53526. // the data included in the request.
  53527. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  53528. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53529. c.project = project
  53530. c.healthCheck = healthCheck
  53531. c.healthcheck = healthcheck
  53532. return c
  53533. }
  53534. // RequestId sets the optional parameter "requestId": An optional
  53535. // request ID to identify requests. Specify a unique request ID so that
  53536. // if you must retry your request, the server will know to ignore the
  53537. // request if it has already been completed.
  53538. //
  53539. // For example, consider a situation where you make an initial request
  53540. // and the request times out. If you make the request again with the
  53541. // same request ID, the server can check if original operation with the
  53542. // same request ID was received, and if so, will ignore the second
  53543. // request. This prevents clients from accidentally creating duplicate
  53544. // commitments.
  53545. //
  53546. // The request ID must be a valid UUID with the exception that zero UUID
  53547. // is not supported (00000000-0000-0000-0000-000000000000).
  53548. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  53549. c.urlParams_.Set("requestId", requestId)
  53550. return c
  53551. }
  53552. // Fields allows partial responses to be retrieved. See
  53553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53554. // for more information.
  53555. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  53556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53557. return c
  53558. }
  53559. // Context sets the context to be used in this call's Do method. Any
  53560. // pending HTTP request will be aborted if the provided context is
  53561. // canceled.
  53562. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  53563. c.ctx_ = ctx
  53564. return c
  53565. }
  53566. // Header returns an http.Header that can be modified by the caller to
  53567. // add HTTP headers to the request.
  53568. func (c *HealthChecksUpdateCall) Header() http.Header {
  53569. if c.header_ == nil {
  53570. c.header_ = make(http.Header)
  53571. }
  53572. return c.header_
  53573. }
  53574. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  53575. reqHeaders := make(http.Header)
  53576. for k, v := range c.header_ {
  53577. reqHeaders[k] = v
  53578. }
  53579. reqHeaders.Set("User-Agent", c.s.userAgent())
  53580. var body io.Reader = nil
  53581. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  53582. if err != nil {
  53583. return nil, err
  53584. }
  53585. reqHeaders.Set("Content-Type", "application/json")
  53586. c.urlParams_.Set("alt", alt)
  53587. c.urlParams_.Set("prettyPrint", "false")
  53588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  53589. urls += "?" + c.urlParams_.Encode()
  53590. req, err := http.NewRequest("PUT", urls, body)
  53591. if err != nil {
  53592. return nil, err
  53593. }
  53594. req.Header = reqHeaders
  53595. googleapi.Expand(req.URL, map[string]string{
  53596. "project": c.project,
  53597. "healthCheck": c.healthCheck,
  53598. })
  53599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53600. }
  53601. // Do executes the "compute.healthChecks.update" call.
  53602. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53603. // status code is an error. Response headers are in either
  53604. // *Operation.ServerResponse.Header or (if a response was returned at
  53605. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53606. // to check whether the returned error was because
  53607. // http.StatusNotModified was returned.
  53608. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53609. gensupport.SetOptions(c.urlParams_, opts...)
  53610. res, err := c.doRequest("json")
  53611. if res != nil && res.StatusCode == http.StatusNotModified {
  53612. if res.Body != nil {
  53613. res.Body.Close()
  53614. }
  53615. return nil, &googleapi.Error{
  53616. Code: res.StatusCode,
  53617. Header: res.Header,
  53618. }
  53619. }
  53620. if err != nil {
  53621. return nil, err
  53622. }
  53623. defer googleapi.CloseBody(res)
  53624. if err := googleapi.CheckResponse(res); err != nil {
  53625. return nil, err
  53626. }
  53627. ret := &Operation{
  53628. ServerResponse: googleapi.ServerResponse{
  53629. Header: res.Header,
  53630. HTTPStatusCode: res.StatusCode,
  53631. },
  53632. }
  53633. target := &ret
  53634. if err := gensupport.DecodeResponse(target, res); err != nil {
  53635. return nil, err
  53636. }
  53637. return ret, nil
  53638. // {
  53639. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  53640. // "httpMethod": "PUT",
  53641. // "id": "compute.healthChecks.update",
  53642. // "parameterOrder": [
  53643. // "project",
  53644. // "healthCheck"
  53645. // ],
  53646. // "parameters": {
  53647. // "healthCheck": {
  53648. // "description": "Name of the HealthCheck resource to update.",
  53649. // "location": "path",
  53650. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53651. // "required": true,
  53652. // "type": "string"
  53653. // },
  53654. // "project": {
  53655. // "description": "Project ID for this request.",
  53656. // "location": "path",
  53657. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53658. // "required": true,
  53659. // "type": "string"
  53660. // },
  53661. // "requestId": {
  53662. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53663. // "location": "query",
  53664. // "type": "string"
  53665. // }
  53666. // },
  53667. // "path": "{project}/global/healthChecks/{healthCheck}",
  53668. // "request": {
  53669. // "$ref": "HealthCheck"
  53670. // },
  53671. // "response": {
  53672. // "$ref": "Operation"
  53673. // },
  53674. // "scopes": [
  53675. // "https://www.googleapis.com/auth/cloud-platform",
  53676. // "https://www.googleapis.com/auth/compute"
  53677. // ]
  53678. // }
  53679. }
  53680. // method id "compute.httpHealthChecks.delete":
  53681. type HttpHealthChecksDeleteCall struct {
  53682. s *Service
  53683. project string
  53684. httpHealthCheck string
  53685. urlParams_ gensupport.URLParams
  53686. ctx_ context.Context
  53687. header_ http.Header
  53688. }
  53689. // Delete: Deletes the specified HttpHealthCheck resource.
  53690. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  53691. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  53692. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53693. c.project = project
  53694. c.httpHealthCheck = httpHealthCheck
  53695. return c
  53696. }
  53697. // RequestId sets the optional parameter "requestId": An optional
  53698. // request ID to identify requests. Specify a unique request ID so that
  53699. // if you must retry your request, the server will know to ignore the
  53700. // request if it has already been completed.
  53701. //
  53702. // For example, consider a situation where you make an initial request
  53703. // and the request times out. If you make the request again with the
  53704. // same request ID, the server can check if original operation with the
  53705. // same request ID was received, and if so, will ignore the second
  53706. // request. This prevents clients from accidentally creating duplicate
  53707. // commitments.
  53708. //
  53709. // The request ID must be a valid UUID with the exception that zero UUID
  53710. // is not supported (00000000-0000-0000-0000-000000000000).
  53711. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  53712. c.urlParams_.Set("requestId", requestId)
  53713. return c
  53714. }
  53715. // Fields allows partial responses to be retrieved. See
  53716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53717. // for more information.
  53718. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  53719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53720. return c
  53721. }
  53722. // Context sets the context to be used in this call's Do method. Any
  53723. // pending HTTP request will be aborted if the provided context is
  53724. // canceled.
  53725. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  53726. c.ctx_ = ctx
  53727. return c
  53728. }
  53729. // Header returns an http.Header that can be modified by the caller to
  53730. // add HTTP headers to the request.
  53731. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  53732. if c.header_ == nil {
  53733. c.header_ = make(http.Header)
  53734. }
  53735. return c.header_
  53736. }
  53737. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  53738. reqHeaders := make(http.Header)
  53739. for k, v := range c.header_ {
  53740. reqHeaders[k] = v
  53741. }
  53742. reqHeaders.Set("User-Agent", c.s.userAgent())
  53743. var body io.Reader = nil
  53744. c.urlParams_.Set("alt", alt)
  53745. c.urlParams_.Set("prettyPrint", "false")
  53746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  53747. urls += "?" + c.urlParams_.Encode()
  53748. req, err := http.NewRequest("DELETE", urls, body)
  53749. if err != nil {
  53750. return nil, err
  53751. }
  53752. req.Header = reqHeaders
  53753. googleapi.Expand(req.URL, map[string]string{
  53754. "project": c.project,
  53755. "httpHealthCheck": c.httpHealthCheck,
  53756. })
  53757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53758. }
  53759. // Do executes the "compute.httpHealthChecks.delete" call.
  53760. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53761. // status code is an error. Response headers are in either
  53762. // *Operation.ServerResponse.Header or (if a response was returned at
  53763. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53764. // to check whether the returned error was because
  53765. // http.StatusNotModified was returned.
  53766. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53767. gensupport.SetOptions(c.urlParams_, opts...)
  53768. res, err := c.doRequest("json")
  53769. if res != nil && res.StatusCode == http.StatusNotModified {
  53770. if res.Body != nil {
  53771. res.Body.Close()
  53772. }
  53773. return nil, &googleapi.Error{
  53774. Code: res.StatusCode,
  53775. Header: res.Header,
  53776. }
  53777. }
  53778. if err != nil {
  53779. return nil, err
  53780. }
  53781. defer googleapi.CloseBody(res)
  53782. if err := googleapi.CheckResponse(res); err != nil {
  53783. return nil, err
  53784. }
  53785. ret := &Operation{
  53786. ServerResponse: googleapi.ServerResponse{
  53787. Header: res.Header,
  53788. HTTPStatusCode: res.StatusCode,
  53789. },
  53790. }
  53791. target := &ret
  53792. if err := gensupport.DecodeResponse(target, res); err != nil {
  53793. return nil, err
  53794. }
  53795. return ret, nil
  53796. // {
  53797. // "description": "Deletes the specified HttpHealthCheck resource.",
  53798. // "httpMethod": "DELETE",
  53799. // "id": "compute.httpHealthChecks.delete",
  53800. // "parameterOrder": [
  53801. // "project",
  53802. // "httpHealthCheck"
  53803. // ],
  53804. // "parameters": {
  53805. // "httpHealthCheck": {
  53806. // "description": "Name of the HttpHealthCheck resource to delete.",
  53807. // "location": "path",
  53808. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53809. // "required": true,
  53810. // "type": "string"
  53811. // },
  53812. // "project": {
  53813. // "description": "Project ID for this request.",
  53814. // "location": "path",
  53815. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53816. // "required": true,
  53817. // "type": "string"
  53818. // },
  53819. // "requestId": {
  53820. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53821. // "location": "query",
  53822. // "type": "string"
  53823. // }
  53824. // },
  53825. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  53826. // "response": {
  53827. // "$ref": "Operation"
  53828. // },
  53829. // "scopes": [
  53830. // "https://www.googleapis.com/auth/cloud-platform",
  53831. // "https://www.googleapis.com/auth/compute"
  53832. // ]
  53833. // }
  53834. }
  53835. // method id "compute.httpHealthChecks.get":
  53836. type HttpHealthChecksGetCall struct {
  53837. s *Service
  53838. project string
  53839. httpHealthCheck string
  53840. urlParams_ gensupport.URLParams
  53841. ifNoneMatch_ string
  53842. ctx_ context.Context
  53843. header_ http.Header
  53844. }
  53845. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  53846. // available HTTP health checks by making a list() request.
  53847. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  53848. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  53849. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53850. c.project = project
  53851. c.httpHealthCheck = httpHealthCheck
  53852. return c
  53853. }
  53854. // Fields allows partial responses to be retrieved. See
  53855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53856. // for more information.
  53857. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  53858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53859. return c
  53860. }
  53861. // IfNoneMatch sets the optional parameter which makes the operation
  53862. // fail if the object's ETag matches the given value. This is useful for
  53863. // getting updates only after the object has changed since the last
  53864. // request. Use googleapi.IsNotModified to check whether the response
  53865. // error from Do is the result of In-None-Match.
  53866. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  53867. c.ifNoneMatch_ = entityTag
  53868. return c
  53869. }
  53870. // Context sets the context to be used in this call's Do method. Any
  53871. // pending HTTP request will be aborted if the provided context is
  53872. // canceled.
  53873. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  53874. c.ctx_ = ctx
  53875. return c
  53876. }
  53877. // Header returns an http.Header that can be modified by the caller to
  53878. // add HTTP headers to the request.
  53879. func (c *HttpHealthChecksGetCall) Header() http.Header {
  53880. if c.header_ == nil {
  53881. c.header_ = make(http.Header)
  53882. }
  53883. return c.header_
  53884. }
  53885. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  53886. reqHeaders := make(http.Header)
  53887. for k, v := range c.header_ {
  53888. reqHeaders[k] = v
  53889. }
  53890. reqHeaders.Set("User-Agent", c.s.userAgent())
  53891. if c.ifNoneMatch_ != "" {
  53892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53893. }
  53894. var body io.Reader = nil
  53895. c.urlParams_.Set("alt", alt)
  53896. c.urlParams_.Set("prettyPrint", "false")
  53897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  53898. urls += "?" + c.urlParams_.Encode()
  53899. req, err := http.NewRequest("GET", urls, body)
  53900. if err != nil {
  53901. return nil, err
  53902. }
  53903. req.Header = reqHeaders
  53904. googleapi.Expand(req.URL, map[string]string{
  53905. "project": c.project,
  53906. "httpHealthCheck": c.httpHealthCheck,
  53907. })
  53908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53909. }
  53910. // Do executes the "compute.httpHealthChecks.get" call.
  53911. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  53912. // status code is an error. Response headers are in either
  53913. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  53914. // at all) in error.(*googleapi.Error).Header. Use
  53915. // googleapi.IsNotModified to check whether the returned error was
  53916. // because http.StatusNotModified was returned.
  53917. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  53918. gensupport.SetOptions(c.urlParams_, opts...)
  53919. res, err := c.doRequest("json")
  53920. if res != nil && res.StatusCode == http.StatusNotModified {
  53921. if res.Body != nil {
  53922. res.Body.Close()
  53923. }
  53924. return nil, &googleapi.Error{
  53925. Code: res.StatusCode,
  53926. Header: res.Header,
  53927. }
  53928. }
  53929. if err != nil {
  53930. return nil, err
  53931. }
  53932. defer googleapi.CloseBody(res)
  53933. if err := googleapi.CheckResponse(res); err != nil {
  53934. return nil, err
  53935. }
  53936. ret := &HttpHealthCheck{
  53937. ServerResponse: googleapi.ServerResponse{
  53938. Header: res.Header,
  53939. HTTPStatusCode: res.StatusCode,
  53940. },
  53941. }
  53942. target := &ret
  53943. if err := gensupport.DecodeResponse(target, res); err != nil {
  53944. return nil, err
  53945. }
  53946. return ret, nil
  53947. // {
  53948. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  53949. // "httpMethod": "GET",
  53950. // "id": "compute.httpHealthChecks.get",
  53951. // "parameterOrder": [
  53952. // "project",
  53953. // "httpHealthCheck"
  53954. // ],
  53955. // "parameters": {
  53956. // "httpHealthCheck": {
  53957. // "description": "Name of the HttpHealthCheck resource to return.",
  53958. // "location": "path",
  53959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53960. // "required": true,
  53961. // "type": "string"
  53962. // },
  53963. // "project": {
  53964. // "description": "Project ID for this request.",
  53965. // "location": "path",
  53966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53967. // "required": true,
  53968. // "type": "string"
  53969. // }
  53970. // },
  53971. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  53972. // "response": {
  53973. // "$ref": "HttpHealthCheck"
  53974. // },
  53975. // "scopes": [
  53976. // "https://www.googleapis.com/auth/cloud-platform",
  53977. // "https://www.googleapis.com/auth/compute",
  53978. // "https://www.googleapis.com/auth/compute.readonly"
  53979. // ]
  53980. // }
  53981. }
  53982. // method id "compute.httpHealthChecks.insert":
  53983. type HttpHealthChecksInsertCall struct {
  53984. s *Service
  53985. project string
  53986. httphealthcheck *HttpHealthCheck
  53987. urlParams_ gensupport.URLParams
  53988. ctx_ context.Context
  53989. header_ http.Header
  53990. }
  53991. // Insert: Creates a HttpHealthCheck resource in the specified project
  53992. // using the data included in the request.
  53993. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  53994. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  53995. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53996. c.project = project
  53997. c.httphealthcheck = httphealthcheck
  53998. return c
  53999. }
  54000. // RequestId sets the optional parameter "requestId": An optional
  54001. // request ID to identify requests. Specify a unique request ID so that
  54002. // if you must retry your request, the server will know to ignore the
  54003. // request if it has already been completed.
  54004. //
  54005. // For example, consider a situation where you make an initial request
  54006. // and the request times out. If you make the request again with the
  54007. // same request ID, the server can check if original operation with the
  54008. // same request ID was received, and if so, will ignore the second
  54009. // request. This prevents clients from accidentally creating duplicate
  54010. // commitments.
  54011. //
  54012. // The request ID must be a valid UUID with the exception that zero UUID
  54013. // is not supported (00000000-0000-0000-0000-000000000000).
  54014. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  54015. c.urlParams_.Set("requestId", requestId)
  54016. return c
  54017. }
  54018. // Fields allows partial responses to be retrieved. See
  54019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54020. // for more information.
  54021. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  54022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54023. return c
  54024. }
  54025. // Context sets the context to be used in this call's Do method. Any
  54026. // pending HTTP request will be aborted if the provided context is
  54027. // canceled.
  54028. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  54029. c.ctx_ = ctx
  54030. return c
  54031. }
  54032. // Header returns an http.Header that can be modified by the caller to
  54033. // add HTTP headers to the request.
  54034. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  54035. if c.header_ == nil {
  54036. c.header_ = make(http.Header)
  54037. }
  54038. return c.header_
  54039. }
  54040. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  54041. reqHeaders := make(http.Header)
  54042. for k, v := range c.header_ {
  54043. reqHeaders[k] = v
  54044. }
  54045. reqHeaders.Set("User-Agent", c.s.userAgent())
  54046. var body io.Reader = nil
  54047. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  54048. if err != nil {
  54049. return nil, err
  54050. }
  54051. reqHeaders.Set("Content-Type", "application/json")
  54052. c.urlParams_.Set("alt", alt)
  54053. c.urlParams_.Set("prettyPrint", "false")
  54054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  54055. urls += "?" + c.urlParams_.Encode()
  54056. req, err := http.NewRequest("POST", urls, body)
  54057. if err != nil {
  54058. return nil, err
  54059. }
  54060. req.Header = reqHeaders
  54061. googleapi.Expand(req.URL, map[string]string{
  54062. "project": c.project,
  54063. })
  54064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54065. }
  54066. // Do executes the "compute.httpHealthChecks.insert" call.
  54067. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54068. // status code is an error. Response headers are in either
  54069. // *Operation.ServerResponse.Header or (if a response was returned at
  54070. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54071. // to check whether the returned error was because
  54072. // http.StatusNotModified was returned.
  54073. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54074. gensupport.SetOptions(c.urlParams_, opts...)
  54075. res, err := c.doRequest("json")
  54076. if res != nil && res.StatusCode == http.StatusNotModified {
  54077. if res.Body != nil {
  54078. res.Body.Close()
  54079. }
  54080. return nil, &googleapi.Error{
  54081. Code: res.StatusCode,
  54082. Header: res.Header,
  54083. }
  54084. }
  54085. if err != nil {
  54086. return nil, err
  54087. }
  54088. defer googleapi.CloseBody(res)
  54089. if err := googleapi.CheckResponse(res); err != nil {
  54090. return nil, err
  54091. }
  54092. ret := &Operation{
  54093. ServerResponse: googleapi.ServerResponse{
  54094. Header: res.Header,
  54095. HTTPStatusCode: res.StatusCode,
  54096. },
  54097. }
  54098. target := &ret
  54099. if err := gensupport.DecodeResponse(target, res); err != nil {
  54100. return nil, err
  54101. }
  54102. return ret, nil
  54103. // {
  54104. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  54105. // "httpMethod": "POST",
  54106. // "id": "compute.httpHealthChecks.insert",
  54107. // "parameterOrder": [
  54108. // "project"
  54109. // ],
  54110. // "parameters": {
  54111. // "project": {
  54112. // "description": "Project ID for this request.",
  54113. // "location": "path",
  54114. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54115. // "required": true,
  54116. // "type": "string"
  54117. // },
  54118. // "requestId": {
  54119. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54120. // "location": "query",
  54121. // "type": "string"
  54122. // }
  54123. // },
  54124. // "path": "{project}/global/httpHealthChecks",
  54125. // "request": {
  54126. // "$ref": "HttpHealthCheck"
  54127. // },
  54128. // "response": {
  54129. // "$ref": "Operation"
  54130. // },
  54131. // "scopes": [
  54132. // "https://www.googleapis.com/auth/cloud-platform",
  54133. // "https://www.googleapis.com/auth/compute"
  54134. // ]
  54135. // }
  54136. }
  54137. // method id "compute.httpHealthChecks.list":
  54138. type HttpHealthChecksListCall struct {
  54139. s *Service
  54140. project string
  54141. urlParams_ gensupport.URLParams
  54142. ifNoneMatch_ string
  54143. ctx_ context.Context
  54144. header_ http.Header
  54145. }
  54146. // List: Retrieves the list of HttpHealthCheck resources available to
  54147. // the specified project.
  54148. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  54149. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  54150. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54151. c.project = project
  54152. return c
  54153. }
  54154. // Filter sets the optional parameter "filter": A filter expression that
  54155. // filters resources listed in the response. The expression must specify
  54156. // the field name, a comparison operator, and the value that you want to
  54157. // use for filtering. The value must be a string, a number, or a
  54158. // boolean. The comparison operator must be either =, !=, >, or <.
  54159. //
  54160. // For example, if you are filtering Compute Engine instances, you can
  54161. // exclude instances named example-instance by specifying name !=
  54162. // example-instance.
  54163. //
  54164. // You can also filter nested fields. For example, you could specify
  54165. // scheduling.automaticRestart = false to include instances only if they
  54166. // are not scheduled for automatic restarts. You can use filtering on
  54167. // nested fields to filter based on resource labels.
  54168. //
  54169. // To filter on multiple expressions, provide each separate expression
  54170. // within parentheses. For example, (scheduling.automaticRestart = true)
  54171. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54172. // AND expression. However, you can include AND and OR expressions
  54173. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54174. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54175. // true).
  54176. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  54177. c.urlParams_.Set("filter", filter)
  54178. return c
  54179. }
  54180. // MaxResults sets the optional parameter "maxResults": The maximum
  54181. // number of results per page that should be returned. If the number of
  54182. // available results is larger than maxResults, Compute Engine returns a
  54183. // nextPageToken that can be used to get the next page of results in
  54184. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54185. // (Default: 500)
  54186. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  54187. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54188. return c
  54189. }
  54190. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54191. // a certain order. By default, results are returned in alphanumerical
  54192. // order based on the resource name.
  54193. //
  54194. // You can also sort results in descending order based on the creation
  54195. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54196. // based on the creationTimestamp field in reverse chronological order
  54197. // (newest result first). Use this to sort resources like operations so
  54198. // that the newest operation is returned first.
  54199. //
  54200. // Currently, only sorting by name or creationTimestamp desc is
  54201. // supported.
  54202. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  54203. c.urlParams_.Set("orderBy", orderBy)
  54204. return c
  54205. }
  54206. // PageToken sets the optional parameter "pageToken": Specifies a page
  54207. // token to use. Set pageToken to the nextPageToken returned by a
  54208. // previous list request to get the next page of results.
  54209. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  54210. c.urlParams_.Set("pageToken", pageToken)
  54211. return c
  54212. }
  54213. // Fields allows partial responses to be retrieved. See
  54214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54215. // for more information.
  54216. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  54217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54218. return c
  54219. }
  54220. // IfNoneMatch sets the optional parameter which makes the operation
  54221. // fail if the object's ETag matches the given value. This is useful for
  54222. // getting updates only after the object has changed since the last
  54223. // request. Use googleapi.IsNotModified to check whether the response
  54224. // error from Do is the result of In-None-Match.
  54225. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  54226. c.ifNoneMatch_ = entityTag
  54227. return c
  54228. }
  54229. // Context sets the context to be used in this call's Do method. Any
  54230. // pending HTTP request will be aborted if the provided context is
  54231. // canceled.
  54232. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  54233. c.ctx_ = ctx
  54234. return c
  54235. }
  54236. // Header returns an http.Header that can be modified by the caller to
  54237. // add HTTP headers to the request.
  54238. func (c *HttpHealthChecksListCall) Header() http.Header {
  54239. if c.header_ == nil {
  54240. c.header_ = make(http.Header)
  54241. }
  54242. return c.header_
  54243. }
  54244. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  54245. reqHeaders := make(http.Header)
  54246. for k, v := range c.header_ {
  54247. reqHeaders[k] = v
  54248. }
  54249. reqHeaders.Set("User-Agent", c.s.userAgent())
  54250. if c.ifNoneMatch_ != "" {
  54251. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54252. }
  54253. var body io.Reader = nil
  54254. c.urlParams_.Set("alt", alt)
  54255. c.urlParams_.Set("prettyPrint", "false")
  54256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  54257. urls += "?" + c.urlParams_.Encode()
  54258. req, err := http.NewRequest("GET", urls, body)
  54259. if err != nil {
  54260. return nil, err
  54261. }
  54262. req.Header = reqHeaders
  54263. googleapi.Expand(req.URL, map[string]string{
  54264. "project": c.project,
  54265. })
  54266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54267. }
  54268. // Do executes the "compute.httpHealthChecks.list" call.
  54269. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  54270. // non-2xx status code is an error. Response headers are in either
  54271. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  54272. // returned at all) in error.(*googleapi.Error).Header. Use
  54273. // googleapi.IsNotModified to check whether the returned error was
  54274. // because http.StatusNotModified was returned.
  54275. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  54276. gensupport.SetOptions(c.urlParams_, opts...)
  54277. res, err := c.doRequest("json")
  54278. if res != nil && res.StatusCode == http.StatusNotModified {
  54279. if res.Body != nil {
  54280. res.Body.Close()
  54281. }
  54282. return nil, &googleapi.Error{
  54283. Code: res.StatusCode,
  54284. Header: res.Header,
  54285. }
  54286. }
  54287. if err != nil {
  54288. return nil, err
  54289. }
  54290. defer googleapi.CloseBody(res)
  54291. if err := googleapi.CheckResponse(res); err != nil {
  54292. return nil, err
  54293. }
  54294. ret := &HttpHealthCheckList{
  54295. ServerResponse: googleapi.ServerResponse{
  54296. Header: res.Header,
  54297. HTTPStatusCode: res.StatusCode,
  54298. },
  54299. }
  54300. target := &ret
  54301. if err := gensupport.DecodeResponse(target, res); err != nil {
  54302. return nil, err
  54303. }
  54304. return ret, nil
  54305. // {
  54306. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  54307. // "httpMethod": "GET",
  54308. // "id": "compute.httpHealthChecks.list",
  54309. // "parameterOrder": [
  54310. // "project"
  54311. // ],
  54312. // "parameters": {
  54313. // "filter": {
  54314. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  54315. // "location": "query",
  54316. // "type": "string"
  54317. // },
  54318. // "maxResults": {
  54319. // "default": "500",
  54320. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54321. // "format": "uint32",
  54322. // "location": "query",
  54323. // "minimum": "0",
  54324. // "type": "integer"
  54325. // },
  54326. // "orderBy": {
  54327. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54328. // "location": "query",
  54329. // "type": "string"
  54330. // },
  54331. // "pageToken": {
  54332. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54333. // "location": "query",
  54334. // "type": "string"
  54335. // },
  54336. // "project": {
  54337. // "description": "Project ID for this request.",
  54338. // "location": "path",
  54339. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54340. // "required": true,
  54341. // "type": "string"
  54342. // }
  54343. // },
  54344. // "path": "{project}/global/httpHealthChecks",
  54345. // "response": {
  54346. // "$ref": "HttpHealthCheckList"
  54347. // },
  54348. // "scopes": [
  54349. // "https://www.googleapis.com/auth/cloud-platform",
  54350. // "https://www.googleapis.com/auth/compute",
  54351. // "https://www.googleapis.com/auth/compute.readonly"
  54352. // ]
  54353. // }
  54354. }
  54355. // Pages invokes f for each page of results.
  54356. // A non-nil error returned from f will halt the iteration.
  54357. // The provided context supersedes any context provided to the Context method.
  54358. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  54359. c.ctx_ = ctx
  54360. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54361. for {
  54362. x, err := c.Do()
  54363. if err != nil {
  54364. return err
  54365. }
  54366. if err := f(x); err != nil {
  54367. return err
  54368. }
  54369. if x.NextPageToken == "" {
  54370. return nil
  54371. }
  54372. c.PageToken(x.NextPageToken)
  54373. }
  54374. }
  54375. // method id "compute.httpHealthChecks.patch":
  54376. type HttpHealthChecksPatchCall struct {
  54377. s *Service
  54378. project string
  54379. httpHealthCheck string
  54380. httphealthcheck *HttpHealthCheck
  54381. urlParams_ gensupport.URLParams
  54382. ctx_ context.Context
  54383. header_ http.Header
  54384. }
  54385. // Patch: Updates a HttpHealthCheck resource in the specified project
  54386. // using the data included in the request. This method supports PATCH
  54387. // semantics and uses the JSON merge patch format and processing rules.
  54388. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  54389. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  54390. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54391. c.project = project
  54392. c.httpHealthCheck = httpHealthCheck
  54393. c.httphealthcheck = httphealthcheck
  54394. return c
  54395. }
  54396. // RequestId sets the optional parameter "requestId": An optional
  54397. // request ID to identify requests. Specify a unique request ID so that
  54398. // if you must retry your request, the server will know to ignore the
  54399. // request if it has already been completed.
  54400. //
  54401. // For example, consider a situation where you make an initial request
  54402. // and the request times out. If you make the request again with the
  54403. // same request ID, the server can check if original operation with the
  54404. // same request ID was received, and if so, will ignore the second
  54405. // request. This prevents clients from accidentally creating duplicate
  54406. // commitments.
  54407. //
  54408. // The request ID must be a valid UUID with the exception that zero UUID
  54409. // is not supported (00000000-0000-0000-0000-000000000000).
  54410. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  54411. c.urlParams_.Set("requestId", requestId)
  54412. return c
  54413. }
  54414. // Fields allows partial responses to be retrieved. See
  54415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54416. // for more information.
  54417. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  54418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54419. return c
  54420. }
  54421. // Context sets the context to be used in this call's Do method. Any
  54422. // pending HTTP request will be aborted if the provided context is
  54423. // canceled.
  54424. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  54425. c.ctx_ = ctx
  54426. return c
  54427. }
  54428. // Header returns an http.Header that can be modified by the caller to
  54429. // add HTTP headers to the request.
  54430. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  54431. if c.header_ == nil {
  54432. c.header_ = make(http.Header)
  54433. }
  54434. return c.header_
  54435. }
  54436. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  54437. reqHeaders := make(http.Header)
  54438. for k, v := range c.header_ {
  54439. reqHeaders[k] = v
  54440. }
  54441. reqHeaders.Set("User-Agent", c.s.userAgent())
  54442. var body io.Reader = nil
  54443. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  54444. if err != nil {
  54445. return nil, err
  54446. }
  54447. reqHeaders.Set("Content-Type", "application/json")
  54448. c.urlParams_.Set("alt", alt)
  54449. c.urlParams_.Set("prettyPrint", "false")
  54450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  54451. urls += "?" + c.urlParams_.Encode()
  54452. req, err := http.NewRequest("PATCH", urls, body)
  54453. if err != nil {
  54454. return nil, err
  54455. }
  54456. req.Header = reqHeaders
  54457. googleapi.Expand(req.URL, map[string]string{
  54458. "project": c.project,
  54459. "httpHealthCheck": c.httpHealthCheck,
  54460. })
  54461. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54462. }
  54463. // Do executes the "compute.httpHealthChecks.patch" call.
  54464. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54465. // status code is an error. Response headers are in either
  54466. // *Operation.ServerResponse.Header or (if a response was returned at
  54467. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54468. // to check whether the returned error was because
  54469. // http.StatusNotModified was returned.
  54470. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54471. gensupport.SetOptions(c.urlParams_, opts...)
  54472. res, err := c.doRequest("json")
  54473. if res != nil && res.StatusCode == http.StatusNotModified {
  54474. if res.Body != nil {
  54475. res.Body.Close()
  54476. }
  54477. return nil, &googleapi.Error{
  54478. Code: res.StatusCode,
  54479. Header: res.Header,
  54480. }
  54481. }
  54482. if err != nil {
  54483. return nil, err
  54484. }
  54485. defer googleapi.CloseBody(res)
  54486. if err := googleapi.CheckResponse(res); err != nil {
  54487. return nil, err
  54488. }
  54489. ret := &Operation{
  54490. ServerResponse: googleapi.ServerResponse{
  54491. Header: res.Header,
  54492. HTTPStatusCode: res.StatusCode,
  54493. },
  54494. }
  54495. target := &ret
  54496. if err := gensupport.DecodeResponse(target, res); err != nil {
  54497. return nil, err
  54498. }
  54499. return ret, nil
  54500. // {
  54501. // "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.",
  54502. // "httpMethod": "PATCH",
  54503. // "id": "compute.httpHealthChecks.patch",
  54504. // "parameterOrder": [
  54505. // "project",
  54506. // "httpHealthCheck"
  54507. // ],
  54508. // "parameters": {
  54509. // "httpHealthCheck": {
  54510. // "description": "Name of the HttpHealthCheck resource to patch.",
  54511. // "location": "path",
  54512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54513. // "required": true,
  54514. // "type": "string"
  54515. // },
  54516. // "project": {
  54517. // "description": "Project ID for this request.",
  54518. // "location": "path",
  54519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54520. // "required": true,
  54521. // "type": "string"
  54522. // },
  54523. // "requestId": {
  54524. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54525. // "location": "query",
  54526. // "type": "string"
  54527. // }
  54528. // },
  54529. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  54530. // "request": {
  54531. // "$ref": "HttpHealthCheck"
  54532. // },
  54533. // "response": {
  54534. // "$ref": "Operation"
  54535. // },
  54536. // "scopes": [
  54537. // "https://www.googleapis.com/auth/cloud-platform",
  54538. // "https://www.googleapis.com/auth/compute"
  54539. // ]
  54540. // }
  54541. }
  54542. // method id "compute.httpHealthChecks.testIamPermissions":
  54543. type HttpHealthChecksTestIamPermissionsCall struct {
  54544. s *Service
  54545. project string
  54546. resource string
  54547. testpermissionsrequest *TestPermissionsRequest
  54548. urlParams_ gensupport.URLParams
  54549. ctx_ context.Context
  54550. header_ http.Header
  54551. }
  54552. // TestIamPermissions: Returns permissions that a caller has on the
  54553. // specified resource.
  54554. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  54555. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54556. c.project = project
  54557. c.resource = resource
  54558. c.testpermissionsrequest = testpermissionsrequest
  54559. return c
  54560. }
  54561. // Fields allows partial responses to be retrieved. See
  54562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54563. // for more information.
  54564. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  54565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54566. return c
  54567. }
  54568. // Context sets the context to be used in this call's Do method. Any
  54569. // pending HTTP request will be aborted if the provided context is
  54570. // canceled.
  54571. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  54572. c.ctx_ = ctx
  54573. return c
  54574. }
  54575. // Header returns an http.Header that can be modified by the caller to
  54576. // add HTTP headers to the request.
  54577. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  54578. if c.header_ == nil {
  54579. c.header_ = make(http.Header)
  54580. }
  54581. return c.header_
  54582. }
  54583. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  54584. reqHeaders := make(http.Header)
  54585. for k, v := range c.header_ {
  54586. reqHeaders[k] = v
  54587. }
  54588. reqHeaders.Set("User-Agent", c.s.userAgent())
  54589. var body io.Reader = nil
  54590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  54591. if err != nil {
  54592. return nil, err
  54593. }
  54594. reqHeaders.Set("Content-Type", "application/json")
  54595. c.urlParams_.Set("alt", alt)
  54596. c.urlParams_.Set("prettyPrint", "false")
  54597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  54598. urls += "?" + c.urlParams_.Encode()
  54599. req, err := http.NewRequest("POST", urls, body)
  54600. if err != nil {
  54601. return nil, err
  54602. }
  54603. req.Header = reqHeaders
  54604. googleapi.Expand(req.URL, map[string]string{
  54605. "project": c.project,
  54606. "resource": c.resource,
  54607. })
  54608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54609. }
  54610. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  54611. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  54612. // non-2xx status code is an error. Response headers are in either
  54613. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  54614. // returned at all) in error.(*googleapi.Error).Header. Use
  54615. // googleapi.IsNotModified to check whether the returned error was
  54616. // because http.StatusNotModified was returned.
  54617. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  54618. gensupport.SetOptions(c.urlParams_, opts...)
  54619. res, err := c.doRequest("json")
  54620. if res != nil && res.StatusCode == http.StatusNotModified {
  54621. if res.Body != nil {
  54622. res.Body.Close()
  54623. }
  54624. return nil, &googleapi.Error{
  54625. Code: res.StatusCode,
  54626. Header: res.Header,
  54627. }
  54628. }
  54629. if err != nil {
  54630. return nil, err
  54631. }
  54632. defer googleapi.CloseBody(res)
  54633. if err := googleapi.CheckResponse(res); err != nil {
  54634. return nil, err
  54635. }
  54636. ret := &TestPermissionsResponse{
  54637. ServerResponse: googleapi.ServerResponse{
  54638. Header: res.Header,
  54639. HTTPStatusCode: res.StatusCode,
  54640. },
  54641. }
  54642. target := &ret
  54643. if err := gensupport.DecodeResponse(target, res); err != nil {
  54644. return nil, err
  54645. }
  54646. return ret, nil
  54647. // {
  54648. // "description": "Returns permissions that a caller has on the specified resource.",
  54649. // "httpMethod": "POST",
  54650. // "id": "compute.httpHealthChecks.testIamPermissions",
  54651. // "parameterOrder": [
  54652. // "project",
  54653. // "resource"
  54654. // ],
  54655. // "parameters": {
  54656. // "project": {
  54657. // "description": "Project ID for this request.",
  54658. // "location": "path",
  54659. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54660. // "required": true,
  54661. // "type": "string"
  54662. // },
  54663. // "resource": {
  54664. // "description": "Name or id of the resource for this request.",
  54665. // "location": "path",
  54666. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54667. // "required": true,
  54668. // "type": "string"
  54669. // }
  54670. // },
  54671. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  54672. // "request": {
  54673. // "$ref": "TestPermissionsRequest"
  54674. // },
  54675. // "response": {
  54676. // "$ref": "TestPermissionsResponse"
  54677. // },
  54678. // "scopes": [
  54679. // "https://www.googleapis.com/auth/cloud-platform",
  54680. // "https://www.googleapis.com/auth/compute",
  54681. // "https://www.googleapis.com/auth/compute.readonly"
  54682. // ]
  54683. // }
  54684. }
  54685. // method id "compute.httpHealthChecks.update":
  54686. type HttpHealthChecksUpdateCall struct {
  54687. s *Service
  54688. project string
  54689. httpHealthCheck string
  54690. httphealthcheck *HttpHealthCheck
  54691. urlParams_ gensupport.URLParams
  54692. ctx_ context.Context
  54693. header_ http.Header
  54694. }
  54695. // Update: Updates a HttpHealthCheck resource in the specified project
  54696. // using the data included in the request.
  54697. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  54698. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  54699. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54700. c.project = project
  54701. c.httpHealthCheck = httpHealthCheck
  54702. c.httphealthcheck = httphealthcheck
  54703. return c
  54704. }
  54705. // RequestId sets the optional parameter "requestId": An optional
  54706. // request ID to identify requests. Specify a unique request ID so that
  54707. // if you must retry your request, the server will know to ignore the
  54708. // request if it has already been completed.
  54709. //
  54710. // For example, consider a situation where you make an initial request
  54711. // and the request times out. If you make the request again with the
  54712. // same request ID, the server can check if original operation with the
  54713. // same request ID was received, and if so, will ignore the second
  54714. // request. This prevents clients from accidentally creating duplicate
  54715. // commitments.
  54716. //
  54717. // The request ID must be a valid UUID with the exception that zero UUID
  54718. // is not supported (00000000-0000-0000-0000-000000000000).
  54719. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  54720. c.urlParams_.Set("requestId", requestId)
  54721. return c
  54722. }
  54723. // Fields allows partial responses to be retrieved. See
  54724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54725. // for more information.
  54726. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  54727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54728. return c
  54729. }
  54730. // Context sets the context to be used in this call's Do method. Any
  54731. // pending HTTP request will be aborted if the provided context is
  54732. // canceled.
  54733. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  54734. c.ctx_ = ctx
  54735. return c
  54736. }
  54737. // Header returns an http.Header that can be modified by the caller to
  54738. // add HTTP headers to the request.
  54739. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  54740. if c.header_ == nil {
  54741. c.header_ = make(http.Header)
  54742. }
  54743. return c.header_
  54744. }
  54745. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  54746. reqHeaders := make(http.Header)
  54747. for k, v := range c.header_ {
  54748. reqHeaders[k] = v
  54749. }
  54750. reqHeaders.Set("User-Agent", c.s.userAgent())
  54751. var body io.Reader = nil
  54752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  54753. if err != nil {
  54754. return nil, err
  54755. }
  54756. reqHeaders.Set("Content-Type", "application/json")
  54757. c.urlParams_.Set("alt", alt)
  54758. c.urlParams_.Set("prettyPrint", "false")
  54759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  54760. urls += "?" + c.urlParams_.Encode()
  54761. req, err := http.NewRequest("PUT", urls, body)
  54762. if err != nil {
  54763. return nil, err
  54764. }
  54765. req.Header = reqHeaders
  54766. googleapi.Expand(req.URL, map[string]string{
  54767. "project": c.project,
  54768. "httpHealthCheck": c.httpHealthCheck,
  54769. })
  54770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54771. }
  54772. // Do executes the "compute.httpHealthChecks.update" call.
  54773. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54774. // status code is an error. Response headers are in either
  54775. // *Operation.ServerResponse.Header or (if a response was returned at
  54776. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54777. // to check whether the returned error was because
  54778. // http.StatusNotModified was returned.
  54779. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54780. gensupport.SetOptions(c.urlParams_, opts...)
  54781. res, err := c.doRequest("json")
  54782. if res != nil && res.StatusCode == http.StatusNotModified {
  54783. if res.Body != nil {
  54784. res.Body.Close()
  54785. }
  54786. return nil, &googleapi.Error{
  54787. Code: res.StatusCode,
  54788. Header: res.Header,
  54789. }
  54790. }
  54791. if err != nil {
  54792. return nil, err
  54793. }
  54794. defer googleapi.CloseBody(res)
  54795. if err := googleapi.CheckResponse(res); err != nil {
  54796. return nil, err
  54797. }
  54798. ret := &Operation{
  54799. ServerResponse: googleapi.ServerResponse{
  54800. Header: res.Header,
  54801. HTTPStatusCode: res.StatusCode,
  54802. },
  54803. }
  54804. target := &ret
  54805. if err := gensupport.DecodeResponse(target, res); err != nil {
  54806. return nil, err
  54807. }
  54808. return ret, nil
  54809. // {
  54810. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  54811. // "httpMethod": "PUT",
  54812. // "id": "compute.httpHealthChecks.update",
  54813. // "parameterOrder": [
  54814. // "project",
  54815. // "httpHealthCheck"
  54816. // ],
  54817. // "parameters": {
  54818. // "httpHealthCheck": {
  54819. // "description": "Name of the HttpHealthCheck resource to update.",
  54820. // "location": "path",
  54821. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54822. // "required": true,
  54823. // "type": "string"
  54824. // },
  54825. // "project": {
  54826. // "description": "Project ID for this request.",
  54827. // "location": "path",
  54828. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54829. // "required": true,
  54830. // "type": "string"
  54831. // },
  54832. // "requestId": {
  54833. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54834. // "location": "query",
  54835. // "type": "string"
  54836. // }
  54837. // },
  54838. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  54839. // "request": {
  54840. // "$ref": "HttpHealthCheck"
  54841. // },
  54842. // "response": {
  54843. // "$ref": "Operation"
  54844. // },
  54845. // "scopes": [
  54846. // "https://www.googleapis.com/auth/cloud-platform",
  54847. // "https://www.googleapis.com/auth/compute"
  54848. // ]
  54849. // }
  54850. }
  54851. // method id "compute.httpsHealthChecks.delete":
  54852. type HttpsHealthChecksDeleteCall struct {
  54853. s *Service
  54854. project string
  54855. httpsHealthCheck string
  54856. urlParams_ gensupport.URLParams
  54857. ctx_ context.Context
  54858. header_ http.Header
  54859. }
  54860. // Delete: Deletes the specified HttpsHealthCheck resource.
  54861. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  54862. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54863. c.project = project
  54864. c.httpsHealthCheck = httpsHealthCheck
  54865. return c
  54866. }
  54867. // RequestId sets the optional parameter "requestId": An optional
  54868. // request ID to identify requests. Specify a unique request ID so that
  54869. // if you must retry your request, the server will know to ignore the
  54870. // request if it has already been completed.
  54871. //
  54872. // For example, consider a situation where you make an initial request
  54873. // and the request times out. If you make the request again with the
  54874. // same request ID, the server can check if original operation with the
  54875. // same request ID was received, and if so, will ignore the second
  54876. // request. This prevents clients from accidentally creating duplicate
  54877. // commitments.
  54878. //
  54879. // The request ID must be a valid UUID with the exception that zero UUID
  54880. // is not supported (00000000-0000-0000-0000-000000000000).
  54881. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  54882. c.urlParams_.Set("requestId", requestId)
  54883. return c
  54884. }
  54885. // Fields allows partial responses to be retrieved. See
  54886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54887. // for more information.
  54888. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  54889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54890. return c
  54891. }
  54892. // Context sets the context to be used in this call's Do method. Any
  54893. // pending HTTP request will be aborted if the provided context is
  54894. // canceled.
  54895. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  54896. c.ctx_ = ctx
  54897. return c
  54898. }
  54899. // Header returns an http.Header that can be modified by the caller to
  54900. // add HTTP headers to the request.
  54901. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  54902. if c.header_ == nil {
  54903. c.header_ = make(http.Header)
  54904. }
  54905. return c.header_
  54906. }
  54907. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  54908. reqHeaders := make(http.Header)
  54909. for k, v := range c.header_ {
  54910. reqHeaders[k] = v
  54911. }
  54912. reqHeaders.Set("User-Agent", c.s.userAgent())
  54913. var body io.Reader = nil
  54914. c.urlParams_.Set("alt", alt)
  54915. c.urlParams_.Set("prettyPrint", "false")
  54916. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  54917. urls += "?" + c.urlParams_.Encode()
  54918. req, err := http.NewRequest("DELETE", urls, body)
  54919. if err != nil {
  54920. return nil, err
  54921. }
  54922. req.Header = reqHeaders
  54923. googleapi.Expand(req.URL, map[string]string{
  54924. "project": c.project,
  54925. "httpsHealthCheck": c.httpsHealthCheck,
  54926. })
  54927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54928. }
  54929. // Do executes the "compute.httpsHealthChecks.delete" call.
  54930. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54931. // status code is an error. Response headers are in either
  54932. // *Operation.ServerResponse.Header or (if a response was returned at
  54933. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54934. // to check whether the returned error was because
  54935. // http.StatusNotModified was returned.
  54936. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54937. gensupport.SetOptions(c.urlParams_, opts...)
  54938. res, err := c.doRequest("json")
  54939. if res != nil && res.StatusCode == http.StatusNotModified {
  54940. if res.Body != nil {
  54941. res.Body.Close()
  54942. }
  54943. return nil, &googleapi.Error{
  54944. Code: res.StatusCode,
  54945. Header: res.Header,
  54946. }
  54947. }
  54948. if err != nil {
  54949. return nil, err
  54950. }
  54951. defer googleapi.CloseBody(res)
  54952. if err := googleapi.CheckResponse(res); err != nil {
  54953. return nil, err
  54954. }
  54955. ret := &Operation{
  54956. ServerResponse: googleapi.ServerResponse{
  54957. Header: res.Header,
  54958. HTTPStatusCode: res.StatusCode,
  54959. },
  54960. }
  54961. target := &ret
  54962. if err := gensupport.DecodeResponse(target, res); err != nil {
  54963. return nil, err
  54964. }
  54965. return ret, nil
  54966. // {
  54967. // "description": "Deletes the specified HttpsHealthCheck resource.",
  54968. // "httpMethod": "DELETE",
  54969. // "id": "compute.httpsHealthChecks.delete",
  54970. // "parameterOrder": [
  54971. // "project",
  54972. // "httpsHealthCheck"
  54973. // ],
  54974. // "parameters": {
  54975. // "httpsHealthCheck": {
  54976. // "description": "Name of the HttpsHealthCheck resource to delete.",
  54977. // "location": "path",
  54978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54979. // "required": true,
  54980. // "type": "string"
  54981. // },
  54982. // "project": {
  54983. // "description": "Project ID for this request.",
  54984. // "location": "path",
  54985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54986. // "required": true,
  54987. // "type": "string"
  54988. // },
  54989. // "requestId": {
  54990. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54991. // "location": "query",
  54992. // "type": "string"
  54993. // }
  54994. // },
  54995. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  54996. // "response": {
  54997. // "$ref": "Operation"
  54998. // },
  54999. // "scopes": [
  55000. // "https://www.googleapis.com/auth/cloud-platform",
  55001. // "https://www.googleapis.com/auth/compute"
  55002. // ]
  55003. // }
  55004. }
  55005. // method id "compute.httpsHealthChecks.get":
  55006. type HttpsHealthChecksGetCall struct {
  55007. s *Service
  55008. project string
  55009. httpsHealthCheck string
  55010. urlParams_ gensupport.URLParams
  55011. ifNoneMatch_ string
  55012. ctx_ context.Context
  55013. header_ http.Header
  55014. }
  55015. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  55016. // available HTTPS health checks by making a list() request.
  55017. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  55018. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55019. c.project = project
  55020. c.httpsHealthCheck = httpsHealthCheck
  55021. return c
  55022. }
  55023. // Fields allows partial responses to be retrieved. See
  55024. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55025. // for more information.
  55026. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  55027. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55028. return c
  55029. }
  55030. // IfNoneMatch sets the optional parameter which makes the operation
  55031. // fail if the object's ETag matches the given value. This is useful for
  55032. // getting updates only after the object has changed since the last
  55033. // request. Use googleapi.IsNotModified to check whether the response
  55034. // error from Do is the result of In-None-Match.
  55035. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  55036. c.ifNoneMatch_ = entityTag
  55037. return c
  55038. }
  55039. // Context sets the context to be used in this call's Do method. Any
  55040. // pending HTTP request will be aborted if the provided context is
  55041. // canceled.
  55042. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  55043. c.ctx_ = ctx
  55044. return c
  55045. }
  55046. // Header returns an http.Header that can be modified by the caller to
  55047. // add HTTP headers to the request.
  55048. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  55049. if c.header_ == nil {
  55050. c.header_ = make(http.Header)
  55051. }
  55052. return c.header_
  55053. }
  55054. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  55055. reqHeaders := make(http.Header)
  55056. for k, v := range c.header_ {
  55057. reqHeaders[k] = v
  55058. }
  55059. reqHeaders.Set("User-Agent", c.s.userAgent())
  55060. if c.ifNoneMatch_ != "" {
  55061. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55062. }
  55063. var body io.Reader = nil
  55064. c.urlParams_.Set("alt", alt)
  55065. c.urlParams_.Set("prettyPrint", "false")
  55066. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  55067. urls += "?" + c.urlParams_.Encode()
  55068. req, err := http.NewRequest("GET", urls, body)
  55069. if err != nil {
  55070. return nil, err
  55071. }
  55072. req.Header = reqHeaders
  55073. googleapi.Expand(req.URL, map[string]string{
  55074. "project": c.project,
  55075. "httpsHealthCheck": c.httpsHealthCheck,
  55076. })
  55077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55078. }
  55079. // Do executes the "compute.httpsHealthChecks.get" call.
  55080. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  55081. // non-2xx status code is an error. Response headers are in either
  55082. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  55083. // returned at all) in error.(*googleapi.Error).Header. Use
  55084. // googleapi.IsNotModified to check whether the returned error was
  55085. // because http.StatusNotModified was returned.
  55086. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  55087. gensupport.SetOptions(c.urlParams_, opts...)
  55088. res, err := c.doRequest("json")
  55089. if res != nil && res.StatusCode == http.StatusNotModified {
  55090. if res.Body != nil {
  55091. res.Body.Close()
  55092. }
  55093. return nil, &googleapi.Error{
  55094. Code: res.StatusCode,
  55095. Header: res.Header,
  55096. }
  55097. }
  55098. if err != nil {
  55099. return nil, err
  55100. }
  55101. defer googleapi.CloseBody(res)
  55102. if err := googleapi.CheckResponse(res); err != nil {
  55103. return nil, err
  55104. }
  55105. ret := &HttpsHealthCheck{
  55106. ServerResponse: googleapi.ServerResponse{
  55107. Header: res.Header,
  55108. HTTPStatusCode: res.StatusCode,
  55109. },
  55110. }
  55111. target := &ret
  55112. if err := gensupport.DecodeResponse(target, res); err != nil {
  55113. return nil, err
  55114. }
  55115. return ret, nil
  55116. // {
  55117. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  55118. // "httpMethod": "GET",
  55119. // "id": "compute.httpsHealthChecks.get",
  55120. // "parameterOrder": [
  55121. // "project",
  55122. // "httpsHealthCheck"
  55123. // ],
  55124. // "parameters": {
  55125. // "httpsHealthCheck": {
  55126. // "description": "Name of the HttpsHealthCheck resource to return.",
  55127. // "location": "path",
  55128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55129. // "required": true,
  55130. // "type": "string"
  55131. // },
  55132. // "project": {
  55133. // "description": "Project ID for this request.",
  55134. // "location": "path",
  55135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55136. // "required": true,
  55137. // "type": "string"
  55138. // }
  55139. // },
  55140. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  55141. // "response": {
  55142. // "$ref": "HttpsHealthCheck"
  55143. // },
  55144. // "scopes": [
  55145. // "https://www.googleapis.com/auth/cloud-platform",
  55146. // "https://www.googleapis.com/auth/compute",
  55147. // "https://www.googleapis.com/auth/compute.readonly"
  55148. // ]
  55149. // }
  55150. }
  55151. // method id "compute.httpsHealthChecks.insert":
  55152. type HttpsHealthChecksInsertCall struct {
  55153. s *Service
  55154. project string
  55155. httpshealthcheck *HttpsHealthCheck
  55156. urlParams_ gensupport.URLParams
  55157. ctx_ context.Context
  55158. header_ http.Header
  55159. }
  55160. // Insert: Creates a HttpsHealthCheck resource in the specified project
  55161. // using the data included in the request.
  55162. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  55163. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55164. c.project = project
  55165. c.httpshealthcheck = httpshealthcheck
  55166. return c
  55167. }
  55168. // RequestId sets the optional parameter "requestId": An optional
  55169. // request ID to identify requests. Specify a unique request ID so that
  55170. // if you must retry your request, the server will know to ignore the
  55171. // request if it has already been completed.
  55172. //
  55173. // For example, consider a situation where you make an initial request
  55174. // and the request times out. If you make the request again with the
  55175. // same request ID, the server can check if original operation with the
  55176. // same request ID was received, and if so, will ignore the second
  55177. // request. This prevents clients from accidentally creating duplicate
  55178. // commitments.
  55179. //
  55180. // The request ID must be a valid UUID with the exception that zero UUID
  55181. // is not supported (00000000-0000-0000-0000-000000000000).
  55182. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  55183. c.urlParams_.Set("requestId", requestId)
  55184. return c
  55185. }
  55186. // Fields allows partial responses to be retrieved. See
  55187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55188. // for more information.
  55189. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  55190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55191. return c
  55192. }
  55193. // Context sets the context to be used in this call's Do method. Any
  55194. // pending HTTP request will be aborted if the provided context is
  55195. // canceled.
  55196. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  55197. c.ctx_ = ctx
  55198. return c
  55199. }
  55200. // Header returns an http.Header that can be modified by the caller to
  55201. // add HTTP headers to the request.
  55202. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  55203. if c.header_ == nil {
  55204. c.header_ = make(http.Header)
  55205. }
  55206. return c.header_
  55207. }
  55208. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  55209. reqHeaders := make(http.Header)
  55210. for k, v := range c.header_ {
  55211. reqHeaders[k] = v
  55212. }
  55213. reqHeaders.Set("User-Agent", c.s.userAgent())
  55214. var body io.Reader = nil
  55215. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  55216. if err != nil {
  55217. return nil, err
  55218. }
  55219. reqHeaders.Set("Content-Type", "application/json")
  55220. c.urlParams_.Set("alt", alt)
  55221. c.urlParams_.Set("prettyPrint", "false")
  55222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  55223. urls += "?" + c.urlParams_.Encode()
  55224. req, err := http.NewRequest("POST", urls, body)
  55225. if err != nil {
  55226. return nil, err
  55227. }
  55228. req.Header = reqHeaders
  55229. googleapi.Expand(req.URL, map[string]string{
  55230. "project": c.project,
  55231. })
  55232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55233. }
  55234. // Do executes the "compute.httpsHealthChecks.insert" call.
  55235. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55236. // status code is an error. Response headers are in either
  55237. // *Operation.ServerResponse.Header or (if a response was returned at
  55238. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55239. // to check whether the returned error was because
  55240. // http.StatusNotModified was returned.
  55241. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55242. gensupport.SetOptions(c.urlParams_, opts...)
  55243. res, err := c.doRequest("json")
  55244. if res != nil && res.StatusCode == http.StatusNotModified {
  55245. if res.Body != nil {
  55246. res.Body.Close()
  55247. }
  55248. return nil, &googleapi.Error{
  55249. Code: res.StatusCode,
  55250. Header: res.Header,
  55251. }
  55252. }
  55253. if err != nil {
  55254. return nil, err
  55255. }
  55256. defer googleapi.CloseBody(res)
  55257. if err := googleapi.CheckResponse(res); err != nil {
  55258. return nil, err
  55259. }
  55260. ret := &Operation{
  55261. ServerResponse: googleapi.ServerResponse{
  55262. Header: res.Header,
  55263. HTTPStatusCode: res.StatusCode,
  55264. },
  55265. }
  55266. target := &ret
  55267. if err := gensupport.DecodeResponse(target, res); err != nil {
  55268. return nil, err
  55269. }
  55270. return ret, nil
  55271. // {
  55272. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  55273. // "httpMethod": "POST",
  55274. // "id": "compute.httpsHealthChecks.insert",
  55275. // "parameterOrder": [
  55276. // "project"
  55277. // ],
  55278. // "parameters": {
  55279. // "project": {
  55280. // "description": "Project ID for this request.",
  55281. // "location": "path",
  55282. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55283. // "required": true,
  55284. // "type": "string"
  55285. // },
  55286. // "requestId": {
  55287. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55288. // "location": "query",
  55289. // "type": "string"
  55290. // }
  55291. // },
  55292. // "path": "{project}/global/httpsHealthChecks",
  55293. // "request": {
  55294. // "$ref": "HttpsHealthCheck"
  55295. // },
  55296. // "response": {
  55297. // "$ref": "Operation"
  55298. // },
  55299. // "scopes": [
  55300. // "https://www.googleapis.com/auth/cloud-platform",
  55301. // "https://www.googleapis.com/auth/compute"
  55302. // ]
  55303. // }
  55304. }
  55305. // method id "compute.httpsHealthChecks.list":
  55306. type HttpsHealthChecksListCall struct {
  55307. s *Service
  55308. project string
  55309. urlParams_ gensupport.URLParams
  55310. ifNoneMatch_ string
  55311. ctx_ context.Context
  55312. header_ http.Header
  55313. }
  55314. // List: Retrieves the list of HttpsHealthCheck resources available to
  55315. // the specified project.
  55316. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  55317. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55318. c.project = project
  55319. return c
  55320. }
  55321. // Filter sets the optional parameter "filter": A filter expression that
  55322. // filters resources listed in the response. The expression must specify
  55323. // the field name, a comparison operator, and the value that you want to
  55324. // use for filtering. The value must be a string, a number, or a
  55325. // boolean. The comparison operator must be either =, !=, >, or <.
  55326. //
  55327. // For example, if you are filtering Compute Engine instances, you can
  55328. // exclude instances named example-instance by specifying name !=
  55329. // example-instance.
  55330. //
  55331. // You can also filter nested fields. For example, you could specify
  55332. // scheduling.automaticRestart = false to include instances only if they
  55333. // are not scheduled for automatic restarts. You can use filtering on
  55334. // nested fields to filter based on resource labels.
  55335. //
  55336. // To filter on multiple expressions, provide each separate expression
  55337. // within parentheses. For example, (scheduling.automaticRestart = true)
  55338. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55339. // AND expression. However, you can include AND and OR expressions
  55340. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55341. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55342. // true).
  55343. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  55344. c.urlParams_.Set("filter", filter)
  55345. return c
  55346. }
  55347. // MaxResults sets the optional parameter "maxResults": The maximum
  55348. // number of results per page that should be returned. If the number of
  55349. // available results is larger than maxResults, Compute Engine returns a
  55350. // nextPageToken that can be used to get the next page of results in
  55351. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55352. // (Default: 500)
  55353. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  55354. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55355. return c
  55356. }
  55357. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55358. // a certain order. By default, results are returned in alphanumerical
  55359. // order based on the resource name.
  55360. //
  55361. // You can also sort results in descending order based on the creation
  55362. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55363. // based on the creationTimestamp field in reverse chronological order
  55364. // (newest result first). Use this to sort resources like operations so
  55365. // that the newest operation is returned first.
  55366. //
  55367. // Currently, only sorting by name or creationTimestamp desc is
  55368. // supported.
  55369. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  55370. c.urlParams_.Set("orderBy", orderBy)
  55371. return c
  55372. }
  55373. // PageToken sets the optional parameter "pageToken": Specifies a page
  55374. // token to use. Set pageToken to the nextPageToken returned by a
  55375. // previous list request to get the next page of results.
  55376. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  55377. c.urlParams_.Set("pageToken", pageToken)
  55378. return c
  55379. }
  55380. // Fields allows partial responses to be retrieved. See
  55381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55382. // for more information.
  55383. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  55384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55385. return c
  55386. }
  55387. // IfNoneMatch sets the optional parameter which makes the operation
  55388. // fail if the object's ETag matches the given value. This is useful for
  55389. // getting updates only after the object has changed since the last
  55390. // request. Use googleapi.IsNotModified to check whether the response
  55391. // error from Do is the result of In-None-Match.
  55392. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  55393. c.ifNoneMatch_ = entityTag
  55394. return c
  55395. }
  55396. // Context sets the context to be used in this call's Do method. Any
  55397. // pending HTTP request will be aborted if the provided context is
  55398. // canceled.
  55399. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  55400. c.ctx_ = ctx
  55401. return c
  55402. }
  55403. // Header returns an http.Header that can be modified by the caller to
  55404. // add HTTP headers to the request.
  55405. func (c *HttpsHealthChecksListCall) Header() http.Header {
  55406. if c.header_ == nil {
  55407. c.header_ = make(http.Header)
  55408. }
  55409. return c.header_
  55410. }
  55411. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  55412. reqHeaders := make(http.Header)
  55413. for k, v := range c.header_ {
  55414. reqHeaders[k] = v
  55415. }
  55416. reqHeaders.Set("User-Agent", c.s.userAgent())
  55417. if c.ifNoneMatch_ != "" {
  55418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55419. }
  55420. var body io.Reader = nil
  55421. c.urlParams_.Set("alt", alt)
  55422. c.urlParams_.Set("prettyPrint", "false")
  55423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  55424. urls += "?" + c.urlParams_.Encode()
  55425. req, err := http.NewRequest("GET", urls, body)
  55426. if err != nil {
  55427. return nil, err
  55428. }
  55429. req.Header = reqHeaders
  55430. googleapi.Expand(req.URL, map[string]string{
  55431. "project": c.project,
  55432. })
  55433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55434. }
  55435. // Do executes the "compute.httpsHealthChecks.list" call.
  55436. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  55437. // non-2xx status code is an error. Response headers are in either
  55438. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  55439. // returned at all) in error.(*googleapi.Error).Header. Use
  55440. // googleapi.IsNotModified to check whether the returned error was
  55441. // because http.StatusNotModified was returned.
  55442. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  55443. gensupport.SetOptions(c.urlParams_, opts...)
  55444. res, err := c.doRequest("json")
  55445. if res != nil && res.StatusCode == http.StatusNotModified {
  55446. if res.Body != nil {
  55447. res.Body.Close()
  55448. }
  55449. return nil, &googleapi.Error{
  55450. Code: res.StatusCode,
  55451. Header: res.Header,
  55452. }
  55453. }
  55454. if err != nil {
  55455. return nil, err
  55456. }
  55457. defer googleapi.CloseBody(res)
  55458. if err := googleapi.CheckResponse(res); err != nil {
  55459. return nil, err
  55460. }
  55461. ret := &HttpsHealthCheckList{
  55462. ServerResponse: googleapi.ServerResponse{
  55463. Header: res.Header,
  55464. HTTPStatusCode: res.StatusCode,
  55465. },
  55466. }
  55467. target := &ret
  55468. if err := gensupport.DecodeResponse(target, res); err != nil {
  55469. return nil, err
  55470. }
  55471. return ret, nil
  55472. // {
  55473. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  55474. // "httpMethod": "GET",
  55475. // "id": "compute.httpsHealthChecks.list",
  55476. // "parameterOrder": [
  55477. // "project"
  55478. // ],
  55479. // "parameters": {
  55480. // "filter": {
  55481. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55482. // "location": "query",
  55483. // "type": "string"
  55484. // },
  55485. // "maxResults": {
  55486. // "default": "500",
  55487. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55488. // "format": "uint32",
  55489. // "location": "query",
  55490. // "minimum": "0",
  55491. // "type": "integer"
  55492. // },
  55493. // "orderBy": {
  55494. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55495. // "location": "query",
  55496. // "type": "string"
  55497. // },
  55498. // "pageToken": {
  55499. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55500. // "location": "query",
  55501. // "type": "string"
  55502. // },
  55503. // "project": {
  55504. // "description": "Project ID for this request.",
  55505. // "location": "path",
  55506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55507. // "required": true,
  55508. // "type": "string"
  55509. // }
  55510. // },
  55511. // "path": "{project}/global/httpsHealthChecks",
  55512. // "response": {
  55513. // "$ref": "HttpsHealthCheckList"
  55514. // },
  55515. // "scopes": [
  55516. // "https://www.googleapis.com/auth/cloud-platform",
  55517. // "https://www.googleapis.com/auth/compute",
  55518. // "https://www.googleapis.com/auth/compute.readonly"
  55519. // ]
  55520. // }
  55521. }
  55522. // Pages invokes f for each page of results.
  55523. // A non-nil error returned from f will halt the iteration.
  55524. // The provided context supersedes any context provided to the Context method.
  55525. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  55526. c.ctx_ = ctx
  55527. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55528. for {
  55529. x, err := c.Do()
  55530. if err != nil {
  55531. return err
  55532. }
  55533. if err := f(x); err != nil {
  55534. return err
  55535. }
  55536. if x.NextPageToken == "" {
  55537. return nil
  55538. }
  55539. c.PageToken(x.NextPageToken)
  55540. }
  55541. }
  55542. // method id "compute.httpsHealthChecks.patch":
  55543. type HttpsHealthChecksPatchCall struct {
  55544. s *Service
  55545. project string
  55546. httpsHealthCheck string
  55547. httpshealthcheck *HttpsHealthCheck
  55548. urlParams_ gensupport.URLParams
  55549. ctx_ context.Context
  55550. header_ http.Header
  55551. }
  55552. // Patch: Updates a HttpsHealthCheck resource in the specified project
  55553. // using the data included in the request. This method supports PATCH
  55554. // semantics and uses the JSON merge patch format and processing rules.
  55555. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  55556. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55557. c.project = project
  55558. c.httpsHealthCheck = httpsHealthCheck
  55559. c.httpshealthcheck = httpshealthcheck
  55560. return c
  55561. }
  55562. // RequestId sets the optional parameter "requestId": An optional
  55563. // request ID to identify requests. Specify a unique request ID so that
  55564. // if you must retry your request, the server will know to ignore the
  55565. // request if it has already been completed.
  55566. //
  55567. // For example, consider a situation where you make an initial request
  55568. // and the request times out. If you make the request again with the
  55569. // same request ID, the server can check if original operation with the
  55570. // same request ID was received, and if so, will ignore the second
  55571. // request. This prevents clients from accidentally creating duplicate
  55572. // commitments.
  55573. //
  55574. // The request ID must be a valid UUID with the exception that zero UUID
  55575. // is not supported (00000000-0000-0000-0000-000000000000).
  55576. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  55577. c.urlParams_.Set("requestId", requestId)
  55578. return c
  55579. }
  55580. // Fields allows partial responses to be retrieved. See
  55581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55582. // for more information.
  55583. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  55584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55585. return c
  55586. }
  55587. // Context sets the context to be used in this call's Do method. Any
  55588. // pending HTTP request will be aborted if the provided context is
  55589. // canceled.
  55590. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  55591. c.ctx_ = ctx
  55592. return c
  55593. }
  55594. // Header returns an http.Header that can be modified by the caller to
  55595. // add HTTP headers to the request.
  55596. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  55597. if c.header_ == nil {
  55598. c.header_ = make(http.Header)
  55599. }
  55600. return c.header_
  55601. }
  55602. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  55603. reqHeaders := make(http.Header)
  55604. for k, v := range c.header_ {
  55605. reqHeaders[k] = v
  55606. }
  55607. reqHeaders.Set("User-Agent", c.s.userAgent())
  55608. var body io.Reader = nil
  55609. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  55610. if err != nil {
  55611. return nil, err
  55612. }
  55613. reqHeaders.Set("Content-Type", "application/json")
  55614. c.urlParams_.Set("alt", alt)
  55615. c.urlParams_.Set("prettyPrint", "false")
  55616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  55617. urls += "?" + c.urlParams_.Encode()
  55618. req, err := http.NewRequest("PATCH", urls, body)
  55619. if err != nil {
  55620. return nil, err
  55621. }
  55622. req.Header = reqHeaders
  55623. googleapi.Expand(req.URL, map[string]string{
  55624. "project": c.project,
  55625. "httpsHealthCheck": c.httpsHealthCheck,
  55626. })
  55627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55628. }
  55629. // Do executes the "compute.httpsHealthChecks.patch" call.
  55630. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55631. // status code is an error. Response headers are in either
  55632. // *Operation.ServerResponse.Header or (if a response was returned at
  55633. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55634. // to check whether the returned error was because
  55635. // http.StatusNotModified was returned.
  55636. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55637. gensupport.SetOptions(c.urlParams_, opts...)
  55638. res, err := c.doRequest("json")
  55639. if res != nil && res.StatusCode == http.StatusNotModified {
  55640. if res.Body != nil {
  55641. res.Body.Close()
  55642. }
  55643. return nil, &googleapi.Error{
  55644. Code: res.StatusCode,
  55645. Header: res.Header,
  55646. }
  55647. }
  55648. if err != nil {
  55649. return nil, err
  55650. }
  55651. defer googleapi.CloseBody(res)
  55652. if err := googleapi.CheckResponse(res); err != nil {
  55653. return nil, err
  55654. }
  55655. ret := &Operation{
  55656. ServerResponse: googleapi.ServerResponse{
  55657. Header: res.Header,
  55658. HTTPStatusCode: res.StatusCode,
  55659. },
  55660. }
  55661. target := &ret
  55662. if err := gensupport.DecodeResponse(target, res); err != nil {
  55663. return nil, err
  55664. }
  55665. return ret, nil
  55666. // {
  55667. // "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.",
  55668. // "httpMethod": "PATCH",
  55669. // "id": "compute.httpsHealthChecks.patch",
  55670. // "parameterOrder": [
  55671. // "project",
  55672. // "httpsHealthCheck"
  55673. // ],
  55674. // "parameters": {
  55675. // "httpsHealthCheck": {
  55676. // "description": "Name of the HttpsHealthCheck resource to patch.",
  55677. // "location": "path",
  55678. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55679. // "required": true,
  55680. // "type": "string"
  55681. // },
  55682. // "project": {
  55683. // "description": "Project ID for this request.",
  55684. // "location": "path",
  55685. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55686. // "required": true,
  55687. // "type": "string"
  55688. // },
  55689. // "requestId": {
  55690. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55691. // "location": "query",
  55692. // "type": "string"
  55693. // }
  55694. // },
  55695. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  55696. // "request": {
  55697. // "$ref": "HttpsHealthCheck"
  55698. // },
  55699. // "response": {
  55700. // "$ref": "Operation"
  55701. // },
  55702. // "scopes": [
  55703. // "https://www.googleapis.com/auth/cloud-platform",
  55704. // "https://www.googleapis.com/auth/compute"
  55705. // ]
  55706. // }
  55707. }
  55708. // method id "compute.httpsHealthChecks.testIamPermissions":
  55709. type HttpsHealthChecksTestIamPermissionsCall struct {
  55710. s *Service
  55711. project string
  55712. resource string
  55713. testpermissionsrequest *TestPermissionsRequest
  55714. urlParams_ gensupport.URLParams
  55715. ctx_ context.Context
  55716. header_ http.Header
  55717. }
  55718. // TestIamPermissions: Returns permissions that a caller has on the
  55719. // specified resource.
  55720. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  55721. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55722. c.project = project
  55723. c.resource = resource
  55724. c.testpermissionsrequest = testpermissionsrequest
  55725. return c
  55726. }
  55727. // Fields allows partial responses to be retrieved. See
  55728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55729. // for more information.
  55730. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  55731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55732. return c
  55733. }
  55734. // Context sets the context to be used in this call's Do method. Any
  55735. // pending HTTP request will be aborted if the provided context is
  55736. // canceled.
  55737. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  55738. c.ctx_ = ctx
  55739. return c
  55740. }
  55741. // Header returns an http.Header that can be modified by the caller to
  55742. // add HTTP headers to the request.
  55743. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  55744. if c.header_ == nil {
  55745. c.header_ = make(http.Header)
  55746. }
  55747. return c.header_
  55748. }
  55749. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  55750. reqHeaders := make(http.Header)
  55751. for k, v := range c.header_ {
  55752. reqHeaders[k] = v
  55753. }
  55754. reqHeaders.Set("User-Agent", c.s.userAgent())
  55755. var body io.Reader = nil
  55756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  55757. if err != nil {
  55758. return nil, err
  55759. }
  55760. reqHeaders.Set("Content-Type", "application/json")
  55761. c.urlParams_.Set("alt", alt)
  55762. c.urlParams_.Set("prettyPrint", "false")
  55763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  55764. urls += "?" + c.urlParams_.Encode()
  55765. req, err := http.NewRequest("POST", urls, body)
  55766. if err != nil {
  55767. return nil, err
  55768. }
  55769. req.Header = reqHeaders
  55770. googleapi.Expand(req.URL, map[string]string{
  55771. "project": c.project,
  55772. "resource": c.resource,
  55773. })
  55774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55775. }
  55776. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  55777. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  55778. // non-2xx status code is an error. Response headers are in either
  55779. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  55780. // returned at all) in error.(*googleapi.Error).Header. Use
  55781. // googleapi.IsNotModified to check whether the returned error was
  55782. // because http.StatusNotModified was returned.
  55783. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  55784. gensupport.SetOptions(c.urlParams_, opts...)
  55785. res, err := c.doRequest("json")
  55786. if res != nil && res.StatusCode == http.StatusNotModified {
  55787. if res.Body != nil {
  55788. res.Body.Close()
  55789. }
  55790. return nil, &googleapi.Error{
  55791. Code: res.StatusCode,
  55792. Header: res.Header,
  55793. }
  55794. }
  55795. if err != nil {
  55796. return nil, err
  55797. }
  55798. defer googleapi.CloseBody(res)
  55799. if err := googleapi.CheckResponse(res); err != nil {
  55800. return nil, err
  55801. }
  55802. ret := &TestPermissionsResponse{
  55803. ServerResponse: googleapi.ServerResponse{
  55804. Header: res.Header,
  55805. HTTPStatusCode: res.StatusCode,
  55806. },
  55807. }
  55808. target := &ret
  55809. if err := gensupport.DecodeResponse(target, res); err != nil {
  55810. return nil, err
  55811. }
  55812. return ret, nil
  55813. // {
  55814. // "description": "Returns permissions that a caller has on the specified resource.",
  55815. // "httpMethod": "POST",
  55816. // "id": "compute.httpsHealthChecks.testIamPermissions",
  55817. // "parameterOrder": [
  55818. // "project",
  55819. // "resource"
  55820. // ],
  55821. // "parameters": {
  55822. // "project": {
  55823. // "description": "Project ID for this request.",
  55824. // "location": "path",
  55825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55826. // "required": true,
  55827. // "type": "string"
  55828. // },
  55829. // "resource": {
  55830. // "description": "Name or id of the resource for this request.",
  55831. // "location": "path",
  55832. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55833. // "required": true,
  55834. // "type": "string"
  55835. // }
  55836. // },
  55837. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  55838. // "request": {
  55839. // "$ref": "TestPermissionsRequest"
  55840. // },
  55841. // "response": {
  55842. // "$ref": "TestPermissionsResponse"
  55843. // },
  55844. // "scopes": [
  55845. // "https://www.googleapis.com/auth/cloud-platform",
  55846. // "https://www.googleapis.com/auth/compute",
  55847. // "https://www.googleapis.com/auth/compute.readonly"
  55848. // ]
  55849. // }
  55850. }
  55851. // method id "compute.httpsHealthChecks.update":
  55852. type HttpsHealthChecksUpdateCall struct {
  55853. s *Service
  55854. project string
  55855. httpsHealthCheck string
  55856. httpshealthcheck *HttpsHealthCheck
  55857. urlParams_ gensupport.URLParams
  55858. ctx_ context.Context
  55859. header_ http.Header
  55860. }
  55861. // Update: Updates a HttpsHealthCheck resource in the specified project
  55862. // using the data included in the request.
  55863. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  55864. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55865. c.project = project
  55866. c.httpsHealthCheck = httpsHealthCheck
  55867. c.httpshealthcheck = httpshealthcheck
  55868. return c
  55869. }
  55870. // RequestId sets the optional parameter "requestId": An optional
  55871. // request ID to identify requests. Specify a unique request ID so that
  55872. // if you must retry your request, the server will know to ignore the
  55873. // request if it has already been completed.
  55874. //
  55875. // For example, consider a situation where you make an initial request
  55876. // and the request times out. If you make the request again with the
  55877. // same request ID, the server can check if original operation with the
  55878. // same request ID was received, and if so, will ignore the second
  55879. // request. This prevents clients from accidentally creating duplicate
  55880. // commitments.
  55881. //
  55882. // The request ID must be a valid UUID with the exception that zero UUID
  55883. // is not supported (00000000-0000-0000-0000-000000000000).
  55884. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  55885. c.urlParams_.Set("requestId", requestId)
  55886. return c
  55887. }
  55888. // Fields allows partial responses to be retrieved. See
  55889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55890. // for more information.
  55891. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  55892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55893. return c
  55894. }
  55895. // Context sets the context to be used in this call's Do method. Any
  55896. // pending HTTP request will be aborted if the provided context is
  55897. // canceled.
  55898. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  55899. c.ctx_ = ctx
  55900. return c
  55901. }
  55902. // Header returns an http.Header that can be modified by the caller to
  55903. // add HTTP headers to the request.
  55904. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  55905. if c.header_ == nil {
  55906. c.header_ = make(http.Header)
  55907. }
  55908. return c.header_
  55909. }
  55910. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  55911. reqHeaders := make(http.Header)
  55912. for k, v := range c.header_ {
  55913. reqHeaders[k] = v
  55914. }
  55915. reqHeaders.Set("User-Agent", c.s.userAgent())
  55916. var body io.Reader = nil
  55917. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  55918. if err != nil {
  55919. return nil, err
  55920. }
  55921. reqHeaders.Set("Content-Type", "application/json")
  55922. c.urlParams_.Set("alt", alt)
  55923. c.urlParams_.Set("prettyPrint", "false")
  55924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  55925. urls += "?" + c.urlParams_.Encode()
  55926. req, err := http.NewRequest("PUT", urls, body)
  55927. if err != nil {
  55928. return nil, err
  55929. }
  55930. req.Header = reqHeaders
  55931. googleapi.Expand(req.URL, map[string]string{
  55932. "project": c.project,
  55933. "httpsHealthCheck": c.httpsHealthCheck,
  55934. })
  55935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55936. }
  55937. // Do executes the "compute.httpsHealthChecks.update" call.
  55938. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55939. // status code is an error. Response headers are in either
  55940. // *Operation.ServerResponse.Header or (if a response was returned at
  55941. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55942. // to check whether the returned error was because
  55943. // http.StatusNotModified was returned.
  55944. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55945. gensupport.SetOptions(c.urlParams_, opts...)
  55946. res, err := c.doRequest("json")
  55947. if res != nil && res.StatusCode == http.StatusNotModified {
  55948. if res.Body != nil {
  55949. res.Body.Close()
  55950. }
  55951. return nil, &googleapi.Error{
  55952. Code: res.StatusCode,
  55953. Header: res.Header,
  55954. }
  55955. }
  55956. if err != nil {
  55957. return nil, err
  55958. }
  55959. defer googleapi.CloseBody(res)
  55960. if err := googleapi.CheckResponse(res); err != nil {
  55961. return nil, err
  55962. }
  55963. ret := &Operation{
  55964. ServerResponse: googleapi.ServerResponse{
  55965. Header: res.Header,
  55966. HTTPStatusCode: res.StatusCode,
  55967. },
  55968. }
  55969. target := &ret
  55970. if err := gensupport.DecodeResponse(target, res); err != nil {
  55971. return nil, err
  55972. }
  55973. return ret, nil
  55974. // {
  55975. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  55976. // "httpMethod": "PUT",
  55977. // "id": "compute.httpsHealthChecks.update",
  55978. // "parameterOrder": [
  55979. // "project",
  55980. // "httpsHealthCheck"
  55981. // ],
  55982. // "parameters": {
  55983. // "httpsHealthCheck": {
  55984. // "description": "Name of the HttpsHealthCheck resource to update.",
  55985. // "location": "path",
  55986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55987. // "required": true,
  55988. // "type": "string"
  55989. // },
  55990. // "project": {
  55991. // "description": "Project ID for this request.",
  55992. // "location": "path",
  55993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55994. // "required": true,
  55995. // "type": "string"
  55996. // },
  55997. // "requestId": {
  55998. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55999. // "location": "query",
  56000. // "type": "string"
  56001. // }
  56002. // },
  56003. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  56004. // "request": {
  56005. // "$ref": "HttpsHealthCheck"
  56006. // },
  56007. // "response": {
  56008. // "$ref": "Operation"
  56009. // },
  56010. // "scopes": [
  56011. // "https://www.googleapis.com/auth/cloud-platform",
  56012. // "https://www.googleapis.com/auth/compute"
  56013. // ]
  56014. // }
  56015. }
  56016. // method id "compute.images.delete":
  56017. type ImagesDeleteCall struct {
  56018. s *Service
  56019. project string
  56020. image string
  56021. urlParams_ gensupport.URLParams
  56022. ctx_ context.Context
  56023. header_ http.Header
  56024. }
  56025. // Delete: Deletes the specified image.
  56026. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  56027. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  56028. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56029. c.project = project
  56030. c.image = image
  56031. return c
  56032. }
  56033. // RequestId sets the optional parameter "requestId": An optional
  56034. // request ID to identify requests. Specify a unique request ID so that
  56035. // if you must retry your request, the server will know to ignore the
  56036. // request if it has already been completed.
  56037. //
  56038. // For example, consider a situation where you make an initial request
  56039. // and the request times out. If you make the request again with the
  56040. // same request ID, the server can check if original operation with the
  56041. // same request ID was received, and if so, will ignore the second
  56042. // request. This prevents clients from accidentally creating duplicate
  56043. // commitments.
  56044. //
  56045. // The request ID must be a valid UUID with the exception that zero UUID
  56046. // is not supported (00000000-0000-0000-0000-000000000000).
  56047. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  56048. c.urlParams_.Set("requestId", requestId)
  56049. return c
  56050. }
  56051. // Fields allows partial responses to be retrieved. See
  56052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56053. // for more information.
  56054. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  56055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56056. return c
  56057. }
  56058. // Context sets the context to be used in this call's Do method. Any
  56059. // pending HTTP request will be aborted if the provided context is
  56060. // canceled.
  56061. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  56062. c.ctx_ = ctx
  56063. return c
  56064. }
  56065. // Header returns an http.Header that can be modified by the caller to
  56066. // add HTTP headers to the request.
  56067. func (c *ImagesDeleteCall) Header() http.Header {
  56068. if c.header_ == nil {
  56069. c.header_ = make(http.Header)
  56070. }
  56071. return c.header_
  56072. }
  56073. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  56074. reqHeaders := make(http.Header)
  56075. for k, v := range c.header_ {
  56076. reqHeaders[k] = v
  56077. }
  56078. reqHeaders.Set("User-Agent", c.s.userAgent())
  56079. var body io.Reader = nil
  56080. c.urlParams_.Set("alt", alt)
  56081. c.urlParams_.Set("prettyPrint", "false")
  56082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  56083. urls += "?" + c.urlParams_.Encode()
  56084. req, err := http.NewRequest("DELETE", urls, body)
  56085. if err != nil {
  56086. return nil, err
  56087. }
  56088. req.Header = reqHeaders
  56089. googleapi.Expand(req.URL, map[string]string{
  56090. "project": c.project,
  56091. "image": c.image,
  56092. })
  56093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56094. }
  56095. // Do executes the "compute.images.delete" call.
  56096. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56097. // status code is an error. Response headers are in either
  56098. // *Operation.ServerResponse.Header or (if a response was returned at
  56099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56100. // to check whether the returned error was because
  56101. // http.StatusNotModified was returned.
  56102. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56103. gensupport.SetOptions(c.urlParams_, opts...)
  56104. res, err := c.doRequest("json")
  56105. if res != nil && res.StatusCode == http.StatusNotModified {
  56106. if res.Body != nil {
  56107. res.Body.Close()
  56108. }
  56109. return nil, &googleapi.Error{
  56110. Code: res.StatusCode,
  56111. Header: res.Header,
  56112. }
  56113. }
  56114. if err != nil {
  56115. return nil, err
  56116. }
  56117. defer googleapi.CloseBody(res)
  56118. if err := googleapi.CheckResponse(res); err != nil {
  56119. return nil, err
  56120. }
  56121. ret := &Operation{
  56122. ServerResponse: googleapi.ServerResponse{
  56123. Header: res.Header,
  56124. HTTPStatusCode: res.StatusCode,
  56125. },
  56126. }
  56127. target := &ret
  56128. if err := gensupport.DecodeResponse(target, res); err != nil {
  56129. return nil, err
  56130. }
  56131. return ret, nil
  56132. // {
  56133. // "description": "Deletes the specified image.",
  56134. // "httpMethod": "DELETE",
  56135. // "id": "compute.images.delete",
  56136. // "parameterOrder": [
  56137. // "project",
  56138. // "image"
  56139. // ],
  56140. // "parameters": {
  56141. // "image": {
  56142. // "description": "Name of the image resource to delete.",
  56143. // "location": "path",
  56144. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56145. // "required": true,
  56146. // "type": "string"
  56147. // },
  56148. // "project": {
  56149. // "description": "Project ID for this request.",
  56150. // "location": "path",
  56151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56152. // "required": true,
  56153. // "type": "string"
  56154. // },
  56155. // "requestId": {
  56156. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56157. // "location": "query",
  56158. // "type": "string"
  56159. // }
  56160. // },
  56161. // "path": "{project}/global/images/{image}",
  56162. // "response": {
  56163. // "$ref": "Operation"
  56164. // },
  56165. // "scopes": [
  56166. // "https://www.googleapis.com/auth/cloud-platform",
  56167. // "https://www.googleapis.com/auth/compute"
  56168. // ]
  56169. // }
  56170. }
  56171. // method id "compute.images.deprecate":
  56172. type ImagesDeprecateCall struct {
  56173. s *Service
  56174. project string
  56175. image string
  56176. deprecationstatus *DeprecationStatus
  56177. urlParams_ gensupport.URLParams
  56178. ctx_ context.Context
  56179. header_ http.Header
  56180. }
  56181. // Deprecate: Sets the deprecation status of an image.
  56182. //
  56183. // If an empty request body is given, clears the deprecation status
  56184. // instead.
  56185. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  56186. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  56187. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56188. c.project = project
  56189. c.image = image
  56190. c.deprecationstatus = deprecationstatus
  56191. return c
  56192. }
  56193. // RequestId sets the optional parameter "requestId": An optional
  56194. // request ID to identify requests. Specify a unique request ID so that
  56195. // if you must retry your request, the server will know to ignore the
  56196. // request if it has already been completed.
  56197. //
  56198. // For example, consider a situation where you make an initial request
  56199. // and the request times out. If you make the request again with the
  56200. // same request ID, the server can check if original operation with the
  56201. // same request ID was received, and if so, will ignore the second
  56202. // request. This prevents clients from accidentally creating duplicate
  56203. // commitments.
  56204. //
  56205. // The request ID must be a valid UUID with the exception that zero UUID
  56206. // is not supported (00000000-0000-0000-0000-000000000000).
  56207. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  56208. c.urlParams_.Set("requestId", requestId)
  56209. return c
  56210. }
  56211. // Fields allows partial responses to be retrieved. See
  56212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56213. // for more information.
  56214. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  56215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56216. return c
  56217. }
  56218. // Context sets the context to be used in this call's Do method. Any
  56219. // pending HTTP request will be aborted if the provided context is
  56220. // canceled.
  56221. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  56222. c.ctx_ = ctx
  56223. return c
  56224. }
  56225. // Header returns an http.Header that can be modified by the caller to
  56226. // add HTTP headers to the request.
  56227. func (c *ImagesDeprecateCall) Header() http.Header {
  56228. if c.header_ == nil {
  56229. c.header_ = make(http.Header)
  56230. }
  56231. return c.header_
  56232. }
  56233. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  56234. reqHeaders := make(http.Header)
  56235. for k, v := range c.header_ {
  56236. reqHeaders[k] = v
  56237. }
  56238. reqHeaders.Set("User-Agent", c.s.userAgent())
  56239. var body io.Reader = nil
  56240. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  56241. if err != nil {
  56242. return nil, err
  56243. }
  56244. reqHeaders.Set("Content-Type", "application/json")
  56245. c.urlParams_.Set("alt", alt)
  56246. c.urlParams_.Set("prettyPrint", "false")
  56247. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  56248. urls += "?" + c.urlParams_.Encode()
  56249. req, err := http.NewRequest("POST", urls, body)
  56250. if err != nil {
  56251. return nil, err
  56252. }
  56253. req.Header = reqHeaders
  56254. googleapi.Expand(req.URL, map[string]string{
  56255. "project": c.project,
  56256. "image": c.image,
  56257. })
  56258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56259. }
  56260. // Do executes the "compute.images.deprecate" call.
  56261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56262. // status code is an error. Response headers are in either
  56263. // *Operation.ServerResponse.Header or (if a response was returned at
  56264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56265. // to check whether the returned error was because
  56266. // http.StatusNotModified was returned.
  56267. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56268. gensupport.SetOptions(c.urlParams_, opts...)
  56269. res, err := c.doRequest("json")
  56270. if res != nil && res.StatusCode == http.StatusNotModified {
  56271. if res.Body != nil {
  56272. res.Body.Close()
  56273. }
  56274. return nil, &googleapi.Error{
  56275. Code: res.StatusCode,
  56276. Header: res.Header,
  56277. }
  56278. }
  56279. if err != nil {
  56280. return nil, err
  56281. }
  56282. defer googleapi.CloseBody(res)
  56283. if err := googleapi.CheckResponse(res); err != nil {
  56284. return nil, err
  56285. }
  56286. ret := &Operation{
  56287. ServerResponse: googleapi.ServerResponse{
  56288. Header: res.Header,
  56289. HTTPStatusCode: res.StatusCode,
  56290. },
  56291. }
  56292. target := &ret
  56293. if err := gensupport.DecodeResponse(target, res); err != nil {
  56294. return nil, err
  56295. }
  56296. return ret, nil
  56297. // {
  56298. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  56299. // "httpMethod": "POST",
  56300. // "id": "compute.images.deprecate",
  56301. // "parameterOrder": [
  56302. // "project",
  56303. // "image"
  56304. // ],
  56305. // "parameters": {
  56306. // "image": {
  56307. // "description": "Image name.",
  56308. // "location": "path",
  56309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56310. // "required": true,
  56311. // "type": "string"
  56312. // },
  56313. // "project": {
  56314. // "description": "Project ID for this request.",
  56315. // "location": "path",
  56316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56317. // "required": true,
  56318. // "type": "string"
  56319. // },
  56320. // "requestId": {
  56321. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56322. // "location": "query",
  56323. // "type": "string"
  56324. // }
  56325. // },
  56326. // "path": "{project}/global/images/{image}/deprecate",
  56327. // "request": {
  56328. // "$ref": "DeprecationStatus"
  56329. // },
  56330. // "response": {
  56331. // "$ref": "Operation"
  56332. // },
  56333. // "scopes": [
  56334. // "https://www.googleapis.com/auth/cloud-platform",
  56335. // "https://www.googleapis.com/auth/compute"
  56336. // ]
  56337. // }
  56338. }
  56339. // method id "compute.images.get":
  56340. type ImagesGetCall struct {
  56341. s *Service
  56342. project string
  56343. image string
  56344. urlParams_ gensupport.URLParams
  56345. ifNoneMatch_ string
  56346. ctx_ context.Context
  56347. header_ http.Header
  56348. }
  56349. // Get: Returns the specified image. Gets a list of available images by
  56350. // making a list() request.
  56351. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  56352. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  56353. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56354. c.project = project
  56355. c.image = image
  56356. return c
  56357. }
  56358. // Fields allows partial responses to be retrieved. See
  56359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56360. // for more information.
  56361. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  56362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56363. return c
  56364. }
  56365. // IfNoneMatch sets the optional parameter which makes the operation
  56366. // fail if the object's ETag matches the given value. This is useful for
  56367. // getting updates only after the object has changed since the last
  56368. // request. Use googleapi.IsNotModified to check whether the response
  56369. // error from Do is the result of In-None-Match.
  56370. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  56371. c.ifNoneMatch_ = entityTag
  56372. return c
  56373. }
  56374. // Context sets the context to be used in this call's Do method. Any
  56375. // pending HTTP request will be aborted if the provided context is
  56376. // canceled.
  56377. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  56378. c.ctx_ = ctx
  56379. return c
  56380. }
  56381. // Header returns an http.Header that can be modified by the caller to
  56382. // add HTTP headers to the request.
  56383. func (c *ImagesGetCall) Header() http.Header {
  56384. if c.header_ == nil {
  56385. c.header_ = make(http.Header)
  56386. }
  56387. return c.header_
  56388. }
  56389. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  56390. reqHeaders := make(http.Header)
  56391. for k, v := range c.header_ {
  56392. reqHeaders[k] = v
  56393. }
  56394. reqHeaders.Set("User-Agent", c.s.userAgent())
  56395. if c.ifNoneMatch_ != "" {
  56396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56397. }
  56398. var body io.Reader = nil
  56399. c.urlParams_.Set("alt", alt)
  56400. c.urlParams_.Set("prettyPrint", "false")
  56401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  56402. urls += "?" + c.urlParams_.Encode()
  56403. req, err := http.NewRequest("GET", urls, body)
  56404. if err != nil {
  56405. return nil, err
  56406. }
  56407. req.Header = reqHeaders
  56408. googleapi.Expand(req.URL, map[string]string{
  56409. "project": c.project,
  56410. "image": c.image,
  56411. })
  56412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56413. }
  56414. // Do executes the "compute.images.get" call.
  56415. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  56416. // code is an error. Response headers are in either
  56417. // *Image.ServerResponse.Header or (if a response was returned at all)
  56418. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  56419. // check whether the returned error was because http.StatusNotModified
  56420. // was returned.
  56421. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  56422. gensupport.SetOptions(c.urlParams_, opts...)
  56423. res, err := c.doRequest("json")
  56424. if res != nil && res.StatusCode == http.StatusNotModified {
  56425. if res.Body != nil {
  56426. res.Body.Close()
  56427. }
  56428. return nil, &googleapi.Error{
  56429. Code: res.StatusCode,
  56430. Header: res.Header,
  56431. }
  56432. }
  56433. if err != nil {
  56434. return nil, err
  56435. }
  56436. defer googleapi.CloseBody(res)
  56437. if err := googleapi.CheckResponse(res); err != nil {
  56438. return nil, err
  56439. }
  56440. ret := &Image{
  56441. ServerResponse: googleapi.ServerResponse{
  56442. Header: res.Header,
  56443. HTTPStatusCode: res.StatusCode,
  56444. },
  56445. }
  56446. target := &ret
  56447. if err := gensupport.DecodeResponse(target, res); err != nil {
  56448. return nil, err
  56449. }
  56450. return ret, nil
  56451. // {
  56452. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  56453. // "httpMethod": "GET",
  56454. // "id": "compute.images.get",
  56455. // "parameterOrder": [
  56456. // "project",
  56457. // "image"
  56458. // ],
  56459. // "parameters": {
  56460. // "image": {
  56461. // "description": "Name of the image resource to return.",
  56462. // "location": "path",
  56463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56464. // "required": true,
  56465. // "type": "string"
  56466. // },
  56467. // "project": {
  56468. // "description": "Project ID for this request.",
  56469. // "location": "path",
  56470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56471. // "required": true,
  56472. // "type": "string"
  56473. // }
  56474. // },
  56475. // "path": "{project}/global/images/{image}",
  56476. // "response": {
  56477. // "$ref": "Image"
  56478. // },
  56479. // "scopes": [
  56480. // "https://www.googleapis.com/auth/cloud-platform",
  56481. // "https://www.googleapis.com/auth/compute",
  56482. // "https://www.googleapis.com/auth/compute.readonly"
  56483. // ]
  56484. // }
  56485. }
  56486. // method id "compute.images.getFromFamily":
  56487. type ImagesGetFromFamilyCall struct {
  56488. s *Service
  56489. project string
  56490. family string
  56491. urlParams_ gensupport.URLParams
  56492. ifNoneMatch_ string
  56493. ctx_ context.Context
  56494. header_ http.Header
  56495. }
  56496. // GetFromFamily: Returns the latest image that is part of an image
  56497. // family and is not deprecated.
  56498. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  56499. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56500. c.project = project
  56501. c.family = family
  56502. return c
  56503. }
  56504. // Fields allows partial responses to be retrieved. See
  56505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56506. // for more information.
  56507. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  56508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56509. return c
  56510. }
  56511. // IfNoneMatch sets the optional parameter which makes the operation
  56512. // fail if the object's ETag matches the given value. This is useful for
  56513. // getting updates only after the object has changed since the last
  56514. // request. Use googleapi.IsNotModified to check whether the response
  56515. // error from Do is the result of In-None-Match.
  56516. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  56517. c.ifNoneMatch_ = entityTag
  56518. return c
  56519. }
  56520. // Context sets the context to be used in this call's Do method. Any
  56521. // pending HTTP request will be aborted if the provided context is
  56522. // canceled.
  56523. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  56524. c.ctx_ = ctx
  56525. return c
  56526. }
  56527. // Header returns an http.Header that can be modified by the caller to
  56528. // add HTTP headers to the request.
  56529. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  56530. if c.header_ == nil {
  56531. c.header_ = make(http.Header)
  56532. }
  56533. return c.header_
  56534. }
  56535. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  56536. reqHeaders := make(http.Header)
  56537. for k, v := range c.header_ {
  56538. reqHeaders[k] = v
  56539. }
  56540. reqHeaders.Set("User-Agent", c.s.userAgent())
  56541. if c.ifNoneMatch_ != "" {
  56542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56543. }
  56544. var body io.Reader = nil
  56545. c.urlParams_.Set("alt", alt)
  56546. c.urlParams_.Set("prettyPrint", "false")
  56547. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  56548. urls += "?" + c.urlParams_.Encode()
  56549. req, err := http.NewRequest("GET", urls, body)
  56550. if err != nil {
  56551. return nil, err
  56552. }
  56553. req.Header = reqHeaders
  56554. googleapi.Expand(req.URL, map[string]string{
  56555. "project": c.project,
  56556. "family": c.family,
  56557. })
  56558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56559. }
  56560. // Do executes the "compute.images.getFromFamily" call.
  56561. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  56562. // code is an error. Response headers are in either
  56563. // *Image.ServerResponse.Header or (if a response was returned at all)
  56564. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  56565. // check whether the returned error was because http.StatusNotModified
  56566. // was returned.
  56567. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  56568. gensupport.SetOptions(c.urlParams_, opts...)
  56569. res, err := c.doRequest("json")
  56570. if res != nil && res.StatusCode == http.StatusNotModified {
  56571. if res.Body != nil {
  56572. res.Body.Close()
  56573. }
  56574. return nil, &googleapi.Error{
  56575. Code: res.StatusCode,
  56576. Header: res.Header,
  56577. }
  56578. }
  56579. if err != nil {
  56580. return nil, err
  56581. }
  56582. defer googleapi.CloseBody(res)
  56583. if err := googleapi.CheckResponse(res); err != nil {
  56584. return nil, err
  56585. }
  56586. ret := &Image{
  56587. ServerResponse: googleapi.ServerResponse{
  56588. Header: res.Header,
  56589. HTTPStatusCode: res.StatusCode,
  56590. },
  56591. }
  56592. target := &ret
  56593. if err := gensupport.DecodeResponse(target, res); err != nil {
  56594. return nil, err
  56595. }
  56596. return ret, nil
  56597. // {
  56598. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  56599. // "httpMethod": "GET",
  56600. // "id": "compute.images.getFromFamily",
  56601. // "parameterOrder": [
  56602. // "project",
  56603. // "family"
  56604. // ],
  56605. // "parameters": {
  56606. // "family": {
  56607. // "description": "Name of the image family to search for.",
  56608. // "location": "path",
  56609. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56610. // "required": true,
  56611. // "type": "string"
  56612. // },
  56613. // "project": {
  56614. // "description": "Project ID for this request.",
  56615. // "location": "path",
  56616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56617. // "required": true,
  56618. // "type": "string"
  56619. // }
  56620. // },
  56621. // "path": "{project}/global/images/family/{family}",
  56622. // "response": {
  56623. // "$ref": "Image"
  56624. // },
  56625. // "scopes": [
  56626. // "https://www.googleapis.com/auth/cloud-platform",
  56627. // "https://www.googleapis.com/auth/compute",
  56628. // "https://www.googleapis.com/auth/compute.readonly"
  56629. // ]
  56630. // }
  56631. }
  56632. // method id "compute.images.getIamPolicy":
  56633. type ImagesGetIamPolicyCall struct {
  56634. s *Service
  56635. project string
  56636. resource string
  56637. urlParams_ gensupport.URLParams
  56638. ifNoneMatch_ string
  56639. ctx_ context.Context
  56640. header_ http.Header
  56641. }
  56642. // GetIamPolicy: Gets the access control policy for a resource. May be
  56643. // empty if no such policy or resource exists.
  56644. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  56645. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56646. c.project = project
  56647. c.resource = resource
  56648. return c
  56649. }
  56650. // Fields allows partial responses to be retrieved. See
  56651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56652. // for more information.
  56653. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  56654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56655. return c
  56656. }
  56657. // IfNoneMatch sets the optional parameter which makes the operation
  56658. // fail if the object's ETag matches the given value. This is useful for
  56659. // getting updates only after the object has changed since the last
  56660. // request. Use googleapi.IsNotModified to check whether the response
  56661. // error from Do is the result of In-None-Match.
  56662. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  56663. c.ifNoneMatch_ = entityTag
  56664. return c
  56665. }
  56666. // Context sets the context to be used in this call's Do method. Any
  56667. // pending HTTP request will be aborted if the provided context is
  56668. // canceled.
  56669. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  56670. c.ctx_ = ctx
  56671. return c
  56672. }
  56673. // Header returns an http.Header that can be modified by the caller to
  56674. // add HTTP headers to the request.
  56675. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  56676. if c.header_ == nil {
  56677. c.header_ = make(http.Header)
  56678. }
  56679. return c.header_
  56680. }
  56681. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  56682. reqHeaders := make(http.Header)
  56683. for k, v := range c.header_ {
  56684. reqHeaders[k] = v
  56685. }
  56686. reqHeaders.Set("User-Agent", c.s.userAgent())
  56687. if c.ifNoneMatch_ != "" {
  56688. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56689. }
  56690. var body io.Reader = nil
  56691. c.urlParams_.Set("alt", alt)
  56692. c.urlParams_.Set("prettyPrint", "false")
  56693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  56694. urls += "?" + c.urlParams_.Encode()
  56695. req, err := http.NewRequest("GET", urls, body)
  56696. if err != nil {
  56697. return nil, err
  56698. }
  56699. req.Header = reqHeaders
  56700. googleapi.Expand(req.URL, map[string]string{
  56701. "project": c.project,
  56702. "resource": c.resource,
  56703. })
  56704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56705. }
  56706. // Do executes the "compute.images.getIamPolicy" call.
  56707. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  56708. // code is an error. Response headers are in either
  56709. // *Policy.ServerResponse.Header or (if a response was returned at all)
  56710. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  56711. // check whether the returned error was because http.StatusNotModified
  56712. // was returned.
  56713. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  56714. gensupport.SetOptions(c.urlParams_, opts...)
  56715. res, err := c.doRequest("json")
  56716. if res != nil && res.StatusCode == http.StatusNotModified {
  56717. if res.Body != nil {
  56718. res.Body.Close()
  56719. }
  56720. return nil, &googleapi.Error{
  56721. Code: res.StatusCode,
  56722. Header: res.Header,
  56723. }
  56724. }
  56725. if err != nil {
  56726. return nil, err
  56727. }
  56728. defer googleapi.CloseBody(res)
  56729. if err := googleapi.CheckResponse(res); err != nil {
  56730. return nil, err
  56731. }
  56732. ret := &Policy{
  56733. ServerResponse: googleapi.ServerResponse{
  56734. Header: res.Header,
  56735. HTTPStatusCode: res.StatusCode,
  56736. },
  56737. }
  56738. target := &ret
  56739. if err := gensupport.DecodeResponse(target, res); err != nil {
  56740. return nil, err
  56741. }
  56742. return ret, nil
  56743. // {
  56744. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  56745. // "httpMethod": "GET",
  56746. // "id": "compute.images.getIamPolicy",
  56747. // "parameterOrder": [
  56748. // "project",
  56749. // "resource"
  56750. // ],
  56751. // "parameters": {
  56752. // "project": {
  56753. // "description": "Project ID for this request.",
  56754. // "location": "path",
  56755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56756. // "required": true,
  56757. // "type": "string"
  56758. // },
  56759. // "resource": {
  56760. // "description": "Name or id of the resource for this request.",
  56761. // "location": "path",
  56762. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56763. // "required": true,
  56764. // "type": "string"
  56765. // }
  56766. // },
  56767. // "path": "{project}/global/images/{resource}/getIamPolicy",
  56768. // "response": {
  56769. // "$ref": "Policy"
  56770. // },
  56771. // "scopes": [
  56772. // "https://www.googleapis.com/auth/cloud-platform",
  56773. // "https://www.googleapis.com/auth/compute",
  56774. // "https://www.googleapis.com/auth/compute.readonly"
  56775. // ]
  56776. // }
  56777. }
  56778. // method id "compute.images.insert":
  56779. type ImagesInsertCall struct {
  56780. s *Service
  56781. project string
  56782. image *Image
  56783. urlParams_ gensupport.URLParams
  56784. ctx_ context.Context
  56785. header_ http.Header
  56786. }
  56787. // Insert: Creates an image in the specified project using the data
  56788. // included in the request.
  56789. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  56790. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  56791. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56792. c.project = project
  56793. c.image = image
  56794. return c
  56795. }
  56796. // ForceCreate sets the optional parameter "forceCreate": Force image
  56797. // creation if true.
  56798. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  56799. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  56800. return c
  56801. }
  56802. // RequestId sets the optional parameter "requestId": An optional
  56803. // request ID to identify requests. Specify a unique request ID so that
  56804. // if you must retry your request, the server will know to ignore the
  56805. // request if it has already been completed.
  56806. //
  56807. // For example, consider a situation where you make an initial request
  56808. // and the request times out. If you make the request again with the
  56809. // same request ID, the server can check if original operation with the
  56810. // same request ID was received, and if so, will ignore the second
  56811. // request. This prevents clients from accidentally creating duplicate
  56812. // commitments.
  56813. //
  56814. // The request ID must be a valid UUID with the exception that zero UUID
  56815. // is not supported (00000000-0000-0000-0000-000000000000).
  56816. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  56817. c.urlParams_.Set("requestId", requestId)
  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 *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  56824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56825. return c
  56826. }
  56827. // Context sets the context to be used in this call's Do method. Any
  56828. // pending HTTP request will be aborted if the provided context is
  56829. // canceled.
  56830. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  56831. c.ctx_ = ctx
  56832. return c
  56833. }
  56834. // Header returns an http.Header that can be modified by the caller to
  56835. // add HTTP headers to the request.
  56836. func (c *ImagesInsertCall) Header() http.Header {
  56837. if c.header_ == nil {
  56838. c.header_ = make(http.Header)
  56839. }
  56840. return c.header_
  56841. }
  56842. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  56843. reqHeaders := make(http.Header)
  56844. for k, v := range c.header_ {
  56845. reqHeaders[k] = v
  56846. }
  56847. reqHeaders.Set("User-Agent", c.s.userAgent())
  56848. var body io.Reader = nil
  56849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  56850. if err != nil {
  56851. return nil, err
  56852. }
  56853. reqHeaders.Set("Content-Type", "application/json")
  56854. c.urlParams_.Set("alt", alt)
  56855. c.urlParams_.Set("prettyPrint", "false")
  56856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  56857. urls += "?" + c.urlParams_.Encode()
  56858. req, err := http.NewRequest("POST", urls, body)
  56859. if err != nil {
  56860. return nil, err
  56861. }
  56862. req.Header = reqHeaders
  56863. googleapi.Expand(req.URL, map[string]string{
  56864. "project": c.project,
  56865. })
  56866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56867. }
  56868. // Do executes the "compute.images.insert" call.
  56869. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56870. // status code is an error. Response headers are in either
  56871. // *Operation.ServerResponse.Header or (if a response was returned at
  56872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56873. // to check whether the returned error was because
  56874. // http.StatusNotModified was returned.
  56875. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56876. gensupport.SetOptions(c.urlParams_, opts...)
  56877. res, err := c.doRequest("json")
  56878. if res != nil && res.StatusCode == http.StatusNotModified {
  56879. if res.Body != nil {
  56880. res.Body.Close()
  56881. }
  56882. return nil, &googleapi.Error{
  56883. Code: res.StatusCode,
  56884. Header: res.Header,
  56885. }
  56886. }
  56887. if err != nil {
  56888. return nil, err
  56889. }
  56890. defer googleapi.CloseBody(res)
  56891. if err := googleapi.CheckResponse(res); err != nil {
  56892. return nil, err
  56893. }
  56894. ret := &Operation{
  56895. ServerResponse: googleapi.ServerResponse{
  56896. Header: res.Header,
  56897. HTTPStatusCode: res.StatusCode,
  56898. },
  56899. }
  56900. target := &ret
  56901. if err := gensupport.DecodeResponse(target, res); err != nil {
  56902. return nil, err
  56903. }
  56904. return ret, nil
  56905. // {
  56906. // "description": "Creates an image in the specified project using the data included in the request.",
  56907. // "httpMethod": "POST",
  56908. // "id": "compute.images.insert",
  56909. // "parameterOrder": [
  56910. // "project"
  56911. // ],
  56912. // "parameters": {
  56913. // "forceCreate": {
  56914. // "description": "Force image creation if true.",
  56915. // "location": "query",
  56916. // "type": "boolean"
  56917. // },
  56918. // "project": {
  56919. // "description": "Project ID for this request.",
  56920. // "location": "path",
  56921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56922. // "required": true,
  56923. // "type": "string"
  56924. // },
  56925. // "requestId": {
  56926. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56927. // "location": "query",
  56928. // "type": "string"
  56929. // }
  56930. // },
  56931. // "path": "{project}/global/images",
  56932. // "request": {
  56933. // "$ref": "Image"
  56934. // },
  56935. // "response": {
  56936. // "$ref": "Operation"
  56937. // },
  56938. // "scopes": [
  56939. // "https://www.googleapis.com/auth/cloud-platform",
  56940. // "https://www.googleapis.com/auth/compute",
  56941. // "https://www.googleapis.com/auth/devstorage.full_control",
  56942. // "https://www.googleapis.com/auth/devstorage.read_only",
  56943. // "https://www.googleapis.com/auth/devstorage.read_write"
  56944. // ]
  56945. // }
  56946. }
  56947. // method id "compute.images.list":
  56948. type ImagesListCall struct {
  56949. s *Service
  56950. project string
  56951. urlParams_ gensupport.URLParams
  56952. ifNoneMatch_ string
  56953. ctx_ context.Context
  56954. header_ http.Header
  56955. }
  56956. // List: Retrieves the list of custom images available to the specified
  56957. // project. Custom images are images you create that belong to your
  56958. // project. This method does not get any images that belong to other
  56959. // projects, including publicly-available images, like Debian 8. If you
  56960. // want to get a list of publicly-available images, use this method to
  56961. // make a request to the respective image project, such as debian-cloud
  56962. // or windows-cloud.
  56963. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  56964. func (r *ImagesService) List(project string) *ImagesListCall {
  56965. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56966. c.project = project
  56967. return c
  56968. }
  56969. // Filter sets the optional parameter "filter": A filter expression that
  56970. // filters resources listed in the response. The expression must specify
  56971. // the field name, a comparison operator, and the value that you want to
  56972. // use for filtering. The value must be a string, a number, or a
  56973. // boolean. The comparison operator must be either =, !=, >, or <.
  56974. //
  56975. // For example, if you are filtering Compute Engine instances, you can
  56976. // exclude instances named example-instance by specifying name !=
  56977. // example-instance.
  56978. //
  56979. // You can also filter nested fields. For example, you could specify
  56980. // scheduling.automaticRestart = false to include instances only if they
  56981. // are not scheduled for automatic restarts. You can use filtering on
  56982. // nested fields to filter based on resource labels.
  56983. //
  56984. // To filter on multiple expressions, provide each separate expression
  56985. // within parentheses. For example, (scheduling.automaticRestart = true)
  56986. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56987. // AND expression. However, you can include AND and OR expressions
  56988. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56989. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56990. // true).
  56991. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  56992. c.urlParams_.Set("filter", filter)
  56993. return c
  56994. }
  56995. // MaxResults sets the optional parameter "maxResults": The maximum
  56996. // number of results per page that should be returned. If the number of
  56997. // available results is larger than maxResults, Compute Engine returns a
  56998. // nextPageToken that can be used to get the next page of results in
  56999. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57000. // (Default: 500)
  57001. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  57002. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57003. return c
  57004. }
  57005. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57006. // a certain order. By default, results are returned in alphanumerical
  57007. // order based on the resource name.
  57008. //
  57009. // You can also sort results in descending order based on the creation
  57010. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57011. // based on the creationTimestamp field in reverse chronological order
  57012. // (newest result first). Use this to sort resources like operations so
  57013. // that the newest operation is returned first.
  57014. //
  57015. // Currently, only sorting by name or creationTimestamp desc is
  57016. // supported.
  57017. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  57018. c.urlParams_.Set("orderBy", orderBy)
  57019. return c
  57020. }
  57021. // PageToken sets the optional parameter "pageToken": Specifies a page
  57022. // token to use. Set pageToken to the nextPageToken returned by a
  57023. // previous list request to get the next page of results.
  57024. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  57025. c.urlParams_.Set("pageToken", pageToken)
  57026. return c
  57027. }
  57028. // Fields allows partial responses to be retrieved. See
  57029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57030. // for more information.
  57031. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  57032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57033. return c
  57034. }
  57035. // IfNoneMatch sets the optional parameter which makes the operation
  57036. // fail if the object's ETag matches the given value. This is useful for
  57037. // getting updates only after the object has changed since the last
  57038. // request. Use googleapi.IsNotModified to check whether the response
  57039. // error from Do is the result of In-None-Match.
  57040. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  57041. c.ifNoneMatch_ = entityTag
  57042. return c
  57043. }
  57044. // Context sets the context to be used in this call's Do method. Any
  57045. // pending HTTP request will be aborted if the provided context is
  57046. // canceled.
  57047. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  57048. c.ctx_ = ctx
  57049. return c
  57050. }
  57051. // Header returns an http.Header that can be modified by the caller to
  57052. // add HTTP headers to the request.
  57053. func (c *ImagesListCall) Header() http.Header {
  57054. if c.header_ == nil {
  57055. c.header_ = make(http.Header)
  57056. }
  57057. return c.header_
  57058. }
  57059. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  57060. reqHeaders := make(http.Header)
  57061. for k, v := range c.header_ {
  57062. reqHeaders[k] = v
  57063. }
  57064. reqHeaders.Set("User-Agent", c.s.userAgent())
  57065. if c.ifNoneMatch_ != "" {
  57066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57067. }
  57068. var body io.Reader = nil
  57069. c.urlParams_.Set("alt", alt)
  57070. c.urlParams_.Set("prettyPrint", "false")
  57071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  57072. urls += "?" + c.urlParams_.Encode()
  57073. req, err := http.NewRequest("GET", urls, body)
  57074. if err != nil {
  57075. return nil, err
  57076. }
  57077. req.Header = reqHeaders
  57078. googleapi.Expand(req.URL, map[string]string{
  57079. "project": c.project,
  57080. })
  57081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57082. }
  57083. // Do executes the "compute.images.list" call.
  57084. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  57085. // status code is an error. Response headers are in either
  57086. // *ImageList.ServerResponse.Header or (if a response was returned at
  57087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57088. // to check whether the returned error was because
  57089. // http.StatusNotModified was returned.
  57090. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  57091. gensupport.SetOptions(c.urlParams_, opts...)
  57092. res, err := c.doRequest("json")
  57093. if res != nil && res.StatusCode == http.StatusNotModified {
  57094. if res.Body != nil {
  57095. res.Body.Close()
  57096. }
  57097. return nil, &googleapi.Error{
  57098. Code: res.StatusCode,
  57099. Header: res.Header,
  57100. }
  57101. }
  57102. if err != nil {
  57103. return nil, err
  57104. }
  57105. defer googleapi.CloseBody(res)
  57106. if err := googleapi.CheckResponse(res); err != nil {
  57107. return nil, err
  57108. }
  57109. ret := &ImageList{
  57110. ServerResponse: googleapi.ServerResponse{
  57111. Header: res.Header,
  57112. HTTPStatusCode: res.StatusCode,
  57113. },
  57114. }
  57115. target := &ret
  57116. if err := gensupport.DecodeResponse(target, res); err != nil {
  57117. return nil, err
  57118. }
  57119. return ret, nil
  57120. // {
  57121. // "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.",
  57122. // "httpMethod": "GET",
  57123. // "id": "compute.images.list",
  57124. // "parameterOrder": [
  57125. // "project"
  57126. // ],
  57127. // "parameters": {
  57128. // "filter": {
  57129. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57130. // "location": "query",
  57131. // "type": "string"
  57132. // },
  57133. // "maxResults": {
  57134. // "default": "500",
  57135. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57136. // "format": "uint32",
  57137. // "location": "query",
  57138. // "minimum": "0",
  57139. // "type": "integer"
  57140. // },
  57141. // "orderBy": {
  57142. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57143. // "location": "query",
  57144. // "type": "string"
  57145. // },
  57146. // "pageToken": {
  57147. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57148. // "location": "query",
  57149. // "type": "string"
  57150. // },
  57151. // "project": {
  57152. // "description": "Project ID for this request.",
  57153. // "location": "path",
  57154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57155. // "required": true,
  57156. // "type": "string"
  57157. // }
  57158. // },
  57159. // "path": "{project}/global/images",
  57160. // "response": {
  57161. // "$ref": "ImageList"
  57162. // },
  57163. // "scopes": [
  57164. // "https://www.googleapis.com/auth/cloud-platform",
  57165. // "https://www.googleapis.com/auth/compute",
  57166. // "https://www.googleapis.com/auth/compute.readonly"
  57167. // ]
  57168. // }
  57169. }
  57170. // Pages invokes f for each page of results.
  57171. // A non-nil error returned from f will halt the iteration.
  57172. // The provided context supersedes any context provided to the Context method.
  57173. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  57174. c.ctx_ = ctx
  57175. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57176. for {
  57177. x, err := c.Do()
  57178. if err != nil {
  57179. return err
  57180. }
  57181. if err := f(x); err != nil {
  57182. return err
  57183. }
  57184. if x.NextPageToken == "" {
  57185. return nil
  57186. }
  57187. c.PageToken(x.NextPageToken)
  57188. }
  57189. }
  57190. // method id "compute.images.setIamPolicy":
  57191. type ImagesSetIamPolicyCall struct {
  57192. s *Service
  57193. project string
  57194. resource string
  57195. globalsetpolicyrequest *GlobalSetPolicyRequest
  57196. urlParams_ gensupport.URLParams
  57197. ctx_ context.Context
  57198. header_ http.Header
  57199. }
  57200. // SetIamPolicy: Sets the access control policy on the specified
  57201. // resource. Replaces any existing policy.
  57202. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  57203. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57204. c.project = project
  57205. c.resource = resource
  57206. c.globalsetpolicyrequest = globalsetpolicyrequest
  57207. return c
  57208. }
  57209. // Fields allows partial responses to be retrieved. See
  57210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57211. // for more information.
  57212. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  57213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57214. return c
  57215. }
  57216. // Context sets the context to be used in this call's Do method. Any
  57217. // pending HTTP request will be aborted if the provided context is
  57218. // canceled.
  57219. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  57220. c.ctx_ = ctx
  57221. return c
  57222. }
  57223. // Header returns an http.Header that can be modified by the caller to
  57224. // add HTTP headers to the request.
  57225. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  57226. if c.header_ == nil {
  57227. c.header_ = make(http.Header)
  57228. }
  57229. return c.header_
  57230. }
  57231. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  57232. reqHeaders := make(http.Header)
  57233. for k, v := range c.header_ {
  57234. reqHeaders[k] = v
  57235. }
  57236. reqHeaders.Set("User-Agent", c.s.userAgent())
  57237. var body io.Reader = nil
  57238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  57239. if err != nil {
  57240. return nil, err
  57241. }
  57242. reqHeaders.Set("Content-Type", "application/json")
  57243. c.urlParams_.Set("alt", alt)
  57244. c.urlParams_.Set("prettyPrint", "false")
  57245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  57246. urls += "?" + c.urlParams_.Encode()
  57247. req, err := http.NewRequest("POST", urls, body)
  57248. if err != nil {
  57249. return nil, err
  57250. }
  57251. req.Header = reqHeaders
  57252. googleapi.Expand(req.URL, map[string]string{
  57253. "project": c.project,
  57254. "resource": c.resource,
  57255. })
  57256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57257. }
  57258. // Do executes the "compute.images.setIamPolicy" call.
  57259. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  57260. // code is an error. Response headers are in either
  57261. // *Policy.ServerResponse.Header or (if a response was returned at all)
  57262. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57263. // check whether the returned error was because http.StatusNotModified
  57264. // was returned.
  57265. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  57266. gensupport.SetOptions(c.urlParams_, opts...)
  57267. res, err := c.doRequest("json")
  57268. if res != nil && res.StatusCode == http.StatusNotModified {
  57269. if res.Body != nil {
  57270. res.Body.Close()
  57271. }
  57272. return nil, &googleapi.Error{
  57273. Code: res.StatusCode,
  57274. Header: res.Header,
  57275. }
  57276. }
  57277. if err != nil {
  57278. return nil, err
  57279. }
  57280. defer googleapi.CloseBody(res)
  57281. if err := googleapi.CheckResponse(res); err != nil {
  57282. return nil, err
  57283. }
  57284. ret := &Policy{
  57285. ServerResponse: googleapi.ServerResponse{
  57286. Header: res.Header,
  57287. HTTPStatusCode: res.StatusCode,
  57288. },
  57289. }
  57290. target := &ret
  57291. if err := gensupport.DecodeResponse(target, res); err != nil {
  57292. return nil, err
  57293. }
  57294. return ret, nil
  57295. // {
  57296. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  57297. // "httpMethod": "POST",
  57298. // "id": "compute.images.setIamPolicy",
  57299. // "parameterOrder": [
  57300. // "project",
  57301. // "resource"
  57302. // ],
  57303. // "parameters": {
  57304. // "project": {
  57305. // "description": "Project ID for this request.",
  57306. // "location": "path",
  57307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57308. // "required": true,
  57309. // "type": "string"
  57310. // },
  57311. // "resource": {
  57312. // "description": "Name or id of the resource for this request.",
  57313. // "location": "path",
  57314. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57315. // "required": true,
  57316. // "type": "string"
  57317. // }
  57318. // },
  57319. // "path": "{project}/global/images/{resource}/setIamPolicy",
  57320. // "request": {
  57321. // "$ref": "GlobalSetPolicyRequest"
  57322. // },
  57323. // "response": {
  57324. // "$ref": "Policy"
  57325. // },
  57326. // "scopes": [
  57327. // "https://www.googleapis.com/auth/cloud-platform",
  57328. // "https://www.googleapis.com/auth/compute"
  57329. // ]
  57330. // }
  57331. }
  57332. // method id "compute.images.setLabels":
  57333. type ImagesSetLabelsCall struct {
  57334. s *Service
  57335. project string
  57336. resource string
  57337. globalsetlabelsrequest *GlobalSetLabelsRequest
  57338. urlParams_ gensupport.URLParams
  57339. ctx_ context.Context
  57340. header_ http.Header
  57341. }
  57342. // SetLabels: Sets the labels on an image. To learn more about labels,
  57343. // read the Labeling Resources documentation.
  57344. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  57345. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57346. c.project = project
  57347. c.resource = resource
  57348. c.globalsetlabelsrequest = globalsetlabelsrequest
  57349. return c
  57350. }
  57351. // Fields allows partial responses to be retrieved. See
  57352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57353. // for more information.
  57354. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  57355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57356. return c
  57357. }
  57358. // Context sets the context to be used in this call's Do method. Any
  57359. // pending HTTP request will be aborted if the provided context is
  57360. // canceled.
  57361. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  57362. c.ctx_ = ctx
  57363. return c
  57364. }
  57365. // Header returns an http.Header that can be modified by the caller to
  57366. // add HTTP headers to the request.
  57367. func (c *ImagesSetLabelsCall) Header() http.Header {
  57368. if c.header_ == nil {
  57369. c.header_ = make(http.Header)
  57370. }
  57371. return c.header_
  57372. }
  57373. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  57374. reqHeaders := make(http.Header)
  57375. for k, v := range c.header_ {
  57376. reqHeaders[k] = v
  57377. }
  57378. reqHeaders.Set("User-Agent", c.s.userAgent())
  57379. var body io.Reader = nil
  57380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  57381. if err != nil {
  57382. return nil, err
  57383. }
  57384. reqHeaders.Set("Content-Type", "application/json")
  57385. c.urlParams_.Set("alt", alt)
  57386. c.urlParams_.Set("prettyPrint", "false")
  57387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  57388. urls += "?" + c.urlParams_.Encode()
  57389. req, err := http.NewRequest("POST", urls, body)
  57390. if err != nil {
  57391. return nil, err
  57392. }
  57393. req.Header = reqHeaders
  57394. googleapi.Expand(req.URL, map[string]string{
  57395. "project": c.project,
  57396. "resource": c.resource,
  57397. })
  57398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57399. }
  57400. // Do executes the "compute.images.setLabels" call.
  57401. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57402. // status code is an error. Response headers are in either
  57403. // *Operation.ServerResponse.Header or (if a response was returned at
  57404. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57405. // to check whether the returned error was because
  57406. // http.StatusNotModified was returned.
  57407. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57408. gensupport.SetOptions(c.urlParams_, opts...)
  57409. res, err := c.doRequest("json")
  57410. if res != nil && res.StatusCode == http.StatusNotModified {
  57411. if res.Body != nil {
  57412. res.Body.Close()
  57413. }
  57414. return nil, &googleapi.Error{
  57415. Code: res.StatusCode,
  57416. Header: res.Header,
  57417. }
  57418. }
  57419. if err != nil {
  57420. return nil, err
  57421. }
  57422. defer googleapi.CloseBody(res)
  57423. if err := googleapi.CheckResponse(res); err != nil {
  57424. return nil, err
  57425. }
  57426. ret := &Operation{
  57427. ServerResponse: googleapi.ServerResponse{
  57428. Header: res.Header,
  57429. HTTPStatusCode: res.StatusCode,
  57430. },
  57431. }
  57432. target := &ret
  57433. if err := gensupport.DecodeResponse(target, res); err != nil {
  57434. return nil, err
  57435. }
  57436. return ret, nil
  57437. // {
  57438. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  57439. // "httpMethod": "POST",
  57440. // "id": "compute.images.setLabels",
  57441. // "parameterOrder": [
  57442. // "project",
  57443. // "resource"
  57444. // ],
  57445. // "parameters": {
  57446. // "project": {
  57447. // "description": "Project ID for this request.",
  57448. // "location": "path",
  57449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57450. // "required": true,
  57451. // "type": "string"
  57452. // },
  57453. // "resource": {
  57454. // "description": "Name or id of the resource for this request.",
  57455. // "location": "path",
  57456. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57457. // "required": true,
  57458. // "type": "string"
  57459. // }
  57460. // },
  57461. // "path": "{project}/global/images/{resource}/setLabels",
  57462. // "request": {
  57463. // "$ref": "GlobalSetLabelsRequest"
  57464. // },
  57465. // "response": {
  57466. // "$ref": "Operation"
  57467. // },
  57468. // "scopes": [
  57469. // "https://www.googleapis.com/auth/cloud-platform",
  57470. // "https://www.googleapis.com/auth/compute"
  57471. // ]
  57472. // }
  57473. }
  57474. // method id "compute.images.testIamPermissions":
  57475. type ImagesTestIamPermissionsCall struct {
  57476. s *Service
  57477. project string
  57478. resource string
  57479. testpermissionsrequest *TestPermissionsRequest
  57480. urlParams_ gensupport.URLParams
  57481. ctx_ context.Context
  57482. header_ http.Header
  57483. }
  57484. // TestIamPermissions: Returns permissions that a caller has on the
  57485. // specified resource.
  57486. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  57487. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57488. c.project = project
  57489. c.resource = resource
  57490. c.testpermissionsrequest = testpermissionsrequest
  57491. return c
  57492. }
  57493. // Fields allows partial responses to be retrieved. See
  57494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57495. // for more information.
  57496. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  57497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57498. return c
  57499. }
  57500. // Context sets the context to be used in this call's Do method. Any
  57501. // pending HTTP request will be aborted if the provided context is
  57502. // canceled.
  57503. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  57504. c.ctx_ = ctx
  57505. return c
  57506. }
  57507. // Header returns an http.Header that can be modified by the caller to
  57508. // add HTTP headers to the request.
  57509. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  57510. if c.header_ == nil {
  57511. c.header_ = make(http.Header)
  57512. }
  57513. return c.header_
  57514. }
  57515. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57516. reqHeaders := make(http.Header)
  57517. for k, v := range c.header_ {
  57518. reqHeaders[k] = v
  57519. }
  57520. reqHeaders.Set("User-Agent", c.s.userAgent())
  57521. var body io.Reader = nil
  57522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57523. if err != nil {
  57524. return nil, err
  57525. }
  57526. reqHeaders.Set("Content-Type", "application/json")
  57527. c.urlParams_.Set("alt", alt)
  57528. c.urlParams_.Set("prettyPrint", "false")
  57529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  57530. urls += "?" + c.urlParams_.Encode()
  57531. req, err := http.NewRequest("POST", urls, body)
  57532. if err != nil {
  57533. return nil, err
  57534. }
  57535. req.Header = reqHeaders
  57536. googleapi.Expand(req.URL, map[string]string{
  57537. "project": c.project,
  57538. "resource": c.resource,
  57539. })
  57540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57541. }
  57542. // Do executes the "compute.images.testIamPermissions" call.
  57543. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57544. // non-2xx status code is an error. Response headers are in either
  57545. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  57546. // returned at all) in error.(*googleapi.Error).Header. Use
  57547. // googleapi.IsNotModified to check whether the returned error was
  57548. // because http.StatusNotModified was returned.
  57549. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  57550. gensupport.SetOptions(c.urlParams_, opts...)
  57551. res, err := c.doRequest("json")
  57552. if res != nil && res.StatusCode == http.StatusNotModified {
  57553. if res.Body != nil {
  57554. res.Body.Close()
  57555. }
  57556. return nil, &googleapi.Error{
  57557. Code: res.StatusCode,
  57558. Header: res.Header,
  57559. }
  57560. }
  57561. if err != nil {
  57562. return nil, err
  57563. }
  57564. defer googleapi.CloseBody(res)
  57565. if err := googleapi.CheckResponse(res); err != nil {
  57566. return nil, err
  57567. }
  57568. ret := &TestPermissionsResponse{
  57569. ServerResponse: googleapi.ServerResponse{
  57570. Header: res.Header,
  57571. HTTPStatusCode: res.StatusCode,
  57572. },
  57573. }
  57574. target := &ret
  57575. if err := gensupport.DecodeResponse(target, res); err != nil {
  57576. return nil, err
  57577. }
  57578. return ret, nil
  57579. // {
  57580. // "description": "Returns permissions that a caller has on the specified resource.",
  57581. // "httpMethod": "POST",
  57582. // "id": "compute.images.testIamPermissions",
  57583. // "parameterOrder": [
  57584. // "project",
  57585. // "resource"
  57586. // ],
  57587. // "parameters": {
  57588. // "project": {
  57589. // "description": "Project ID for this request.",
  57590. // "location": "path",
  57591. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57592. // "required": true,
  57593. // "type": "string"
  57594. // },
  57595. // "resource": {
  57596. // "description": "Name or id of the resource for this request.",
  57597. // "location": "path",
  57598. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57599. // "required": true,
  57600. // "type": "string"
  57601. // }
  57602. // },
  57603. // "path": "{project}/global/images/{resource}/testIamPermissions",
  57604. // "request": {
  57605. // "$ref": "TestPermissionsRequest"
  57606. // },
  57607. // "response": {
  57608. // "$ref": "TestPermissionsResponse"
  57609. // },
  57610. // "scopes": [
  57611. // "https://www.googleapis.com/auth/cloud-platform",
  57612. // "https://www.googleapis.com/auth/compute",
  57613. // "https://www.googleapis.com/auth/compute.readonly"
  57614. // ]
  57615. // }
  57616. }
  57617. // method id "compute.instanceGroupManagers.abandonInstances":
  57618. type InstanceGroupManagersAbandonInstancesCall struct {
  57619. s *Service
  57620. project string
  57621. zone string
  57622. instanceGroupManager string
  57623. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  57624. urlParams_ gensupport.URLParams
  57625. ctx_ context.Context
  57626. header_ http.Header
  57627. }
  57628. // AbandonInstances: Flags the specified instances to be removed from
  57629. // the managed instance group. Abandoning an instance does not delete
  57630. // the instance, but it does remove the instance from any target pools
  57631. // that are applied by the managed instance group. This method reduces
  57632. // the targetSize of the managed instance group by the number of
  57633. // instances that you abandon. This operation is marked as DONE when the
  57634. // action is scheduled even if the instances have not yet been removed
  57635. // from the group. You must separately verify the status of the
  57636. // abandoning action with the listmanagedinstances method.
  57637. //
  57638. // If the group is part of a backend service that has enabled connection
  57639. // draining, it can take up to 60 seconds after the connection draining
  57640. // duration has elapsed before the VM instance is removed or
  57641. // deleted.
  57642. //
  57643. // You can specify a maximum of 1000 instances with this method per
  57644. // request.
  57645. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  57646. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57647. c.project = project
  57648. c.zone = zone
  57649. c.instanceGroupManager = instanceGroupManager
  57650. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  57651. return c
  57652. }
  57653. // RequestId sets the optional parameter "requestId": An optional
  57654. // request ID to identify requests. Specify a unique request ID so that
  57655. // if you must retry your request, the server will know to ignore the
  57656. // request if it has already been completed.
  57657. //
  57658. // For example, consider a situation where you make an initial request
  57659. // and the request times out. If you make the request again with the
  57660. // same request ID, the server can check if original operation with the
  57661. // same request ID was received, and if so, will ignore the second
  57662. // request. This prevents clients from accidentally creating duplicate
  57663. // commitments.
  57664. //
  57665. // The request ID must be a valid UUID with the exception that zero UUID
  57666. // is not supported (00000000-0000-0000-0000-000000000000).
  57667. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  57668. c.urlParams_.Set("requestId", requestId)
  57669. return c
  57670. }
  57671. // Fields allows partial responses to be retrieved. See
  57672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57673. // for more information.
  57674. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  57675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57676. return c
  57677. }
  57678. // Context sets the context to be used in this call's Do method. Any
  57679. // pending HTTP request will be aborted if the provided context is
  57680. // canceled.
  57681. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  57682. c.ctx_ = ctx
  57683. return c
  57684. }
  57685. // Header returns an http.Header that can be modified by the caller to
  57686. // add HTTP headers to the request.
  57687. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  57688. if c.header_ == nil {
  57689. c.header_ = make(http.Header)
  57690. }
  57691. return c.header_
  57692. }
  57693. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  57694. reqHeaders := make(http.Header)
  57695. for k, v := range c.header_ {
  57696. reqHeaders[k] = v
  57697. }
  57698. reqHeaders.Set("User-Agent", c.s.userAgent())
  57699. var body io.Reader = nil
  57700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  57701. if err != nil {
  57702. return nil, err
  57703. }
  57704. reqHeaders.Set("Content-Type", "application/json")
  57705. c.urlParams_.Set("alt", alt)
  57706. c.urlParams_.Set("prettyPrint", "false")
  57707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  57708. urls += "?" + c.urlParams_.Encode()
  57709. req, err := http.NewRequest("POST", urls, body)
  57710. if err != nil {
  57711. return nil, err
  57712. }
  57713. req.Header = reqHeaders
  57714. googleapi.Expand(req.URL, map[string]string{
  57715. "project": c.project,
  57716. "zone": c.zone,
  57717. "instanceGroupManager": c.instanceGroupManager,
  57718. })
  57719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57720. }
  57721. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  57722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57723. // status code is an error. Response headers are in either
  57724. // *Operation.ServerResponse.Header or (if a response was returned at
  57725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57726. // to check whether the returned error was because
  57727. // http.StatusNotModified was returned.
  57728. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57729. gensupport.SetOptions(c.urlParams_, opts...)
  57730. res, err := c.doRequest("json")
  57731. if res != nil && res.StatusCode == http.StatusNotModified {
  57732. if res.Body != nil {
  57733. res.Body.Close()
  57734. }
  57735. return nil, &googleapi.Error{
  57736. Code: res.StatusCode,
  57737. Header: res.Header,
  57738. }
  57739. }
  57740. if err != nil {
  57741. return nil, err
  57742. }
  57743. defer googleapi.CloseBody(res)
  57744. if err := googleapi.CheckResponse(res); err != nil {
  57745. return nil, err
  57746. }
  57747. ret := &Operation{
  57748. ServerResponse: googleapi.ServerResponse{
  57749. Header: res.Header,
  57750. HTTPStatusCode: res.StatusCode,
  57751. },
  57752. }
  57753. target := &ret
  57754. if err := gensupport.DecodeResponse(target, res); err != nil {
  57755. return nil, err
  57756. }
  57757. return ret, nil
  57758. // {
  57759. // "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.",
  57760. // "httpMethod": "POST",
  57761. // "id": "compute.instanceGroupManagers.abandonInstances",
  57762. // "parameterOrder": [
  57763. // "project",
  57764. // "zone",
  57765. // "instanceGroupManager"
  57766. // ],
  57767. // "parameters": {
  57768. // "instanceGroupManager": {
  57769. // "description": "The name of the managed instance group.",
  57770. // "location": "path",
  57771. // "required": true,
  57772. // "type": "string"
  57773. // },
  57774. // "project": {
  57775. // "description": "Project ID for this request.",
  57776. // "location": "path",
  57777. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57778. // "required": true,
  57779. // "type": "string"
  57780. // },
  57781. // "requestId": {
  57782. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57783. // "location": "query",
  57784. // "type": "string"
  57785. // },
  57786. // "zone": {
  57787. // "description": "The name of the zone where the managed instance group is located.",
  57788. // "location": "path",
  57789. // "required": true,
  57790. // "type": "string"
  57791. // }
  57792. // },
  57793. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  57794. // "request": {
  57795. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  57796. // },
  57797. // "response": {
  57798. // "$ref": "Operation"
  57799. // },
  57800. // "scopes": [
  57801. // "https://www.googleapis.com/auth/cloud-platform",
  57802. // "https://www.googleapis.com/auth/compute"
  57803. // ]
  57804. // }
  57805. }
  57806. // method id "compute.instanceGroupManagers.aggregatedList":
  57807. type InstanceGroupManagersAggregatedListCall struct {
  57808. s *Service
  57809. project string
  57810. urlParams_ gensupport.URLParams
  57811. ifNoneMatch_ string
  57812. ctx_ context.Context
  57813. header_ http.Header
  57814. }
  57815. // AggregatedList: Retrieves the list of managed instance groups and
  57816. // groups them by zone.
  57817. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  57818. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57819. c.project = project
  57820. return c
  57821. }
  57822. // Filter sets the optional parameter "filter": A filter expression that
  57823. // filters resources listed in the response. The expression must specify
  57824. // the field name, a comparison operator, and the value that you want to
  57825. // use for filtering. The value must be a string, a number, or a
  57826. // boolean. The comparison operator must be either =, !=, >, or <.
  57827. //
  57828. // For example, if you are filtering Compute Engine instances, you can
  57829. // exclude instances named example-instance by specifying name !=
  57830. // example-instance.
  57831. //
  57832. // You can also filter nested fields. For example, you could specify
  57833. // scheduling.automaticRestart = false to include instances only if they
  57834. // are not scheduled for automatic restarts. You can use filtering on
  57835. // nested fields to filter based on resource labels.
  57836. //
  57837. // To filter on multiple expressions, provide each separate expression
  57838. // within parentheses. For example, (scheduling.automaticRestart = true)
  57839. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57840. // AND expression. However, you can include AND and OR expressions
  57841. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57842. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57843. // true).
  57844. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  57845. c.urlParams_.Set("filter", filter)
  57846. return c
  57847. }
  57848. // MaxResults sets the optional parameter "maxResults": The maximum
  57849. // number of results per page that should be returned. If the number of
  57850. // available results is larger than maxResults, Compute Engine returns a
  57851. // nextPageToken that can be used to get the next page of results in
  57852. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57853. // (Default: 500)
  57854. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  57855. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57856. return c
  57857. }
  57858. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57859. // a certain order. By default, results are returned in alphanumerical
  57860. // order based on the resource name.
  57861. //
  57862. // You can also sort results in descending order based on the creation
  57863. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57864. // based on the creationTimestamp field in reverse chronological order
  57865. // (newest result first). Use this to sort resources like operations so
  57866. // that the newest operation is returned first.
  57867. //
  57868. // Currently, only sorting by name or creationTimestamp desc is
  57869. // supported.
  57870. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  57871. c.urlParams_.Set("orderBy", orderBy)
  57872. return c
  57873. }
  57874. // PageToken sets the optional parameter "pageToken": Specifies a page
  57875. // token to use. Set pageToken to the nextPageToken returned by a
  57876. // previous list request to get the next page of results.
  57877. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  57878. c.urlParams_.Set("pageToken", pageToken)
  57879. return c
  57880. }
  57881. // Fields allows partial responses to be retrieved. See
  57882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57883. // for more information.
  57884. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  57885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57886. return c
  57887. }
  57888. // IfNoneMatch sets the optional parameter which makes the operation
  57889. // fail if the object's ETag matches the given value. This is useful for
  57890. // getting updates only after the object has changed since the last
  57891. // request. Use googleapi.IsNotModified to check whether the response
  57892. // error from Do is the result of In-None-Match.
  57893. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  57894. c.ifNoneMatch_ = entityTag
  57895. return c
  57896. }
  57897. // Context sets the context to be used in this call's Do method. Any
  57898. // pending HTTP request will be aborted if the provided context is
  57899. // canceled.
  57900. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  57901. c.ctx_ = ctx
  57902. return c
  57903. }
  57904. // Header returns an http.Header that can be modified by the caller to
  57905. // add HTTP headers to the request.
  57906. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  57907. if c.header_ == nil {
  57908. c.header_ = make(http.Header)
  57909. }
  57910. return c.header_
  57911. }
  57912. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  57913. reqHeaders := make(http.Header)
  57914. for k, v := range c.header_ {
  57915. reqHeaders[k] = v
  57916. }
  57917. reqHeaders.Set("User-Agent", c.s.userAgent())
  57918. if c.ifNoneMatch_ != "" {
  57919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57920. }
  57921. var body io.Reader = nil
  57922. c.urlParams_.Set("alt", alt)
  57923. c.urlParams_.Set("prettyPrint", "false")
  57924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  57925. urls += "?" + c.urlParams_.Encode()
  57926. req, err := http.NewRequest("GET", urls, body)
  57927. if err != nil {
  57928. return nil, err
  57929. }
  57930. req.Header = reqHeaders
  57931. googleapi.Expand(req.URL, map[string]string{
  57932. "project": c.project,
  57933. })
  57934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57935. }
  57936. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  57937. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  57938. // non-nil. Any non-2xx status code is an error. Response headers are in
  57939. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  57940. // (if a response was returned at all) in
  57941. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  57942. // whether the returned error was because http.StatusNotModified was
  57943. // returned.
  57944. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  57945. gensupport.SetOptions(c.urlParams_, opts...)
  57946. res, err := c.doRequest("json")
  57947. if res != nil && res.StatusCode == http.StatusNotModified {
  57948. if res.Body != nil {
  57949. res.Body.Close()
  57950. }
  57951. return nil, &googleapi.Error{
  57952. Code: res.StatusCode,
  57953. Header: res.Header,
  57954. }
  57955. }
  57956. if err != nil {
  57957. return nil, err
  57958. }
  57959. defer googleapi.CloseBody(res)
  57960. if err := googleapi.CheckResponse(res); err != nil {
  57961. return nil, err
  57962. }
  57963. ret := &InstanceGroupManagerAggregatedList{
  57964. ServerResponse: googleapi.ServerResponse{
  57965. Header: res.Header,
  57966. HTTPStatusCode: res.StatusCode,
  57967. },
  57968. }
  57969. target := &ret
  57970. if err := gensupport.DecodeResponse(target, res); err != nil {
  57971. return nil, err
  57972. }
  57973. return ret, nil
  57974. // {
  57975. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  57976. // "httpMethod": "GET",
  57977. // "id": "compute.instanceGroupManagers.aggregatedList",
  57978. // "parameterOrder": [
  57979. // "project"
  57980. // ],
  57981. // "parameters": {
  57982. // "filter": {
  57983. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57984. // "location": "query",
  57985. // "type": "string"
  57986. // },
  57987. // "maxResults": {
  57988. // "default": "500",
  57989. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57990. // "format": "uint32",
  57991. // "location": "query",
  57992. // "minimum": "0",
  57993. // "type": "integer"
  57994. // },
  57995. // "orderBy": {
  57996. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57997. // "location": "query",
  57998. // "type": "string"
  57999. // },
  58000. // "pageToken": {
  58001. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58002. // "location": "query",
  58003. // "type": "string"
  58004. // },
  58005. // "project": {
  58006. // "description": "Project ID for this request.",
  58007. // "location": "path",
  58008. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58009. // "required": true,
  58010. // "type": "string"
  58011. // }
  58012. // },
  58013. // "path": "{project}/aggregated/instanceGroupManagers",
  58014. // "response": {
  58015. // "$ref": "InstanceGroupManagerAggregatedList"
  58016. // },
  58017. // "scopes": [
  58018. // "https://www.googleapis.com/auth/cloud-platform",
  58019. // "https://www.googleapis.com/auth/compute",
  58020. // "https://www.googleapis.com/auth/compute.readonly"
  58021. // ]
  58022. // }
  58023. }
  58024. // Pages invokes f for each page of results.
  58025. // A non-nil error returned from f will halt the iteration.
  58026. // The provided context supersedes any context provided to the Context method.
  58027. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  58028. c.ctx_ = ctx
  58029. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58030. for {
  58031. x, err := c.Do()
  58032. if err != nil {
  58033. return err
  58034. }
  58035. if err := f(x); err != nil {
  58036. return err
  58037. }
  58038. if x.NextPageToken == "" {
  58039. return nil
  58040. }
  58041. c.PageToken(x.NextPageToken)
  58042. }
  58043. }
  58044. // method id "compute.instanceGroupManagers.applyUpdatesToInstances":
  58045. type InstanceGroupManagersApplyUpdatesToInstancesCall struct {
  58046. s *Service
  58047. project string
  58048. zone string
  58049. instanceGroupManager string
  58050. instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest
  58051. urlParams_ gensupport.URLParams
  58052. ctx_ context.Context
  58053. header_ http.Header
  58054. }
  58055. // ApplyUpdatesToInstances: Apply changes to selected instances on the
  58056. // managed instance group. This method can be used to apply new
  58057. // overrides and/or new versions.
  58058. func (r *InstanceGroupManagersService) ApplyUpdatesToInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  58059. c := &InstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58060. c.project = project
  58061. c.zone = zone
  58062. c.instanceGroupManager = instanceGroupManager
  58063. c.instancegroupmanagersapplyupdatesrequest = instancegroupmanagersapplyupdatesrequest
  58064. return c
  58065. }
  58066. // Fields allows partial responses to be retrieved. See
  58067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58068. // for more information.
  58069. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  58070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58071. return c
  58072. }
  58073. // Context sets the context to be used in this call's Do method. Any
  58074. // pending HTTP request will be aborted if the provided context is
  58075. // canceled.
  58076. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  58077. c.ctx_ = ctx
  58078. return c
  58079. }
  58080. // Header returns an http.Header that can be modified by the caller to
  58081. // add HTTP headers to the request.
  58082. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  58083. if c.header_ == nil {
  58084. c.header_ = make(http.Header)
  58085. }
  58086. return c.header_
  58087. }
  58088. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  58089. reqHeaders := make(http.Header)
  58090. for k, v := range c.header_ {
  58091. reqHeaders[k] = v
  58092. }
  58093. reqHeaders.Set("User-Agent", c.s.userAgent())
  58094. var body io.Reader = nil
  58095. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest)
  58096. if err != nil {
  58097. return nil, err
  58098. }
  58099. reqHeaders.Set("Content-Type", "application/json")
  58100. c.urlParams_.Set("alt", alt)
  58101. c.urlParams_.Set("prettyPrint", "false")
  58102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  58103. urls += "?" + c.urlParams_.Encode()
  58104. req, err := http.NewRequest("POST", urls, body)
  58105. if err != nil {
  58106. return nil, err
  58107. }
  58108. req.Header = reqHeaders
  58109. googleapi.Expand(req.URL, map[string]string{
  58110. "project": c.project,
  58111. "zone": c.zone,
  58112. "instanceGroupManager": c.instanceGroupManager,
  58113. })
  58114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58115. }
  58116. // Do executes the "compute.instanceGroupManagers.applyUpdatesToInstances" call.
  58117. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58118. // status code is an error. Response headers are in either
  58119. // *Operation.ServerResponse.Header or (if a response was returned at
  58120. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58121. // to check whether the returned error was because
  58122. // http.StatusNotModified was returned.
  58123. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58124. gensupport.SetOptions(c.urlParams_, opts...)
  58125. res, err := c.doRequest("json")
  58126. if res != nil && res.StatusCode == http.StatusNotModified {
  58127. if res.Body != nil {
  58128. res.Body.Close()
  58129. }
  58130. return nil, &googleapi.Error{
  58131. Code: res.StatusCode,
  58132. Header: res.Header,
  58133. }
  58134. }
  58135. if err != nil {
  58136. return nil, err
  58137. }
  58138. defer googleapi.CloseBody(res)
  58139. if err := googleapi.CheckResponse(res); err != nil {
  58140. return nil, err
  58141. }
  58142. ret := &Operation{
  58143. ServerResponse: googleapi.ServerResponse{
  58144. Header: res.Header,
  58145. HTTPStatusCode: res.StatusCode,
  58146. },
  58147. }
  58148. target := &ret
  58149. if err := gensupport.DecodeResponse(target, res); err != nil {
  58150. return nil, err
  58151. }
  58152. return ret, nil
  58153. // {
  58154. // "description": "Apply changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.",
  58155. // "httpMethod": "POST",
  58156. // "id": "compute.instanceGroupManagers.applyUpdatesToInstances",
  58157. // "parameterOrder": [
  58158. // "project",
  58159. // "zone",
  58160. // "instanceGroupManager"
  58161. // ],
  58162. // "parameters": {
  58163. // "instanceGroupManager": {
  58164. // "description": "The name of the managed instance group, should conform to RFC1035.",
  58165. // "location": "path",
  58166. // "required": true,
  58167. // "type": "string"
  58168. // },
  58169. // "project": {
  58170. // "description": "Project ID for this request.",
  58171. // "location": "path",
  58172. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58173. // "required": true,
  58174. // "type": "string"
  58175. // },
  58176. // "zone": {
  58177. // "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.",
  58178. // "location": "path",
  58179. // "required": true,
  58180. // "type": "string"
  58181. // }
  58182. // },
  58183. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  58184. // "request": {
  58185. // "$ref": "InstanceGroupManagersApplyUpdatesRequest"
  58186. // },
  58187. // "response": {
  58188. // "$ref": "Operation"
  58189. // },
  58190. // "scopes": [
  58191. // "https://www.googleapis.com/auth/cloud-platform",
  58192. // "https://www.googleapis.com/auth/compute"
  58193. // ]
  58194. // }
  58195. }
  58196. // method id "compute.instanceGroupManagers.createInstances":
  58197. type InstanceGroupManagersCreateInstancesCall struct {
  58198. s *Service
  58199. project string
  58200. zone string
  58201. instanceGroupManager string
  58202. instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest
  58203. urlParams_ gensupport.URLParams
  58204. ctx_ context.Context
  58205. header_ http.Header
  58206. }
  58207. // CreateInstances: Creates instances with per-instance configs in this
  58208. // managed instance group. Instances are created using the current
  58209. // instance template. The create instances operation is marked DONE if
  58210. // the createInstances request is successful. The underlying actions
  58211. // take additional time. You must separately verify the status of the
  58212. // creating or actions with the listmanagedinstances method.
  58213. func (r *InstanceGroupManagersService) CreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest) *InstanceGroupManagersCreateInstancesCall {
  58214. c := &InstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58215. c.project = project
  58216. c.zone = zone
  58217. c.instanceGroupManager = instanceGroupManager
  58218. c.instancegroupmanagerscreateinstancesrequest = instancegroupmanagerscreateinstancesrequest
  58219. return c
  58220. }
  58221. // RequestId sets the optional parameter "requestId": An optional
  58222. // request ID to identify requests. Specify a unique request ID so that
  58223. // if you must retry your request, the server will know to ignore the
  58224. // request if it has already been completed.
  58225. //
  58226. // For example, consider a situation where you make an initial request
  58227. // and the request times out. If you make the request again with the
  58228. // same request ID, the server can check if original operation with the
  58229. // same request ID was received, and if so, will ignore the second
  58230. // request.
  58231. //
  58232. // The request ID must be a valid UUID with the exception that zero UUID
  58233. // is not supported (00000000-0000-0000-0000-000000000000).
  58234. func (c *InstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersCreateInstancesCall {
  58235. c.urlParams_.Set("requestId", requestId)
  58236. return c
  58237. }
  58238. // Fields allows partial responses to be retrieved. See
  58239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58240. // for more information.
  58241. func (c *InstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersCreateInstancesCall {
  58242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58243. return c
  58244. }
  58245. // Context sets the context to be used in this call's Do method. Any
  58246. // pending HTTP request will be aborted if the provided context is
  58247. // canceled.
  58248. func (c *InstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersCreateInstancesCall {
  58249. c.ctx_ = ctx
  58250. return c
  58251. }
  58252. // Header returns an http.Header that can be modified by the caller to
  58253. // add HTTP headers to the request.
  58254. func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header {
  58255. if c.header_ == nil {
  58256. c.header_ = make(http.Header)
  58257. }
  58258. return c.header_
  58259. }
  58260. func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  58261. reqHeaders := make(http.Header)
  58262. for k, v := range c.header_ {
  58263. reqHeaders[k] = v
  58264. }
  58265. reqHeaders.Set("User-Agent", c.s.userAgent())
  58266. var body io.Reader = nil
  58267. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest)
  58268. if err != nil {
  58269. return nil, err
  58270. }
  58271. reqHeaders.Set("Content-Type", "application/json")
  58272. c.urlParams_.Set("alt", alt)
  58273. c.urlParams_.Set("prettyPrint", "false")
  58274. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances")
  58275. urls += "?" + c.urlParams_.Encode()
  58276. req, err := http.NewRequest("POST", urls, body)
  58277. if err != nil {
  58278. return nil, err
  58279. }
  58280. req.Header = reqHeaders
  58281. googleapi.Expand(req.URL, map[string]string{
  58282. "project": c.project,
  58283. "zone": c.zone,
  58284. "instanceGroupManager": c.instanceGroupManager,
  58285. })
  58286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58287. }
  58288. // Do executes the "compute.instanceGroupManagers.createInstances" call.
  58289. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58290. // status code is an error. Response headers are in either
  58291. // *Operation.ServerResponse.Header or (if a response was returned at
  58292. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58293. // to check whether the returned error was because
  58294. // http.StatusNotModified was returned.
  58295. func (c *InstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58296. gensupport.SetOptions(c.urlParams_, opts...)
  58297. res, err := c.doRequest("json")
  58298. if res != nil && res.StatusCode == http.StatusNotModified {
  58299. if res.Body != nil {
  58300. res.Body.Close()
  58301. }
  58302. return nil, &googleapi.Error{
  58303. Code: res.StatusCode,
  58304. Header: res.Header,
  58305. }
  58306. }
  58307. if err != nil {
  58308. return nil, err
  58309. }
  58310. defer googleapi.CloseBody(res)
  58311. if err := googleapi.CheckResponse(res); err != nil {
  58312. return nil, err
  58313. }
  58314. ret := &Operation{
  58315. ServerResponse: googleapi.ServerResponse{
  58316. Header: res.Header,
  58317. HTTPStatusCode: res.StatusCode,
  58318. },
  58319. }
  58320. target := &ret
  58321. if err := gensupport.DecodeResponse(target, res); err != nil {
  58322. return nil, err
  58323. }
  58324. return ret, nil
  58325. // {
  58326. // "description": "Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.",
  58327. // "httpMethod": "POST",
  58328. // "id": "compute.instanceGroupManagers.createInstances",
  58329. // "parameterOrder": [
  58330. // "project",
  58331. // "zone",
  58332. // "instanceGroupManager"
  58333. // ],
  58334. // "parameters": {
  58335. // "instanceGroupManager": {
  58336. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  58337. // "location": "path",
  58338. // "required": true,
  58339. // "type": "string"
  58340. // },
  58341. // "project": {
  58342. // "description": "Project ID for this request.",
  58343. // "location": "path",
  58344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58345. // "required": true,
  58346. // "type": "string"
  58347. // },
  58348. // "requestId": {
  58349. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58350. // "location": "query",
  58351. // "type": "string"
  58352. // },
  58353. // "zone": {
  58354. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  58355. // "location": "path",
  58356. // "required": true,
  58357. // "type": "string"
  58358. // }
  58359. // },
  58360. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances",
  58361. // "request": {
  58362. // "$ref": "InstanceGroupManagersCreateInstancesRequest"
  58363. // },
  58364. // "response": {
  58365. // "$ref": "Operation"
  58366. // },
  58367. // "scopes": [
  58368. // "https://www.googleapis.com/auth/cloud-platform",
  58369. // "https://www.googleapis.com/auth/compute"
  58370. // ]
  58371. // }
  58372. }
  58373. // method id "compute.instanceGroupManagers.delete":
  58374. type InstanceGroupManagersDeleteCall struct {
  58375. s *Service
  58376. project string
  58377. zone string
  58378. instanceGroupManager string
  58379. urlParams_ gensupport.URLParams
  58380. ctx_ context.Context
  58381. header_ http.Header
  58382. }
  58383. // Delete: Deletes the specified managed instance group and all of the
  58384. // instances in that group. Note that the instance group must not belong
  58385. // to a backend service. Read Deleting an instance group for more
  58386. // information.
  58387. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  58388. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58389. c.project = project
  58390. c.zone = zone
  58391. c.instanceGroupManager = instanceGroupManager
  58392. return c
  58393. }
  58394. // RequestId sets the optional parameter "requestId": An optional
  58395. // request ID to identify requests. Specify a unique request ID so that
  58396. // if you must retry your request, the server will know to ignore the
  58397. // request if it has already been completed.
  58398. //
  58399. // For example, consider a situation where you make an initial request
  58400. // and the request times out. If you make the request again with the
  58401. // same request ID, the server can check if original operation with the
  58402. // same request ID was received, and if so, will ignore the second
  58403. // request. This prevents clients from accidentally creating duplicate
  58404. // commitments.
  58405. //
  58406. // The request ID must be a valid UUID with the exception that zero UUID
  58407. // is not supported (00000000-0000-0000-0000-000000000000).
  58408. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  58409. c.urlParams_.Set("requestId", requestId)
  58410. return c
  58411. }
  58412. // Fields allows partial responses to be retrieved. See
  58413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58414. // for more information.
  58415. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  58416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58417. return c
  58418. }
  58419. // Context sets the context to be used in this call's Do method. Any
  58420. // pending HTTP request will be aborted if the provided context is
  58421. // canceled.
  58422. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  58423. c.ctx_ = ctx
  58424. return c
  58425. }
  58426. // Header returns an http.Header that can be modified by the caller to
  58427. // add HTTP headers to the request.
  58428. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  58429. if c.header_ == nil {
  58430. c.header_ = make(http.Header)
  58431. }
  58432. return c.header_
  58433. }
  58434. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  58435. reqHeaders := make(http.Header)
  58436. for k, v := range c.header_ {
  58437. reqHeaders[k] = v
  58438. }
  58439. reqHeaders.Set("User-Agent", c.s.userAgent())
  58440. var body io.Reader = nil
  58441. c.urlParams_.Set("alt", alt)
  58442. c.urlParams_.Set("prettyPrint", "false")
  58443. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  58444. urls += "?" + c.urlParams_.Encode()
  58445. req, err := http.NewRequest("DELETE", urls, body)
  58446. if err != nil {
  58447. return nil, err
  58448. }
  58449. req.Header = reqHeaders
  58450. googleapi.Expand(req.URL, map[string]string{
  58451. "project": c.project,
  58452. "zone": c.zone,
  58453. "instanceGroupManager": c.instanceGroupManager,
  58454. })
  58455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58456. }
  58457. // Do executes the "compute.instanceGroupManagers.delete" call.
  58458. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58459. // status code is an error. Response headers are in either
  58460. // *Operation.ServerResponse.Header or (if a response was returned at
  58461. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58462. // to check whether the returned error was because
  58463. // http.StatusNotModified was returned.
  58464. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58465. gensupport.SetOptions(c.urlParams_, opts...)
  58466. res, err := c.doRequest("json")
  58467. if res != nil && res.StatusCode == http.StatusNotModified {
  58468. if res.Body != nil {
  58469. res.Body.Close()
  58470. }
  58471. return nil, &googleapi.Error{
  58472. Code: res.StatusCode,
  58473. Header: res.Header,
  58474. }
  58475. }
  58476. if err != nil {
  58477. return nil, err
  58478. }
  58479. defer googleapi.CloseBody(res)
  58480. if err := googleapi.CheckResponse(res); err != nil {
  58481. return nil, err
  58482. }
  58483. ret := &Operation{
  58484. ServerResponse: googleapi.ServerResponse{
  58485. Header: res.Header,
  58486. HTTPStatusCode: res.StatusCode,
  58487. },
  58488. }
  58489. target := &ret
  58490. if err := gensupport.DecodeResponse(target, res); err != nil {
  58491. return nil, err
  58492. }
  58493. return ret, nil
  58494. // {
  58495. // "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.",
  58496. // "httpMethod": "DELETE",
  58497. // "id": "compute.instanceGroupManagers.delete",
  58498. // "parameterOrder": [
  58499. // "project",
  58500. // "zone",
  58501. // "instanceGroupManager"
  58502. // ],
  58503. // "parameters": {
  58504. // "instanceGroupManager": {
  58505. // "description": "The name of the managed instance group to delete.",
  58506. // "location": "path",
  58507. // "required": true,
  58508. // "type": "string"
  58509. // },
  58510. // "project": {
  58511. // "description": "Project ID for this request.",
  58512. // "location": "path",
  58513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58514. // "required": true,
  58515. // "type": "string"
  58516. // },
  58517. // "requestId": {
  58518. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58519. // "location": "query",
  58520. // "type": "string"
  58521. // },
  58522. // "zone": {
  58523. // "description": "The name of the zone where the managed instance group is located.",
  58524. // "location": "path",
  58525. // "required": true,
  58526. // "type": "string"
  58527. // }
  58528. // },
  58529. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  58530. // "response": {
  58531. // "$ref": "Operation"
  58532. // },
  58533. // "scopes": [
  58534. // "https://www.googleapis.com/auth/cloud-platform",
  58535. // "https://www.googleapis.com/auth/compute"
  58536. // ]
  58537. // }
  58538. }
  58539. // method id "compute.instanceGroupManagers.deleteInstances":
  58540. type InstanceGroupManagersDeleteInstancesCall struct {
  58541. s *Service
  58542. project string
  58543. zone string
  58544. instanceGroupManager string
  58545. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  58546. urlParams_ gensupport.URLParams
  58547. ctx_ context.Context
  58548. header_ http.Header
  58549. }
  58550. // DeleteInstances: Flags the specified instances in the managed
  58551. // instance group for immediate deletion. The instances are also removed
  58552. // from any target pools of which they were a member. This method
  58553. // reduces the targetSize of the managed instance group by the number of
  58554. // instances that you delete. This operation is marked as DONE when the
  58555. // action is scheduled even if the instances are still being deleted.
  58556. // You must separately verify the status of the deleting action with the
  58557. // listmanagedinstances method.
  58558. //
  58559. // If the group is part of a backend service that has enabled connection
  58560. // draining, it can take up to 60 seconds after the connection draining
  58561. // duration has elapsed before the VM instance is removed or
  58562. // deleted.
  58563. //
  58564. // You can specify a maximum of 1000 instances with this method per
  58565. // request.
  58566. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  58567. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58568. c.project = project
  58569. c.zone = zone
  58570. c.instanceGroupManager = instanceGroupManager
  58571. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  58572. return c
  58573. }
  58574. // RequestId sets the optional parameter "requestId": An optional
  58575. // request ID to identify requests. Specify a unique request ID so that
  58576. // if you must retry your request, the server will know to ignore the
  58577. // request if it has already been completed.
  58578. //
  58579. // For example, consider a situation where you make an initial request
  58580. // and the request times out. If you make the request again with the
  58581. // same request ID, the server can check if original operation with the
  58582. // same request ID was received, and if so, will ignore the second
  58583. // request. This prevents clients from accidentally creating duplicate
  58584. // commitments.
  58585. //
  58586. // The request ID must be a valid UUID with the exception that zero UUID
  58587. // is not supported (00000000-0000-0000-0000-000000000000).
  58588. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  58589. c.urlParams_.Set("requestId", requestId)
  58590. return c
  58591. }
  58592. // Fields allows partial responses to be retrieved. See
  58593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58594. // for more information.
  58595. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  58596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58597. return c
  58598. }
  58599. // Context sets the context to be used in this call's Do method. Any
  58600. // pending HTTP request will be aborted if the provided context is
  58601. // canceled.
  58602. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  58603. c.ctx_ = ctx
  58604. return c
  58605. }
  58606. // Header returns an http.Header that can be modified by the caller to
  58607. // add HTTP headers to the request.
  58608. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  58609. if c.header_ == nil {
  58610. c.header_ = make(http.Header)
  58611. }
  58612. return c.header_
  58613. }
  58614. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  58615. reqHeaders := make(http.Header)
  58616. for k, v := range c.header_ {
  58617. reqHeaders[k] = v
  58618. }
  58619. reqHeaders.Set("User-Agent", c.s.userAgent())
  58620. var body io.Reader = nil
  58621. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  58622. if err != nil {
  58623. return nil, err
  58624. }
  58625. reqHeaders.Set("Content-Type", "application/json")
  58626. c.urlParams_.Set("alt", alt)
  58627. c.urlParams_.Set("prettyPrint", "false")
  58628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  58629. urls += "?" + c.urlParams_.Encode()
  58630. req, err := http.NewRequest("POST", urls, body)
  58631. if err != nil {
  58632. return nil, err
  58633. }
  58634. req.Header = reqHeaders
  58635. googleapi.Expand(req.URL, map[string]string{
  58636. "project": c.project,
  58637. "zone": c.zone,
  58638. "instanceGroupManager": c.instanceGroupManager,
  58639. })
  58640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58641. }
  58642. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  58643. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58644. // status code is an error. Response headers are in either
  58645. // *Operation.ServerResponse.Header or (if a response was returned at
  58646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58647. // to check whether the returned error was because
  58648. // http.StatusNotModified was returned.
  58649. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58650. gensupport.SetOptions(c.urlParams_, opts...)
  58651. res, err := c.doRequest("json")
  58652. if res != nil && res.StatusCode == http.StatusNotModified {
  58653. if res.Body != nil {
  58654. res.Body.Close()
  58655. }
  58656. return nil, &googleapi.Error{
  58657. Code: res.StatusCode,
  58658. Header: res.Header,
  58659. }
  58660. }
  58661. if err != nil {
  58662. return nil, err
  58663. }
  58664. defer googleapi.CloseBody(res)
  58665. if err := googleapi.CheckResponse(res); err != nil {
  58666. return nil, err
  58667. }
  58668. ret := &Operation{
  58669. ServerResponse: googleapi.ServerResponse{
  58670. Header: res.Header,
  58671. HTTPStatusCode: res.StatusCode,
  58672. },
  58673. }
  58674. target := &ret
  58675. if err := gensupport.DecodeResponse(target, res); err != nil {
  58676. return nil, err
  58677. }
  58678. return ret, nil
  58679. // {
  58680. // "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.",
  58681. // "httpMethod": "POST",
  58682. // "id": "compute.instanceGroupManagers.deleteInstances",
  58683. // "parameterOrder": [
  58684. // "project",
  58685. // "zone",
  58686. // "instanceGroupManager"
  58687. // ],
  58688. // "parameters": {
  58689. // "instanceGroupManager": {
  58690. // "description": "The name of the managed instance group.",
  58691. // "location": "path",
  58692. // "required": true,
  58693. // "type": "string"
  58694. // },
  58695. // "project": {
  58696. // "description": "Project ID for this request.",
  58697. // "location": "path",
  58698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58699. // "required": true,
  58700. // "type": "string"
  58701. // },
  58702. // "requestId": {
  58703. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58704. // "location": "query",
  58705. // "type": "string"
  58706. // },
  58707. // "zone": {
  58708. // "description": "The name of the zone where the managed instance group is located.",
  58709. // "location": "path",
  58710. // "required": true,
  58711. // "type": "string"
  58712. // }
  58713. // },
  58714. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  58715. // "request": {
  58716. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  58717. // },
  58718. // "response": {
  58719. // "$ref": "Operation"
  58720. // },
  58721. // "scopes": [
  58722. // "https://www.googleapis.com/auth/cloud-platform",
  58723. // "https://www.googleapis.com/auth/compute"
  58724. // ]
  58725. // }
  58726. }
  58727. // method id "compute.instanceGroupManagers.deletePerInstanceConfigs":
  58728. type InstanceGroupManagersDeletePerInstanceConfigsCall struct {
  58729. s *Service
  58730. project string
  58731. zone string
  58732. instanceGroupManager string
  58733. instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq
  58734. urlParams_ gensupport.URLParams
  58735. ctx_ context.Context
  58736. header_ http.Header
  58737. }
  58738. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  58739. // the managed instance group.
  58740. func (r *InstanceGroupManagersService) DeletePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  58741. c := &InstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58742. c.project = project
  58743. c.zone = zone
  58744. c.instanceGroupManager = instanceGroupManager
  58745. c.instancegroupmanagersdeleteperinstanceconfigsreq = instancegroupmanagersdeleteperinstanceconfigsreq
  58746. return c
  58747. }
  58748. // Fields allows partial responses to be retrieved. See
  58749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58750. // for more information.
  58751. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  58752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58753. return c
  58754. }
  58755. // Context sets the context to be used in this call's Do method. Any
  58756. // pending HTTP request will be aborted if the provided context is
  58757. // canceled.
  58758. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  58759. c.ctx_ = ctx
  58760. return c
  58761. }
  58762. // Header returns an http.Header that can be modified by the caller to
  58763. // add HTTP headers to the request.
  58764. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  58765. if c.header_ == nil {
  58766. c.header_ = make(http.Header)
  58767. }
  58768. return c.header_
  58769. }
  58770. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  58771. reqHeaders := make(http.Header)
  58772. for k, v := range c.header_ {
  58773. reqHeaders[k] = v
  58774. }
  58775. reqHeaders.Set("User-Agent", c.s.userAgent())
  58776. var body io.Reader = nil
  58777. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq)
  58778. if err != nil {
  58779. return nil, err
  58780. }
  58781. reqHeaders.Set("Content-Type", "application/json")
  58782. c.urlParams_.Set("alt", alt)
  58783. c.urlParams_.Set("prettyPrint", "false")
  58784. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  58785. urls += "?" + c.urlParams_.Encode()
  58786. req, err := http.NewRequest("POST", urls, body)
  58787. if err != nil {
  58788. return nil, err
  58789. }
  58790. req.Header = reqHeaders
  58791. googleapi.Expand(req.URL, map[string]string{
  58792. "project": c.project,
  58793. "zone": c.zone,
  58794. "instanceGroupManager": c.instanceGroupManager,
  58795. })
  58796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58797. }
  58798. // Do executes the "compute.instanceGroupManagers.deletePerInstanceConfigs" call.
  58799. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58800. // status code is an error. Response headers are in either
  58801. // *Operation.ServerResponse.Header or (if a response was returned at
  58802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58803. // to check whether the returned error was because
  58804. // http.StatusNotModified was returned.
  58805. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58806. gensupport.SetOptions(c.urlParams_, opts...)
  58807. res, err := c.doRequest("json")
  58808. if res != nil && res.StatusCode == http.StatusNotModified {
  58809. if res.Body != nil {
  58810. res.Body.Close()
  58811. }
  58812. return nil, &googleapi.Error{
  58813. Code: res.StatusCode,
  58814. Header: res.Header,
  58815. }
  58816. }
  58817. if err != nil {
  58818. return nil, err
  58819. }
  58820. defer googleapi.CloseBody(res)
  58821. if err := googleapi.CheckResponse(res); err != nil {
  58822. return nil, err
  58823. }
  58824. ret := &Operation{
  58825. ServerResponse: googleapi.ServerResponse{
  58826. Header: res.Header,
  58827. HTTPStatusCode: res.StatusCode,
  58828. },
  58829. }
  58830. target := &ret
  58831. if err := gensupport.DecodeResponse(target, res); err != nil {
  58832. return nil, err
  58833. }
  58834. return ret, nil
  58835. // {
  58836. // "description": "Deletes selected per-instance configs for the managed instance group.",
  58837. // "httpMethod": "POST",
  58838. // "id": "compute.instanceGroupManagers.deletePerInstanceConfigs",
  58839. // "parameterOrder": [
  58840. // "project",
  58841. // "zone",
  58842. // "instanceGroupManager"
  58843. // ],
  58844. // "parameters": {
  58845. // "instanceGroupManager": {
  58846. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  58847. // "location": "path",
  58848. // "required": true,
  58849. // "type": "string"
  58850. // },
  58851. // "project": {
  58852. // "description": "Project ID for this request.",
  58853. // "location": "path",
  58854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58855. // "required": true,
  58856. // "type": "string"
  58857. // },
  58858. // "zone": {
  58859. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  58860. // "location": "path",
  58861. // "required": true,
  58862. // "type": "string"
  58863. // }
  58864. // },
  58865. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  58866. // "request": {
  58867. // "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq"
  58868. // },
  58869. // "response": {
  58870. // "$ref": "Operation"
  58871. // },
  58872. // "scopes": [
  58873. // "https://www.googleapis.com/auth/cloud-platform",
  58874. // "https://www.googleapis.com/auth/compute"
  58875. // ]
  58876. // }
  58877. }
  58878. // method id "compute.instanceGroupManagers.get":
  58879. type InstanceGroupManagersGetCall struct {
  58880. s *Service
  58881. project string
  58882. zone string
  58883. instanceGroupManager string
  58884. urlParams_ gensupport.URLParams
  58885. ifNoneMatch_ string
  58886. ctx_ context.Context
  58887. header_ http.Header
  58888. }
  58889. // Get: Returns all of the details about the specified managed instance
  58890. // group. Gets a list of available managed instance groups by making a
  58891. // list() request.
  58892. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  58893. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58894. c.project = project
  58895. c.zone = zone
  58896. c.instanceGroupManager = instanceGroupManager
  58897. return c
  58898. }
  58899. // Fields allows partial responses to be retrieved. See
  58900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58901. // for more information.
  58902. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  58903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58904. return c
  58905. }
  58906. // IfNoneMatch sets the optional parameter which makes the operation
  58907. // fail if the object's ETag matches the given value. This is useful for
  58908. // getting updates only after the object has changed since the last
  58909. // request. Use googleapi.IsNotModified to check whether the response
  58910. // error from Do is the result of In-None-Match.
  58911. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  58912. c.ifNoneMatch_ = entityTag
  58913. return c
  58914. }
  58915. // Context sets the context to be used in this call's Do method. Any
  58916. // pending HTTP request will be aborted if the provided context is
  58917. // canceled.
  58918. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  58919. c.ctx_ = ctx
  58920. return c
  58921. }
  58922. // Header returns an http.Header that can be modified by the caller to
  58923. // add HTTP headers to the request.
  58924. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  58925. if c.header_ == nil {
  58926. c.header_ = make(http.Header)
  58927. }
  58928. return c.header_
  58929. }
  58930. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  58931. reqHeaders := make(http.Header)
  58932. for k, v := range c.header_ {
  58933. reqHeaders[k] = v
  58934. }
  58935. reqHeaders.Set("User-Agent", c.s.userAgent())
  58936. if c.ifNoneMatch_ != "" {
  58937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58938. }
  58939. var body io.Reader = nil
  58940. c.urlParams_.Set("alt", alt)
  58941. c.urlParams_.Set("prettyPrint", "false")
  58942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  58943. urls += "?" + c.urlParams_.Encode()
  58944. req, err := http.NewRequest("GET", urls, body)
  58945. if err != nil {
  58946. return nil, err
  58947. }
  58948. req.Header = reqHeaders
  58949. googleapi.Expand(req.URL, map[string]string{
  58950. "project": c.project,
  58951. "zone": c.zone,
  58952. "instanceGroupManager": c.instanceGroupManager,
  58953. })
  58954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58955. }
  58956. // Do executes the "compute.instanceGroupManagers.get" call.
  58957. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  58958. // non-2xx status code is an error. Response headers are in either
  58959. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  58960. // returned at all) in error.(*googleapi.Error).Header. Use
  58961. // googleapi.IsNotModified to check whether the returned error was
  58962. // because http.StatusNotModified was returned.
  58963. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  58964. gensupport.SetOptions(c.urlParams_, opts...)
  58965. res, err := c.doRequest("json")
  58966. if res != nil && res.StatusCode == http.StatusNotModified {
  58967. if res.Body != nil {
  58968. res.Body.Close()
  58969. }
  58970. return nil, &googleapi.Error{
  58971. Code: res.StatusCode,
  58972. Header: res.Header,
  58973. }
  58974. }
  58975. if err != nil {
  58976. return nil, err
  58977. }
  58978. defer googleapi.CloseBody(res)
  58979. if err := googleapi.CheckResponse(res); err != nil {
  58980. return nil, err
  58981. }
  58982. ret := &InstanceGroupManager{
  58983. ServerResponse: googleapi.ServerResponse{
  58984. Header: res.Header,
  58985. HTTPStatusCode: res.StatusCode,
  58986. },
  58987. }
  58988. target := &ret
  58989. if err := gensupport.DecodeResponse(target, res); err != nil {
  58990. return nil, err
  58991. }
  58992. return ret, nil
  58993. // {
  58994. // "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.",
  58995. // "httpMethod": "GET",
  58996. // "id": "compute.instanceGroupManagers.get",
  58997. // "parameterOrder": [
  58998. // "project",
  58999. // "zone",
  59000. // "instanceGroupManager"
  59001. // ],
  59002. // "parameters": {
  59003. // "instanceGroupManager": {
  59004. // "description": "The name of the managed instance group.",
  59005. // "location": "path",
  59006. // "required": true,
  59007. // "type": "string"
  59008. // },
  59009. // "project": {
  59010. // "description": "Project ID for this request.",
  59011. // "location": "path",
  59012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59013. // "required": true,
  59014. // "type": "string"
  59015. // },
  59016. // "zone": {
  59017. // "description": "The name of the zone where the managed instance group is located.",
  59018. // "location": "path",
  59019. // "required": true,
  59020. // "type": "string"
  59021. // }
  59022. // },
  59023. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  59024. // "response": {
  59025. // "$ref": "InstanceGroupManager"
  59026. // },
  59027. // "scopes": [
  59028. // "https://www.googleapis.com/auth/cloud-platform",
  59029. // "https://www.googleapis.com/auth/compute",
  59030. // "https://www.googleapis.com/auth/compute.readonly"
  59031. // ]
  59032. // }
  59033. }
  59034. // method id "compute.instanceGroupManagers.insert":
  59035. type InstanceGroupManagersInsertCall struct {
  59036. s *Service
  59037. project string
  59038. zone string
  59039. instancegroupmanager *InstanceGroupManager
  59040. urlParams_ gensupport.URLParams
  59041. ctx_ context.Context
  59042. header_ http.Header
  59043. }
  59044. // Insert: Creates a managed instance group using the information that
  59045. // you specify in the request. After the group is created, instances in
  59046. // the group are created using the specified instance template. This
  59047. // operation is marked as DONE when the group is created even if the
  59048. // instances in the group have not yet been created. You must separately
  59049. // verify the status of the individual instances with the
  59050. // listmanagedinstances method.
  59051. //
  59052. // A managed instance group can have up to 1000 VM instances per group.
  59053. // Please contact Cloud Support if you need an increase in this limit.
  59054. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  59055. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59056. c.project = project
  59057. c.zone = zone
  59058. c.instancegroupmanager = instancegroupmanager
  59059. return c
  59060. }
  59061. // RequestId sets the optional parameter "requestId": An optional
  59062. // request ID to identify requests. Specify a unique request ID so that
  59063. // if you must retry your request, the server will know to ignore the
  59064. // request if it has already been completed.
  59065. //
  59066. // For example, consider a situation where you make an initial request
  59067. // and the request times out. If you make the request again with the
  59068. // same request ID, the server can check if original operation with the
  59069. // same request ID was received, and if so, will ignore the second
  59070. // request. This prevents clients from accidentally creating duplicate
  59071. // commitments.
  59072. //
  59073. // The request ID must be a valid UUID with the exception that zero UUID
  59074. // is not supported (00000000-0000-0000-0000-000000000000).
  59075. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  59076. c.urlParams_.Set("requestId", requestId)
  59077. return c
  59078. }
  59079. // Fields allows partial responses to be retrieved. See
  59080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59081. // for more information.
  59082. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  59083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59084. return c
  59085. }
  59086. // Context sets the context to be used in this call's Do method. Any
  59087. // pending HTTP request will be aborted if the provided context is
  59088. // canceled.
  59089. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  59090. c.ctx_ = ctx
  59091. return c
  59092. }
  59093. // Header returns an http.Header that can be modified by the caller to
  59094. // add HTTP headers to the request.
  59095. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  59096. if c.header_ == nil {
  59097. c.header_ = make(http.Header)
  59098. }
  59099. return c.header_
  59100. }
  59101. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  59102. reqHeaders := make(http.Header)
  59103. for k, v := range c.header_ {
  59104. reqHeaders[k] = v
  59105. }
  59106. reqHeaders.Set("User-Agent", c.s.userAgent())
  59107. var body io.Reader = nil
  59108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  59109. if err != nil {
  59110. return nil, err
  59111. }
  59112. reqHeaders.Set("Content-Type", "application/json")
  59113. c.urlParams_.Set("alt", alt)
  59114. c.urlParams_.Set("prettyPrint", "false")
  59115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  59116. urls += "?" + c.urlParams_.Encode()
  59117. req, err := http.NewRequest("POST", urls, body)
  59118. if err != nil {
  59119. return nil, err
  59120. }
  59121. req.Header = reqHeaders
  59122. googleapi.Expand(req.URL, map[string]string{
  59123. "project": c.project,
  59124. "zone": c.zone,
  59125. })
  59126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59127. }
  59128. // Do executes the "compute.instanceGroupManagers.insert" call.
  59129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59130. // status code is an error. Response headers are in either
  59131. // *Operation.ServerResponse.Header or (if a response was returned at
  59132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59133. // to check whether the returned error was because
  59134. // http.StatusNotModified was returned.
  59135. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59136. gensupport.SetOptions(c.urlParams_, opts...)
  59137. res, err := c.doRequest("json")
  59138. if res != nil && res.StatusCode == http.StatusNotModified {
  59139. if res.Body != nil {
  59140. res.Body.Close()
  59141. }
  59142. return nil, &googleapi.Error{
  59143. Code: res.StatusCode,
  59144. Header: res.Header,
  59145. }
  59146. }
  59147. if err != nil {
  59148. return nil, err
  59149. }
  59150. defer googleapi.CloseBody(res)
  59151. if err := googleapi.CheckResponse(res); err != nil {
  59152. return nil, err
  59153. }
  59154. ret := &Operation{
  59155. ServerResponse: googleapi.ServerResponse{
  59156. Header: res.Header,
  59157. HTTPStatusCode: res.StatusCode,
  59158. },
  59159. }
  59160. target := &ret
  59161. if err := gensupport.DecodeResponse(target, res); err != nil {
  59162. return nil, err
  59163. }
  59164. return ret, nil
  59165. // {
  59166. // "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.",
  59167. // "httpMethod": "POST",
  59168. // "id": "compute.instanceGroupManagers.insert",
  59169. // "parameterOrder": [
  59170. // "project",
  59171. // "zone"
  59172. // ],
  59173. // "parameters": {
  59174. // "project": {
  59175. // "description": "Project ID for this request.",
  59176. // "location": "path",
  59177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59178. // "required": true,
  59179. // "type": "string"
  59180. // },
  59181. // "requestId": {
  59182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59183. // "location": "query",
  59184. // "type": "string"
  59185. // },
  59186. // "zone": {
  59187. // "description": "The name of the zone where you want to create the managed instance group.",
  59188. // "location": "path",
  59189. // "required": true,
  59190. // "type": "string"
  59191. // }
  59192. // },
  59193. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  59194. // "request": {
  59195. // "$ref": "InstanceGroupManager"
  59196. // },
  59197. // "response": {
  59198. // "$ref": "Operation"
  59199. // },
  59200. // "scopes": [
  59201. // "https://www.googleapis.com/auth/cloud-platform",
  59202. // "https://www.googleapis.com/auth/compute"
  59203. // ]
  59204. // }
  59205. }
  59206. // method id "compute.instanceGroupManagers.list":
  59207. type InstanceGroupManagersListCall struct {
  59208. s *Service
  59209. project string
  59210. zone string
  59211. urlParams_ gensupport.URLParams
  59212. ifNoneMatch_ string
  59213. ctx_ context.Context
  59214. header_ http.Header
  59215. }
  59216. // List: Retrieves a list of managed instance groups that are contained
  59217. // within the specified project and zone.
  59218. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  59219. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59220. c.project = project
  59221. c.zone = zone
  59222. return c
  59223. }
  59224. // Filter sets the optional parameter "filter": A filter expression that
  59225. // filters resources listed in the response. The expression must specify
  59226. // the field name, a comparison operator, and the value that you want to
  59227. // use for filtering. The value must be a string, a number, or a
  59228. // boolean. The comparison operator must be either =, !=, >, or <.
  59229. //
  59230. // For example, if you are filtering Compute Engine instances, you can
  59231. // exclude instances named example-instance by specifying name !=
  59232. // example-instance.
  59233. //
  59234. // You can also filter nested fields. For example, you could specify
  59235. // scheduling.automaticRestart = false to include instances only if they
  59236. // are not scheduled for automatic restarts. You can use filtering on
  59237. // nested fields to filter based on resource labels.
  59238. //
  59239. // To filter on multiple expressions, provide each separate expression
  59240. // within parentheses. For example, (scheduling.automaticRestart = true)
  59241. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59242. // AND expression. However, you can include AND and OR expressions
  59243. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59244. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59245. // true).
  59246. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  59247. c.urlParams_.Set("filter", filter)
  59248. return c
  59249. }
  59250. // MaxResults sets the optional parameter "maxResults": The maximum
  59251. // number of results per page that should be returned. If the number of
  59252. // available results is larger than maxResults, Compute Engine returns a
  59253. // nextPageToken that can be used to get the next page of results in
  59254. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59255. // (Default: 500)
  59256. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  59257. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59258. return c
  59259. }
  59260. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59261. // a certain order. By default, results are returned in alphanumerical
  59262. // order based on the resource name.
  59263. //
  59264. // You can also sort results in descending order based on the creation
  59265. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59266. // based on the creationTimestamp field in reverse chronological order
  59267. // (newest result first). Use this to sort resources like operations so
  59268. // that the newest operation is returned first.
  59269. //
  59270. // Currently, only sorting by name or creationTimestamp desc is
  59271. // supported.
  59272. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  59273. c.urlParams_.Set("orderBy", orderBy)
  59274. return c
  59275. }
  59276. // PageToken sets the optional parameter "pageToken": Specifies a page
  59277. // token to use. Set pageToken to the nextPageToken returned by a
  59278. // previous list request to get the next page of results.
  59279. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  59280. c.urlParams_.Set("pageToken", pageToken)
  59281. return c
  59282. }
  59283. // Fields allows partial responses to be retrieved. See
  59284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59285. // for more information.
  59286. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  59287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59288. return c
  59289. }
  59290. // IfNoneMatch sets the optional parameter which makes the operation
  59291. // fail if the object's ETag matches the given value. This is useful for
  59292. // getting updates only after the object has changed since the last
  59293. // request. Use googleapi.IsNotModified to check whether the response
  59294. // error from Do is the result of In-None-Match.
  59295. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  59296. c.ifNoneMatch_ = entityTag
  59297. return c
  59298. }
  59299. // Context sets the context to be used in this call's Do method. Any
  59300. // pending HTTP request will be aborted if the provided context is
  59301. // canceled.
  59302. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  59303. c.ctx_ = ctx
  59304. return c
  59305. }
  59306. // Header returns an http.Header that can be modified by the caller to
  59307. // add HTTP headers to the request.
  59308. func (c *InstanceGroupManagersListCall) Header() http.Header {
  59309. if c.header_ == nil {
  59310. c.header_ = make(http.Header)
  59311. }
  59312. return c.header_
  59313. }
  59314. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  59315. reqHeaders := make(http.Header)
  59316. for k, v := range c.header_ {
  59317. reqHeaders[k] = v
  59318. }
  59319. reqHeaders.Set("User-Agent", c.s.userAgent())
  59320. if c.ifNoneMatch_ != "" {
  59321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59322. }
  59323. var body io.Reader = nil
  59324. c.urlParams_.Set("alt", alt)
  59325. c.urlParams_.Set("prettyPrint", "false")
  59326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  59327. urls += "?" + c.urlParams_.Encode()
  59328. req, err := http.NewRequest("GET", urls, body)
  59329. if err != nil {
  59330. return nil, err
  59331. }
  59332. req.Header = reqHeaders
  59333. googleapi.Expand(req.URL, map[string]string{
  59334. "project": c.project,
  59335. "zone": c.zone,
  59336. })
  59337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59338. }
  59339. // Do executes the "compute.instanceGroupManagers.list" call.
  59340. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  59341. // Any non-2xx status code is an error. Response headers are in either
  59342. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  59343. // returned at all) in error.(*googleapi.Error).Header. Use
  59344. // googleapi.IsNotModified to check whether the returned error was
  59345. // because http.StatusNotModified was returned.
  59346. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  59347. gensupport.SetOptions(c.urlParams_, opts...)
  59348. res, err := c.doRequest("json")
  59349. if res != nil && res.StatusCode == http.StatusNotModified {
  59350. if res.Body != nil {
  59351. res.Body.Close()
  59352. }
  59353. return nil, &googleapi.Error{
  59354. Code: res.StatusCode,
  59355. Header: res.Header,
  59356. }
  59357. }
  59358. if err != nil {
  59359. return nil, err
  59360. }
  59361. defer googleapi.CloseBody(res)
  59362. if err := googleapi.CheckResponse(res); err != nil {
  59363. return nil, err
  59364. }
  59365. ret := &InstanceGroupManagerList{
  59366. ServerResponse: googleapi.ServerResponse{
  59367. Header: res.Header,
  59368. HTTPStatusCode: res.StatusCode,
  59369. },
  59370. }
  59371. target := &ret
  59372. if err := gensupport.DecodeResponse(target, res); err != nil {
  59373. return nil, err
  59374. }
  59375. return ret, nil
  59376. // {
  59377. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  59378. // "httpMethod": "GET",
  59379. // "id": "compute.instanceGroupManagers.list",
  59380. // "parameterOrder": [
  59381. // "project",
  59382. // "zone"
  59383. // ],
  59384. // "parameters": {
  59385. // "filter": {
  59386. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59387. // "location": "query",
  59388. // "type": "string"
  59389. // },
  59390. // "maxResults": {
  59391. // "default": "500",
  59392. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59393. // "format": "uint32",
  59394. // "location": "query",
  59395. // "minimum": "0",
  59396. // "type": "integer"
  59397. // },
  59398. // "orderBy": {
  59399. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59400. // "location": "query",
  59401. // "type": "string"
  59402. // },
  59403. // "pageToken": {
  59404. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59405. // "location": "query",
  59406. // "type": "string"
  59407. // },
  59408. // "project": {
  59409. // "description": "Project ID for this request.",
  59410. // "location": "path",
  59411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59412. // "required": true,
  59413. // "type": "string"
  59414. // },
  59415. // "zone": {
  59416. // "description": "The name of the zone where the managed instance group is located.",
  59417. // "location": "path",
  59418. // "required": true,
  59419. // "type": "string"
  59420. // }
  59421. // },
  59422. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  59423. // "response": {
  59424. // "$ref": "InstanceGroupManagerList"
  59425. // },
  59426. // "scopes": [
  59427. // "https://www.googleapis.com/auth/cloud-platform",
  59428. // "https://www.googleapis.com/auth/compute",
  59429. // "https://www.googleapis.com/auth/compute.readonly"
  59430. // ]
  59431. // }
  59432. }
  59433. // Pages invokes f for each page of results.
  59434. // A non-nil error returned from f will halt the iteration.
  59435. // The provided context supersedes any context provided to the Context method.
  59436. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  59437. c.ctx_ = ctx
  59438. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59439. for {
  59440. x, err := c.Do()
  59441. if err != nil {
  59442. return err
  59443. }
  59444. if err := f(x); err != nil {
  59445. return err
  59446. }
  59447. if x.NextPageToken == "" {
  59448. return nil
  59449. }
  59450. c.PageToken(x.NextPageToken)
  59451. }
  59452. }
  59453. // method id "compute.instanceGroupManagers.listManagedInstances":
  59454. type InstanceGroupManagersListManagedInstancesCall struct {
  59455. s *Service
  59456. project string
  59457. zone string
  59458. instanceGroupManager string
  59459. urlParams_ gensupport.URLParams
  59460. ctx_ context.Context
  59461. header_ http.Header
  59462. }
  59463. // ListManagedInstances: Lists all of the instances in the managed
  59464. // instance group. Each instance in the list has a currentAction, which
  59465. // indicates the action that the managed instance group is performing on
  59466. // the instance. For example, if the group is still creating an
  59467. // instance, the currentAction is CREATING. If a previous action failed,
  59468. // the list displays the errors for that failed action.
  59469. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  59470. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59471. c.project = project
  59472. c.zone = zone
  59473. c.instanceGroupManager = instanceGroupManager
  59474. return c
  59475. }
  59476. // Filter sets the optional parameter "filter": A filter expression that
  59477. // filters resources listed in the response. The expression must specify
  59478. // the field name, a comparison operator, and the value that you want to
  59479. // use for filtering. The value must be a string, a number, or a
  59480. // boolean. The comparison operator must be either =, !=, >, or <.
  59481. //
  59482. // For example, if you are filtering Compute Engine instances, you can
  59483. // exclude instances named example-instance by specifying name !=
  59484. // example-instance.
  59485. //
  59486. // You can also filter nested fields. For example, you could specify
  59487. // scheduling.automaticRestart = false to include instances only if they
  59488. // are not scheduled for automatic restarts. You can use filtering on
  59489. // nested fields to filter based on resource labels.
  59490. //
  59491. // To filter on multiple expressions, provide each separate expression
  59492. // within parentheses. For example, (scheduling.automaticRestart = true)
  59493. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59494. // AND expression. However, you can include AND and OR expressions
  59495. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59496. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59497. // true).
  59498. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  59499. c.urlParams_.Set("filter", filter)
  59500. return c
  59501. }
  59502. // MaxResults sets the optional parameter "maxResults": The maximum
  59503. // number of results per page that should be returned. If the number of
  59504. // available results is larger than maxResults, Compute Engine returns a
  59505. // nextPageToken that can be used to get the next page of results in
  59506. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59507. // (Default: 500)
  59508. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  59509. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59510. return c
  59511. }
  59512. // OrderBy sets the optional parameter "order_by": Sorts list results by
  59513. // a certain order. By default, results are returned in alphanumerical
  59514. // order based on the resource name.
  59515. //
  59516. // You can also sort results in descending order based on the creation
  59517. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59518. // based on the creationTimestamp field in reverse chronological order
  59519. // (newest result first). Use this to sort resources like operations so
  59520. // that the newest operation is returned first.
  59521. //
  59522. // Currently, only sorting by name or creationTimestamp desc is
  59523. // supported.
  59524. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  59525. c.urlParams_.Set("order_by", orderBy)
  59526. return c
  59527. }
  59528. // PageToken sets the optional parameter "pageToken": Specifies a page
  59529. // token to use. Set pageToken to the nextPageToken returned by a
  59530. // previous list request to get the next page of results.
  59531. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  59532. c.urlParams_.Set("pageToken", pageToken)
  59533. return c
  59534. }
  59535. // Fields allows partial responses to be retrieved. See
  59536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59537. // for more information.
  59538. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  59539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59540. return c
  59541. }
  59542. // Context sets the context to be used in this call's Do method. Any
  59543. // pending HTTP request will be aborted if the provided context is
  59544. // canceled.
  59545. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  59546. c.ctx_ = ctx
  59547. return c
  59548. }
  59549. // Header returns an http.Header that can be modified by the caller to
  59550. // add HTTP headers to the request.
  59551. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  59552. if c.header_ == nil {
  59553. c.header_ = make(http.Header)
  59554. }
  59555. return c.header_
  59556. }
  59557. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  59558. reqHeaders := make(http.Header)
  59559. for k, v := range c.header_ {
  59560. reqHeaders[k] = v
  59561. }
  59562. reqHeaders.Set("User-Agent", c.s.userAgent())
  59563. var body io.Reader = nil
  59564. c.urlParams_.Set("alt", alt)
  59565. c.urlParams_.Set("prettyPrint", "false")
  59566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  59567. urls += "?" + c.urlParams_.Encode()
  59568. req, err := http.NewRequest("POST", urls, body)
  59569. if err != nil {
  59570. return nil, err
  59571. }
  59572. req.Header = reqHeaders
  59573. googleapi.Expand(req.URL, map[string]string{
  59574. "project": c.project,
  59575. "zone": c.zone,
  59576. "instanceGroupManager": c.instanceGroupManager,
  59577. })
  59578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59579. }
  59580. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  59581. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  59582. // error will be non-nil. Any non-2xx status code is an error. Response
  59583. // headers are in either
  59584. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  59585. // er or (if a response was returned at all) in
  59586. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  59587. // whether the returned error was because http.StatusNotModified was
  59588. // returned.
  59589. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  59590. gensupport.SetOptions(c.urlParams_, opts...)
  59591. res, err := c.doRequest("json")
  59592. if res != nil && res.StatusCode == http.StatusNotModified {
  59593. if res.Body != nil {
  59594. res.Body.Close()
  59595. }
  59596. return nil, &googleapi.Error{
  59597. Code: res.StatusCode,
  59598. Header: res.Header,
  59599. }
  59600. }
  59601. if err != nil {
  59602. return nil, err
  59603. }
  59604. defer googleapi.CloseBody(res)
  59605. if err := googleapi.CheckResponse(res); err != nil {
  59606. return nil, err
  59607. }
  59608. ret := &InstanceGroupManagersListManagedInstancesResponse{
  59609. ServerResponse: googleapi.ServerResponse{
  59610. Header: res.Header,
  59611. HTTPStatusCode: res.StatusCode,
  59612. },
  59613. }
  59614. target := &ret
  59615. if err := gensupport.DecodeResponse(target, res); err != nil {
  59616. return nil, err
  59617. }
  59618. return ret, nil
  59619. // {
  59620. // "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.",
  59621. // "httpMethod": "POST",
  59622. // "id": "compute.instanceGroupManagers.listManagedInstances",
  59623. // "parameterOrder": [
  59624. // "project",
  59625. // "zone",
  59626. // "instanceGroupManager"
  59627. // ],
  59628. // "parameters": {
  59629. // "filter": {
  59630. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59631. // "location": "query",
  59632. // "type": "string"
  59633. // },
  59634. // "instanceGroupManager": {
  59635. // "description": "The name of the managed instance group.",
  59636. // "location": "path",
  59637. // "required": true,
  59638. // "type": "string"
  59639. // },
  59640. // "maxResults": {
  59641. // "default": "500",
  59642. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59643. // "format": "uint32",
  59644. // "location": "query",
  59645. // "minimum": "0",
  59646. // "type": "integer"
  59647. // },
  59648. // "order_by": {
  59649. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59650. // "location": "query",
  59651. // "type": "string"
  59652. // },
  59653. // "pageToken": {
  59654. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59655. // "location": "query",
  59656. // "type": "string"
  59657. // },
  59658. // "project": {
  59659. // "description": "Project ID for this request.",
  59660. // "location": "path",
  59661. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59662. // "required": true,
  59663. // "type": "string"
  59664. // },
  59665. // "zone": {
  59666. // "description": "The name of the zone where the managed instance group is located.",
  59667. // "location": "path",
  59668. // "required": true,
  59669. // "type": "string"
  59670. // }
  59671. // },
  59672. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  59673. // "response": {
  59674. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  59675. // },
  59676. // "scopes": [
  59677. // "https://www.googleapis.com/auth/cloud-platform",
  59678. // "https://www.googleapis.com/auth/compute",
  59679. // "https://www.googleapis.com/auth/compute.readonly"
  59680. // ]
  59681. // }
  59682. }
  59683. // Pages invokes f for each page of results.
  59684. // A non-nil error returned from f will halt the iteration.
  59685. // The provided context supersedes any context provided to the Context method.
  59686. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  59687. c.ctx_ = ctx
  59688. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59689. for {
  59690. x, err := c.Do()
  59691. if err != nil {
  59692. return err
  59693. }
  59694. if err := f(x); err != nil {
  59695. return err
  59696. }
  59697. if x.NextPageToken == "" {
  59698. return nil
  59699. }
  59700. c.PageToken(x.NextPageToken)
  59701. }
  59702. }
  59703. // method id "compute.instanceGroupManagers.listPerInstanceConfigs":
  59704. type InstanceGroupManagersListPerInstanceConfigsCall struct {
  59705. s *Service
  59706. project string
  59707. zone string
  59708. instanceGroupManager string
  59709. urlParams_ gensupport.URLParams
  59710. ctx_ context.Context
  59711. header_ http.Header
  59712. }
  59713. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  59714. // for the managed instance group.
  59715. func (r *InstanceGroupManagersService) ListPerInstanceConfigs(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListPerInstanceConfigsCall {
  59716. c := &InstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59717. c.project = project
  59718. c.zone = zone
  59719. c.instanceGroupManager = instanceGroupManager
  59720. return c
  59721. }
  59722. // Filter sets the optional parameter "filter": A filter expression that
  59723. // filters resources listed in the response. The expression must specify
  59724. // the field name, a comparison operator, and the value that you want to
  59725. // use for filtering. The value must be a string, a number, or a
  59726. // boolean. The comparison operator must be either =, !=, >, or <.
  59727. //
  59728. // For example, if you are filtering Compute Engine instances, you can
  59729. // exclude instances named example-instance by specifying name !=
  59730. // example-instance.
  59731. //
  59732. // You can also filter nested fields. For example, you could specify
  59733. // scheduling.automaticRestart = false to include instances only if they
  59734. // are not scheduled for automatic restarts. You can use filtering on
  59735. // nested fields to filter based on resource labels.
  59736. //
  59737. // To filter on multiple expressions, provide each separate expression
  59738. // within parentheses. For example, (scheduling.automaticRestart = true)
  59739. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59740. // AND expression. However, you can include AND and OR expressions
  59741. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59742. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59743. // true).
  59744. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *InstanceGroupManagersListPerInstanceConfigsCall {
  59745. c.urlParams_.Set("filter", filter)
  59746. return c
  59747. }
  59748. // MaxResults sets the optional parameter "maxResults": The maximum
  59749. // number of results per page that should be returned. If the number of
  59750. // available results is larger than maxResults, Compute Engine returns a
  59751. // nextPageToken that can be used to get the next page of results in
  59752. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59753. // (Default: 500)
  59754. func (c *InstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *InstanceGroupManagersListPerInstanceConfigsCall {
  59755. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59756. return c
  59757. }
  59758. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59759. // a certain order. By default, results are returned in alphanumerical
  59760. // order based on the resource name.
  59761. //
  59762. // You can also sort results in descending order based on the creation
  59763. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59764. // based on the creationTimestamp field in reverse chronological order
  59765. // (newest result first). Use this to sort resources like operations so
  59766. // that the newest operation is returned first.
  59767. //
  59768. // Currently, only sorting by name or creationTimestamp desc is
  59769. // supported.
  59770. func (c *InstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *InstanceGroupManagersListPerInstanceConfigsCall {
  59771. c.urlParams_.Set("orderBy", orderBy)
  59772. return c
  59773. }
  59774. // PageToken sets the optional parameter "pageToken": Specifies a page
  59775. // token to use. Set pageToken to the nextPageToken returned by a
  59776. // previous list request to get the next page of results.
  59777. func (c *InstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *InstanceGroupManagersListPerInstanceConfigsCall {
  59778. c.urlParams_.Set("pageToken", pageToken)
  59779. return c
  59780. }
  59781. // Fields allows partial responses to be retrieved. See
  59782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59783. // for more information.
  59784. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListPerInstanceConfigsCall {
  59785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59786. return c
  59787. }
  59788. // Context sets the context to be used in this call's Do method. Any
  59789. // pending HTTP request will be aborted if the provided context is
  59790. // canceled.
  59791. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersListPerInstanceConfigsCall {
  59792. c.ctx_ = ctx
  59793. return c
  59794. }
  59795. // Header returns an http.Header that can be modified by the caller to
  59796. // add HTTP headers to the request.
  59797. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  59798. if c.header_ == nil {
  59799. c.header_ = make(http.Header)
  59800. }
  59801. return c.header_
  59802. }
  59803. func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  59804. reqHeaders := make(http.Header)
  59805. for k, v := range c.header_ {
  59806. reqHeaders[k] = v
  59807. }
  59808. reqHeaders.Set("User-Agent", c.s.userAgent())
  59809. var body io.Reader = nil
  59810. c.urlParams_.Set("alt", alt)
  59811. c.urlParams_.Set("prettyPrint", "false")
  59812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  59813. urls += "?" + c.urlParams_.Encode()
  59814. req, err := http.NewRequest("POST", urls, body)
  59815. if err != nil {
  59816. return nil, err
  59817. }
  59818. req.Header = reqHeaders
  59819. googleapi.Expand(req.URL, map[string]string{
  59820. "project": c.project,
  59821. "zone": c.zone,
  59822. "instanceGroupManager": c.instanceGroupManager,
  59823. })
  59824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59825. }
  59826. // Do executes the "compute.instanceGroupManagers.listPerInstanceConfigs" call.
  59827. // Exactly one of *InstanceGroupManagersListPerInstanceConfigsResp or
  59828. // error will be non-nil. Any non-2xx status code is an error. Response
  59829. // headers are in either
  59830. // *InstanceGroupManagersListPerInstanceConfigsResp.ServerResponse.Header
  59831. // or (if a response was returned at all) in
  59832. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  59833. // whether the returned error was because http.StatusNotModified was
  59834. // returned.
  59835. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListPerInstanceConfigsResp, error) {
  59836. gensupport.SetOptions(c.urlParams_, opts...)
  59837. res, err := c.doRequest("json")
  59838. if res != nil && res.StatusCode == http.StatusNotModified {
  59839. if res.Body != nil {
  59840. res.Body.Close()
  59841. }
  59842. return nil, &googleapi.Error{
  59843. Code: res.StatusCode,
  59844. Header: res.Header,
  59845. }
  59846. }
  59847. if err != nil {
  59848. return nil, err
  59849. }
  59850. defer googleapi.CloseBody(res)
  59851. if err := googleapi.CheckResponse(res); err != nil {
  59852. return nil, err
  59853. }
  59854. ret := &InstanceGroupManagersListPerInstanceConfigsResp{
  59855. ServerResponse: googleapi.ServerResponse{
  59856. Header: res.Header,
  59857. HTTPStatusCode: res.StatusCode,
  59858. },
  59859. }
  59860. target := &ret
  59861. if err := gensupport.DecodeResponse(target, res); err != nil {
  59862. return nil, err
  59863. }
  59864. return ret, nil
  59865. // {
  59866. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  59867. // "httpMethod": "POST",
  59868. // "id": "compute.instanceGroupManagers.listPerInstanceConfigs",
  59869. // "parameterOrder": [
  59870. // "project",
  59871. // "zone",
  59872. // "instanceGroupManager"
  59873. // ],
  59874. // "parameters": {
  59875. // "filter": {
  59876. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59877. // "location": "query",
  59878. // "type": "string"
  59879. // },
  59880. // "instanceGroupManager": {
  59881. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  59882. // "location": "path",
  59883. // "required": true,
  59884. // "type": "string"
  59885. // },
  59886. // "maxResults": {
  59887. // "default": "500",
  59888. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59889. // "format": "uint32",
  59890. // "location": "query",
  59891. // "minimum": "0",
  59892. // "type": "integer"
  59893. // },
  59894. // "orderBy": {
  59895. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59896. // "location": "query",
  59897. // "type": "string"
  59898. // },
  59899. // "pageToken": {
  59900. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59901. // "location": "query",
  59902. // "type": "string"
  59903. // },
  59904. // "project": {
  59905. // "description": "Project ID for this request.",
  59906. // "location": "path",
  59907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59908. // "required": true,
  59909. // "type": "string"
  59910. // },
  59911. // "zone": {
  59912. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  59913. // "location": "path",
  59914. // "required": true,
  59915. // "type": "string"
  59916. // }
  59917. // },
  59918. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  59919. // "response": {
  59920. // "$ref": "InstanceGroupManagersListPerInstanceConfigsResp"
  59921. // },
  59922. // "scopes": [
  59923. // "https://www.googleapis.com/auth/cloud-platform",
  59924. // "https://www.googleapis.com/auth/compute",
  59925. // "https://www.googleapis.com/auth/compute.readonly"
  59926. // ]
  59927. // }
  59928. }
  59929. // Pages invokes f for each page of results.
  59930. // A non-nil error returned from f will halt the iteration.
  59931. // The provided context supersedes any context provided to the Context method.
  59932. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListPerInstanceConfigsResp) error) error {
  59933. c.ctx_ = ctx
  59934. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59935. for {
  59936. x, err := c.Do()
  59937. if err != nil {
  59938. return err
  59939. }
  59940. if err := f(x); err != nil {
  59941. return err
  59942. }
  59943. if x.NextPageToken == "" {
  59944. return nil
  59945. }
  59946. c.PageToken(x.NextPageToken)
  59947. }
  59948. }
  59949. // method id "compute.instanceGroupManagers.patch":
  59950. type InstanceGroupManagersPatchCall struct {
  59951. s *Service
  59952. project string
  59953. zone string
  59954. instanceGroupManager string
  59955. instancegroupmanager *InstanceGroupManager
  59956. urlParams_ gensupport.URLParams
  59957. ctx_ context.Context
  59958. header_ http.Header
  59959. }
  59960. // Patch: Updates a managed instance group using the information that
  59961. // you specify in the request. This operation is marked as DONE when the
  59962. // group is patched even if the instances in the group are still in the
  59963. // process of being patched. You must separately verify the status of
  59964. // the individual instances with the listManagedInstances method. This
  59965. // method supports PATCH semantics and uses the JSON merge patch format
  59966. // and processing rules.
  59967. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  59968. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59969. c.project = project
  59970. c.zone = zone
  59971. c.instanceGroupManager = instanceGroupManager
  59972. c.instancegroupmanager = instancegroupmanager
  59973. return c
  59974. }
  59975. // RequestId sets the optional parameter "requestId": An optional
  59976. // request ID to identify requests. Specify a unique request ID so that
  59977. // if you must retry your request, the server will know to ignore the
  59978. // request if it has already been completed.
  59979. //
  59980. // For example, consider a situation where you make an initial request
  59981. // and the request times out. If you make the request again with the
  59982. // same request ID, the server can check if original operation with the
  59983. // same request ID was received, and if so, will ignore the second
  59984. // request. This prevents clients from accidentally creating duplicate
  59985. // commitments.
  59986. //
  59987. // The request ID must be a valid UUID with the exception that zero UUID
  59988. // is not supported (00000000-0000-0000-0000-000000000000).
  59989. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  59990. c.urlParams_.Set("requestId", requestId)
  59991. return c
  59992. }
  59993. // Fields allows partial responses to be retrieved. See
  59994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59995. // for more information.
  59996. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  59997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59998. return c
  59999. }
  60000. // Context sets the context to be used in this call's Do method. Any
  60001. // pending HTTP request will be aborted if the provided context is
  60002. // canceled.
  60003. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  60004. c.ctx_ = ctx
  60005. return c
  60006. }
  60007. // Header returns an http.Header that can be modified by the caller to
  60008. // add HTTP headers to the request.
  60009. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  60010. if c.header_ == nil {
  60011. c.header_ = make(http.Header)
  60012. }
  60013. return c.header_
  60014. }
  60015. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  60016. reqHeaders := make(http.Header)
  60017. for k, v := range c.header_ {
  60018. reqHeaders[k] = v
  60019. }
  60020. reqHeaders.Set("User-Agent", c.s.userAgent())
  60021. var body io.Reader = nil
  60022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  60023. if err != nil {
  60024. return nil, err
  60025. }
  60026. reqHeaders.Set("Content-Type", "application/json")
  60027. c.urlParams_.Set("alt", alt)
  60028. c.urlParams_.Set("prettyPrint", "false")
  60029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  60030. urls += "?" + c.urlParams_.Encode()
  60031. req, err := http.NewRequest("PATCH", urls, body)
  60032. if err != nil {
  60033. return nil, err
  60034. }
  60035. req.Header = reqHeaders
  60036. googleapi.Expand(req.URL, map[string]string{
  60037. "project": c.project,
  60038. "zone": c.zone,
  60039. "instanceGroupManager": c.instanceGroupManager,
  60040. })
  60041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60042. }
  60043. // Do executes the "compute.instanceGroupManagers.patch" call.
  60044. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60045. // status code is an error. Response headers are in either
  60046. // *Operation.ServerResponse.Header or (if a response was returned at
  60047. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60048. // to check whether the returned error was because
  60049. // http.StatusNotModified was returned.
  60050. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60051. gensupport.SetOptions(c.urlParams_, opts...)
  60052. res, err := c.doRequest("json")
  60053. if res != nil && res.StatusCode == http.StatusNotModified {
  60054. if res.Body != nil {
  60055. res.Body.Close()
  60056. }
  60057. return nil, &googleapi.Error{
  60058. Code: res.StatusCode,
  60059. Header: res.Header,
  60060. }
  60061. }
  60062. if err != nil {
  60063. return nil, err
  60064. }
  60065. defer googleapi.CloseBody(res)
  60066. if err := googleapi.CheckResponse(res); err != nil {
  60067. return nil, err
  60068. }
  60069. ret := &Operation{
  60070. ServerResponse: googleapi.ServerResponse{
  60071. Header: res.Header,
  60072. HTTPStatusCode: res.StatusCode,
  60073. },
  60074. }
  60075. target := &ret
  60076. if err := gensupport.DecodeResponse(target, res); err != nil {
  60077. return nil, err
  60078. }
  60079. return ret, nil
  60080. // {
  60081. // "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.",
  60082. // "httpMethod": "PATCH",
  60083. // "id": "compute.instanceGroupManagers.patch",
  60084. // "parameterOrder": [
  60085. // "project",
  60086. // "zone",
  60087. // "instanceGroupManager"
  60088. // ],
  60089. // "parameters": {
  60090. // "instanceGroupManager": {
  60091. // "description": "The name of the instance group manager.",
  60092. // "location": "path",
  60093. // "required": true,
  60094. // "type": "string"
  60095. // },
  60096. // "project": {
  60097. // "description": "Project ID for this request.",
  60098. // "location": "path",
  60099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60100. // "required": true,
  60101. // "type": "string"
  60102. // },
  60103. // "requestId": {
  60104. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60105. // "location": "query",
  60106. // "type": "string"
  60107. // },
  60108. // "zone": {
  60109. // "description": "The name of the zone where you want to create the managed instance group.",
  60110. // "location": "path",
  60111. // "required": true,
  60112. // "type": "string"
  60113. // }
  60114. // },
  60115. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  60116. // "request": {
  60117. // "$ref": "InstanceGroupManager"
  60118. // },
  60119. // "response": {
  60120. // "$ref": "Operation"
  60121. // },
  60122. // "scopes": [
  60123. // "https://www.googleapis.com/auth/cloud-platform",
  60124. // "https://www.googleapis.com/auth/compute"
  60125. // ]
  60126. // }
  60127. }
  60128. // method id "compute.instanceGroupManagers.recreateInstances":
  60129. type InstanceGroupManagersRecreateInstancesCall struct {
  60130. s *Service
  60131. project string
  60132. zone string
  60133. instanceGroupManager string
  60134. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  60135. urlParams_ gensupport.URLParams
  60136. ctx_ context.Context
  60137. header_ http.Header
  60138. }
  60139. // RecreateInstances: Flags the specified instances in the managed
  60140. // instance group to be immediately recreated. The instances are deleted
  60141. // and recreated using the current instance template for the managed
  60142. // instance group. This operation is marked as DONE when the flag is set
  60143. // even if the instances have not yet been recreated. You must
  60144. // separately verify the status of the recreating action with the
  60145. // listmanagedinstances method.
  60146. //
  60147. // If the group is part of a backend service that has enabled connection
  60148. // draining, it can take up to 60 seconds after the connection draining
  60149. // duration has elapsed before the VM instance is removed or
  60150. // deleted.
  60151. //
  60152. // You can specify a maximum of 1000 instances with this method per
  60153. // request.
  60154. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  60155. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60156. c.project = project
  60157. c.zone = zone
  60158. c.instanceGroupManager = instanceGroupManager
  60159. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  60160. return c
  60161. }
  60162. // RequestId sets the optional parameter "requestId": An optional
  60163. // request ID to identify requests. Specify a unique request ID so that
  60164. // if you must retry your request, the server will know to ignore the
  60165. // request if it has already been completed.
  60166. //
  60167. // For example, consider a situation where you make an initial request
  60168. // and the request times out. If you make the request again with the
  60169. // same request ID, the server can check if original operation with the
  60170. // same request ID was received, and if so, will ignore the second
  60171. // request. This prevents clients from accidentally creating duplicate
  60172. // commitments.
  60173. //
  60174. // The request ID must be a valid UUID with the exception that zero UUID
  60175. // is not supported (00000000-0000-0000-0000-000000000000).
  60176. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  60177. c.urlParams_.Set("requestId", requestId)
  60178. return c
  60179. }
  60180. // Fields allows partial responses to be retrieved. See
  60181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60182. // for more information.
  60183. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  60184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60185. return c
  60186. }
  60187. // Context sets the context to be used in this call's Do method. Any
  60188. // pending HTTP request will be aborted if the provided context is
  60189. // canceled.
  60190. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  60191. c.ctx_ = ctx
  60192. return c
  60193. }
  60194. // Header returns an http.Header that can be modified by the caller to
  60195. // add HTTP headers to the request.
  60196. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  60197. if c.header_ == nil {
  60198. c.header_ = make(http.Header)
  60199. }
  60200. return c.header_
  60201. }
  60202. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  60203. reqHeaders := make(http.Header)
  60204. for k, v := range c.header_ {
  60205. reqHeaders[k] = v
  60206. }
  60207. reqHeaders.Set("User-Agent", c.s.userAgent())
  60208. var body io.Reader = nil
  60209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  60210. if err != nil {
  60211. return nil, err
  60212. }
  60213. reqHeaders.Set("Content-Type", "application/json")
  60214. c.urlParams_.Set("alt", alt)
  60215. c.urlParams_.Set("prettyPrint", "false")
  60216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  60217. urls += "?" + c.urlParams_.Encode()
  60218. req, err := http.NewRequest("POST", urls, body)
  60219. if err != nil {
  60220. return nil, err
  60221. }
  60222. req.Header = reqHeaders
  60223. googleapi.Expand(req.URL, map[string]string{
  60224. "project": c.project,
  60225. "zone": c.zone,
  60226. "instanceGroupManager": c.instanceGroupManager,
  60227. })
  60228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60229. }
  60230. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  60231. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60232. // status code is an error. Response headers are in either
  60233. // *Operation.ServerResponse.Header or (if a response was returned at
  60234. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60235. // to check whether the returned error was because
  60236. // http.StatusNotModified was returned.
  60237. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60238. gensupport.SetOptions(c.urlParams_, opts...)
  60239. res, err := c.doRequest("json")
  60240. if res != nil && res.StatusCode == http.StatusNotModified {
  60241. if res.Body != nil {
  60242. res.Body.Close()
  60243. }
  60244. return nil, &googleapi.Error{
  60245. Code: res.StatusCode,
  60246. Header: res.Header,
  60247. }
  60248. }
  60249. if err != nil {
  60250. return nil, err
  60251. }
  60252. defer googleapi.CloseBody(res)
  60253. if err := googleapi.CheckResponse(res); err != nil {
  60254. return nil, err
  60255. }
  60256. ret := &Operation{
  60257. ServerResponse: googleapi.ServerResponse{
  60258. Header: res.Header,
  60259. HTTPStatusCode: res.StatusCode,
  60260. },
  60261. }
  60262. target := &ret
  60263. if err := gensupport.DecodeResponse(target, res); err != nil {
  60264. return nil, err
  60265. }
  60266. return ret, nil
  60267. // {
  60268. // "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.",
  60269. // "httpMethod": "POST",
  60270. // "id": "compute.instanceGroupManagers.recreateInstances",
  60271. // "parameterOrder": [
  60272. // "project",
  60273. // "zone",
  60274. // "instanceGroupManager"
  60275. // ],
  60276. // "parameters": {
  60277. // "instanceGroupManager": {
  60278. // "description": "The name of the managed instance group.",
  60279. // "location": "path",
  60280. // "required": true,
  60281. // "type": "string"
  60282. // },
  60283. // "project": {
  60284. // "description": "Project ID for this request.",
  60285. // "location": "path",
  60286. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60287. // "required": true,
  60288. // "type": "string"
  60289. // },
  60290. // "requestId": {
  60291. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60292. // "location": "query",
  60293. // "type": "string"
  60294. // },
  60295. // "zone": {
  60296. // "description": "The name of the zone where the managed instance group is located.",
  60297. // "location": "path",
  60298. // "required": true,
  60299. // "type": "string"
  60300. // }
  60301. // },
  60302. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  60303. // "request": {
  60304. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  60305. // },
  60306. // "response": {
  60307. // "$ref": "Operation"
  60308. // },
  60309. // "scopes": [
  60310. // "https://www.googleapis.com/auth/cloud-platform",
  60311. // "https://www.googleapis.com/auth/compute"
  60312. // ]
  60313. // }
  60314. }
  60315. // method id "compute.instanceGroupManagers.resize":
  60316. type InstanceGroupManagersResizeCall struct {
  60317. s *Service
  60318. project string
  60319. zone string
  60320. instanceGroupManager string
  60321. urlParams_ gensupport.URLParams
  60322. ctx_ context.Context
  60323. header_ http.Header
  60324. }
  60325. // Resize: Resizes the managed instance group. If you increase the size,
  60326. // the group creates new instances using the current instance template.
  60327. // If you decrease the size, the group deletes instances. The resize
  60328. // operation is marked DONE when the resize actions are scheduled even
  60329. // if the group has not yet added or deleted any instances. You must
  60330. // separately verify the status of the creating or deleting actions with
  60331. // the listmanagedinstances method.
  60332. //
  60333. // When resizing down, the instance group arbitrarily chooses the order
  60334. // in which VMs are deleted. The group takes into account some VM
  60335. // attributes when making the selection including:
  60336. //
  60337. // + The status of the VM instance. + The health of the VM instance. +
  60338. // The instance template version the VM is based on. + For regional
  60339. // managed instance groups, the location of the VM instance.
  60340. //
  60341. // This list is subject to change.
  60342. //
  60343. // If the group is part of a backend service that has enabled connection
  60344. // draining, it can take up to 60 seconds after the connection draining
  60345. // duration has elapsed before the VM instance is removed or deleted.
  60346. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  60347. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60348. c.project = project
  60349. c.zone = zone
  60350. c.instanceGroupManager = instanceGroupManager
  60351. c.urlParams_.Set("size", fmt.Sprint(size))
  60352. return c
  60353. }
  60354. // RequestId sets the optional parameter "requestId": An optional
  60355. // request ID to identify requests. Specify a unique request ID so that
  60356. // if you must retry your request, the server will know to ignore the
  60357. // request if it has already been completed.
  60358. //
  60359. // For example, consider a situation where you make an initial request
  60360. // and the request times out. If you make the request again with the
  60361. // same request ID, the server can check if original operation with the
  60362. // same request ID was received, and if so, will ignore the second
  60363. // request. This prevents clients from accidentally creating duplicate
  60364. // commitments.
  60365. //
  60366. // The request ID must be a valid UUID with the exception that zero UUID
  60367. // is not supported (00000000-0000-0000-0000-000000000000).
  60368. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  60369. c.urlParams_.Set("requestId", requestId)
  60370. return c
  60371. }
  60372. // Fields allows partial responses to be retrieved. See
  60373. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60374. // for more information.
  60375. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  60376. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60377. return c
  60378. }
  60379. // Context sets the context to be used in this call's Do method. Any
  60380. // pending HTTP request will be aborted if the provided context is
  60381. // canceled.
  60382. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  60383. c.ctx_ = ctx
  60384. return c
  60385. }
  60386. // Header returns an http.Header that can be modified by the caller to
  60387. // add HTTP headers to the request.
  60388. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  60389. if c.header_ == nil {
  60390. c.header_ = make(http.Header)
  60391. }
  60392. return c.header_
  60393. }
  60394. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  60395. reqHeaders := make(http.Header)
  60396. for k, v := range c.header_ {
  60397. reqHeaders[k] = v
  60398. }
  60399. reqHeaders.Set("User-Agent", c.s.userAgent())
  60400. var body io.Reader = nil
  60401. c.urlParams_.Set("alt", alt)
  60402. c.urlParams_.Set("prettyPrint", "false")
  60403. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  60404. urls += "?" + c.urlParams_.Encode()
  60405. req, err := http.NewRequest("POST", urls, body)
  60406. if err != nil {
  60407. return nil, err
  60408. }
  60409. req.Header = reqHeaders
  60410. googleapi.Expand(req.URL, map[string]string{
  60411. "project": c.project,
  60412. "zone": c.zone,
  60413. "instanceGroupManager": c.instanceGroupManager,
  60414. })
  60415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60416. }
  60417. // Do executes the "compute.instanceGroupManagers.resize" call.
  60418. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60419. // status code is an error. Response headers are in either
  60420. // *Operation.ServerResponse.Header or (if a response was returned at
  60421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60422. // to check whether the returned error was because
  60423. // http.StatusNotModified was returned.
  60424. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60425. gensupport.SetOptions(c.urlParams_, opts...)
  60426. res, err := c.doRequest("json")
  60427. if res != nil && res.StatusCode == http.StatusNotModified {
  60428. if res.Body != nil {
  60429. res.Body.Close()
  60430. }
  60431. return nil, &googleapi.Error{
  60432. Code: res.StatusCode,
  60433. Header: res.Header,
  60434. }
  60435. }
  60436. if err != nil {
  60437. return nil, err
  60438. }
  60439. defer googleapi.CloseBody(res)
  60440. if err := googleapi.CheckResponse(res); err != nil {
  60441. return nil, err
  60442. }
  60443. ret := &Operation{
  60444. ServerResponse: googleapi.ServerResponse{
  60445. Header: res.Header,
  60446. HTTPStatusCode: res.StatusCode,
  60447. },
  60448. }
  60449. target := &ret
  60450. if err := gensupport.DecodeResponse(target, res); err != nil {
  60451. return nil, err
  60452. }
  60453. return ret, nil
  60454. // {
  60455. // "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.",
  60456. // "httpMethod": "POST",
  60457. // "id": "compute.instanceGroupManagers.resize",
  60458. // "parameterOrder": [
  60459. // "project",
  60460. // "zone",
  60461. // "instanceGroupManager",
  60462. // "size"
  60463. // ],
  60464. // "parameters": {
  60465. // "instanceGroupManager": {
  60466. // "description": "The name of the managed instance group.",
  60467. // "location": "path",
  60468. // "required": true,
  60469. // "type": "string"
  60470. // },
  60471. // "project": {
  60472. // "description": "Project ID for this request.",
  60473. // "location": "path",
  60474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60475. // "required": true,
  60476. // "type": "string"
  60477. // },
  60478. // "requestId": {
  60479. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60480. // "location": "query",
  60481. // "type": "string"
  60482. // },
  60483. // "size": {
  60484. // "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.",
  60485. // "format": "int32",
  60486. // "location": "query",
  60487. // "required": true,
  60488. // "type": "integer"
  60489. // },
  60490. // "zone": {
  60491. // "description": "The name of the zone where the managed instance group is located.",
  60492. // "location": "path",
  60493. // "required": true,
  60494. // "type": "string"
  60495. // }
  60496. // },
  60497. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  60498. // "response": {
  60499. // "$ref": "Operation"
  60500. // },
  60501. // "scopes": [
  60502. // "https://www.googleapis.com/auth/cloud-platform",
  60503. // "https://www.googleapis.com/auth/compute"
  60504. // ]
  60505. // }
  60506. }
  60507. // method id "compute.instanceGroupManagers.resizeAdvanced":
  60508. type InstanceGroupManagersResizeAdvancedCall struct {
  60509. s *Service
  60510. project string
  60511. zone string
  60512. instanceGroupManager string
  60513. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  60514. urlParams_ gensupport.URLParams
  60515. ctx_ context.Context
  60516. header_ http.Header
  60517. }
  60518. // ResizeAdvanced: Resizes the managed instance group with advanced
  60519. // configuration options like disabling creation retries. This is an
  60520. // extended version of the resize method.
  60521. //
  60522. // If you increase the size of the instance group, the group creates new
  60523. // instances using the current instance template. If you decrease the
  60524. // size, the group deletes instances. The resize operation is marked
  60525. // DONE when the resize actions are scheduled even if the group has not
  60526. // yet added or deleted any instances. You must separately verify the
  60527. // status of the creating, creatingWithoutRetries, or deleting actions
  60528. // with the get or listmanagedinstances method.
  60529. //
  60530. // If the group is part of a backend service that has enabled connection
  60531. // draining, it can take up to 60 seconds after the connection draining
  60532. // duration has elapsed before the VM instance is removed or deleted.
  60533. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  60534. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60535. c.project = project
  60536. c.zone = zone
  60537. c.instanceGroupManager = instanceGroupManager
  60538. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  60539. return c
  60540. }
  60541. // RequestId sets the optional parameter "requestId": An optional
  60542. // request ID to identify requests. Specify a unique request ID so that
  60543. // if you must retry your request, the server will know to ignore the
  60544. // request if it has already been completed.
  60545. //
  60546. // For example, consider a situation where you make an initial request
  60547. // and the request times out. If you make the request again with the
  60548. // same request ID, the server can check if original operation with the
  60549. // same request ID was received, and if so, will ignore the second
  60550. // request. This prevents clients from accidentally creating duplicate
  60551. // commitments.
  60552. //
  60553. // The request ID must be a valid UUID with the exception that zero UUID
  60554. // is not supported (00000000-0000-0000-0000-000000000000).
  60555. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  60556. c.urlParams_.Set("requestId", requestId)
  60557. return c
  60558. }
  60559. // Fields allows partial responses to be retrieved. See
  60560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60561. // for more information.
  60562. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  60563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60564. return c
  60565. }
  60566. // Context sets the context to be used in this call's Do method. Any
  60567. // pending HTTP request will be aborted if the provided context is
  60568. // canceled.
  60569. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  60570. c.ctx_ = ctx
  60571. return c
  60572. }
  60573. // Header returns an http.Header that can be modified by the caller to
  60574. // add HTTP headers to the request.
  60575. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  60576. if c.header_ == nil {
  60577. c.header_ = make(http.Header)
  60578. }
  60579. return c.header_
  60580. }
  60581. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  60582. reqHeaders := make(http.Header)
  60583. for k, v := range c.header_ {
  60584. reqHeaders[k] = v
  60585. }
  60586. reqHeaders.Set("User-Agent", c.s.userAgent())
  60587. var body io.Reader = nil
  60588. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  60589. if err != nil {
  60590. return nil, err
  60591. }
  60592. reqHeaders.Set("Content-Type", "application/json")
  60593. c.urlParams_.Set("alt", alt)
  60594. c.urlParams_.Set("prettyPrint", "false")
  60595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  60596. urls += "?" + c.urlParams_.Encode()
  60597. req, err := http.NewRequest("POST", urls, body)
  60598. if err != nil {
  60599. return nil, err
  60600. }
  60601. req.Header = reqHeaders
  60602. googleapi.Expand(req.URL, map[string]string{
  60603. "project": c.project,
  60604. "zone": c.zone,
  60605. "instanceGroupManager": c.instanceGroupManager,
  60606. })
  60607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60608. }
  60609. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  60610. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60611. // status code is an error. Response headers are in either
  60612. // *Operation.ServerResponse.Header or (if a response was returned at
  60613. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60614. // to check whether the returned error was because
  60615. // http.StatusNotModified was returned.
  60616. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60617. gensupport.SetOptions(c.urlParams_, opts...)
  60618. res, err := c.doRequest("json")
  60619. if res != nil && res.StatusCode == http.StatusNotModified {
  60620. if res.Body != nil {
  60621. res.Body.Close()
  60622. }
  60623. return nil, &googleapi.Error{
  60624. Code: res.StatusCode,
  60625. Header: res.Header,
  60626. }
  60627. }
  60628. if err != nil {
  60629. return nil, err
  60630. }
  60631. defer googleapi.CloseBody(res)
  60632. if err := googleapi.CheckResponse(res); err != nil {
  60633. return nil, err
  60634. }
  60635. ret := &Operation{
  60636. ServerResponse: googleapi.ServerResponse{
  60637. Header: res.Header,
  60638. HTTPStatusCode: res.StatusCode,
  60639. },
  60640. }
  60641. target := &ret
  60642. if err := gensupport.DecodeResponse(target, res); err != nil {
  60643. return nil, err
  60644. }
  60645. return ret, nil
  60646. // {
  60647. // "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.",
  60648. // "httpMethod": "POST",
  60649. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  60650. // "parameterOrder": [
  60651. // "project",
  60652. // "zone",
  60653. // "instanceGroupManager"
  60654. // ],
  60655. // "parameters": {
  60656. // "instanceGroupManager": {
  60657. // "description": "The name of the managed instance group.",
  60658. // "location": "path",
  60659. // "required": true,
  60660. // "type": "string"
  60661. // },
  60662. // "project": {
  60663. // "description": "Project ID for this request.",
  60664. // "location": "path",
  60665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60666. // "required": true,
  60667. // "type": "string"
  60668. // },
  60669. // "requestId": {
  60670. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60671. // "location": "query",
  60672. // "type": "string"
  60673. // },
  60674. // "zone": {
  60675. // "description": "The name of the zone where the managed instance group is located.",
  60676. // "location": "path",
  60677. // "required": true,
  60678. // "type": "string"
  60679. // }
  60680. // },
  60681. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  60682. // "request": {
  60683. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  60684. // },
  60685. // "response": {
  60686. // "$ref": "Operation"
  60687. // },
  60688. // "scopes": [
  60689. // "https://www.googleapis.com/auth/cloud-platform",
  60690. // "https://www.googleapis.com/auth/compute"
  60691. // ]
  60692. // }
  60693. }
  60694. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  60695. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  60696. s *Service
  60697. project string
  60698. zone string
  60699. instanceGroupManager string
  60700. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  60701. urlParams_ gensupport.URLParams
  60702. ctx_ context.Context
  60703. header_ http.Header
  60704. }
  60705. // SetAutoHealingPolicies: Modifies the autohealing policies.
  60706. // [Deprecated] This method is deprecated. Please use Patch instead.
  60707. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  60708. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60709. c.project = project
  60710. c.zone = zone
  60711. c.instanceGroupManager = instanceGroupManager
  60712. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  60713. return c
  60714. }
  60715. // RequestId sets the optional parameter "requestId": An optional
  60716. // request ID to identify requests. Specify a unique request ID so that
  60717. // if you must retry your request, the server will know to ignore the
  60718. // request if it has already been completed.
  60719. //
  60720. // For example, consider a situation where you make an initial request
  60721. // and the request times out. If you make the request again with the
  60722. // same request ID, the server can check if original operation with the
  60723. // same request ID was received, and if so, will ignore the second
  60724. // request. This prevents clients from accidentally creating duplicate
  60725. // commitments.
  60726. //
  60727. // The request ID must be a valid UUID with the exception that zero UUID
  60728. // is not supported (00000000-0000-0000-0000-000000000000).
  60729. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  60730. c.urlParams_.Set("requestId", requestId)
  60731. return c
  60732. }
  60733. // Fields allows partial responses to be retrieved. See
  60734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60735. // for more information.
  60736. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  60737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60738. return c
  60739. }
  60740. // Context sets the context to be used in this call's Do method. Any
  60741. // pending HTTP request will be aborted if the provided context is
  60742. // canceled.
  60743. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  60744. c.ctx_ = ctx
  60745. return c
  60746. }
  60747. // Header returns an http.Header that can be modified by the caller to
  60748. // add HTTP headers to the request.
  60749. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  60750. if c.header_ == nil {
  60751. c.header_ = make(http.Header)
  60752. }
  60753. return c.header_
  60754. }
  60755. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  60756. reqHeaders := make(http.Header)
  60757. for k, v := range c.header_ {
  60758. reqHeaders[k] = v
  60759. }
  60760. reqHeaders.Set("User-Agent", c.s.userAgent())
  60761. var body io.Reader = nil
  60762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  60763. if err != nil {
  60764. return nil, err
  60765. }
  60766. reqHeaders.Set("Content-Type", "application/json")
  60767. c.urlParams_.Set("alt", alt)
  60768. c.urlParams_.Set("prettyPrint", "false")
  60769. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  60770. urls += "?" + c.urlParams_.Encode()
  60771. req, err := http.NewRequest("POST", urls, body)
  60772. if err != nil {
  60773. return nil, err
  60774. }
  60775. req.Header = reqHeaders
  60776. googleapi.Expand(req.URL, map[string]string{
  60777. "project": c.project,
  60778. "zone": c.zone,
  60779. "instanceGroupManager": c.instanceGroupManager,
  60780. })
  60781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60782. }
  60783. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  60784. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60785. // status code is an error. Response headers are in either
  60786. // *Operation.ServerResponse.Header or (if a response was returned at
  60787. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60788. // to check whether the returned error was because
  60789. // http.StatusNotModified was returned.
  60790. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60791. gensupport.SetOptions(c.urlParams_, opts...)
  60792. res, err := c.doRequest("json")
  60793. if res != nil && res.StatusCode == http.StatusNotModified {
  60794. if res.Body != nil {
  60795. res.Body.Close()
  60796. }
  60797. return nil, &googleapi.Error{
  60798. Code: res.StatusCode,
  60799. Header: res.Header,
  60800. }
  60801. }
  60802. if err != nil {
  60803. return nil, err
  60804. }
  60805. defer googleapi.CloseBody(res)
  60806. if err := googleapi.CheckResponse(res); err != nil {
  60807. return nil, err
  60808. }
  60809. ret := &Operation{
  60810. ServerResponse: googleapi.ServerResponse{
  60811. Header: res.Header,
  60812. HTTPStatusCode: res.StatusCode,
  60813. },
  60814. }
  60815. target := &ret
  60816. if err := gensupport.DecodeResponse(target, res); err != nil {
  60817. return nil, err
  60818. }
  60819. return ret, nil
  60820. // {
  60821. // "description": "Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.",
  60822. // "httpMethod": "POST",
  60823. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  60824. // "parameterOrder": [
  60825. // "project",
  60826. // "zone",
  60827. // "instanceGroupManager"
  60828. // ],
  60829. // "parameters": {
  60830. // "instanceGroupManager": {
  60831. // "description": "The name of the instance group manager.",
  60832. // "location": "path",
  60833. // "required": true,
  60834. // "type": "string"
  60835. // },
  60836. // "project": {
  60837. // "description": "Project ID for this request.",
  60838. // "location": "path",
  60839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60840. // "required": true,
  60841. // "type": "string"
  60842. // },
  60843. // "requestId": {
  60844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60845. // "location": "query",
  60846. // "type": "string"
  60847. // },
  60848. // "zone": {
  60849. // "description": "The name of the zone where the managed instance group is located.",
  60850. // "location": "path",
  60851. // "required": true,
  60852. // "type": "string"
  60853. // }
  60854. // },
  60855. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  60856. // "request": {
  60857. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  60858. // },
  60859. // "response": {
  60860. // "$ref": "Operation"
  60861. // },
  60862. // "scopes": [
  60863. // "https://www.googleapis.com/auth/cloud-platform",
  60864. // "https://www.googleapis.com/auth/compute"
  60865. // ]
  60866. // }
  60867. }
  60868. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  60869. type InstanceGroupManagersSetInstanceTemplateCall struct {
  60870. s *Service
  60871. project string
  60872. zone string
  60873. instanceGroupManager string
  60874. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  60875. urlParams_ gensupport.URLParams
  60876. ctx_ context.Context
  60877. header_ http.Header
  60878. }
  60879. // SetInstanceTemplate: Specifies the instance template to use when
  60880. // creating new instances in this group. The templates for existing
  60881. // instances in the group do not change unless you recreate them.
  60882. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  60883. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60884. c.project = project
  60885. c.zone = zone
  60886. c.instanceGroupManager = instanceGroupManager
  60887. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  60888. return c
  60889. }
  60890. // RequestId sets the optional parameter "requestId": An optional
  60891. // request ID to identify requests. Specify a unique request ID so that
  60892. // if you must retry your request, the server will know to ignore the
  60893. // request if it has already been completed.
  60894. //
  60895. // For example, consider a situation where you make an initial request
  60896. // and the request times out. If you make the request again with the
  60897. // same request ID, the server can check if original operation with the
  60898. // same request ID was received, and if so, will ignore the second
  60899. // request. This prevents clients from accidentally creating duplicate
  60900. // commitments.
  60901. //
  60902. // The request ID must be a valid UUID with the exception that zero UUID
  60903. // is not supported (00000000-0000-0000-0000-000000000000).
  60904. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  60905. c.urlParams_.Set("requestId", requestId)
  60906. return c
  60907. }
  60908. // Fields allows partial responses to be retrieved. See
  60909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60910. // for more information.
  60911. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  60912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60913. return c
  60914. }
  60915. // Context sets the context to be used in this call's Do method. Any
  60916. // pending HTTP request will be aborted if the provided context is
  60917. // canceled.
  60918. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  60919. c.ctx_ = ctx
  60920. return c
  60921. }
  60922. // Header returns an http.Header that can be modified by the caller to
  60923. // add HTTP headers to the request.
  60924. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  60925. if c.header_ == nil {
  60926. c.header_ = make(http.Header)
  60927. }
  60928. return c.header_
  60929. }
  60930. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  60931. reqHeaders := make(http.Header)
  60932. for k, v := range c.header_ {
  60933. reqHeaders[k] = v
  60934. }
  60935. reqHeaders.Set("User-Agent", c.s.userAgent())
  60936. var body io.Reader = nil
  60937. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  60938. if err != nil {
  60939. return nil, err
  60940. }
  60941. reqHeaders.Set("Content-Type", "application/json")
  60942. c.urlParams_.Set("alt", alt)
  60943. c.urlParams_.Set("prettyPrint", "false")
  60944. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  60945. urls += "?" + c.urlParams_.Encode()
  60946. req, err := http.NewRequest("POST", urls, body)
  60947. if err != nil {
  60948. return nil, err
  60949. }
  60950. req.Header = reqHeaders
  60951. googleapi.Expand(req.URL, map[string]string{
  60952. "project": c.project,
  60953. "zone": c.zone,
  60954. "instanceGroupManager": c.instanceGroupManager,
  60955. })
  60956. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60957. }
  60958. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  60959. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60960. // status code is an error. Response headers are in either
  60961. // *Operation.ServerResponse.Header or (if a response was returned at
  60962. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60963. // to check whether the returned error was because
  60964. // http.StatusNotModified was returned.
  60965. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60966. gensupport.SetOptions(c.urlParams_, opts...)
  60967. res, err := c.doRequest("json")
  60968. if res != nil && res.StatusCode == http.StatusNotModified {
  60969. if res.Body != nil {
  60970. res.Body.Close()
  60971. }
  60972. return nil, &googleapi.Error{
  60973. Code: res.StatusCode,
  60974. Header: res.Header,
  60975. }
  60976. }
  60977. if err != nil {
  60978. return nil, err
  60979. }
  60980. defer googleapi.CloseBody(res)
  60981. if err := googleapi.CheckResponse(res); err != nil {
  60982. return nil, err
  60983. }
  60984. ret := &Operation{
  60985. ServerResponse: googleapi.ServerResponse{
  60986. Header: res.Header,
  60987. HTTPStatusCode: res.StatusCode,
  60988. },
  60989. }
  60990. target := &ret
  60991. if err := gensupport.DecodeResponse(target, res); err != nil {
  60992. return nil, err
  60993. }
  60994. return ret, nil
  60995. // {
  60996. // "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.",
  60997. // "httpMethod": "POST",
  60998. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  60999. // "parameterOrder": [
  61000. // "project",
  61001. // "zone",
  61002. // "instanceGroupManager"
  61003. // ],
  61004. // "parameters": {
  61005. // "instanceGroupManager": {
  61006. // "description": "The name of the managed instance group.",
  61007. // "location": "path",
  61008. // "required": true,
  61009. // "type": "string"
  61010. // },
  61011. // "project": {
  61012. // "description": "Project ID for this request.",
  61013. // "location": "path",
  61014. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61015. // "required": true,
  61016. // "type": "string"
  61017. // },
  61018. // "requestId": {
  61019. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61020. // "location": "query",
  61021. // "type": "string"
  61022. // },
  61023. // "zone": {
  61024. // "description": "The name of the zone where the managed instance group is located.",
  61025. // "location": "path",
  61026. // "required": true,
  61027. // "type": "string"
  61028. // }
  61029. // },
  61030. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  61031. // "request": {
  61032. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  61033. // },
  61034. // "response": {
  61035. // "$ref": "Operation"
  61036. // },
  61037. // "scopes": [
  61038. // "https://www.googleapis.com/auth/cloud-platform",
  61039. // "https://www.googleapis.com/auth/compute"
  61040. // ]
  61041. // }
  61042. }
  61043. // method id "compute.instanceGroupManagers.setTargetPools":
  61044. type InstanceGroupManagersSetTargetPoolsCall struct {
  61045. s *Service
  61046. project string
  61047. zone string
  61048. instanceGroupManager string
  61049. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  61050. urlParams_ gensupport.URLParams
  61051. ctx_ context.Context
  61052. header_ http.Header
  61053. }
  61054. // SetTargetPools: Modifies the target pools to which all instances in
  61055. // this managed instance group are assigned. The target pools
  61056. // automatically apply to all of the instances in the managed instance
  61057. // group. This operation is marked DONE when you make the request even
  61058. // if the instances have not yet been added to their target pools. The
  61059. // change might take some time to apply to all of the instances in the
  61060. // group depending on the size of the group.
  61061. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  61062. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61063. c.project = project
  61064. c.zone = zone
  61065. c.instanceGroupManager = instanceGroupManager
  61066. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  61067. return c
  61068. }
  61069. // RequestId sets the optional parameter "requestId": An optional
  61070. // request ID to identify requests. Specify a unique request ID so that
  61071. // if you must retry your request, the server will know to ignore the
  61072. // request if it has already been completed.
  61073. //
  61074. // For example, consider a situation where you make an initial request
  61075. // and the request times out. If you make the request again with the
  61076. // same request ID, the server can check if original operation with the
  61077. // same request ID was received, and if so, will ignore the second
  61078. // request. This prevents clients from accidentally creating duplicate
  61079. // commitments.
  61080. //
  61081. // The request ID must be a valid UUID with the exception that zero UUID
  61082. // is not supported (00000000-0000-0000-0000-000000000000).
  61083. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  61084. c.urlParams_.Set("requestId", requestId)
  61085. return c
  61086. }
  61087. // Fields allows partial responses to be retrieved. See
  61088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61089. // for more information.
  61090. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  61091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61092. return c
  61093. }
  61094. // Context sets the context to be used in this call's Do method. Any
  61095. // pending HTTP request will be aborted if the provided context is
  61096. // canceled.
  61097. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  61098. c.ctx_ = ctx
  61099. return c
  61100. }
  61101. // Header returns an http.Header that can be modified by the caller to
  61102. // add HTTP headers to the request.
  61103. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  61104. if c.header_ == nil {
  61105. c.header_ = make(http.Header)
  61106. }
  61107. return c.header_
  61108. }
  61109. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  61110. reqHeaders := make(http.Header)
  61111. for k, v := range c.header_ {
  61112. reqHeaders[k] = v
  61113. }
  61114. reqHeaders.Set("User-Agent", c.s.userAgent())
  61115. var body io.Reader = nil
  61116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  61117. if err != nil {
  61118. return nil, err
  61119. }
  61120. reqHeaders.Set("Content-Type", "application/json")
  61121. c.urlParams_.Set("alt", alt)
  61122. c.urlParams_.Set("prettyPrint", "false")
  61123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  61124. urls += "?" + c.urlParams_.Encode()
  61125. req, err := http.NewRequest("POST", urls, body)
  61126. if err != nil {
  61127. return nil, err
  61128. }
  61129. req.Header = reqHeaders
  61130. googleapi.Expand(req.URL, map[string]string{
  61131. "project": c.project,
  61132. "zone": c.zone,
  61133. "instanceGroupManager": c.instanceGroupManager,
  61134. })
  61135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61136. }
  61137. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  61138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61139. // status code is an error. Response headers are in either
  61140. // *Operation.ServerResponse.Header or (if a response was returned at
  61141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61142. // to check whether the returned error was because
  61143. // http.StatusNotModified was returned.
  61144. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61145. gensupport.SetOptions(c.urlParams_, opts...)
  61146. res, err := c.doRequest("json")
  61147. if res != nil && res.StatusCode == http.StatusNotModified {
  61148. if res.Body != nil {
  61149. res.Body.Close()
  61150. }
  61151. return nil, &googleapi.Error{
  61152. Code: res.StatusCode,
  61153. Header: res.Header,
  61154. }
  61155. }
  61156. if err != nil {
  61157. return nil, err
  61158. }
  61159. defer googleapi.CloseBody(res)
  61160. if err := googleapi.CheckResponse(res); err != nil {
  61161. return nil, err
  61162. }
  61163. ret := &Operation{
  61164. ServerResponse: googleapi.ServerResponse{
  61165. Header: res.Header,
  61166. HTTPStatusCode: res.StatusCode,
  61167. },
  61168. }
  61169. target := &ret
  61170. if err := gensupport.DecodeResponse(target, res); err != nil {
  61171. return nil, err
  61172. }
  61173. return ret, nil
  61174. // {
  61175. // "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.",
  61176. // "httpMethod": "POST",
  61177. // "id": "compute.instanceGroupManagers.setTargetPools",
  61178. // "parameterOrder": [
  61179. // "project",
  61180. // "zone",
  61181. // "instanceGroupManager"
  61182. // ],
  61183. // "parameters": {
  61184. // "instanceGroupManager": {
  61185. // "description": "The name of the managed instance group.",
  61186. // "location": "path",
  61187. // "required": true,
  61188. // "type": "string"
  61189. // },
  61190. // "project": {
  61191. // "description": "Project ID for this request.",
  61192. // "location": "path",
  61193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61194. // "required": true,
  61195. // "type": "string"
  61196. // },
  61197. // "requestId": {
  61198. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61199. // "location": "query",
  61200. // "type": "string"
  61201. // },
  61202. // "zone": {
  61203. // "description": "The name of the zone where the managed instance group is located.",
  61204. // "location": "path",
  61205. // "required": true,
  61206. // "type": "string"
  61207. // }
  61208. // },
  61209. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  61210. // "request": {
  61211. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  61212. // },
  61213. // "response": {
  61214. // "$ref": "Operation"
  61215. // },
  61216. // "scopes": [
  61217. // "https://www.googleapis.com/auth/cloud-platform",
  61218. // "https://www.googleapis.com/auth/compute"
  61219. // ]
  61220. // }
  61221. }
  61222. // method id "compute.instanceGroupManagers.testIamPermissions":
  61223. type InstanceGroupManagersTestIamPermissionsCall struct {
  61224. s *Service
  61225. project string
  61226. zone string
  61227. resource string
  61228. testpermissionsrequest *TestPermissionsRequest
  61229. urlParams_ gensupport.URLParams
  61230. ctx_ context.Context
  61231. header_ http.Header
  61232. }
  61233. // TestIamPermissions: Returns permissions that a caller has on the
  61234. // specified resource.
  61235. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  61236. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61237. c.project = project
  61238. c.zone = zone
  61239. c.resource = resource
  61240. c.testpermissionsrequest = testpermissionsrequest
  61241. return c
  61242. }
  61243. // Fields allows partial responses to be retrieved. See
  61244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61245. // for more information.
  61246. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  61247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61248. return c
  61249. }
  61250. // Context sets the context to be used in this call's Do method. Any
  61251. // pending HTTP request will be aborted if the provided context is
  61252. // canceled.
  61253. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  61254. c.ctx_ = ctx
  61255. return c
  61256. }
  61257. // Header returns an http.Header that can be modified by the caller to
  61258. // add HTTP headers to the request.
  61259. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  61260. if c.header_ == nil {
  61261. c.header_ = make(http.Header)
  61262. }
  61263. return c.header_
  61264. }
  61265. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  61266. reqHeaders := make(http.Header)
  61267. for k, v := range c.header_ {
  61268. reqHeaders[k] = v
  61269. }
  61270. reqHeaders.Set("User-Agent", c.s.userAgent())
  61271. var body io.Reader = nil
  61272. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  61273. if err != nil {
  61274. return nil, err
  61275. }
  61276. reqHeaders.Set("Content-Type", "application/json")
  61277. c.urlParams_.Set("alt", alt)
  61278. c.urlParams_.Set("prettyPrint", "false")
  61279. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  61280. urls += "?" + c.urlParams_.Encode()
  61281. req, err := http.NewRequest("POST", urls, body)
  61282. if err != nil {
  61283. return nil, err
  61284. }
  61285. req.Header = reqHeaders
  61286. googleapi.Expand(req.URL, map[string]string{
  61287. "project": c.project,
  61288. "zone": c.zone,
  61289. "resource": c.resource,
  61290. })
  61291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61292. }
  61293. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  61294. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  61295. // non-2xx status code is an error. Response headers are in either
  61296. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  61297. // returned at all) in error.(*googleapi.Error).Header. Use
  61298. // googleapi.IsNotModified to check whether the returned error was
  61299. // because http.StatusNotModified was returned.
  61300. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  61301. gensupport.SetOptions(c.urlParams_, opts...)
  61302. res, err := c.doRequest("json")
  61303. if res != nil && res.StatusCode == http.StatusNotModified {
  61304. if res.Body != nil {
  61305. res.Body.Close()
  61306. }
  61307. return nil, &googleapi.Error{
  61308. Code: res.StatusCode,
  61309. Header: res.Header,
  61310. }
  61311. }
  61312. if err != nil {
  61313. return nil, err
  61314. }
  61315. defer googleapi.CloseBody(res)
  61316. if err := googleapi.CheckResponse(res); err != nil {
  61317. return nil, err
  61318. }
  61319. ret := &TestPermissionsResponse{
  61320. ServerResponse: googleapi.ServerResponse{
  61321. Header: res.Header,
  61322. HTTPStatusCode: res.StatusCode,
  61323. },
  61324. }
  61325. target := &ret
  61326. if err := gensupport.DecodeResponse(target, res); err != nil {
  61327. return nil, err
  61328. }
  61329. return ret, nil
  61330. // {
  61331. // "description": "Returns permissions that a caller has on the specified resource.",
  61332. // "httpMethod": "POST",
  61333. // "id": "compute.instanceGroupManagers.testIamPermissions",
  61334. // "parameterOrder": [
  61335. // "project",
  61336. // "zone",
  61337. // "resource"
  61338. // ],
  61339. // "parameters": {
  61340. // "project": {
  61341. // "description": "Project ID for this request.",
  61342. // "location": "path",
  61343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61344. // "required": true,
  61345. // "type": "string"
  61346. // },
  61347. // "resource": {
  61348. // "description": "Name or id of the resource for this request.",
  61349. // "location": "path",
  61350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61351. // "required": true,
  61352. // "type": "string"
  61353. // },
  61354. // "zone": {
  61355. // "description": "The name of the zone for this request.",
  61356. // "location": "path",
  61357. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61358. // "required": true,
  61359. // "type": "string"
  61360. // }
  61361. // },
  61362. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  61363. // "request": {
  61364. // "$ref": "TestPermissionsRequest"
  61365. // },
  61366. // "response": {
  61367. // "$ref": "TestPermissionsResponse"
  61368. // },
  61369. // "scopes": [
  61370. // "https://www.googleapis.com/auth/cloud-platform",
  61371. // "https://www.googleapis.com/auth/compute",
  61372. // "https://www.googleapis.com/auth/compute.readonly"
  61373. // ]
  61374. // }
  61375. }
  61376. // method id "compute.instanceGroupManagers.update":
  61377. type InstanceGroupManagersUpdateCall struct {
  61378. s *Service
  61379. project string
  61380. zone string
  61381. instanceGroupManager string
  61382. instancegroupmanager *InstanceGroupManager
  61383. urlParams_ gensupport.URLParams
  61384. ctx_ context.Context
  61385. header_ http.Header
  61386. }
  61387. // Update: Updates a managed instance group using the information that
  61388. // you specify in the request. This operation is marked as DONE when the
  61389. // group is updated even if the instances in the group have not yet been
  61390. // updated. You must separately verify the status of the individual
  61391. // instances with the listManagedInstances method.
  61392. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  61393. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61394. c.project = project
  61395. c.zone = zone
  61396. c.instanceGroupManager = instanceGroupManager
  61397. c.instancegroupmanager = instancegroupmanager
  61398. return c
  61399. }
  61400. // RequestId sets the optional parameter "requestId": An optional
  61401. // request ID to identify requests. Specify a unique request ID so that
  61402. // if you must retry your request, the server will know to ignore the
  61403. // request if it has already been completed.
  61404. //
  61405. // For example, consider a situation where you make an initial request
  61406. // and the request times out. If you make the request again with the
  61407. // same request ID, the server can check if original operation with the
  61408. // same request ID was received, and if so, will ignore the second
  61409. // request. This prevents clients from accidentally creating duplicate
  61410. // commitments.
  61411. //
  61412. // The request ID must be a valid UUID with the exception that zero UUID
  61413. // is not supported (00000000-0000-0000-0000-000000000000).
  61414. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  61415. c.urlParams_.Set("requestId", requestId)
  61416. return c
  61417. }
  61418. // Fields allows partial responses to be retrieved. See
  61419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61420. // for more information.
  61421. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  61422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61423. return c
  61424. }
  61425. // Context sets the context to be used in this call's Do method. Any
  61426. // pending HTTP request will be aborted if the provided context is
  61427. // canceled.
  61428. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  61429. c.ctx_ = ctx
  61430. return c
  61431. }
  61432. // Header returns an http.Header that can be modified by the caller to
  61433. // add HTTP headers to the request.
  61434. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  61435. if c.header_ == nil {
  61436. c.header_ = make(http.Header)
  61437. }
  61438. return c.header_
  61439. }
  61440. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  61441. reqHeaders := make(http.Header)
  61442. for k, v := range c.header_ {
  61443. reqHeaders[k] = v
  61444. }
  61445. reqHeaders.Set("User-Agent", c.s.userAgent())
  61446. var body io.Reader = nil
  61447. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  61448. if err != nil {
  61449. return nil, err
  61450. }
  61451. reqHeaders.Set("Content-Type", "application/json")
  61452. c.urlParams_.Set("alt", alt)
  61453. c.urlParams_.Set("prettyPrint", "false")
  61454. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  61455. urls += "?" + c.urlParams_.Encode()
  61456. req, err := http.NewRequest("PUT", urls, body)
  61457. if err != nil {
  61458. return nil, err
  61459. }
  61460. req.Header = reqHeaders
  61461. googleapi.Expand(req.URL, map[string]string{
  61462. "project": c.project,
  61463. "zone": c.zone,
  61464. "instanceGroupManager": c.instanceGroupManager,
  61465. })
  61466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61467. }
  61468. // Do executes the "compute.instanceGroupManagers.update" call.
  61469. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61470. // status code is an error. Response headers are in either
  61471. // *Operation.ServerResponse.Header or (if a response was returned at
  61472. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61473. // to check whether the returned error was because
  61474. // http.StatusNotModified was returned.
  61475. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61476. gensupport.SetOptions(c.urlParams_, opts...)
  61477. res, err := c.doRequest("json")
  61478. if res != nil && res.StatusCode == http.StatusNotModified {
  61479. if res.Body != nil {
  61480. res.Body.Close()
  61481. }
  61482. return nil, &googleapi.Error{
  61483. Code: res.StatusCode,
  61484. Header: res.Header,
  61485. }
  61486. }
  61487. if err != nil {
  61488. return nil, err
  61489. }
  61490. defer googleapi.CloseBody(res)
  61491. if err := googleapi.CheckResponse(res); err != nil {
  61492. return nil, err
  61493. }
  61494. ret := &Operation{
  61495. ServerResponse: googleapi.ServerResponse{
  61496. Header: res.Header,
  61497. HTTPStatusCode: res.StatusCode,
  61498. },
  61499. }
  61500. target := &ret
  61501. if err := gensupport.DecodeResponse(target, res); err != nil {
  61502. return nil, err
  61503. }
  61504. return ret, nil
  61505. // {
  61506. // "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.",
  61507. // "httpMethod": "PUT",
  61508. // "id": "compute.instanceGroupManagers.update",
  61509. // "parameterOrder": [
  61510. // "project",
  61511. // "zone",
  61512. // "instanceGroupManager"
  61513. // ],
  61514. // "parameters": {
  61515. // "instanceGroupManager": {
  61516. // "description": "The name of the instance group manager.",
  61517. // "location": "path",
  61518. // "required": true,
  61519. // "type": "string"
  61520. // },
  61521. // "project": {
  61522. // "description": "Project ID for this request.",
  61523. // "location": "path",
  61524. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61525. // "required": true,
  61526. // "type": "string"
  61527. // },
  61528. // "requestId": {
  61529. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61530. // "location": "query",
  61531. // "type": "string"
  61532. // },
  61533. // "zone": {
  61534. // "description": "The name of the zone where you want to create the managed instance group.",
  61535. // "location": "path",
  61536. // "required": true,
  61537. // "type": "string"
  61538. // }
  61539. // },
  61540. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  61541. // "request": {
  61542. // "$ref": "InstanceGroupManager"
  61543. // },
  61544. // "response": {
  61545. // "$ref": "Operation"
  61546. // },
  61547. // "scopes": [
  61548. // "https://www.googleapis.com/auth/cloud-platform",
  61549. // "https://www.googleapis.com/auth/compute"
  61550. // ]
  61551. // }
  61552. }
  61553. // method id "compute.instanceGroupManagers.updatePerInstanceConfigs":
  61554. type InstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  61555. s *Service
  61556. project string
  61557. zone string
  61558. instanceGroupManager string
  61559. instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq
  61560. urlParams_ gensupport.URLParams
  61561. ctx_ context.Context
  61562. header_ http.Header
  61563. }
  61564. // UpdatePerInstanceConfigs: Insert or patch (for the ones that already
  61565. // exist) per-instance configs for the managed instance group.
  61566. // perInstanceConfig.instance serves as a key used to distinguish
  61567. // whether to perform insert or patch.
  61568. func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  61569. c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61570. c.project = project
  61571. c.zone = zone
  61572. c.instanceGroupManager = instanceGroupManager
  61573. c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq
  61574. return c
  61575. }
  61576. // RequestId sets the optional parameter "requestId": An optional
  61577. // request ID to identify requests. Specify a unique request ID so that
  61578. // if you must retry your request, the server will know to ignore the
  61579. // request if it has already been completed.
  61580. //
  61581. // For example, consider a situation where you make an initial request
  61582. // and the request times out. If you make the request again with the
  61583. // same request ID, the server can check if original operation with the
  61584. // same request ID was received, and if so, will ignore the second
  61585. // request. This prevents clients from accidentally creating duplicate
  61586. // commitments.
  61587. //
  61588. // The request ID must be a valid UUID with the exception that zero UUID
  61589. // is not supported (00000000-0000-0000-0000-000000000000).
  61590. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  61591. c.urlParams_.Set("requestId", requestId)
  61592. return c
  61593. }
  61594. // Fields allows partial responses to be retrieved. See
  61595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61596. // for more information.
  61597. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  61598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61599. return c
  61600. }
  61601. // Context sets the context to be used in this call's Do method. Any
  61602. // pending HTTP request will be aborted if the provided context is
  61603. // canceled.
  61604. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  61605. c.ctx_ = ctx
  61606. return c
  61607. }
  61608. // Header returns an http.Header that can be modified by the caller to
  61609. // add HTTP headers to the request.
  61610. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  61611. if c.header_ == nil {
  61612. c.header_ = make(http.Header)
  61613. }
  61614. return c.header_
  61615. }
  61616. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  61617. reqHeaders := make(http.Header)
  61618. for k, v := range c.header_ {
  61619. reqHeaders[k] = v
  61620. }
  61621. reqHeaders.Set("User-Agent", c.s.userAgent())
  61622. var body io.Reader = nil
  61623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq)
  61624. if err != nil {
  61625. return nil, err
  61626. }
  61627. reqHeaders.Set("Content-Type", "application/json")
  61628. c.urlParams_.Set("alt", alt)
  61629. c.urlParams_.Set("prettyPrint", "false")
  61630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  61631. urls += "?" + c.urlParams_.Encode()
  61632. req, err := http.NewRequest("POST", urls, body)
  61633. if err != nil {
  61634. return nil, err
  61635. }
  61636. req.Header = reqHeaders
  61637. googleapi.Expand(req.URL, map[string]string{
  61638. "project": c.project,
  61639. "zone": c.zone,
  61640. "instanceGroupManager": c.instanceGroupManager,
  61641. })
  61642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61643. }
  61644. // Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call.
  61645. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61646. // status code is an error. Response headers are in either
  61647. // *Operation.ServerResponse.Header or (if a response was returned at
  61648. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61649. // to check whether the returned error was because
  61650. // http.StatusNotModified was returned.
  61651. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61652. gensupport.SetOptions(c.urlParams_, opts...)
  61653. res, err := c.doRequest("json")
  61654. if res != nil && res.StatusCode == http.StatusNotModified {
  61655. if res.Body != nil {
  61656. res.Body.Close()
  61657. }
  61658. return nil, &googleapi.Error{
  61659. Code: res.StatusCode,
  61660. Header: res.Header,
  61661. }
  61662. }
  61663. if err != nil {
  61664. return nil, err
  61665. }
  61666. defer googleapi.CloseBody(res)
  61667. if err := googleapi.CheckResponse(res); err != nil {
  61668. return nil, err
  61669. }
  61670. ret := &Operation{
  61671. ServerResponse: googleapi.ServerResponse{
  61672. Header: res.Header,
  61673. HTTPStatusCode: res.StatusCode,
  61674. },
  61675. }
  61676. target := &ret
  61677. if err := gensupport.DecodeResponse(target, res); err != nil {
  61678. return nil, err
  61679. }
  61680. return ret, nil
  61681. // {
  61682. // "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  61683. // "httpMethod": "POST",
  61684. // "id": "compute.instanceGroupManagers.updatePerInstanceConfigs",
  61685. // "parameterOrder": [
  61686. // "project",
  61687. // "zone",
  61688. // "instanceGroupManager"
  61689. // ],
  61690. // "parameters": {
  61691. // "instanceGroupManager": {
  61692. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  61693. // "location": "path",
  61694. // "required": true,
  61695. // "type": "string"
  61696. // },
  61697. // "project": {
  61698. // "description": "Project ID for this request.",
  61699. // "location": "path",
  61700. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61701. // "required": true,
  61702. // "type": "string"
  61703. // },
  61704. // "requestId": {
  61705. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61706. // "location": "query",
  61707. // "type": "string"
  61708. // },
  61709. // "zone": {
  61710. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  61711. // "location": "path",
  61712. // "required": true,
  61713. // "type": "string"
  61714. // }
  61715. // },
  61716. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  61717. // "request": {
  61718. // "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq"
  61719. // },
  61720. // "response": {
  61721. // "$ref": "Operation"
  61722. // },
  61723. // "scopes": [
  61724. // "https://www.googleapis.com/auth/cloud-platform",
  61725. // "https://www.googleapis.com/auth/compute"
  61726. // ]
  61727. // }
  61728. }
  61729. // method id "compute.instanceGroups.addInstances":
  61730. type InstanceGroupsAddInstancesCall struct {
  61731. s *Service
  61732. project string
  61733. zone string
  61734. instanceGroup string
  61735. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  61736. urlParams_ gensupport.URLParams
  61737. ctx_ context.Context
  61738. header_ http.Header
  61739. }
  61740. // AddInstances: Adds a list of instances to the specified instance
  61741. // group. All of the instances in the instance group must be in the same
  61742. // network/subnetwork. Read Adding instances for more information.
  61743. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  61744. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61745. c.project = project
  61746. c.zone = zone
  61747. c.instanceGroup = instanceGroup
  61748. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  61749. return c
  61750. }
  61751. // RequestId sets the optional parameter "requestId": An optional
  61752. // request ID to identify requests. Specify a unique request ID so that
  61753. // if you must retry your request, the server will know to ignore the
  61754. // request if it has already been completed.
  61755. //
  61756. // For example, consider a situation where you make an initial request
  61757. // and the request times out. If you make the request again with the
  61758. // same request ID, the server can check if original operation with the
  61759. // same request ID was received, and if so, will ignore the second
  61760. // request. This prevents clients from accidentally creating duplicate
  61761. // commitments.
  61762. //
  61763. // The request ID must be a valid UUID with the exception that zero UUID
  61764. // is not supported (00000000-0000-0000-0000-000000000000).
  61765. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  61766. c.urlParams_.Set("requestId", requestId)
  61767. return c
  61768. }
  61769. // Fields allows partial responses to be retrieved. See
  61770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61771. // for more information.
  61772. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  61773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61774. return c
  61775. }
  61776. // Context sets the context to be used in this call's Do method. Any
  61777. // pending HTTP request will be aborted if the provided context is
  61778. // canceled.
  61779. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  61780. c.ctx_ = ctx
  61781. return c
  61782. }
  61783. // Header returns an http.Header that can be modified by the caller to
  61784. // add HTTP headers to the request.
  61785. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  61786. if c.header_ == nil {
  61787. c.header_ = make(http.Header)
  61788. }
  61789. return c.header_
  61790. }
  61791. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  61792. reqHeaders := make(http.Header)
  61793. for k, v := range c.header_ {
  61794. reqHeaders[k] = v
  61795. }
  61796. reqHeaders.Set("User-Agent", c.s.userAgent())
  61797. var body io.Reader = nil
  61798. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  61799. if err != nil {
  61800. return nil, err
  61801. }
  61802. reqHeaders.Set("Content-Type", "application/json")
  61803. c.urlParams_.Set("alt", alt)
  61804. c.urlParams_.Set("prettyPrint", "false")
  61805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  61806. urls += "?" + c.urlParams_.Encode()
  61807. req, err := http.NewRequest("POST", urls, body)
  61808. if err != nil {
  61809. return nil, err
  61810. }
  61811. req.Header = reqHeaders
  61812. googleapi.Expand(req.URL, map[string]string{
  61813. "project": c.project,
  61814. "zone": c.zone,
  61815. "instanceGroup": c.instanceGroup,
  61816. })
  61817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61818. }
  61819. // Do executes the "compute.instanceGroups.addInstances" call.
  61820. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61821. // status code is an error. Response headers are in either
  61822. // *Operation.ServerResponse.Header or (if a response was returned at
  61823. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61824. // to check whether the returned error was because
  61825. // http.StatusNotModified was returned.
  61826. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61827. gensupport.SetOptions(c.urlParams_, opts...)
  61828. res, err := c.doRequest("json")
  61829. if res != nil && res.StatusCode == http.StatusNotModified {
  61830. if res.Body != nil {
  61831. res.Body.Close()
  61832. }
  61833. return nil, &googleapi.Error{
  61834. Code: res.StatusCode,
  61835. Header: res.Header,
  61836. }
  61837. }
  61838. if err != nil {
  61839. return nil, err
  61840. }
  61841. defer googleapi.CloseBody(res)
  61842. if err := googleapi.CheckResponse(res); err != nil {
  61843. return nil, err
  61844. }
  61845. ret := &Operation{
  61846. ServerResponse: googleapi.ServerResponse{
  61847. Header: res.Header,
  61848. HTTPStatusCode: res.StatusCode,
  61849. },
  61850. }
  61851. target := &ret
  61852. if err := gensupport.DecodeResponse(target, res); err != nil {
  61853. return nil, err
  61854. }
  61855. return ret, nil
  61856. // {
  61857. // "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.",
  61858. // "httpMethod": "POST",
  61859. // "id": "compute.instanceGroups.addInstances",
  61860. // "parameterOrder": [
  61861. // "project",
  61862. // "zone",
  61863. // "instanceGroup"
  61864. // ],
  61865. // "parameters": {
  61866. // "instanceGroup": {
  61867. // "description": "The name of the instance group where you are adding instances.",
  61868. // "location": "path",
  61869. // "required": true,
  61870. // "type": "string"
  61871. // },
  61872. // "project": {
  61873. // "description": "Project ID for this request.",
  61874. // "location": "path",
  61875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61876. // "required": true,
  61877. // "type": "string"
  61878. // },
  61879. // "requestId": {
  61880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61881. // "location": "query",
  61882. // "type": "string"
  61883. // },
  61884. // "zone": {
  61885. // "description": "The name of the zone where the instance group is located.",
  61886. // "location": "path",
  61887. // "required": true,
  61888. // "type": "string"
  61889. // }
  61890. // },
  61891. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  61892. // "request": {
  61893. // "$ref": "InstanceGroupsAddInstancesRequest"
  61894. // },
  61895. // "response": {
  61896. // "$ref": "Operation"
  61897. // },
  61898. // "scopes": [
  61899. // "https://www.googleapis.com/auth/cloud-platform",
  61900. // "https://www.googleapis.com/auth/compute"
  61901. // ]
  61902. // }
  61903. }
  61904. // method id "compute.instanceGroups.aggregatedList":
  61905. type InstanceGroupsAggregatedListCall struct {
  61906. s *Service
  61907. project string
  61908. urlParams_ gensupport.URLParams
  61909. ifNoneMatch_ string
  61910. ctx_ context.Context
  61911. header_ http.Header
  61912. }
  61913. // AggregatedList: Retrieves the list of instance groups and sorts them
  61914. // by zone.
  61915. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  61916. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61917. c.project = project
  61918. return c
  61919. }
  61920. // Filter sets the optional parameter "filter": A filter expression that
  61921. // filters resources listed in the response. The expression must specify
  61922. // the field name, a comparison operator, and the value that you want to
  61923. // use for filtering. The value must be a string, a number, or a
  61924. // boolean. The comparison operator must be either =, !=, >, or <.
  61925. //
  61926. // For example, if you are filtering Compute Engine instances, you can
  61927. // exclude instances named example-instance by specifying name !=
  61928. // example-instance.
  61929. //
  61930. // You can also filter nested fields. For example, you could specify
  61931. // scheduling.automaticRestart = false to include instances only if they
  61932. // are not scheduled for automatic restarts. You can use filtering on
  61933. // nested fields to filter based on resource labels.
  61934. //
  61935. // To filter on multiple expressions, provide each separate expression
  61936. // within parentheses. For example, (scheduling.automaticRestart = true)
  61937. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61938. // AND expression. However, you can include AND and OR expressions
  61939. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61940. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61941. // true).
  61942. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  61943. c.urlParams_.Set("filter", filter)
  61944. return c
  61945. }
  61946. // MaxResults sets the optional parameter "maxResults": The maximum
  61947. // number of results per page that should be returned. If the number of
  61948. // available results is larger than maxResults, Compute Engine returns a
  61949. // nextPageToken that can be used to get the next page of results in
  61950. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61951. // (Default: 500)
  61952. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  61953. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61954. return c
  61955. }
  61956. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61957. // a certain order. By default, results are returned in alphanumerical
  61958. // order based on the resource name.
  61959. //
  61960. // You can also sort results in descending order based on the creation
  61961. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61962. // based on the creationTimestamp field in reverse chronological order
  61963. // (newest result first). Use this to sort resources like operations so
  61964. // that the newest operation is returned first.
  61965. //
  61966. // Currently, only sorting by name or creationTimestamp desc is
  61967. // supported.
  61968. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  61969. c.urlParams_.Set("orderBy", orderBy)
  61970. return c
  61971. }
  61972. // PageToken sets the optional parameter "pageToken": Specifies a page
  61973. // token to use. Set pageToken to the nextPageToken returned by a
  61974. // previous list request to get the next page of results.
  61975. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  61976. c.urlParams_.Set("pageToken", pageToken)
  61977. return c
  61978. }
  61979. // Fields allows partial responses to be retrieved. See
  61980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61981. // for more information.
  61982. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  61983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61984. return c
  61985. }
  61986. // IfNoneMatch sets the optional parameter which makes the operation
  61987. // fail if the object's ETag matches the given value. This is useful for
  61988. // getting updates only after the object has changed since the last
  61989. // request. Use googleapi.IsNotModified to check whether the response
  61990. // error from Do is the result of In-None-Match.
  61991. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  61992. c.ifNoneMatch_ = entityTag
  61993. return c
  61994. }
  61995. // Context sets the context to be used in this call's Do method. Any
  61996. // pending HTTP request will be aborted if the provided context is
  61997. // canceled.
  61998. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  61999. c.ctx_ = ctx
  62000. return c
  62001. }
  62002. // Header returns an http.Header that can be modified by the caller to
  62003. // add HTTP headers to the request.
  62004. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  62005. if c.header_ == nil {
  62006. c.header_ = make(http.Header)
  62007. }
  62008. return c.header_
  62009. }
  62010. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  62011. reqHeaders := make(http.Header)
  62012. for k, v := range c.header_ {
  62013. reqHeaders[k] = v
  62014. }
  62015. reqHeaders.Set("User-Agent", c.s.userAgent())
  62016. if c.ifNoneMatch_ != "" {
  62017. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62018. }
  62019. var body io.Reader = nil
  62020. c.urlParams_.Set("alt", alt)
  62021. c.urlParams_.Set("prettyPrint", "false")
  62022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  62023. urls += "?" + c.urlParams_.Encode()
  62024. req, err := http.NewRequest("GET", urls, body)
  62025. if err != nil {
  62026. return nil, err
  62027. }
  62028. req.Header = reqHeaders
  62029. googleapi.Expand(req.URL, map[string]string{
  62030. "project": c.project,
  62031. })
  62032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62033. }
  62034. // Do executes the "compute.instanceGroups.aggregatedList" call.
  62035. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  62036. // Any non-2xx status code is an error. Response headers are in either
  62037. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  62038. // was returned at all) in error.(*googleapi.Error).Header. Use
  62039. // googleapi.IsNotModified to check whether the returned error was
  62040. // because http.StatusNotModified was returned.
  62041. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  62042. gensupport.SetOptions(c.urlParams_, opts...)
  62043. res, err := c.doRequest("json")
  62044. if res != nil && res.StatusCode == http.StatusNotModified {
  62045. if res.Body != nil {
  62046. res.Body.Close()
  62047. }
  62048. return nil, &googleapi.Error{
  62049. Code: res.StatusCode,
  62050. Header: res.Header,
  62051. }
  62052. }
  62053. if err != nil {
  62054. return nil, err
  62055. }
  62056. defer googleapi.CloseBody(res)
  62057. if err := googleapi.CheckResponse(res); err != nil {
  62058. return nil, err
  62059. }
  62060. ret := &InstanceGroupAggregatedList{
  62061. ServerResponse: googleapi.ServerResponse{
  62062. Header: res.Header,
  62063. HTTPStatusCode: res.StatusCode,
  62064. },
  62065. }
  62066. target := &ret
  62067. if err := gensupport.DecodeResponse(target, res); err != nil {
  62068. return nil, err
  62069. }
  62070. return ret, nil
  62071. // {
  62072. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  62073. // "httpMethod": "GET",
  62074. // "id": "compute.instanceGroups.aggregatedList",
  62075. // "parameterOrder": [
  62076. // "project"
  62077. // ],
  62078. // "parameters": {
  62079. // "filter": {
  62080. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62081. // "location": "query",
  62082. // "type": "string"
  62083. // },
  62084. // "maxResults": {
  62085. // "default": "500",
  62086. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62087. // "format": "uint32",
  62088. // "location": "query",
  62089. // "minimum": "0",
  62090. // "type": "integer"
  62091. // },
  62092. // "orderBy": {
  62093. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62094. // "location": "query",
  62095. // "type": "string"
  62096. // },
  62097. // "pageToken": {
  62098. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62099. // "location": "query",
  62100. // "type": "string"
  62101. // },
  62102. // "project": {
  62103. // "description": "Project ID for this request.",
  62104. // "location": "path",
  62105. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62106. // "required": true,
  62107. // "type": "string"
  62108. // }
  62109. // },
  62110. // "path": "{project}/aggregated/instanceGroups",
  62111. // "response": {
  62112. // "$ref": "InstanceGroupAggregatedList"
  62113. // },
  62114. // "scopes": [
  62115. // "https://www.googleapis.com/auth/cloud-platform",
  62116. // "https://www.googleapis.com/auth/compute",
  62117. // "https://www.googleapis.com/auth/compute.readonly"
  62118. // ]
  62119. // }
  62120. }
  62121. // Pages invokes f for each page of results.
  62122. // A non-nil error returned from f will halt the iteration.
  62123. // The provided context supersedes any context provided to the Context method.
  62124. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  62125. c.ctx_ = ctx
  62126. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62127. for {
  62128. x, err := c.Do()
  62129. if err != nil {
  62130. return err
  62131. }
  62132. if err := f(x); err != nil {
  62133. return err
  62134. }
  62135. if x.NextPageToken == "" {
  62136. return nil
  62137. }
  62138. c.PageToken(x.NextPageToken)
  62139. }
  62140. }
  62141. // method id "compute.instanceGroups.delete":
  62142. type InstanceGroupsDeleteCall struct {
  62143. s *Service
  62144. project string
  62145. zone string
  62146. instanceGroup string
  62147. urlParams_ gensupport.URLParams
  62148. ctx_ context.Context
  62149. header_ http.Header
  62150. }
  62151. // Delete: Deletes the specified instance group. The instances in the
  62152. // group are not deleted. Note that instance group must not belong to a
  62153. // backend service. Read Deleting an instance group for more
  62154. // information.
  62155. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  62156. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62157. c.project = project
  62158. c.zone = zone
  62159. c.instanceGroup = instanceGroup
  62160. return c
  62161. }
  62162. // RequestId sets the optional parameter "requestId": An optional
  62163. // request ID to identify requests. Specify a unique request ID so that
  62164. // if you must retry your request, the server will know to ignore the
  62165. // request if it has already been completed.
  62166. //
  62167. // For example, consider a situation where you make an initial request
  62168. // and the request times out. If you make the request again with the
  62169. // same request ID, the server can check if original operation with the
  62170. // same request ID was received, and if so, will ignore the second
  62171. // request. This prevents clients from accidentally creating duplicate
  62172. // commitments.
  62173. //
  62174. // The request ID must be a valid UUID with the exception that zero UUID
  62175. // is not supported (00000000-0000-0000-0000-000000000000).
  62176. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  62177. c.urlParams_.Set("requestId", requestId)
  62178. return c
  62179. }
  62180. // Fields allows partial responses to be retrieved. See
  62181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62182. // for more information.
  62183. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  62184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62185. return c
  62186. }
  62187. // Context sets the context to be used in this call's Do method. Any
  62188. // pending HTTP request will be aborted if the provided context is
  62189. // canceled.
  62190. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  62191. c.ctx_ = ctx
  62192. return c
  62193. }
  62194. // Header returns an http.Header that can be modified by the caller to
  62195. // add HTTP headers to the request.
  62196. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  62197. if c.header_ == nil {
  62198. c.header_ = make(http.Header)
  62199. }
  62200. return c.header_
  62201. }
  62202. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  62203. reqHeaders := make(http.Header)
  62204. for k, v := range c.header_ {
  62205. reqHeaders[k] = v
  62206. }
  62207. reqHeaders.Set("User-Agent", c.s.userAgent())
  62208. var body io.Reader = nil
  62209. c.urlParams_.Set("alt", alt)
  62210. c.urlParams_.Set("prettyPrint", "false")
  62211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  62212. urls += "?" + c.urlParams_.Encode()
  62213. req, err := http.NewRequest("DELETE", urls, body)
  62214. if err != nil {
  62215. return nil, err
  62216. }
  62217. req.Header = reqHeaders
  62218. googleapi.Expand(req.URL, map[string]string{
  62219. "project": c.project,
  62220. "zone": c.zone,
  62221. "instanceGroup": c.instanceGroup,
  62222. })
  62223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62224. }
  62225. // Do executes the "compute.instanceGroups.delete" call.
  62226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62227. // status code is an error. Response headers are in either
  62228. // *Operation.ServerResponse.Header or (if a response was returned at
  62229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62230. // to check whether the returned error was because
  62231. // http.StatusNotModified was returned.
  62232. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62233. gensupport.SetOptions(c.urlParams_, opts...)
  62234. res, err := c.doRequest("json")
  62235. if res != nil && res.StatusCode == http.StatusNotModified {
  62236. if res.Body != nil {
  62237. res.Body.Close()
  62238. }
  62239. return nil, &googleapi.Error{
  62240. Code: res.StatusCode,
  62241. Header: res.Header,
  62242. }
  62243. }
  62244. if err != nil {
  62245. return nil, err
  62246. }
  62247. defer googleapi.CloseBody(res)
  62248. if err := googleapi.CheckResponse(res); err != nil {
  62249. return nil, err
  62250. }
  62251. ret := &Operation{
  62252. ServerResponse: googleapi.ServerResponse{
  62253. Header: res.Header,
  62254. HTTPStatusCode: res.StatusCode,
  62255. },
  62256. }
  62257. target := &ret
  62258. if err := gensupport.DecodeResponse(target, res); err != nil {
  62259. return nil, err
  62260. }
  62261. return ret, nil
  62262. // {
  62263. // "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.",
  62264. // "httpMethod": "DELETE",
  62265. // "id": "compute.instanceGroups.delete",
  62266. // "parameterOrder": [
  62267. // "project",
  62268. // "zone",
  62269. // "instanceGroup"
  62270. // ],
  62271. // "parameters": {
  62272. // "instanceGroup": {
  62273. // "description": "The name of the instance group to delete.",
  62274. // "location": "path",
  62275. // "required": true,
  62276. // "type": "string"
  62277. // },
  62278. // "project": {
  62279. // "description": "Project ID for this request.",
  62280. // "location": "path",
  62281. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62282. // "required": true,
  62283. // "type": "string"
  62284. // },
  62285. // "requestId": {
  62286. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62287. // "location": "query",
  62288. // "type": "string"
  62289. // },
  62290. // "zone": {
  62291. // "description": "The name of the zone where the instance group is located.",
  62292. // "location": "path",
  62293. // "required": true,
  62294. // "type": "string"
  62295. // }
  62296. // },
  62297. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  62298. // "response": {
  62299. // "$ref": "Operation"
  62300. // },
  62301. // "scopes": [
  62302. // "https://www.googleapis.com/auth/cloud-platform",
  62303. // "https://www.googleapis.com/auth/compute"
  62304. // ]
  62305. // }
  62306. }
  62307. // method id "compute.instanceGroups.get":
  62308. type InstanceGroupsGetCall struct {
  62309. s *Service
  62310. project string
  62311. zone string
  62312. instanceGroup string
  62313. urlParams_ gensupport.URLParams
  62314. ifNoneMatch_ string
  62315. ctx_ context.Context
  62316. header_ http.Header
  62317. }
  62318. // Get: Returns the specified instance group. Gets a list of available
  62319. // instance groups by making a list() request.
  62320. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  62321. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62322. c.project = project
  62323. c.zone = zone
  62324. c.instanceGroup = instanceGroup
  62325. return c
  62326. }
  62327. // Fields allows partial responses to be retrieved. See
  62328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62329. // for more information.
  62330. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  62331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62332. return c
  62333. }
  62334. // IfNoneMatch sets the optional parameter which makes the operation
  62335. // fail if the object's ETag matches the given value. This is useful for
  62336. // getting updates only after the object has changed since the last
  62337. // request. Use googleapi.IsNotModified to check whether the response
  62338. // error from Do is the result of In-None-Match.
  62339. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  62340. c.ifNoneMatch_ = entityTag
  62341. return c
  62342. }
  62343. // Context sets the context to be used in this call's Do method. Any
  62344. // pending HTTP request will be aborted if the provided context is
  62345. // canceled.
  62346. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  62347. c.ctx_ = ctx
  62348. return c
  62349. }
  62350. // Header returns an http.Header that can be modified by the caller to
  62351. // add HTTP headers to the request.
  62352. func (c *InstanceGroupsGetCall) Header() http.Header {
  62353. if c.header_ == nil {
  62354. c.header_ = make(http.Header)
  62355. }
  62356. return c.header_
  62357. }
  62358. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  62359. reqHeaders := make(http.Header)
  62360. for k, v := range c.header_ {
  62361. reqHeaders[k] = v
  62362. }
  62363. reqHeaders.Set("User-Agent", c.s.userAgent())
  62364. if c.ifNoneMatch_ != "" {
  62365. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62366. }
  62367. var body io.Reader = nil
  62368. c.urlParams_.Set("alt", alt)
  62369. c.urlParams_.Set("prettyPrint", "false")
  62370. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  62371. urls += "?" + c.urlParams_.Encode()
  62372. req, err := http.NewRequest("GET", urls, body)
  62373. if err != nil {
  62374. return nil, err
  62375. }
  62376. req.Header = reqHeaders
  62377. googleapi.Expand(req.URL, map[string]string{
  62378. "project": c.project,
  62379. "zone": c.zone,
  62380. "instanceGroup": c.instanceGroup,
  62381. })
  62382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62383. }
  62384. // Do executes the "compute.instanceGroups.get" call.
  62385. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  62386. // status code is an error. Response headers are in either
  62387. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  62388. // at all) in error.(*googleapi.Error).Header. Use
  62389. // googleapi.IsNotModified to check whether the returned error was
  62390. // because http.StatusNotModified was returned.
  62391. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  62392. gensupport.SetOptions(c.urlParams_, opts...)
  62393. res, err := c.doRequest("json")
  62394. if res != nil && res.StatusCode == http.StatusNotModified {
  62395. if res.Body != nil {
  62396. res.Body.Close()
  62397. }
  62398. return nil, &googleapi.Error{
  62399. Code: res.StatusCode,
  62400. Header: res.Header,
  62401. }
  62402. }
  62403. if err != nil {
  62404. return nil, err
  62405. }
  62406. defer googleapi.CloseBody(res)
  62407. if err := googleapi.CheckResponse(res); err != nil {
  62408. return nil, err
  62409. }
  62410. ret := &InstanceGroup{
  62411. ServerResponse: googleapi.ServerResponse{
  62412. Header: res.Header,
  62413. HTTPStatusCode: res.StatusCode,
  62414. },
  62415. }
  62416. target := &ret
  62417. if err := gensupport.DecodeResponse(target, res); err != nil {
  62418. return nil, err
  62419. }
  62420. return ret, nil
  62421. // {
  62422. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  62423. // "httpMethod": "GET",
  62424. // "id": "compute.instanceGroups.get",
  62425. // "parameterOrder": [
  62426. // "project",
  62427. // "zone",
  62428. // "instanceGroup"
  62429. // ],
  62430. // "parameters": {
  62431. // "instanceGroup": {
  62432. // "description": "The name of the instance group.",
  62433. // "location": "path",
  62434. // "required": true,
  62435. // "type": "string"
  62436. // },
  62437. // "project": {
  62438. // "description": "Project ID for this request.",
  62439. // "location": "path",
  62440. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62441. // "required": true,
  62442. // "type": "string"
  62443. // },
  62444. // "zone": {
  62445. // "description": "The name of the zone where the instance group is located.",
  62446. // "location": "path",
  62447. // "required": true,
  62448. // "type": "string"
  62449. // }
  62450. // },
  62451. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  62452. // "response": {
  62453. // "$ref": "InstanceGroup"
  62454. // },
  62455. // "scopes": [
  62456. // "https://www.googleapis.com/auth/cloud-platform",
  62457. // "https://www.googleapis.com/auth/compute",
  62458. // "https://www.googleapis.com/auth/compute.readonly"
  62459. // ]
  62460. // }
  62461. }
  62462. // method id "compute.instanceGroups.insert":
  62463. type InstanceGroupsInsertCall struct {
  62464. s *Service
  62465. project string
  62466. zone string
  62467. instancegroup *InstanceGroup
  62468. urlParams_ gensupport.URLParams
  62469. ctx_ context.Context
  62470. header_ http.Header
  62471. }
  62472. // Insert: Creates an instance group in the specified project using the
  62473. // parameters that are included in the request.
  62474. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  62475. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62476. c.project = project
  62477. c.zone = zone
  62478. c.instancegroup = instancegroup
  62479. return c
  62480. }
  62481. // RequestId sets the optional parameter "requestId": An optional
  62482. // request ID to identify requests. Specify a unique request ID so that
  62483. // if you must retry your request, the server will know to ignore the
  62484. // request if it has already been completed.
  62485. //
  62486. // For example, consider a situation where you make an initial request
  62487. // and the request times out. If you make the request again with the
  62488. // same request ID, the server can check if original operation with the
  62489. // same request ID was received, and if so, will ignore the second
  62490. // request. This prevents clients from accidentally creating duplicate
  62491. // commitments.
  62492. //
  62493. // The request ID must be a valid UUID with the exception that zero UUID
  62494. // is not supported (00000000-0000-0000-0000-000000000000).
  62495. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  62496. c.urlParams_.Set("requestId", requestId)
  62497. return c
  62498. }
  62499. // Fields allows partial responses to be retrieved. See
  62500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62501. // for more information.
  62502. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  62503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62504. return c
  62505. }
  62506. // Context sets the context to be used in this call's Do method. Any
  62507. // pending HTTP request will be aborted if the provided context is
  62508. // canceled.
  62509. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  62510. c.ctx_ = ctx
  62511. return c
  62512. }
  62513. // Header returns an http.Header that can be modified by the caller to
  62514. // add HTTP headers to the request.
  62515. func (c *InstanceGroupsInsertCall) Header() http.Header {
  62516. if c.header_ == nil {
  62517. c.header_ = make(http.Header)
  62518. }
  62519. return c.header_
  62520. }
  62521. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  62522. reqHeaders := make(http.Header)
  62523. for k, v := range c.header_ {
  62524. reqHeaders[k] = v
  62525. }
  62526. reqHeaders.Set("User-Agent", c.s.userAgent())
  62527. var body io.Reader = nil
  62528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  62529. if err != nil {
  62530. return nil, err
  62531. }
  62532. reqHeaders.Set("Content-Type", "application/json")
  62533. c.urlParams_.Set("alt", alt)
  62534. c.urlParams_.Set("prettyPrint", "false")
  62535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  62536. urls += "?" + c.urlParams_.Encode()
  62537. req, err := http.NewRequest("POST", urls, body)
  62538. if err != nil {
  62539. return nil, err
  62540. }
  62541. req.Header = reqHeaders
  62542. googleapi.Expand(req.URL, map[string]string{
  62543. "project": c.project,
  62544. "zone": c.zone,
  62545. })
  62546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62547. }
  62548. // Do executes the "compute.instanceGroups.insert" call.
  62549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62550. // status code is an error. Response headers are in either
  62551. // *Operation.ServerResponse.Header or (if a response was returned at
  62552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62553. // to check whether the returned error was because
  62554. // http.StatusNotModified was returned.
  62555. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62556. gensupport.SetOptions(c.urlParams_, opts...)
  62557. res, err := c.doRequest("json")
  62558. if res != nil && res.StatusCode == http.StatusNotModified {
  62559. if res.Body != nil {
  62560. res.Body.Close()
  62561. }
  62562. return nil, &googleapi.Error{
  62563. Code: res.StatusCode,
  62564. Header: res.Header,
  62565. }
  62566. }
  62567. if err != nil {
  62568. return nil, err
  62569. }
  62570. defer googleapi.CloseBody(res)
  62571. if err := googleapi.CheckResponse(res); err != nil {
  62572. return nil, err
  62573. }
  62574. ret := &Operation{
  62575. ServerResponse: googleapi.ServerResponse{
  62576. Header: res.Header,
  62577. HTTPStatusCode: res.StatusCode,
  62578. },
  62579. }
  62580. target := &ret
  62581. if err := gensupport.DecodeResponse(target, res); err != nil {
  62582. return nil, err
  62583. }
  62584. return ret, nil
  62585. // {
  62586. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  62587. // "httpMethod": "POST",
  62588. // "id": "compute.instanceGroups.insert",
  62589. // "parameterOrder": [
  62590. // "project",
  62591. // "zone"
  62592. // ],
  62593. // "parameters": {
  62594. // "project": {
  62595. // "description": "Project ID for this request.",
  62596. // "location": "path",
  62597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62598. // "required": true,
  62599. // "type": "string"
  62600. // },
  62601. // "requestId": {
  62602. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62603. // "location": "query",
  62604. // "type": "string"
  62605. // },
  62606. // "zone": {
  62607. // "description": "The name of the zone where you want to create the instance group.",
  62608. // "location": "path",
  62609. // "required": true,
  62610. // "type": "string"
  62611. // }
  62612. // },
  62613. // "path": "{project}/zones/{zone}/instanceGroups",
  62614. // "request": {
  62615. // "$ref": "InstanceGroup"
  62616. // },
  62617. // "response": {
  62618. // "$ref": "Operation"
  62619. // },
  62620. // "scopes": [
  62621. // "https://www.googleapis.com/auth/cloud-platform",
  62622. // "https://www.googleapis.com/auth/compute"
  62623. // ]
  62624. // }
  62625. }
  62626. // method id "compute.instanceGroups.list":
  62627. type InstanceGroupsListCall struct {
  62628. s *Service
  62629. project string
  62630. zone string
  62631. urlParams_ gensupport.URLParams
  62632. ifNoneMatch_ string
  62633. ctx_ context.Context
  62634. header_ http.Header
  62635. }
  62636. // List: Retrieves the list of instance groups that are located in the
  62637. // specified project and zone.
  62638. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  62639. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62640. c.project = project
  62641. c.zone = zone
  62642. return c
  62643. }
  62644. // Filter sets the optional parameter "filter": A filter expression that
  62645. // filters resources listed in the response. The expression must specify
  62646. // the field name, a comparison operator, and the value that you want to
  62647. // use for filtering. The value must be a string, a number, or a
  62648. // boolean. The comparison operator must be either =, !=, >, or <.
  62649. //
  62650. // For example, if you are filtering Compute Engine instances, you can
  62651. // exclude instances named example-instance by specifying name !=
  62652. // example-instance.
  62653. //
  62654. // You can also filter nested fields. For example, you could specify
  62655. // scheduling.automaticRestart = false to include instances only if they
  62656. // are not scheduled for automatic restarts. You can use filtering on
  62657. // nested fields to filter based on resource labels.
  62658. //
  62659. // To filter on multiple expressions, provide each separate expression
  62660. // within parentheses. For example, (scheduling.automaticRestart = true)
  62661. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62662. // AND expression. However, you can include AND and OR expressions
  62663. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62664. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62665. // true).
  62666. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  62667. c.urlParams_.Set("filter", filter)
  62668. return c
  62669. }
  62670. // MaxResults sets the optional parameter "maxResults": The maximum
  62671. // number of results per page that should be returned. If the number of
  62672. // available results is larger than maxResults, Compute Engine returns a
  62673. // nextPageToken that can be used to get the next page of results in
  62674. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62675. // (Default: 500)
  62676. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  62677. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62678. return c
  62679. }
  62680. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62681. // a certain order. By default, results are returned in alphanumerical
  62682. // order based on the resource name.
  62683. //
  62684. // You can also sort results in descending order based on the creation
  62685. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62686. // based on the creationTimestamp field in reverse chronological order
  62687. // (newest result first). Use this to sort resources like operations so
  62688. // that the newest operation is returned first.
  62689. //
  62690. // Currently, only sorting by name or creationTimestamp desc is
  62691. // supported.
  62692. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  62693. c.urlParams_.Set("orderBy", orderBy)
  62694. return c
  62695. }
  62696. // PageToken sets the optional parameter "pageToken": Specifies a page
  62697. // token to use. Set pageToken to the nextPageToken returned by a
  62698. // previous list request to get the next page of results.
  62699. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  62700. c.urlParams_.Set("pageToken", pageToken)
  62701. return c
  62702. }
  62703. // Fields allows partial responses to be retrieved. See
  62704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62705. // for more information.
  62706. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  62707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62708. return c
  62709. }
  62710. // IfNoneMatch sets the optional parameter which makes the operation
  62711. // fail if the object's ETag matches the given value. This is useful for
  62712. // getting updates only after the object has changed since the last
  62713. // request. Use googleapi.IsNotModified to check whether the response
  62714. // error from Do is the result of In-None-Match.
  62715. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  62716. c.ifNoneMatch_ = entityTag
  62717. return c
  62718. }
  62719. // Context sets the context to be used in this call's Do method. Any
  62720. // pending HTTP request will be aborted if the provided context is
  62721. // canceled.
  62722. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  62723. c.ctx_ = ctx
  62724. return c
  62725. }
  62726. // Header returns an http.Header that can be modified by the caller to
  62727. // add HTTP headers to the request.
  62728. func (c *InstanceGroupsListCall) Header() http.Header {
  62729. if c.header_ == nil {
  62730. c.header_ = make(http.Header)
  62731. }
  62732. return c.header_
  62733. }
  62734. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  62735. reqHeaders := make(http.Header)
  62736. for k, v := range c.header_ {
  62737. reqHeaders[k] = v
  62738. }
  62739. reqHeaders.Set("User-Agent", c.s.userAgent())
  62740. if c.ifNoneMatch_ != "" {
  62741. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62742. }
  62743. var body io.Reader = nil
  62744. c.urlParams_.Set("alt", alt)
  62745. c.urlParams_.Set("prettyPrint", "false")
  62746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  62747. urls += "?" + c.urlParams_.Encode()
  62748. req, err := http.NewRequest("GET", urls, body)
  62749. if err != nil {
  62750. return nil, err
  62751. }
  62752. req.Header = reqHeaders
  62753. googleapi.Expand(req.URL, map[string]string{
  62754. "project": c.project,
  62755. "zone": c.zone,
  62756. })
  62757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62758. }
  62759. // Do executes the "compute.instanceGroups.list" call.
  62760. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  62761. // non-2xx status code is an error. Response headers are in either
  62762. // *InstanceGroupList.ServerResponse.Header or (if a response was
  62763. // returned at all) in error.(*googleapi.Error).Header. Use
  62764. // googleapi.IsNotModified to check whether the returned error was
  62765. // because http.StatusNotModified was returned.
  62766. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  62767. gensupport.SetOptions(c.urlParams_, opts...)
  62768. res, err := c.doRequest("json")
  62769. if res != nil && res.StatusCode == http.StatusNotModified {
  62770. if res.Body != nil {
  62771. res.Body.Close()
  62772. }
  62773. return nil, &googleapi.Error{
  62774. Code: res.StatusCode,
  62775. Header: res.Header,
  62776. }
  62777. }
  62778. if err != nil {
  62779. return nil, err
  62780. }
  62781. defer googleapi.CloseBody(res)
  62782. if err := googleapi.CheckResponse(res); err != nil {
  62783. return nil, err
  62784. }
  62785. ret := &InstanceGroupList{
  62786. ServerResponse: googleapi.ServerResponse{
  62787. Header: res.Header,
  62788. HTTPStatusCode: res.StatusCode,
  62789. },
  62790. }
  62791. target := &ret
  62792. if err := gensupport.DecodeResponse(target, res); err != nil {
  62793. return nil, err
  62794. }
  62795. return ret, nil
  62796. // {
  62797. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  62798. // "httpMethod": "GET",
  62799. // "id": "compute.instanceGroups.list",
  62800. // "parameterOrder": [
  62801. // "project",
  62802. // "zone"
  62803. // ],
  62804. // "parameters": {
  62805. // "filter": {
  62806. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62807. // "location": "query",
  62808. // "type": "string"
  62809. // },
  62810. // "maxResults": {
  62811. // "default": "500",
  62812. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62813. // "format": "uint32",
  62814. // "location": "query",
  62815. // "minimum": "0",
  62816. // "type": "integer"
  62817. // },
  62818. // "orderBy": {
  62819. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62820. // "location": "query",
  62821. // "type": "string"
  62822. // },
  62823. // "pageToken": {
  62824. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62825. // "location": "query",
  62826. // "type": "string"
  62827. // },
  62828. // "project": {
  62829. // "description": "Project ID for this request.",
  62830. // "location": "path",
  62831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62832. // "required": true,
  62833. // "type": "string"
  62834. // },
  62835. // "zone": {
  62836. // "description": "The name of the zone where the instance group is located.",
  62837. // "location": "path",
  62838. // "required": true,
  62839. // "type": "string"
  62840. // }
  62841. // },
  62842. // "path": "{project}/zones/{zone}/instanceGroups",
  62843. // "response": {
  62844. // "$ref": "InstanceGroupList"
  62845. // },
  62846. // "scopes": [
  62847. // "https://www.googleapis.com/auth/cloud-platform",
  62848. // "https://www.googleapis.com/auth/compute",
  62849. // "https://www.googleapis.com/auth/compute.readonly"
  62850. // ]
  62851. // }
  62852. }
  62853. // Pages invokes f for each page of results.
  62854. // A non-nil error returned from f will halt the iteration.
  62855. // The provided context supersedes any context provided to the Context method.
  62856. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  62857. c.ctx_ = ctx
  62858. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62859. for {
  62860. x, err := c.Do()
  62861. if err != nil {
  62862. return err
  62863. }
  62864. if err := f(x); err != nil {
  62865. return err
  62866. }
  62867. if x.NextPageToken == "" {
  62868. return nil
  62869. }
  62870. c.PageToken(x.NextPageToken)
  62871. }
  62872. }
  62873. // method id "compute.instanceGroups.listInstances":
  62874. type InstanceGroupsListInstancesCall struct {
  62875. s *Service
  62876. project string
  62877. zone string
  62878. instanceGroup string
  62879. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  62880. urlParams_ gensupport.URLParams
  62881. ctx_ context.Context
  62882. header_ http.Header
  62883. }
  62884. // ListInstances: Lists the instances in the specified instance group.
  62885. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  62886. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62887. c.project = project
  62888. c.zone = zone
  62889. c.instanceGroup = instanceGroup
  62890. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  62891. return c
  62892. }
  62893. // Filter sets the optional parameter "filter": A filter expression that
  62894. // filters resources listed in the response. The expression must specify
  62895. // the field name, a comparison operator, and the value that you want to
  62896. // use for filtering. The value must be a string, a number, or a
  62897. // boolean. The comparison operator must be either =, !=, >, or <.
  62898. //
  62899. // For example, if you are filtering Compute Engine instances, you can
  62900. // exclude instances named example-instance by specifying name !=
  62901. // example-instance.
  62902. //
  62903. // You can also filter nested fields. For example, you could specify
  62904. // scheduling.automaticRestart = false to include instances only if they
  62905. // are not scheduled for automatic restarts. You can use filtering on
  62906. // nested fields to filter based on resource labels.
  62907. //
  62908. // To filter on multiple expressions, provide each separate expression
  62909. // within parentheses. For example, (scheduling.automaticRestart = true)
  62910. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62911. // AND expression. However, you can include AND and OR expressions
  62912. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62913. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62914. // true).
  62915. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  62916. c.urlParams_.Set("filter", filter)
  62917. return c
  62918. }
  62919. // MaxResults sets the optional parameter "maxResults": The maximum
  62920. // number of results per page that should be returned. If the number of
  62921. // available results is larger than maxResults, Compute Engine returns a
  62922. // nextPageToken that can be used to get the next page of results in
  62923. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62924. // (Default: 500)
  62925. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  62926. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62927. return c
  62928. }
  62929. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62930. // a certain order. By default, results are returned in alphanumerical
  62931. // order based on the resource name.
  62932. //
  62933. // You can also sort results in descending order based on the creation
  62934. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62935. // based on the creationTimestamp field in reverse chronological order
  62936. // (newest result first). Use this to sort resources like operations so
  62937. // that the newest operation is returned first.
  62938. //
  62939. // Currently, only sorting by name or creationTimestamp desc is
  62940. // supported.
  62941. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  62942. c.urlParams_.Set("orderBy", orderBy)
  62943. return c
  62944. }
  62945. // PageToken sets the optional parameter "pageToken": Specifies a page
  62946. // token to use. Set pageToken to the nextPageToken returned by a
  62947. // previous list request to get the next page of results.
  62948. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  62949. c.urlParams_.Set("pageToken", pageToken)
  62950. return c
  62951. }
  62952. // Fields allows partial responses to be retrieved. See
  62953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62954. // for more information.
  62955. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  62956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62957. return c
  62958. }
  62959. // Context sets the context to be used in this call's Do method. Any
  62960. // pending HTTP request will be aborted if the provided context is
  62961. // canceled.
  62962. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  62963. c.ctx_ = ctx
  62964. return c
  62965. }
  62966. // Header returns an http.Header that can be modified by the caller to
  62967. // add HTTP headers to the request.
  62968. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  62969. if c.header_ == nil {
  62970. c.header_ = make(http.Header)
  62971. }
  62972. return c.header_
  62973. }
  62974. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  62975. reqHeaders := make(http.Header)
  62976. for k, v := range c.header_ {
  62977. reqHeaders[k] = v
  62978. }
  62979. reqHeaders.Set("User-Agent", c.s.userAgent())
  62980. var body io.Reader = nil
  62981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  62982. if err != nil {
  62983. return nil, err
  62984. }
  62985. reqHeaders.Set("Content-Type", "application/json")
  62986. c.urlParams_.Set("alt", alt)
  62987. c.urlParams_.Set("prettyPrint", "false")
  62988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  62989. urls += "?" + c.urlParams_.Encode()
  62990. req, err := http.NewRequest("POST", urls, body)
  62991. if err != nil {
  62992. return nil, err
  62993. }
  62994. req.Header = reqHeaders
  62995. googleapi.Expand(req.URL, map[string]string{
  62996. "project": c.project,
  62997. "zone": c.zone,
  62998. "instanceGroup": c.instanceGroup,
  62999. })
  63000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63001. }
  63002. // Do executes the "compute.instanceGroups.listInstances" call.
  63003. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  63004. // Any non-2xx status code is an error. Response headers are in either
  63005. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  63006. // was returned at all) in error.(*googleapi.Error).Header. Use
  63007. // googleapi.IsNotModified to check whether the returned error was
  63008. // because http.StatusNotModified was returned.
  63009. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  63010. gensupport.SetOptions(c.urlParams_, opts...)
  63011. res, err := c.doRequest("json")
  63012. if res != nil && res.StatusCode == http.StatusNotModified {
  63013. if res.Body != nil {
  63014. res.Body.Close()
  63015. }
  63016. return nil, &googleapi.Error{
  63017. Code: res.StatusCode,
  63018. Header: res.Header,
  63019. }
  63020. }
  63021. if err != nil {
  63022. return nil, err
  63023. }
  63024. defer googleapi.CloseBody(res)
  63025. if err := googleapi.CheckResponse(res); err != nil {
  63026. return nil, err
  63027. }
  63028. ret := &InstanceGroupsListInstances{
  63029. ServerResponse: googleapi.ServerResponse{
  63030. Header: res.Header,
  63031. HTTPStatusCode: res.StatusCode,
  63032. },
  63033. }
  63034. target := &ret
  63035. if err := gensupport.DecodeResponse(target, res); err != nil {
  63036. return nil, err
  63037. }
  63038. return ret, nil
  63039. // {
  63040. // "description": "Lists the instances in the specified instance group.",
  63041. // "httpMethod": "POST",
  63042. // "id": "compute.instanceGroups.listInstances",
  63043. // "parameterOrder": [
  63044. // "project",
  63045. // "zone",
  63046. // "instanceGroup"
  63047. // ],
  63048. // "parameters": {
  63049. // "filter": {
  63050. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  63051. // "location": "query",
  63052. // "type": "string"
  63053. // },
  63054. // "instanceGroup": {
  63055. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  63056. // "location": "path",
  63057. // "required": true,
  63058. // "type": "string"
  63059. // },
  63060. // "maxResults": {
  63061. // "default": "500",
  63062. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  63063. // "format": "uint32",
  63064. // "location": "query",
  63065. // "minimum": "0",
  63066. // "type": "integer"
  63067. // },
  63068. // "orderBy": {
  63069. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  63070. // "location": "query",
  63071. // "type": "string"
  63072. // },
  63073. // "pageToken": {
  63074. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  63075. // "location": "query",
  63076. // "type": "string"
  63077. // },
  63078. // "project": {
  63079. // "description": "Project ID for this request.",
  63080. // "location": "path",
  63081. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63082. // "required": true,
  63083. // "type": "string"
  63084. // },
  63085. // "zone": {
  63086. // "description": "The name of the zone where the instance group is located.",
  63087. // "location": "path",
  63088. // "required": true,
  63089. // "type": "string"
  63090. // }
  63091. // },
  63092. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  63093. // "request": {
  63094. // "$ref": "InstanceGroupsListInstancesRequest"
  63095. // },
  63096. // "response": {
  63097. // "$ref": "InstanceGroupsListInstances"
  63098. // },
  63099. // "scopes": [
  63100. // "https://www.googleapis.com/auth/cloud-platform",
  63101. // "https://www.googleapis.com/auth/compute",
  63102. // "https://www.googleapis.com/auth/compute.readonly"
  63103. // ]
  63104. // }
  63105. }
  63106. // Pages invokes f for each page of results.
  63107. // A non-nil error returned from f will halt the iteration.
  63108. // The provided context supersedes any context provided to the Context method.
  63109. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  63110. c.ctx_ = ctx
  63111. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63112. for {
  63113. x, err := c.Do()
  63114. if err != nil {
  63115. return err
  63116. }
  63117. if err := f(x); err != nil {
  63118. return err
  63119. }
  63120. if x.NextPageToken == "" {
  63121. return nil
  63122. }
  63123. c.PageToken(x.NextPageToken)
  63124. }
  63125. }
  63126. // method id "compute.instanceGroups.removeInstances":
  63127. type InstanceGroupsRemoveInstancesCall struct {
  63128. s *Service
  63129. project string
  63130. zone string
  63131. instanceGroup string
  63132. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  63133. urlParams_ gensupport.URLParams
  63134. ctx_ context.Context
  63135. header_ http.Header
  63136. }
  63137. // RemoveInstances: Removes one or more instances from the specified
  63138. // instance group, but does not delete those instances.
  63139. //
  63140. // If the group is part of a backend service that has enabled connection
  63141. // draining, it can take up to 60 seconds after the connection draining
  63142. // duration before the VM instance is removed or deleted.
  63143. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  63144. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63145. c.project = project
  63146. c.zone = zone
  63147. c.instanceGroup = instanceGroup
  63148. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  63149. return c
  63150. }
  63151. // RequestId sets the optional parameter "requestId": An optional
  63152. // request ID to identify requests. Specify a unique request ID so that
  63153. // if you must retry your request, the server will know to ignore the
  63154. // request if it has already been completed.
  63155. //
  63156. // For example, consider a situation where you make an initial request
  63157. // and the request times out. If you make the request again with the
  63158. // same request ID, the server can check if original operation with the
  63159. // same request ID was received, and if so, will ignore the second
  63160. // request. This prevents clients from accidentally creating duplicate
  63161. // commitments.
  63162. //
  63163. // The request ID must be a valid UUID with the exception that zero UUID
  63164. // is not supported (00000000-0000-0000-0000-000000000000).
  63165. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  63166. c.urlParams_.Set("requestId", requestId)
  63167. return c
  63168. }
  63169. // Fields allows partial responses to be retrieved. See
  63170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63171. // for more information.
  63172. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  63173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63174. return c
  63175. }
  63176. // Context sets the context to be used in this call's Do method. Any
  63177. // pending HTTP request will be aborted if the provided context is
  63178. // canceled.
  63179. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  63180. c.ctx_ = ctx
  63181. return c
  63182. }
  63183. // Header returns an http.Header that can be modified by the caller to
  63184. // add HTTP headers to the request.
  63185. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  63186. if c.header_ == nil {
  63187. c.header_ = make(http.Header)
  63188. }
  63189. return c.header_
  63190. }
  63191. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  63192. reqHeaders := make(http.Header)
  63193. for k, v := range c.header_ {
  63194. reqHeaders[k] = v
  63195. }
  63196. reqHeaders.Set("User-Agent", c.s.userAgent())
  63197. var body io.Reader = nil
  63198. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  63199. if err != nil {
  63200. return nil, err
  63201. }
  63202. reqHeaders.Set("Content-Type", "application/json")
  63203. c.urlParams_.Set("alt", alt)
  63204. c.urlParams_.Set("prettyPrint", "false")
  63205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  63206. urls += "?" + c.urlParams_.Encode()
  63207. req, err := http.NewRequest("POST", urls, body)
  63208. if err != nil {
  63209. return nil, err
  63210. }
  63211. req.Header = reqHeaders
  63212. googleapi.Expand(req.URL, map[string]string{
  63213. "project": c.project,
  63214. "zone": c.zone,
  63215. "instanceGroup": c.instanceGroup,
  63216. })
  63217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63218. }
  63219. // Do executes the "compute.instanceGroups.removeInstances" call.
  63220. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63221. // status code is an error. Response headers are in either
  63222. // *Operation.ServerResponse.Header or (if a response was returned at
  63223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63224. // to check whether the returned error was because
  63225. // http.StatusNotModified was returned.
  63226. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63227. gensupport.SetOptions(c.urlParams_, opts...)
  63228. res, err := c.doRequest("json")
  63229. if res != nil && res.StatusCode == http.StatusNotModified {
  63230. if res.Body != nil {
  63231. res.Body.Close()
  63232. }
  63233. return nil, &googleapi.Error{
  63234. Code: res.StatusCode,
  63235. Header: res.Header,
  63236. }
  63237. }
  63238. if err != nil {
  63239. return nil, err
  63240. }
  63241. defer googleapi.CloseBody(res)
  63242. if err := googleapi.CheckResponse(res); err != nil {
  63243. return nil, err
  63244. }
  63245. ret := &Operation{
  63246. ServerResponse: googleapi.ServerResponse{
  63247. Header: res.Header,
  63248. HTTPStatusCode: res.StatusCode,
  63249. },
  63250. }
  63251. target := &ret
  63252. if err := gensupport.DecodeResponse(target, res); err != nil {
  63253. return nil, err
  63254. }
  63255. return ret, nil
  63256. // {
  63257. // "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.",
  63258. // "httpMethod": "POST",
  63259. // "id": "compute.instanceGroups.removeInstances",
  63260. // "parameterOrder": [
  63261. // "project",
  63262. // "zone",
  63263. // "instanceGroup"
  63264. // ],
  63265. // "parameters": {
  63266. // "instanceGroup": {
  63267. // "description": "The name of the instance group where the specified instances will be removed.",
  63268. // "location": "path",
  63269. // "required": true,
  63270. // "type": "string"
  63271. // },
  63272. // "project": {
  63273. // "description": "Project ID for this request.",
  63274. // "location": "path",
  63275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63276. // "required": true,
  63277. // "type": "string"
  63278. // },
  63279. // "requestId": {
  63280. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63281. // "location": "query",
  63282. // "type": "string"
  63283. // },
  63284. // "zone": {
  63285. // "description": "The name of the zone where the instance group is located.",
  63286. // "location": "path",
  63287. // "required": true,
  63288. // "type": "string"
  63289. // }
  63290. // },
  63291. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  63292. // "request": {
  63293. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  63294. // },
  63295. // "response": {
  63296. // "$ref": "Operation"
  63297. // },
  63298. // "scopes": [
  63299. // "https://www.googleapis.com/auth/cloud-platform",
  63300. // "https://www.googleapis.com/auth/compute"
  63301. // ]
  63302. // }
  63303. }
  63304. // method id "compute.instanceGroups.setNamedPorts":
  63305. type InstanceGroupsSetNamedPortsCall struct {
  63306. s *Service
  63307. project string
  63308. zone string
  63309. instanceGroup string
  63310. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  63311. urlParams_ gensupport.URLParams
  63312. ctx_ context.Context
  63313. header_ http.Header
  63314. }
  63315. // SetNamedPorts: Sets the named ports for the specified instance group.
  63316. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  63317. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63318. c.project = project
  63319. c.zone = zone
  63320. c.instanceGroup = instanceGroup
  63321. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  63322. return c
  63323. }
  63324. // RequestId sets the optional parameter "requestId": An optional
  63325. // request ID to identify requests. Specify a unique request ID so that
  63326. // if you must retry your request, the server will know to ignore the
  63327. // request if it has already been completed.
  63328. //
  63329. // For example, consider a situation where you make an initial request
  63330. // and the request times out. If you make the request again with the
  63331. // same request ID, the server can check if original operation with the
  63332. // same request ID was received, and if so, will ignore the second
  63333. // request. This prevents clients from accidentally creating duplicate
  63334. // commitments.
  63335. //
  63336. // The request ID must be a valid UUID with the exception that zero UUID
  63337. // is not supported (00000000-0000-0000-0000-000000000000).
  63338. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  63339. c.urlParams_.Set("requestId", requestId)
  63340. return c
  63341. }
  63342. // Fields allows partial responses to be retrieved. See
  63343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63344. // for more information.
  63345. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  63346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63347. return c
  63348. }
  63349. // Context sets the context to be used in this call's Do method. Any
  63350. // pending HTTP request will be aborted if the provided context is
  63351. // canceled.
  63352. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  63353. c.ctx_ = ctx
  63354. return c
  63355. }
  63356. // Header returns an http.Header that can be modified by the caller to
  63357. // add HTTP headers to the request.
  63358. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  63359. if c.header_ == nil {
  63360. c.header_ = make(http.Header)
  63361. }
  63362. return c.header_
  63363. }
  63364. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  63365. reqHeaders := make(http.Header)
  63366. for k, v := range c.header_ {
  63367. reqHeaders[k] = v
  63368. }
  63369. reqHeaders.Set("User-Agent", c.s.userAgent())
  63370. var body io.Reader = nil
  63371. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  63372. if err != nil {
  63373. return nil, err
  63374. }
  63375. reqHeaders.Set("Content-Type", "application/json")
  63376. c.urlParams_.Set("alt", alt)
  63377. c.urlParams_.Set("prettyPrint", "false")
  63378. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  63379. urls += "?" + c.urlParams_.Encode()
  63380. req, err := http.NewRequest("POST", urls, body)
  63381. if err != nil {
  63382. return nil, err
  63383. }
  63384. req.Header = reqHeaders
  63385. googleapi.Expand(req.URL, map[string]string{
  63386. "project": c.project,
  63387. "zone": c.zone,
  63388. "instanceGroup": c.instanceGroup,
  63389. })
  63390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63391. }
  63392. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  63393. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63394. // status code is an error. Response headers are in either
  63395. // *Operation.ServerResponse.Header or (if a response was returned at
  63396. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63397. // to check whether the returned error was because
  63398. // http.StatusNotModified was returned.
  63399. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63400. gensupport.SetOptions(c.urlParams_, opts...)
  63401. res, err := c.doRequest("json")
  63402. if res != nil && res.StatusCode == http.StatusNotModified {
  63403. if res.Body != nil {
  63404. res.Body.Close()
  63405. }
  63406. return nil, &googleapi.Error{
  63407. Code: res.StatusCode,
  63408. Header: res.Header,
  63409. }
  63410. }
  63411. if err != nil {
  63412. return nil, err
  63413. }
  63414. defer googleapi.CloseBody(res)
  63415. if err := googleapi.CheckResponse(res); err != nil {
  63416. return nil, err
  63417. }
  63418. ret := &Operation{
  63419. ServerResponse: googleapi.ServerResponse{
  63420. Header: res.Header,
  63421. HTTPStatusCode: res.StatusCode,
  63422. },
  63423. }
  63424. target := &ret
  63425. if err := gensupport.DecodeResponse(target, res); err != nil {
  63426. return nil, err
  63427. }
  63428. return ret, nil
  63429. // {
  63430. // "description": "Sets the named ports for the specified instance group.",
  63431. // "httpMethod": "POST",
  63432. // "id": "compute.instanceGroups.setNamedPorts",
  63433. // "parameterOrder": [
  63434. // "project",
  63435. // "zone",
  63436. // "instanceGroup"
  63437. // ],
  63438. // "parameters": {
  63439. // "instanceGroup": {
  63440. // "description": "The name of the instance group where the named ports are updated.",
  63441. // "location": "path",
  63442. // "required": true,
  63443. // "type": "string"
  63444. // },
  63445. // "project": {
  63446. // "description": "Project ID for this request.",
  63447. // "location": "path",
  63448. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63449. // "required": true,
  63450. // "type": "string"
  63451. // },
  63452. // "requestId": {
  63453. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63454. // "location": "query",
  63455. // "type": "string"
  63456. // },
  63457. // "zone": {
  63458. // "description": "The name of the zone where the instance group is located.",
  63459. // "location": "path",
  63460. // "required": true,
  63461. // "type": "string"
  63462. // }
  63463. // },
  63464. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  63465. // "request": {
  63466. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  63467. // },
  63468. // "response": {
  63469. // "$ref": "Operation"
  63470. // },
  63471. // "scopes": [
  63472. // "https://www.googleapis.com/auth/cloud-platform",
  63473. // "https://www.googleapis.com/auth/compute"
  63474. // ]
  63475. // }
  63476. }
  63477. // method id "compute.instanceGroups.testIamPermissions":
  63478. type InstanceGroupsTestIamPermissionsCall struct {
  63479. s *Service
  63480. project string
  63481. zone string
  63482. resource string
  63483. testpermissionsrequest *TestPermissionsRequest
  63484. urlParams_ gensupport.URLParams
  63485. ctx_ context.Context
  63486. header_ http.Header
  63487. }
  63488. // TestIamPermissions: Returns permissions that a caller has on the
  63489. // specified resource.
  63490. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  63491. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63492. c.project = project
  63493. c.zone = zone
  63494. c.resource = resource
  63495. c.testpermissionsrequest = testpermissionsrequest
  63496. return c
  63497. }
  63498. // Fields allows partial responses to be retrieved. See
  63499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63500. // for more information.
  63501. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  63502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63503. return c
  63504. }
  63505. // Context sets the context to be used in this call's Do method. Any
  63506. // pending HTTP request will be aborted if the provided context is
  63507. // canceled.
  63508. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  63509. c.ctx_ = ctx
  63510. return c
  63511. }
  63512. // Header returns an http.Header that can be modified by the caller to
  63513. // add HTTP headers to the request.
  63514. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  63515. if c.header_ == nil {
  63516. c.header_ = make(http.Header)
  63517. }
  63518. return c.header_
  63519. }
  63520. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  63521. reqHeaders := make(http.Header)
  63522. for k, v := range c.header_ {
  63523. reqHeaders[k] = v
  63524. }
  63525. reqHeaders.Set("User-Agent", c.s.userAgent())
  63526. var body io.Reader = nil
  63527. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  63528. if err != nil {
  63529. return nil, err
  63530. }
  63531. reqHeaders.Set("Content-Type", "application/json")
  63532. c.urlParams_.Set("alt", alt)
  63533. c.urlParams_.Set("prettyPrint", "false")
  63534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  63535. urls += "?" + c.urlParams_.Encode()
  63536. req, err := http.NewRequest("POST", urls, body)
  63537. if err != nil {
  63538. return nil, err
  63539. }
  63540. req.Header = reqHeaders
  63541. googleapi.Expand(req.URL, map[string]string{
  63542. "project": c.project,
  63543. "zone": c.zone,
  63544. "resource": c.resource,
  63545. })
  63546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63547. }
  63548. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  63549. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  63550. // non-2xx status code is an error. Response headers are in either
  63551. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  63552. // returned at all) in error.(*googleapi.Error).Header. Use
  63553. // googleapi.IsNotModified to check whether the returned error was
  63554. // because http.StatusNotModified was returned.
  63555. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  63556. gensupport.SetOptions(c.urlParams_, opts...)
  63557. res, err := c.doRequest("json")
  63558. if res != nil && res.StatusCode == http.StatusNotModified {
  63559. if res.Body != nil {
  63560. res.Body.Close()
  63561. }
  63562. return nil, &googleapi.Error{
  63563. Code: res.StatusCode,
  63564. Header: res.Header,
  63565. }
  63566. }
  63567. if err != nil {
  63568. return nil, err
  63569. }
  63570. defer googleapi.CloseBody(res)
  63571. if err := googleapi.CheckResponse(res); err != nil {
  63572. return nil, err
  63573. }
  63574. ret := &TestPermissionsResponse{
  63575. ServerResponse: googleapi.ServerResponse{
  63576. Header: res.Header,
  63577. HTTPStatusCode: res.StatusCode,
  63578. },
  63579. }
  63580. target := &ret
  63581. if err := gensupport.DecodeResponse(target, res); err != nil {
  63582. return nil, err
  63583. }
  63584. return ret, nil
  63585. // {
  63586. // "description": "Returns permissions that a caller has on the specified resource.",
  63587. // "httpMethod": "POST",
  63588. // "id": "compute.instanceGroups.testIamPermissions",
  63589. // "parameterOrder": [
  63590. // "project",
  63591. // "zone",
  63592. // "resource"
  63593. // ],
  63594. // "parameters": {
  63595. // "project": {
  63596. // "description": "Project ID for this request.",
  63597. // "location": "path",
  63598. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63599. // "required": true,
  63600. // "type": "string"
  63601. // },
  63602. // "resource": {
  63603. // "description": "Name or id of the resource for this request.",
  63604. // "location": "path",
  63605. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63606. // "required": true,
  63607. // "type": "string"
  63608. // },
  63609. // "zone": {
  63610. // "description": "The name of the zone for this request.",
  63611. // "location": "path",
  63612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63613. // "required": true,
  63614. // "type": "string"
  63615. // }
  63616. // },
  63617. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  63618. // "request": {
  63619. // "$ref": "TestPermissionsRequest"
  63620. // },
  63621. // "response": {
  63622. // "$ref": "TestPermissionsResponse"
  63623. // },
  63624. // "scopes": [
  63625. // "https://www.googleapis.com/auth/cloud-platform",
  63626. // "https://www.googleapis.com/auth/compute",
  63627. // "https://www.googleapis.com/auth/compute.readonly"
  63628. // ]
  63629. // }
  63630. }
  63631. // method id "compute.instanceTemplates.delete":
  63632. type InstanceTemplatesDeleteCall struct {
  63633. s *Service
  63634. project string
  63635. instanceTemplate string
  63636. urlParams_ gensupport.URLParams
  63637. ctx_ context.Context
  63638. header_ http.Header
  63639. }
  63640. // Delete: Deletes the specified instance template. Deleting an instance
  63641. // template is permanent and cannot be undone. It's not possible to
  63642. // delete templates which are in use by an instance group.
  63643. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  63644. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  63645. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63646. c.project = project
  63647. c.instanceTemplate = instanceTemplate
  63648. return c
  63649. }
  63650. // RequestId sets the optional parameter "requestId": An optional
  63651. // request ID to identify requests. Specify a unique request ID so that
  63652. // if you must retry your request, the server will know to ignore the
  63653. // request if it has already been completed.
  63654. //
  63655. // For example, consider a situation where you make an initial request
  63656. // and the request times out. If you make the request again with the
  63657. // same request ID, the server can check if original operation with the
  63658. // same request ID was received, and if so, will ignore the second
  63659. // request. This prevents clients from accidentally creating duplicate
  63660. // commitments.
  63661. //
  63662. // The request ID must be a valid UUID with the exception that zero UUID
  63663. // is not supported (00000000-0000-0000-0000-000000000000).
  63664. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  63665. c.urlParams_.Set("requestId", requestId)
  63666. return c
  63667. }
  63668. // Fields allows partial responses to be retrieved. See
  63669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63670. // for more information.
  63671. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  63672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63673. return c
  63674. }
  63675. // Context sets the context to be used in this call's Do method. Any
  63676. // pending HTTP request will be aborted if the provided context is
  63677. // canceled.
  63678. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  63679. c.ctx_ = ctx
  63680. return c
  63681. }
  63682. // Header returns an http.Header that can be modified by the caller to
  63683. // add HTTP headers to the request.
  63684. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  63685. if c.header_ == nil {
  63686. c.header_ = make(http.Header)
  63687. }
  63688. return c.header_
  63689. }
  63690. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  63691. reqHeaders := make(http.Header)
  63692. for k, v := range c.header_ {
  63693. reqHeaders[k] = v
  63694. }
  63695. reqHeaders.Set("User-Agent", c.s.userAgent())
  63696. var body io.Reader = nil
  63697. c.urlParams_.Set("alt", alt)
  63698. c.urlParams_.Set("prettyPrint", "false")
  63699. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  63700. urls += "?" + c.urlParams_.Encode()
  63701. req, err := http.NewRequest("DELETE", urls, body)
  63702. if err != nil {
  63703. return nil, err
  63704. }
  63705. req.Header = reqHeaders
  63706. googleapi.Expand(req.URL, map[string]string{
  63707. "project": c.project,
  63708. "instanceTemplate": c.instanceTemplate,
  63709. })
  63710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63711. }
  63712. // Do executes the "compute.instanceTemplates.delete" call.
  63713. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63714. // status code is an error. Response headers are in either
  63715. // *Operation.ServerResponse.Header or (if a response was returned at
  63716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63717. // to check whether the returned error was because
  63718. // http.StatusNotModified was returned.
  63719. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63720. gensupport.SetOptions(c.urlParams_, opts...)
  63721. res, err := c.doRequest("json")
  63722. if res != nil && res.StatusCode == http.StatusNotModified {
  63723. if res.Body != nil {
  63724. res.Body.Close()
  63725. }
  63726. return nil, &googleapi.Error{
  63727. Code: res.StatusCode,
  63728. Header: res.Header,
  63729. }
  63730. }
  63731. if err != nil {
  63732. return nil, err
  63733. }
  63734. defer googleapi.CloseBody(res)
  63735. if err := googleapi.CheckResponse(res); err != nil {
  63736. return nil, err
  63737. }
  63738. ret := &Operation{
  63739. ServerResponse: googleapi.ServerResponse{
  63740. Header: res.Header,
  63741. HTTPStatusCode: res.StatusCode,
  63742. },
  63743. }
  63744. target := &ret
  63745. if err := gensupport.DecodeResponse(target, res); err != nil {
  63746. return nil, err
  63747. }
  63748. return ret, nil
  63749. // {
  63750. // "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.",
  63751. // "httpMethod": "DELETE",
  63752. // "id": "compute.instanceTemplates.delete",
  63753. // "parameterOrder": [
  63754. // "project",
  63755. // "instanceTemplate"
  63756. // ],
  63757. // "parameters": {
  63758. // "instanceTemplate": {
  63759. // "description": "The name of the instance template to delete.",
  63760. // "location": "path",
  63761. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63762. // "required": true,
  63763. // "type": "string"
  63764. // },
  63765. // "project": {
  63766. // "description": "Project ID for this request.",
  63767. // "location": "path",
  63768. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63769. // "required": true,
  63770. // "type": "string"
  63771. // },
  63772. // "requestId": {
  63773. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63774. // "location": "query",
  63775. // "type": "string"
  63776. // }
  63777. // },
  63778. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  63779. // "response": {
  63780. // "$ref": "Operation"
  63781. // },
  63782. // "scopes": [
  63783. // "https://www.googleapis.com/auth/cloud-platform",
  63784. // "https://www.googleapis.com/auth/compute"
  63785. // ]
  63786. // }
  63787. }
  63788. // method id "compute.instanceTemplates.get":
  63789. type InstanceTemplatesGetCall struct {
  63790. s *Service
  63791. project string
  63792. instanceTemplate string
  63793. urlParams_ gensupport.URLParams
  63794. ifNoneMatch_ string
  63795. ctx_ context.Context
  63796. header_ http.Header
  63797. }
  63798. // Get: Returns the specified instance template. Gets a list of
  63799. // available instance templates by making a list() request.
  63800. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  63801. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  63802. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63803. c.project = project
  63804. c.instanceTemplate = instanceTemplate
  63805. return c
  63806. }
  63807. // Fields allows partial responses to be retrieved. See
  63808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63809. // for more information.
  63810. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  63811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63812. return c
  63813. }
  63814. // IfNoneMatch sets the optional parameter which makes the operation
  63815. // fail if the object's ETag matches the given value. This is useful for
  63816. // getting updates only after the object has changed since the last
  63817. // request. Use googleapi.IsNotModified to check whether the response
  63818. // error from Do is the result of In-None-Match.
  63819. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  63820. c.ifNoneMatch_ = entityTag
  63821. return c
  63822. }
  63823. // Context sets the context to be used in this call's Do method. Any
  63824. // pending HTTP request will be aborted if the provided context is
  63825. // canceled.
  63826. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  63827. c.ctx_ = ctx
  63828. return c
  63829. }
  63830. // Header returns an http.Header that can be modified by the caller to
  63831. // add HTTP headers to the request.
  63832. func (c *InstanceTemplatesGetCall) Header() http.Header {
  63833. if c.header_ == nil {
  63834. c.header_ = make(http.Header)
  63835. }
  63836. return c.header_
  63837. }
  63838. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  63839. reqHeaders := make(http.Header)
  63840. for k, v := range c.header_ {
  63841. reqHeaders[k] = v
  63842. }
  63843. reqHeaders.Set("User-Agent", c.s.userAgent())
  63844. if c.ifNoneMatch_ != "" {
  63845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63846. }
  63847. var body io.Reader = nil
  63848. c.urlParams_.Set("alt", alt)
  63849. c.urlParams_.Set("prettyPrint", "false")
  63850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  63851. urls += "?" + c.urlParams_.Encode()
  63852. req, err := http.NewRequest("GET", urls, body)
  63853. if err != nil {
  63854. return nil, err
  63855. }
  63856. req.Header = reqHeaders
  63857. googleapi.Expand(req.URL, map[string]string{
  63858. "project": c.project,
  63859. "instanceTemplate": c.instanceTemplate,
  63860. })
  63861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63862. }
  63863. // Do executes the "compute.instanceTemplates.get" call.
  63864. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  63865. // non-2xx status code is an error. Response headers are in either
  63866. // *InstanceTemplate.ServerResponse.Header or (if a response was
  63867. // returned at all) in error.(*googleapi.Error).Header. Use
  63868. // googleapi.IsNotModified to check whether the returned error was
  63869. // because http.StatusNotModified was returned.
  63870. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  63871. gensupport.SetOptions(c.urlParams_, opts...)
  63872. res, err := c.doRequest("json")
  63873. if res != nil && res.StatusCode == http.StatusNotModified {
  63874. if res.Body != nil {
  63875. res.Body.Close()
  63876. }
  63877. return nil, &googleapi.Error{
  63878. Code: res.StatusCode,
  63879. Header: res.Header,
  63880. }
  63881. }
  63882. if err != nil {
  63883. return nil, err
  63884. }
  63885. defer googleapi.CloseBody(res)
  63886. if err := googleapi.CheckResponse(res); err != nil {
  63887. return nil, err
  63888. }
  63889. ret := &InstanceTemplate{
  63890. ServerResponse: googleapi.ServerResponse{
  63891. Header: res.Header,
  63892. HTTPStatusCode: res.StatusCode,
  63893. },
  63894. }
  63895. target := &ret
  63896. if err := gensupport.DecodeResponse(target, res); err != nil {
  63897. return nil, err
  63898. }
  63899. return ret, nil
  63900. // {
  63901. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  63902. // "httpMethod": "GET",
  63903. // "id": "compute.instanceTemplates.get",
  63904. // "parameterOrder": [
  63905. // "project",
  63906. // "instanceTemplate"
  63907. // ],
  63908. // "parameters": {
  63909. // "instanceTemplate": {
  63910. // "description": "The name of the instance template.",
  63911. // "location": "path",
  63912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63913. // "required": true,
  63914. // "type": "string"
  63915. // },
  63916. // "project": {
  63917. // "description": "Project ID for this request.",
  63918. // "location": "path",
  63919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63920. // "required": true,
  63921. // "type": "string"
  63922. // }
  63923. // },
  63924. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  63925. // "response": {
  63926. // "$ref": "InstanceTemplate"
  63927. // },
  63928. // "scopes": [
  63929. // "https://www.googleapis.com/auth/cloud-platform",
  63930. // "https://www.googleapis.com/auth/compute",
  63931. // "https://www.googleapis.com/auth/compute.readonly"
  63932. // ]
  63933. // }
  63934. }
  63935. // method id "compute.instanceTemplates.getIamPolicy":
  63936. type InstanceTemplatesGetIamPolicyCall struct {
  63937. s *Service
  63938. project string
  63939. resource string
  63940. urlParams_ gensupport.URLParams
  63941. ifNoneMatch_ string
  63942. ctx_ context.Context
  63943. header_ http.Header
  63944. }
  63945. // GetIamPolicy: Gets the access control policy for a resource. May be
  63946. // empty if no such policy or resource exists.
  63947. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  63948. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63949. c.project = project
  63950. c.resource = resource
  63951. return c
  63952. }
  63953. // Fields allows partial responses to be retrieved. See
  63954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63955. // for more information.
  63956. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  63957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63958. return c
  63959. }
  63960. // IfNoneMatch sets the optional parameter which makes the operation
  63961. // fail if the object's ETag matches the given value. This is useful for
  63962. // getting updates only after the object has changed since the last
  63963. // request. Use googleapi.IsNotModified to check whether the response
  63964. // error from Do is the result of In-None-Match.
  63965. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  63966. c.ifNoneMatch_ = entityTag
  63967. return c
  63968. }
  63969. // Context sets the context to be used in this call's Do method. Any
  63970. // pending HTTP request will be aborted if the provided context is
  63971. // canceled.
  63972. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  63973. c.ctx_ = ctx
  63974. return c
  63975. }
  63976. // Header returns an http.Header that can be modified by the caller to
  63977. // add HTTP headers to the request.
  63978. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  63979. if c.header_ == nil {
  63980. c.header_ = make(http.Header)
  63981. }
  63982. return c.header_
  63983. }
  63984. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  63985. reqHeaders := make(http.Header)
  63986. for k, v := range c.header_ {
  63987. reqHeaders[k] = v
  63988. }
  63989. reqHeaders.Set("User-Agent", c.s.userAgent())
  63990. if c.ifNoneMatch_ != "" {
  63991. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63992. }
  63993. var body io.Reader = nil
  63994. c.urlParams_.Set("alt", alt)
  63995. c.urlParams_.Set("prettyPrint", "false")
  63996. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  63997. urls += "?" + c.urlParams_.Encode()
  63998. req, err := http.NewRequest("GET", urls, body)
  63999. if err != nil {
  64000. return nil, err
  64001. }
  64002. req.Header = reqHeaders
  64003. googleapi.Expand(req.URL, map[string]string{
  64004. "project": c.project,
  64005. "resource": c.resource,
  64006. })
  64007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64008. }
  64009. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  64010. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  64011. // code is an error. Response headers are in either
  64012. // *Policy.ServerResponse.Header or (if a response was returned at all)
  64013. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  64014. // check whether the returned error was because http.StatusNotModified
  64015. // was returned.
  64016. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  64017. gensupport.SetOptions(c.urlParams_, opts...)
  64018. res, err := c.doRequest("json")
  64019. if res != nil && res.StatusCode == http.StatusNotModified {
  64020. if res.Body != nil {
  64021. res.Body.Close()
  64022. }
  64023. return nil, &googleapi.Error{
  64024. Code: res.StatusCode,
  64025. Header: res.Header,
  64026. }
  64027. }
  64028. if err != nil {
  64029. return nil, err
  64030. }
  64031. defer googleapi.CloseBody(res)
  64032. if err := googleapi.CheckResponse(res); err != nil {
  64033. return nil, err
  64034. }
  64035. ret := &Policy{
  64036. ServerResponse: googleapi.ServerResponse{
  64037. Header: res.Header,
  64038. HTTPStatusCode: res.StatusCode,
  64039. },
  64040. }
  64041. target := &ret
  64042. if err := gensupport.DecodeResponse(target, res); err != nil {
  64043. return nil, err
  64044. }
  64045. return ret, nil
  64046. // {
  64047. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  64048. // "httpMethod": "GET",
  64049. // "id": "compute.instanceTemplates.getIamPolicy",
  64050. // "parameterOrder": [
  64051. // "project",
  64052. // "resource"
  64053. // ],
  64054. // "parameters": {
  64055. // "project": {
  64056. // "description": "Project ID for this request.",
  64057. // "location": "path",
  64058. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64059. // "required": true,
  64060. // "type": "string"
  64061. // },
  64062. // "resource": {
  64063. // "description": "Name or id of the resource for this request.",
  64064. // "location": "path",
  64065. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64066. // "required": true,
  64067. // "type": "string"
  64068. // }
  64069. // },
  64070. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  64071. // "response": {
  64072. // "$ref": "Policy"
  64073. // },
  64074. // "scopes": [
  64075. // "https://www.googleapis.com/auth/cloud-platform",
  64076. // "https://www.googleapis.com/auth/compute",
  64077. // "https://www.googleapis.com/auth/compute.readonly"
  64078. // ]
  64079. // }
  64080. }
  64081. // method id "compute.instanceTemplates.insert":
  64082. type InstanceTemplatesInsertCall struct {
  64083. s *Service
  64084. project string
  64085. instancetemplate *InstanceTemplate
  64086. urlParams_ gensupport.URLParams
  64087. ctx_ context.Context
  64088. header_ http.Header
  64089. }
  64090. // Insert: Creates an instance template in the specified project using
  64091. // the data that is included in the request. If you are creating a new
  64092. // template to update an existing instance group, your new instance
  64093. // template must use the same network or, if applicable, the same
  64094. // subnetwork as the original template.
  64095. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  64096. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  64097. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64098. c.project = project
  64099. c.instancetemplate = instancetemplate
  64100. return c
  64101. }
  64102. // RequestId sets the optional parameter "requestId": An optional
  64103. // request ID to identify requests. Specify a unique request ID so that
  64104. // if you must retry your request, the server will know to ignore the
  64105. // request if it has already been completed.
  64106. //
  64107. // For example, consider a situation where you make an initial request
  64108. // and the request times out. If you make the request again with the
  64109. // same request ID, the server can check if original operation with the
  64110. // same request ID was received, and if so, will ignore the second
  64111. // request. This prevents clients from accidentally creating duplicate
  64112. // commitments.
  64113. //
  64114. // The request ID must be a valid UUID with the exception that zero UUID
  64115. // is not supported (00000000-0000-0000-0000-000000000000).
  64116. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  64117. c.urlParams_.Set("requestId", requestId)
  64118. return c
  64119. }
  64120. // Fields allows partial responses to be retrieved. See
  64121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64122. // for more information.
  64123. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  64124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64125. return c
  64126. }
  64127. // Context sets the context to be used in this call's Do method. Any
  64128. // pending HTTP request will be aborted if the provided context is
  64129. // canceled.
  64130. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  64131. c.ctx_ = ctx
  64132. return c
  64133. }
  64134. // Header returns an http.Header that can be modified by the caller to
  64135. // add HTTP headers to the request.
  64136. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  64137. if c.header_ == nil {
  64138. c.header_ = make(http.Header)
  64139. }
  64140. return c.header_
  64141. }
  64142. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  64143. reqHeaders := make(http.Header)
  64144. for k, v := range c.header_ {
  64145. reqHeaders[k] = v
  64146. }
  64147. reqHeaders.Set("User-Agent", c.s.userAgent())
  64148. var body io.Reader = nil
  64149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  64150. if err != nil {
  64151. return nil, err
  64152. }
  64153. reqHeaders.Set("Content-Type", "application/json")
  64154. c.urlParams_.Set("alt", alt)
  64155. c.urlParams_.Set("prettyPrint", "false")
  64156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  64157. urls += "?" + c.urlParams_.Encode()
  64158. req, err := http.NewRequest("POST", urls, body)
  64159. if err != nil {
  64160. return nil, err
  64161. }
  64162. req.Header = reqHeaders
  64163. googleapi.Expand(req.URL, map[string]string{
  64164. "project": c.project,
  64165. })
  64166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64167. }
  64168. // Do executes the "compute.instanceTemplates.insert" call.
  64169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64170. // status code is an error. Response headers are in either
  64171. // *Operation.ServerResponse.Header or (if a response was returned at
  64172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64173. // to check whether the returned error was because
  64174. // http.StatusNotModified was returned.
  64175. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64176. gensupport.SetOptions(c.urlParams_, opts...)
  64177. res, err := c.doRequest("json")
  64178. if res != nil && res.StatusCode == http.StatusNotModified {
  64179. if res.Body != nil {
  64180. res.Body.Close()
  64181. }
  64182. return nil, &googleapi.Error{
  64183. Code: res.StatusCode,
  64184. Header: res.Header,
  64185. }
  64186. }
  64187. if err != nil {
  64188. return nil, err
  64189. }
  64190. defer googleapi.CloseBody(res)
  64191. if err := googleapi.CheckResponse(res); err != nil {
  64192. return nil, err
  64193. }
  64194. ret := &Operation{
  64195. ServerResponse: googleapi.ServerResponse{
  64196. Header: res.Header,
  64197. HTTPStatusCode: res.StatusCode,
  64198. },
  64199. }
  64200. target := &ret
  64201. if err := gensupport.DecodeResponse(target, res); err != nil {
  64202. return nil, err
  64203. }
  64204. return ret, nil
  64205. // {
  64206. // "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.",
  64207. // "httpMethod": "POST",
  64208. // "id": "compute.instanceTemplates.insert",
  64209. // "parameterOrder": [
  64210. // "project"
  64211. // ],
  64212. // "parameters": {
  64213. // "project": {
  64214. // "description": "Project ID for this request.",
  64215. // "location": "path",
  64216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64217. // "required": true,
  64218. // "type": "string"
  64219. // },
  64220. // "requestId": {
  64221. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64222. // "location": "query",
  64223. // "type": "string"
  64224. // }
  64225. // },
  64226. // "path": "{project}/global/instanceTemplates",
  64227. // "request": {
  64228. // "$ref": "InstanceTemplate"
  64229. // },
  64230. // "response": {
  64231. // "$ref": "Operation"
  64232. // },
  64233. // "scopes": [
  64234. // "https://www.googleapis.com/auth/cloud-platform",
  64235. // "https://www.googleapis.com/auth/compute"
  64236. // ]
  64237. // }
  64238. }
  64239. // method id "compute.instanceTemplates.list":
  64240. type InstanceTemplatesListCall struct {
  64241. s *Service
  64242. project string
  64243. urlParams_ gensupport.URLParams
  64244. ifNoneMatch_ string
  64245. ctx_ context.Context
  64246. header_ http.Header
  64247. }
  64248. // List: Retrieves a list of instance templates that are contained
  64249. // within the specified project and zone.
  64250. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  64251. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  64252. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64253. c.project = project
  64254. return c
  64255. }
  64256. // Filter sets the optional parameter "filter": A filter expression that
  64257. // filters resources listed in the response. The expression must specify
  64258. // the field name, a comparison operator, and the value that you want to
  64259. // use for filtering. The value must be a string, a number, or a
  64260. // boolean. The comparison operator must be either =, !=, >, or <.
  64261. //
  64262. // For example, if you are filtering Compute Engine instances, you can
  64263. // exclude instances named example-instance by specifying name !=
  64264. // example-instance.
  64265. //
  64266. // You can also filter nested fields. For example, you could specify
  64267. // scheduling.automaticRestart = false to include instances only if they
  64268. // are not scheduled for automatic restarts. You can use filtering on
  64269. // nested fields to filter based on resource labels.
  64270. //
  64271. // To filter on multiple expressions, provide each separate expression
  64272. // within parentheses. For example, (scheduling.automaticRestart = true)
  64273. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64274. // AND expression. However, you can include AND and OR expressions
  64275. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64276. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64277. // true).
  64278. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  64279. c.urlParams_.Set("filter", filter)
  64280. return c
  64281. }
  64282. // MaxResults sets the optional parameter "maxResults": The maximum
  64283. // number of results per page that should be returned. If the number of
  64284. // available results is larger than maxResults, Compute Engine returns a
  64285. // nextPageToken that can be used to get the next page of results in
  64286. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64287. // (Default: 500)
  64288. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  64289. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64290. return c
  64291. }
  64292. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64293. // a certain order. By default, results are returned in alphanumerical
  64294. // order based on the resource name.
  64295. //
  64296. // You can also sort results in descending order based on the creation
  64297. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64298. // based on the creationTimestamp field in reverse chronological order
  64299. // (newest result first). Use this to sort resources like operations so
  64300. // that the newest operation is returned first.
  64301. //
  64302. // Currently, only sorting by name or creationTimestamp desc is
  64303. // supported.
  64304. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  64305. c.urlParams_.Set("orderBy", orderBy)
  64306. return c
  64307. }
  64308. // PageToken sets the optional parameter "pageToken": Specifies a page
  64309. // token to use. Set pageToken to the nextPageToken returned by a
  64310. // previous list request to get the next page of results.
  64311. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  64312. c.urlParams_.Set("pageToken", pageToken)
  64313. return c
  64314. }
  64315. // Fields allows partial responses to be retrieved. See
  64316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64317. // for more information.
  64318. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  64319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64320. return c
  64321. }
  64322. // IfNoneMatch sets the optional parameter which makes the operation
  64323. // fail if the object's ETag matches the given value. This is useful for
  64324. // getting updates only after the object has changed since the last
  64325. // request. Use googleapi.IsNotModified to check whether the response
  64326. // error from Do is the result of In-None-Match.
  64327. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  64328. c.ifNoneMatch_ = entityTag
  64329. return c
  64330. }
  64331. // Context sets the context to be used in this call's Do method. Any
  64332. // pending HTTP request will be aborted if the provided context is
  64333. // canceled.
  64334. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  64335. c.ctx_ = ctx
  64336. return c
  64337. }
  64338. // Header returns an http.Header that can be modified by the caller to
  64339. // add HTTP headers to the request.
  64340. func (c *InstanceTemplatesListCall) Header() http.Header {
  64341. if c.header_ == nil {
  64342. c.header_ = make(http.Header)
  64343. }
  64344. return c.header_
  64345. }
  64346. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  64347. reqHeaders := make(http.Header)
  64348. for k, v := range c.header_ {
  64349. reqHeaders[k] = v
  64350. }
  64351. reqHeaders.Set("User-Agent", c.s.userAgent())
  64352. if c.ifNoneMatch_ != "" {
  64353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64354. }
  64355. var body io.Reader = nil
  64356. c.urlParams_.Set("alt", alt)
  64357. c.urlParams_.Set("prettyPrint", "false")
  64358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  64359. urls += "?" + c.urlParams_.Encode()
  64360. req, err := http.NewRequest("GET", urls, body)
  64361. if err != nil {
  64362. return nil, err
  64363. }
  64364. req.Header = reqHeaders
  64365. googleapi.Expand(req.URL, map[string]string{
  64366. "project": c.project,
  64367. })
  64368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64369. }
  64370. // Do executes the "compute.instanceTemplates.list" call.
  64371. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  64372. // non-2xx status code is an error. Response headers are in either
  64373. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  64374. // returned at all) in error.(*googleapi.Error).Header. Use
  64375. // googleapi.IsNotModified to check whether the returned error was
  64376. // because http.StatusNotModified was returned.
  64377. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  64378. gensupport.SetOptions(c.urlParams_, opts...)
  64379. res, err := c.doRequest("json")
  64380. if res != nil && res.StatusCode == http.StatusNotModified {
  64381. if res.Body != nil {
  64382. res.Body.Close()
  64383. }
  64384. return nil, &googleapi.Error{
  64385. Code: res.StatusCode,
  64386. Header: res.Header,
  64387. }
  64388. }
  64389. if err != nil {
  64390. return nil, err
  64391. }
  64392. defer googleapi.CloseBody(res)
  64393. if err := googleapi.CheckResponse(res); err != nil {
  64394. return nil, err
  64395. }
  64396. ret := &InstanceTemplateList{
  64397. ServerResponse: googleapi.ServerResponse{
  64398. Header: res.Header,
  64399. HTTPStatusCode: res.StatusCode,
  64400. },
  64401. }
  64402. target := &ret
  64403. if err := gensupport.DecodeResponse(target, res); err != nil {
  64404. return nil, err
  64405. }
  64406. return ret, nil
  64407. // {
  64408. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  64409. // "httpMethod": "GET",
  64410. // "id": "compute.instanceTemplates.list",
  64411. // "parameterOrder": [
  64412. // "project"
  64413. // ],
  64414. // "parameters": {
  64415. // "filter": {
  64416. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64417. // "location": "query",
  64418. // "type": "string"
  64419. // },
  64420. // "maxResults": {
  64421. // "default": "500",
  64422. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64423. // "format": "uint32",
  64424. // "location": "query",
  64425. // "minimum": "0",
  64426. // "type": "integer"
  64427. // },
  64428. // "orderBy": {
  64429. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64430. // "location": "query",
  64431. // "type": "string"
  64432. // },
  64433. // "pageToken": {
  64434. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64435. // "location": "query",
  64436. // "type": "string"
  64437. // },
  64438. // "project": {
  64439. // "description": "Project ID for this request.",
  64440. // "location": "path",
  64441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64442. // "required": true,
  64443. // "type": "string"
  64444. // }
  64445. // },
  64446. // "path": "{project}/global/instanceTemplates",
  64447. // "response": {
  64448. // "$ref": "InstanceTemplateList"
  64449. // },
  64450. // "scopes": [
  64451. // "https://www.googleapis.com/auth/cloud-platform",
  64452. // "https://www.googleapis.com/auth/compute",
  64453. // "https://www.googleapis.com/auth/compute.readonly"
  64454. // ]
  64455. // }
  64456. }
  64457. // Pages invokes f for each page of results.
  64458. // A non-nil error returned from f will halt the iteration.
  64459. // The provided context supersedes any context provided to the Context method.
  64460. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  64461. c.ctx_ = ctx
  64462. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64463. for {
  64464. x, err := c.Do()
  64465. if err != nil {
  64466. return err
  64467. }
  64468. if err := f(x); err != nil {
  64469. return err
  64470. }
  64471. if x.NextPageToken == "" {
  64472. return nil
  64473. }
  64474. c.PageToken(x.NextPageToken)
  64475. }
  64476. }
  64477. // method id "compute.instanceTemplates.setIamPolicy":
  64478. type InstanceTemplatesSetIamPolicyCall struct {
  64479. s *Service
  64480. project string
  64481. resource string
  64482. globalsetpolicyrequest *GlobalSetPolicyRequest
  64483. urlParams_ gensupport.URLParams
  64484. ctx_ context.Context
  64485. header_ http.Header
  64486. }
  64487. // SetIamPolicy: Sets the access control policy on the specified
  64488. // resource. Replaces any existing policy.
  64489. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  64490. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64491. c.project = project
  64492. c.resource = resource
  64493. c.globalsetpolicyrequest = globalsetpolicyrequest
  64494. return c
  64495. }
  64496. // Fields allows partial responses to be retrieved. See
  64497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64498. // for more information.
  64499. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  64500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64501. return c
  64502. }
  64503. // Context sets the context to be used in this call's Do method. Any
  64504. // pending HTTP request will be aborted if the provided context is
  64505. // canceled.
  64506. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  64507. c.ctx_ = ctx
  64508. return c
  64509. }
  64510. // Header returns an http.Header that can be modified by the caller to
  64511. // add HTTP headers to the request.
  64512. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  64513. if c.header_ == nil {
  64514. c.header_ = make(http.Header)
  64515. }
  64516. return c.header_
  64517. }
  64518. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  64519. reqHeaders := make(http.Header)
  64520. for k, v := range c.header_ {
  64521. reqHeaders[k] = v
  64522. }
  64523. reqHeaders.Set("User-Agent", c.s.userAgent())
  64524. var body io.Reader = nil
  64525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  64526. if err != nil {
  64527. return nil, err
  64528. }
  64529. reqHeaders.Set("Content-Type", "application/json")
  64530. c.urlParams_.Set("alt", alt)
  64531. c.urlParams_.Set("prettyPrint", "false")
  64532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  64533. urls += "?" + c.urlParams_.Encode()
  64534. req, err := http.NewRequest("POST", urls, body)
  64535. if err != nil {
  64536. return nil, err
  64537. }
  64538. req.Header = reqHeaders
  64539. googleapi.Expand(req.URL, map[string]string{
  64540. "project": c.project,
  64541. "resource": c.resource,
  64542. })
  64543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64544. }
  64545. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  64546. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  64547. // code is an error. Response headers are in either
  64548. // *Policy.ServerResponse.Header or (if a response was returned at all)
  64549. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  64550. // check whether the returned error was because http.StatusNotModified
  64551. // was returned.
  64552. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  64553. gensupport.SetOptions(c.urlParams_, opts...)
  64554. res, err := c.doRequest("json")
  64555. if res != nil && res.StatusCode == http.StatusNotModified {
  64556. if res.Body != nil {
  64557. res.Body.Close()
  64558. }
  64559. return nil, &googleapi.Error{
  64560. Code: res.StatusCode,
  64561. Header: res.Header,
  64562. }
  64563. }
  64564. if err != nil {
  64565. return nil, err
  64566. }
  64567. defer googleapi.CloseBody(res)
  64568. if err := googleapi.CheckResponse(res); err != nil {
  64569. return nil, err
  64570. }
  64571. ret := &Policy{
  64572. ServerResponse: googleapi.ServerResponse{
  64573. Header: res.Header,
  64574. HTTPStatusCode: res.StatusCode,
  64575. },
  64576. }
  64577. target := &ret
  64578. if err := gensupport.DecodeResponse(target, res); err != nil {
  64579. return nil, err
  64580. }
  64581. return ret, nil
  64582. // {
  64583. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  64584. // "httpMethod": "POST",
  64585. // "id": "compute.instanceTemplates.setIamPolicy",
  64586. // "parameterOrder": [
  64587. // "project",
  64588. // "resource"
  64589. // ],
  64590. // "parameters": {
  64591. // "project": {
  64592. // "description": "Project ID for this request.",
  64593. // "location": "path",
  64594. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64595. // "required": true,
  64596. // "type": "string"
  64597. // },
  64598. // "resource": {
  64599. // "description": "Name or id of the resource for this request.",
  64600. // "location": "path",
  64601. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64602. // "required": true,
  64603. // "type": "string"
  64604. // }
  64605. // },
  64606. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  64607. // "request": {
  64608. // "$ref": "GlobalSetPolicyRequest"
  64609. // },
  64610. // "response": {
  64611. // "$ref": "Policy"
  64612. // },
  64613. // "scopes": [
  64614. // "https://www.googleapis.com/auth/cloud-platform",
  64615. // "https://www.googleapis.com/auth/compute"
  64616. // ]
  64617. // }
  64618. }
  64619. // method id "compute.instanceTemplates.testIamPermissions":
  64620. type InstanceTemplatesTestIamPermissionsCall struct {
  64621. s *Service
  64622. project string
  64623. resource string
  64624. testpermissionsrequest *TestPermissionsRequest
  64625. urlParams_ gensupport.URLParams
  64626. ctx_ context.Context
  64627. header_ http.Header
  64628. }
  64629. // TestIamPermissions: Returns permissions that a caller has on the
  64630. // specified resource.
  64631. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  64632. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64633. c.project = project
  64634. c.resource = resource
  64635. c.testpermissionsrequest = testpermissionsrequest
  64636. return c
  64637. }
  64638. // Fields allows partial responses to be retrieved. See
  64639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64640. // for more information.
  64641. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  64642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64643. return c
  64644. }
  64645. // Context sets the context to be used in this call's Do method. Any
  64646. // pending HTTP request will be aborted if the provided context is
  64647. // canceled.
  64648. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  64649. c.ctx_ = ctx
  64650. return c
  64651. }
  64652. // Header returns an http.Header that can be modified by the caller to
  64653. // add HTTP headers to the request.
  64654. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  64655. if c.header_ == nil {
  64656. c.header_ = make(http.Header)
  64657. }
  64658. return c.header_
  64659. }
  64660. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  64661. reqHeaders := make(http.Header)
  64662. for k, v := range c.header_ {
  64663. reqHeaders[k] = v
  64664. }
  64665. reqHeaders.Set("User-Agent", c.s.userAgent())
  64666. var body io.Reader = nil
  64667. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  64668. if err != nil {
  64669. return nil, err
  64670. }
  64671. reqHeaders.Set("Content-Type", "application/json")
  64672. c.urlParams_.Set("alt", alt)
  64673. c.urlParams_.Set("prettyPrint", "false")
  64674. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  64675. urls += "?" + c.urlParams_.Encode()
  64676. req, err := http.NewRequest("POST", urls, body)
  64677. if err != nil {
  64678. return nil, err
  64679. }
  64680. req.Header = reqHeaders
  64681. googleapi.Expand(req.URL, map[string]string{
  64682. "project": c.project,
  64683. "resource": c.resource,
  64684. })
  64685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64686. }
  64687. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  64688. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  64689. // non-2xx status code is an error. Response headers are in either
  64690. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  64691. // returned at all) in error.(*googleapi.Error).Header. Use
  64692. // googleapi.IsNotModified to check whether the returned error was
  64693. // because http.StatusNotModified was returned.
  64694. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  64695. gensupport.SetOptions(c.urlParams_, opts...)
  64696. res, err := c.doRequest("json")
  64697. if res != nil && res.StatusCode == http.StatusNotModified {
  64698. if res.Body != nil {
  64699. res.Body.Close()
  64700. }
  64701. return nil, &googleapi.Error{
  64702. Code: res.StatusCode,
  64703. Header: res.Header,
  64704. }
  64705. }
  64706. if err != nil {
  64707. return nil, err
  64708. }
  64709. defer googleapi.CloseBody(res)
  64710. if err := googleapi.CheckResponse(res); err != nil {
  64711. return nil, err
  64712. }
  64713. ret := &TestPermissionsResponse{
  64714. ServerResponse: googleapi.ServerResponse{
  64715. Header: res.Header,
  64716. HTTPStatusCode: res.StatusCode,
  64717. },
  64718. }
  64719. target := &ret
  64720. if err := gensupport.DecodeResponse(target, res); err != nil {
  64721. return nil, err
  64722. }
  64723. return ret, nil
  64724. // {
  64725. // "description": "Returns permissions that a caller has on the specified resource.",
  64726. // "httpMethod": "POST",
  64727. // "id": "compute.instanceTemplates.testIamPermissions",
  64728. // "parameterOrder": [
  64729. // "project",
  64730. // "resource"
  64731. // ],
  64732. // "parameters": {
  64733. // "project": {
  64734. // "description": "Project ID for this request.",
  64735. // "location": "path",
  64736. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64737. // "required": true,
  64738. // "type": "string"
  64739. // },
  64740. // "resource": {
  64741. // "description": "Name or id of the resource for this request.",
  64742. // "location": "path",
  64743. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64744. // "required": true,
  64745. // "type": "string"
  64746. // }
  64747. // },
  64748. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  64749. // "request": {
  64750. // "$ref": "TestPermissionsRequest"
  64751. // },
  64752. // "response": {
  64753. // "$ref": "TestPermissionsResponse"
  64754. // },
  64755. // "scopes": [
  64756. // "https://www.googleapis.com/auth/cloud-platform",
  64757. // "https://www.googleapis.com/auth/compute",
  64758. // "https://www.googleapis.com/auth/compute.readonly"
  64759. // ]
  64760. // }
  64761. }
  64762. // method id "compute.instances.addAccessConfig":
  64763. type InstancesAddAccessConfigCall struct {
  64764. s *Service
  64765. project string
  64766. zone string
  64767. instance string
  64768. accessconfig *AccessConfig
  64769. urlParams_ gensupport.URLParams
  64770. ctx_ context.Context
  64771. header_ http.Header
  64772. }
  64773. // AddAccessConfig: Adds an access config to an instance's network
  64774. // interface.
  64775. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  64776. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  64777. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64778. c.project = project
  64779. c.zone = zone
  64780. c.instance = instance
  64781. c.urlParams_.Set("networkInterface", networkInterface)
  64782. c.accessconfig = accessconfig
  64783. return c
  64784. }
  64785. // RequestId sets the optional parameter "requestId": An optional
  64786. // request ID to identify requests. Specify a unique request ID so that
  64787. // if you must retry your request, the server will know to ignore the
  64788. // request if it has already been completed.
  64789. //
  64790. // For example, consider a situation where you make an initial request
  64791. // and the request times out. If you make the request again with the
  64792. // same request ID, the server can check if original operation with the
  64793. // same request ID was received, and if so, will ignore the second
  64794. // request. This prevents clients from accidentally creating duplicate
  64795. // commitments.
  64796. //
  64797. // The request ID must be a valid UUID with the exception that zero UUID
  64798. // is not supported (00000000-0000-0000-0000-000000000000).
  64799. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  64800. c.urlParams_.Set("requestId", requestId)
  64801. return c
  64802. }
  64803. // Fields allows partial responses to be retrieved. See
  64804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64805. // for more information.
  64806. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  64807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64808. return c
  64809. }
  64810. // Context sets the context to be used in this call's Do method. Any
  64811. // pending HTTP request will be aborted if the provided context is
  64812. // canceled.
  64813. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  64814. c.ctx_ = ctx
  64815. return c
  64816. }
  64817. // Header returns an http.Header that can be modified by the caller to
  64818. // add HTTP headers to the request.
  64819. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  64820. if c.header_ == nil {
  64821. c.header_ = make(http.Header)
  64822. }
  64823. return c.header_
  64824. }
  64825. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  64826. reqHeaders := make(http.Header)
  64827. for k, v := range c.header_ {
  64828. reqHeaders[k] = v
  64829. }
  64830. reqHeaders.Set("User-Agent", c.s.userAgent())
  64831. var body io.Reader = nil
  64832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  64833. if err != nil {
  64834. return nil, err
  64835. }
  64836. reqHeaders.Set("Content-Type", "application/json")
  64837. c.urlParams_.Set("alt", alt)
  64838. c.urlParams_.Set("prettyPrint", "false")
  64839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  64840. urls += "?" + c.urlParams_.Encode()
  64841. req, err := http.NewRequest("POST", urls, body)
  64842. if err != nil {
  64843. return nil, err
  64844. }
  64845. req.Header = reqHeaders
  64846. googleapi.Expand(req.URL, map[string]string{
  64847. "project": c.project,
  64848. "zone": c.zone,
  64849. "instance": c.instance,
  64850. })
  64851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64852. }
  64853. // Do executes the "compute.instances.addAccessConfig" call.
  64854. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64855. // status code is an error. Response headers are in either
  64856. // *Operation.ServerResponse.Header or (if a response was returned at
  64857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64858. // to check whether the returned error was because
  64859. // http.StatusNotModified was returned.
  64860. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64861. gensupport.SetOptions(c.urlParams_, opts...)
  64862. res, err := c.doRequest("json")
  64863. if res != nil && res.StatusCode == http.StatusNotModified {
  64864. if res.Body != nil {
  64865. res.Body.Close()
  64866. }
  64867. return nil, &googleapi.Error{
  64868. Code: res.StatusCode,
  64869. Header: res.Header,
  64870. }
  64871. }
  64872. if err != nil {
  64873. return nil, err
  64874. }
  64875. defer googleapi.CloseBody(res)
  64876. if err := googleapi.CheckResponse(res); err != nil {
  64877. return nil, err
  64878. }
  64879. ret := &Operation{
  64880. ServerResponse: googleapi.ServerResponse{
  64881. Header: res.Header,
  64882. HTTPStatusCode: res.StatusCode,
  64883. },
  64884. }
  64885. target := &ret
  64886. if err := gensupport.DecodeResponse(target, res); err != nil {
  64887. return nil, err
  64888. }
  64889. return ret, nil
  64890. // {
  64891. // "description": "Adds an access config to an instance's network interface.",
  64892. // "httpMethod": "POST",
  64893. // "id": "compute.instances.addAccessConfig",
  64894. // "parameterOrder": [
  64895. // "project",
  64896. // "zone",
  64897. // "instance",
  64898. // "networkInterface"
  64899. // ],
  64900. // "parameters": {
  64901. // "instance": {
  64902. // "description": "The instance name for this request.",
  64903. // "location": "path",
  64904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64905. // "required": true,
  64906. // "type": "string"
  64907. // },
  64908. // "networkInterface": {
  64909. // "description": "The name of the network interface to add to this instance.",
  64910. // "location": "query",
  64911. // "required": true,
  64912. // "type": "string"
  64913. // },
  64914. // "project": {
  64915. // "description": "Project ID for this request.",
  64916. // "location": "path",
  64917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64918. // "required": true,
  64919. // "type": "string"
  64920. // },
  64921. // "requestId": {
  64922. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64923. // "location": "query",
  64924. // "type": "string"
  64925. // },
  64926. // "zone": {
  64927. // "description": "The name of the zone for this request.",
  64928. // "location": "path",
  64929. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64930. // "required": true,
  64931. // "type": "string"
  64932. // }
  64933. // },
  64934. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  64935. // "request": {
  64936. // "$ref": "AccessConfig"
  64937. // },
  64938. // "response": {
  64939. // "$ref": "Operation"
  64940. // },
  64941. // "scopes": [
  64942. // "https://www.googleapis.com/auth/cloud-platform",
  64943. // "https://www.googleapis.com/auth/compute"
  64944. // ]
  64945. // }
  64946. }
  64947. // method id "compute.instances.addResourcePolicies":
  64948. type InstancesAddResourcePoliciesCall struct {
  64949. s *Service
  64950. project string
  64951. zone string
  64952. instance string
  64953. instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest
  64954. urlParams_ gensupport.URLParams
  64955. ctx_ context.Context
  64956. header_ http.Header
  64957. }
  64958. // AddResourcePolicies: Adds existing resource policies to an instance.
  64959. // You can only add one policy right now which will be applied to this
  64960. // instance for scheduling live migrations.
  64961. func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall {
  64962. c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64963. c.project = project
  64964. c.zone = zone
  64965. c.instance = instance
  64966. c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest
  64967. return c
  64968. }
  64969. // RequestId sets the optional parameter "requestId": An optional
  64970. // request ID to identify requests. Specify a unique request ID so that
  64971. // if you must retry your request, the server will know to ignore the
  64972. // request if it has already been completed.
  64973. //
  64974. // For example, consider a situation where you make an initial request
  64975. // and the request times out. If you make the request again with the
  64976. // same request ID, the server can check if original operation with the
  64977. // same request ID was received, and if so, will ignore the second
  64978. // request. This prevents clients from accidentally creating duplicate
  64979. // commitments.
  64980. //
  64981. // The request ID must be a valid UUID with the exception that zero UUID
  64982. // is not supported (00000000-0000-0000-0000-000000000000).
  64983. func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall {
  64984. c.urlParams_.Set("requestId", requestId)
  64985. return c
  64986. }
  64987. // Fields allows partial responses to be retrieved. See
  64988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64989. // for more information.
  64990. func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall {
  64991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64992. return c
  64993. }
  64994. // Context sets the context to be used in this call's Do method. Any
  64995. // pending HTTP request will be aborted if the provided context is
  64996. // canceled.
  64997. func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall {
  64998. c.ctx_ = ctx
  64999. return c
  65000. }
  65001. // Header returns an http.Header that can be modified by the caller to
  65002. // add HTTP headers to the request.
  65003. func (c *InstancesAddResourcePoliciesCall) Header() http.Header {
  65004. if c.header_ == nil {
  65005. c.header_ = make(http.Header)
  65006. }
  65007. return c.header_
  65008. }
  65009. func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  65010. reqHeaders := make(http.Header)
  65011. for k, v := range c.header_ {
  65012. reqHeaders[k] = v
  65013. }
  65014. reqHeaders.Set("User-Agent", c.s.userAgent())
  65015. var body io.Reader = nil
  65016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest)
  65017. if err != nil {
  65018. return nil, err
  65019. }
  65020. reqHeaders.Set("Content-Type", "application/json")
  65021. c.urlParams_.Set("alt", alt)
  65022. c.urlParams_.Set("prettyPrint", "false")
  65023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addResourcePolicies")
  65024. urls += "?" + c.urlParams_.Encode()
  65025. req, err := http.NewRequest("POST", urls, body)
  65026. if err != nil {
  65027. return nil, err
  65028. }
  65029. req.Header = reqHeaders
  65030. googleapi.Expand(req.URL, map[string]string{
  65031. "project": c.project,
  65032. "zone": c.zone,
  65033. "instance": c.instance,
  65034. })
  65035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65036. }
  65037. // Do executes the "compute.instances.addResourcePolicies" call.
  65038. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65039. // status code is an error. Response headers are in either
  65040. // *Operation.ServerResponse.Header or (if a response was returned at
  65041. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65042. // to check whether the returned error was because
  65043. // http.StatusNotModified was returned.
  65044. func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65045. gensupport.SetOptions(c.urlParams_, opts...)
  65046. res, err := c.doRequest("json")
  65047. if res != nil && res.StatusCode == http.StatusNotModified {
  65048. if res.Body != nil {
  65049. res.Body.Close()
  65050. }
  65051. return nil, &googleapi.Error{
  65052. Code: res.StatusCode,
  65053. Header: res.Header,
  65054. }
  65055. }
  65056. if err != nil {
  65057. return nil, err
  65058. }
  65059. defer googleapi.CloseBody(res)
  65060. if err := googleapi.CheckResponse(res); err != nil {
  65061. return nil, err
  65062. }
  65063. ret := &Operation{
  65064. ServerResponse: googleapi.ServerResponse{
  65065. Header: res.Header,
  65066. HTTPStatusCode: res.StatusCode,
  65067. },
  65068. }
  65069. target := &ret
  65070. if err := gensupport.DecodeResponse(target, res); err != nil {
  65071. return nil, err
  65072. }
  65073. return ret, nil
  65074. // {
  65075. // "description": "Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.",
  65076. // "httpMethod": "POST",
  65077. // "id": "compute.instances.addResourcePolicies",
  65078. // "parameterOrder": [
  65079. // "project",
  65080. // "zone",
  65081. // "instance"
  65082. // ],
  65083. // "parameters": {
  65084. // "instance": {
  65085. // "description": "The instance name for this request.",
  65086. // "location": "path",
  65087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65088. // "required": true,
  65089. // "type": "string"
  65090. // },
  65091. // "project": {
  65092. // "description": "Project ID for this request.",
  65093. // "location": "path",
  65094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65095. // "required": true,
  65096. // "type": "string"
  65097. // },
  65098. // "requestId": {
  65099. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65100. // "location": "query",
  65101. // "type": "string"
  65102. // },
  65103. // "zone": {
  65104. // "description": "The name of the zone for this request.",
  65105. // "location": "path",
  65106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65107. // "required": true,
  65108. // "type": "string"
  65109. // }
  65110. // },
  65111. // "path": "{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
  65112. // "request": {
  65113. // "$ref": "InstancesAddResourcePoliciesRequest"
  65114. // },
  65115. // "response": {
  65116. // "$ref": "Operation"
  65117. // },
  65118. // "scopes": [
  65119. // "https://www.googleapis.com/auth/cloud-platform",
  65120. // "https://www.googleapis.com/auth/compute"
  65121. // ]
  65122. // }
  65123. }
  65124. // method id "compute.instances.aggregatedList":
  65125. type InstancesAggregatedListCall struct {
  65126. s *Service
  65127. project string
  65128. urlParams_ gensupport.URLParams
  65129. ifNoneMatch_ string
  65130. ctx_ context.Context
  65131. header_ http.Header
  65132. }
  65133. // AggregatedList: Retrieves aggregated list of all of the instances in
  65134. // your project across all regions and zones.
  65135. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  65136. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  65137. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65138. c.project = project
  65139. return c
  65140. }
  65141. // Filter sets the optional parameter "filter": A filter expression that
  65142. // filters resources listed in the response. The expression must specify
  65143. // the field name, a comparison operator, and the value that you want to
  65144. // use for filtering. The value must be a string, a number, or a
  65145. // boolean. The comparison operator must be either =, !=, >, or <.
  65146. //
  65147. // For example, if you are filtering Compute Engine instances, you can
  65148. // exclude instances named example-instance by specifying name !=
  65149. // example-instance.
  65150. //
  65151. // You can also filter nested fields. For example, you could specify
  65152. // scheduling.automaticRestart = false to include instances only if they
  65153. // are not scheduled for automatic restarts. You can use filtering on
  65154. // nested fields to filter based on resource labels.
  65155. //
  65156. // To filter on multiple expressions, provide each separate expression
  65157. // within parentheses. For example, (scheduling.automaticRestart = true)
  65158. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65159. // AND expression. However, you can include AND and OR expressions
  65160. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65161. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65162. // true).
  65163. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  65164. c.urlParams_.Set("filter", filter)
  65165. return c
  65166. }
  65167. // MaxResults sets the optional parameter "maxResults": The maximum
  65168. // number of results per page that should be returned. If the number of
  65169. // available results is larger than maxResults, Compute Engine returns a
  65170. // nextPageToken that can be used to get the next page of results in
  65171. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65172. // (Default: 500)
  65173. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  65174. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65175. return c
  65176. }
  65177. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65178. // a certain order. By default, results are returned in alphanumerical
  65179. // order based on the resource name.
  65180. //
  65181. // You can also sort results in descending order based on the creation
  65182. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65183. // based on the creationTimestamp field in reverse chronological order
  65184. // (newest result first). Use this to sort resources like operations so
  65185. // that the newest operation is returned first.
  65186. //
  65187. // Currently, only sorting by name or creationTimestamp desc is
  65188. // supported.
  65189. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  65190. c.urlParams_.Set("orderBy", orderBy)
  65191. return c
  65192. }
  65193. // PageToken sets the optional parameter "pageToken": Specifies a page
  65194. // token to use. Set pageToken to the nextPageToken returned by a
  65195. // previous list request to get the next page of results.
  65196. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  65197. c.urlParams_.Set("pageToken", pageToken)
  65198. return c
  65199. }
  65200. // Fields allows partial responses to be retrieved. See
  65201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65202. // for more information.
  65203. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  65204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65205. return c
  65206. }
  65207. // IfNoneMatch sets the optional parameter which makes the operation
  65208. // fail if the object's ETag matches the given value. This is useful for
  65209. // getting updates only after the object has changed since the last
  65210. // request. Use googleapi.IsNotModified to check whether the response
  65211. // error from Do is the result of In-None-Match.
  65212. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  65213. c.ifNoneMatch_ = entityTag
  65214. return c
  65215. }
  65216. // Context sets the context to be used in this call's Do method. Any
  65217. // pending HTTP request will be aborted if the provided context is
  65218. // canceled.
  65219. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  65220. c.ctx_ = ctx
  65221. return c
  65222. }
  65223. // Header returns an http.Header that can be modified by the caller to
  65224. // add HTTP headers to the request.
  65225. func (c *InstancesAggregatedListCall) Header() http.Header {
  65226. if c.header_ == nil {
  65227. c.header_ = make(http.Header)
  65228. }
  65229. return c.header_
  65230. }
  65231. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  65232. reqHeaders := make(http.Header)
  65233. for k, v := range c.header_ {
  65234. reqHeaders[k] = v
  65235. }
  65236. reqHeaders.Set("User-Agent", c.s.userAgent())
  65237. if c.ifNoneMatch_ != "" {
  65238. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65239. }
  65240. var body io.Reader = nil
  65241. c.urlParams_.Set("alt", alt)
  65242. c.urlParams_.Set("prettyPrint", "false")
  65243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  65244. urls += "?" + c.urlParams_.Encode()
  65245. req, err := http.NewRequest("GET", urls, body)
  65246. if err != nil {
  65247. return nil, err
  65248. }
  65249. req.Header = reqHeaders
  65250. googleapi.Expand(req.URL, map[string]string{
  65251. "project": c.project,
  65252. })
  65253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65254. }
  65255. // Do executes the "compute.instances.aggregatedList" call.
  65256. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  65257. // non-2xx status code is an error. Response headers are in either
  65258. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  65259. // returned at all) in error.(*googleapi.Error).Header. Use
  65260. // googleapi.IsNotModified to check whether the returned error was
  65261. // because http.StatusNotModified was returned.
  65262. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  65263. gensupport.SetOptions(c.urlParams_, opts...)
  65264. res, err := c.doRequest("json")
  65265. if res != nil && res.StatusCode == http.StatusNotModified {
  65266. if res.Body != nil {
  65267. res.Body.Close()
  65268. }
  65269. return nil, &googleapi.Error{
  65270. Code: res.StatusCode,
  65271. Header: res.Header,
  65272. }
  65273. }
  65274. if err != nil {
  65275. return nil, err
  65276. }
  65277. defer googleapi.CloseBody(res)
  65278. if err := googleapi.CheckResponse(res); err != nil {
  65279. return nil, err
  65280. }
  65281. ret := &InstanceAggregatedList{
  65282. ServerResponse: googleapi.ServerResponse{
  65283. Header: res.Header,
  65284. HTTPStatusCode: res.StatusCode,
  65285. },
  65286. }
  65287. target := &ret
  65288. if err := gensupport.DecodeResponse(target, res); err != nil {
  65289. return nil, err
  65290. }
  65291. return ret, nil
  65292. // {
  65293. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  65294. // "httpMethod": "GET",
  65295. // "id": "compute.instances.aggregatedList",
  65296. // "parameterOrder": [
  65297. // "project"
  65298. // ],
  65299. // "parameters": {
  65300. // "filter": {
  65301. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  65302. // "location": "query",
  65303. // "type": "string"
  65304. // },
  65305. // "maxResults": {
  65306. // "default": "500",
  65307. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  65308. // "format": "uint32",
  65309. // "location": "query",
  65310. // "minimum": "0",
  65311. // "type": "integer"
  65312. // },
  65313. // "orderBy": {
  65314. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  65315. // "location": "query",
  65316. // "type": "string"
  65317. // },
  65318. // "pageToken": {
  65319. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  65320. // "location": "query",
  65321. // "type": "string"
  65322. // },
  65323. // "project": {
  65324. // "description": "Project ID for this request.",
  65325. // "location": "path",
  65326. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65327. // "required": true,
  65328. // "type": "string"
  65329. // }
  65330. // },
  65331. // "path": "{project}/aggregated/instances",
  65332. // "response": {
  65333. // "$ref": "InstanceAggregatedList"
  65334. // },
  65335. // "scopes": [
  65336. // "https://www.googleapis.com/auth/cloud-platform",
  65337. // "https://www.googleapis.com/auth/compute",
  65338. // "https://www.googleapis.com/auth/compute.readonly"
  65339. // ]
  65340. // }
  65341. }
  65342. // Pages invokes f for each page of results.
  65343. // A non-nil error returned from f will halt the iteration.
  65344. // The provided context supersedes any context provided to the Context method.
  65345. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  65346. c.ctx_ = ctx
  65347. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65348. for {
  65349. x, err := c.Do()
  65350. if err != nil {
  65351. return err
  65352. }
  65353. if err := f(x); err != nil {
  65354. return err
  65355. }
  65356. if x.NextPageToken == "" {
  65357. return nil
  65358. }
  65359. c.PageToken(x.NextPageToken)
  65360. }
  65361. }
  65362. // method id "compute.instances.attachDisk":
  65363. type InstancesAttachDiskCall struct {
  65364. s *Service
  65365. project string
  65366. zone string
  65367. instance string
  65368. attacheddisk *AttachedDisk
  65369. urlParams_ gensupport.URLParams
  65370. ctx_ context.Context
  65371. header_ http.Header
  65372. }
  65373. // AttachDisk: Attaches an existing Disk resource to an instance. You
  65374. // must first create the disk before you can attach it. It is not
  65375. // possible to create and attach a disk at the same time. For more
  65376. // information, read Adding a persistent disk to your instance.
  65377. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  65378. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  65379. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65380. c.project = project
  65381. c.zone = zone
  65382. c.instance = instance
  65383. c.attacheddisk = attacheddisk
  65384. return c
  65385. }
  65386. // ForceAttach sets the optional parameter "forceAttach": Whether to
  65387. // force attach the disk even if it's currently attached to another
  65388. // instance. This is only available for regional disks.
  65389. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  65390. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  65391. return c
  65392. }
  65393. // RequestId sets the optional parameter "requestId": An optional
  65394. // request ID to identify requests. Specify a unique request ID so that
  65395. // if you must retry your request, the server will know to ignore the
  65396. // request if it has already been completed.
  65397. //
  65398. // For example, consider a situation where you make an initial request
  65399. // and the request times out. If you make the request again with the
  65400. // same request ID, the server can check if original operation with the
  65401. // same request ID was received, and if so, will ignore the second
  65402. // request. This prevents clients from accidentally creating duplicate
  65403. // commitments.
  65404. //
  65405. // The request ID must be a valid UUID with the exception that zero UUID
  65406. // is not supported (00000000-0000-0000-0000-000000000000).
  65407. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  65408. c.urlParams_.Set("requestId", requestId)
  65409. return c
  65410. }
  65411. // Fields allows partial responses to be retrieved. See
  65412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65413. // for more information.
  65414. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  65415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65416. return c
  65417. }
  65418. // Context sets the context to be used in this call's Do method. Any
  65419. // pending HTTP request will be aborted if the provided context is
  65420. // canceled.
  65421. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  65422. c.ctx_ = ctx
  65423. return c
  65424. }
  65425. // Header returns an http.Header that can be modified by the caller to
  65426. // add HTTP headers to the request.
  65427. func (c *InstancesAttachDiskCall) Header() http.Header {
  65428. if c.header_ == nil {
  65429. c.header_ = make(http.Header)
  65430. }
  65431. return c.header_
  65432. }
  65433. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  65434. reqHeaders := make(http.Header)
  65435. for k, v := range c.header_ {
  65436. reqHeaders[k] = v
  65437. }
  65438. reqHeaders.Set("User-Agent", c.s.userAgent())
  65439. var body io.Reader = nil
  65440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  65441. if err != nil {
  65442. return nil, err
  65443. }
  65444. reqHeaders.Set("Content-Type", "application/json")
  65445. c.urlParams_.Set("alt", alt)
  65446. c.urlParams_.Set("prettyPrint", "false")
  65447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  65448. urls += "?" + c.urlParams_.Encode()
  65449. req, err := http.NewRequest("POST", urls, body)
  65450. if err != nil {
  65451. return nil, err
  65452. }
  65453. req.Header = reqHeaders
  65454. googleapi.Expand(req.URL, map[string]string{
  65455. "project": c.project,
  65456. "zone": c.zone,
  65457. "instance": c.instance,
  65458. })
  65459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65460. }
  65461. // Do executes the "compute.instances.attachDisk" call.
  65462. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65463. // status code is an error. Response headers are in either
  65464. // *Operation.ServerResponse.Header or (if a response was returned at
  65465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65466. // to check whether the returned error was because
  65467. // http.StatusNotModified was returned.
  65468. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65469. gensupport.SetOptions(c.urlParams_, opts...)
  65470. res, err := c.doRequest("json")
  65471. if res != nil && res.StatusCode == http.StatusNotModified {
  65472. if res.Body != nil {
  65473. res.Body.Close()
  65474. }
  65475. return nil, &googleapi.Error{
  65476. Code: res.StatusCode,
  65477. Header: res.Header,
  65478. }
  65479. }
  65480. if err != nil {
  65481. return nil, err
  65482. }
  65483. defer googleapi.CloseBody(res)
  65484. if err := googleapi.CheckResponse(res); err != nil {
  65485. return nil, err
  65486. }
  65487. ret := &Operation{
  65488. ServerResponse: googleapi.ServerResponse{
  65489. Header: res.Header,
  65490. HTTPStatusCode: res.StatusCode,
  65491. },
  65492. }
  65493. target := &ret
  65494. if err := gensupport.DecodeResponse(target, res); err != nil {
  65495. return nil, err
  65496. }
  65497. return ret, nil
  65498. // {
  65499. // "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.",
  65500. // "httpMethod": "POST",
  65501. // "id": "compute.instances.attachDisk",
  65502. // "parameterOrder": [
  65503. // "project",
  65504. // "zone",
  65505. // "instance"
  65506. // ],
  65507. // "parameters": {
  65508. // "forceAttach": {
  65509. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  65510. // "location": "query",
  65511. // "type": "boolean"
  65512. // },
  65513. // "instance": {
  65514. // "description": "The instance name for this request.",
  65515. // "location": "path",
  65516. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65517. // "required": true,
  65518. // "type": "string"
  65519. // },
  65520. // "project": {
  65521. // "description": "Project ID for this request.",
  65522. // "location": "path",
  65523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65524. // "required": true,
  65525. // "type": "string"
  65526. // },
  65527. // "requestId": {
  65528. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65529. // "location": "query",
  65530. // "type": "string"
  65531. // },
  65532. // "zone": {
  65533. // "description": "The name of the zone for this request.",
  65534. // "location": "path",
  65535. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65536. // "required": true,
  65537. // "type": "string"
  65538. // }
  65539. // },
  65540. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  65541. // "request": {
  65542. // "$ref": "AttachedDisk"
  65543. // },
  65544. // "response": {
  65545. // "$ref": "Operation"
  65546. // },
  65547. // "scopes": [
  65548. // "https://www.googleapis.com/auth/cloud-platform",
  65549. // "https://www.googleapis.com/auth/compute"
  65550. // ]
  65551. // }
  65552. }
  65553. // method id "compute.instances.delete":
  65554. type InstancesDeleteCall struct {
  65555. s *Service
  65556. project string
  65557. zone string
  65558. instance string
  65559. urlParams_ gensupport.URLParams
  65560. ctx_ context.Context
  65561. header_ http.Header
  65562. }
  65563. // Delete: Deletes the specified Instance resource. For more
  65564. // information, see Stopping or Deleting an Instance.
  65565. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  65566. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  65567. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65568. c.project = project
  65569. c.zone = zone
  65570. c.instance = instance
  65571. return c
  65572. }
  65573. // RequestId sets the optional parameter "requestId": An optional
  65574. // request ID to identify requests. Specify a unique request ID so that
  65575. // if you must retry your request, the server will know to ignore the
  65576. // request if it has already been completed.
  65577. //
  65578. // For example, consider a situation where you make an initial request
  65579. // and the request times out. If you make the request again with the
  65580. // same request ID, the server can check if original operation with the
  65581. // same request ID was received, and if so, will ignore the second
  65582. // request. This prevents clients from accidentally creating duplicate
  65583. // commitments.
  65584. //
  65585. // The request ID must be a valid UUID with the exception that zero UUID
  65586. // is not supported (00000000-0000-0000-0000-000000000000).
  65587. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  65588. c.urlParams_.Set("requestId", requestId)
  65589. return c
  65590. }
  65591. // Fields allows partial responses to be retrieved. See
  65592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65593. // for more information.
  65594. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  65595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65596. return c
  65597. }
  65598. // Context sets the context to be used in this call's Do method. Any
  65599. // pending HTTP request will be aborted if the provided context is
  65600. // canceled.
  65601. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  65602. c.ctx_ = ctx
  65603. return c
  65604. }
  65605. // Header returns an http.Header that can be modified by the caller to
  65606. // add HTTP headers to the request.
  65607. func (c *InstancesDeleteCall) Header() http.Header {
  65608. if c.header_ == nil {
  65609. c.header_ = make(http.Header)
  65610. }
  65611. return c.header_
  65612. }
  65613. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  65614. reqHeaders := make(http.Header)
  65615. for k, v := range c.header_ {
  65616. reqHeaders[k] = v
  65617. }
  65618. reqHeaders.Set("User-Agent", c.s.userAgent())
  65619. var body io.Reader = nil
  65620. c.urlParams_.Set("alt", alt)
  65621. c.urlParams_.Set("prettyPrint", "false")
  65622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  65623. urls += "?" + c.urlParams_.Encode()
  65624. req, err := http.NewRequest("DELETE", urls, body)
  65625. if err != nil {
  65626. return nil, err
  65627. }
  65628. req.Header = reqHeaders
  65629. googleapi.Expand(req.URL, map[string]string{
  65630. "project": c.project,
  65631. "zone": c.zone,
  65632. "instance": c.instance,
  65633. })
  65634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65635. }
  65636. // Do executes the "compute.instances.delete" call.
  65637. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65638. // status code is an error. Response headers are in either
  65639. // *Operation.ServerResponse.Header or (if a response was returned at
  65640. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65641. // to check whether the returned error was because
  65642. // http.StatusNotModified was returned.
  65643. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65644. gensupport.SetOptions(c.urlParams_, opts...)
  65645. res, err := c.doRequest("json")
  65646. if res != nil && res.StatusCode == http.StatusNotModified {
  65647. if res.Body != nil {
  65648. res.Body.Close()
  65649. }
  65650. return nil, &googleapi.Error{
  65651. Code: res.StatusCode,
  65652. Header: res.Header,
  65653. }
  65654. }
  65655. if err != nil {
  65656. return nil, err
  65657. }
  65658. defer googleapi.CloseBody(res)
  65659. if err := googleapi.CheckResponse(res); err != nil {
  65660. return nil, err
  65661. }
  65662. ret := &Operation{
  65663. ServerResponse: googleapi.ServerResponse{
  65664. Header: res.Header,
  65665. HTTPStatusCode: res.StatusCode,
  65666. },
  65667. }
  65668. target := &ret
  65669. if err := gensupport.DecodeResponse(target, res); err != nil {
  65670. return nil, err
  65671. }
  65672. return ret, nil
  65673. // {
  65674. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  65675. // "httpMethod": "DELETE",
  65676. // "id": "compute.instances.delete",
  65677. // "parameterOrder": [
  65678. // "project",
  65679. // "zone",
  65680. // "instance"
  65681. // ],
  65682. // "parameters": {
  65683. // "instance": {
  65684. // "description": "Name of the instance resource to delete.",
  65685. // "location": "path",
  65686. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65687. // "required": true,
  65688. // "type": "string"
  65689. // },
  65690. // "project": {
  65691. // "description": "Project ID for this request.",
  65692. // "location": "path",
  65693. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65694. // "required": true,
  65695. // "type": "string"
  65696. // },
  65697. // "requestId": {
  65698. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65699. // "location": "query",
  65700. // "type": "string"
  65701. // },
  65702. // "zone": {
  65703. // "description": "The name of the zone for this request.",
  65704. // "location": "path",
  65705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65706. // "required": true,
  65707. // "type": "string"
  65708. // }
  65709. // },
  65710. // "path": "{project}/zones/{zone}/instances/{instance}",
  65711. // "response": {
  65712. // "$ref": "Operation"
  65713. // },
  65714. // "scopes": [
  65715. // "https://www.googleapis.com/auth/cloud-platform",
  65716. // "https://www.googleapis.com/auth/compute"
  65717. // ]
  65718. // }
  65719. }
  65720. // method id "compute.instances.deleteAccessConfig":
  65721. type InstancesDeleteAccessConfigCall struct {
  65722. s *Service
  65723. project string
  65724. zone string
  65725. instance string
  65726. urlParams_ gensupport.URLParams
  65727. ctx_ context.Context
  65728. header_ http.Header
  65729. }
  65730. // DeleteAccessConfig: Deletes an access config from an instance's
  65731. // network interface.
  65732. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  65733. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  65734. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65735. c.project = project
  65736. c.zone = zone
  65737. c.instance = instance
  65738. c.urlParams_.Set("accessConfig", accessConfig)
  65739. c.urlParams_.Set("networkInterface", networkInterface)
  65740. return c
  65741. }
  65742. // RequestId sets the optional parameter "requestId": An optional
  65743. // request ID to identify requests. Specify a unique request ID so that
  65744. // if you must retry your request, the server will know to ignore the
  65745. // request if it has already been completed.
  65746. //
  65747. // For example, consider a situation where you make an initial request
  65748. // and the request times out. If you make the request again with the
  65749. // same request ID, the server can check if original operation with the
  65750. // same request ID was received, and if so, will ignore the second
  65751. // request. This prevents clients from accidentally creating duplicate
  65752. // commitments.
  65753. //
  65754. // The request ID must be a valid UUID with the exception that zero UUID
  65755. // is not supported (00000000-0000-0000-0000-000000000000).
  65756. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  65757. c.urlParams_.Set("requestId", requestId)
  65758. return c
  65759. }
  65760. // Fields allows partial responses to be retrieved. See
  65761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65762. // for more information.
  65763. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  65764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65765. return c
  65766. }
  65767. // Context sets the context to be used in this call's Do method. Any
  65768. // pending HTTP request will be aborted if the provided context is
  65769. // canceled.
  65770. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  65771. c.ctx_ = ctx
  65772. return c
  65773. }
  65774. // Header returns an http.Header that can be modified by the caller to
  65775. // add HTTP headers to the request.
  65776. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  65777. if c.header_ == nil {
  65778. c.header_ = make(http.Header)
  65779. }
  65780. return c.header_
  65781. }
  65782. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  65783. reqHeaders := make(http.Header)
  65784. for k, v := range c.header_ {
  65785. reqHeaders[k] = v
  65786. }
  65787. reqHeaders.Set("User-Agent", c.s.userAgent())
  65788. var body io.Reader = nil
  65789. c.urlParams_.Set("alt", alt)
  65790. c.urlParams_.Set("prettyPrint", "false")
  65791. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  65792. urls += "?" + c.urlParams_.Encode()
  65793. req, err := http.NewRequest("POST", urls, body)
  65794. if err != nil {
  65795. return nil, err
  65796. }
  65797. req.Header = reqHeaders
  65798. googleapi.Expand(req.URL, map[string]string{
  65799. "project": c.project,
  65800. "zone": c.zone,
  65801. "instance": c.instance,
  65802. })
  65803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65804. }
  65805. // Do executes the "compute.instances.deleteAccessConfig" call.
  65806. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65807. // status code is an error. Response headers are in either
  65808. // *Operation.ServerResponse.Header or (if a response was returned at
  65809. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65810. // to check whether the returned error was because
  65811. // http.StatusNotModified was returned.
  65812. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65813. gensupport.SetOptions(c.urlParams_, opts...)
  65814. res, err := c.doRequest("json")
  65815. if res != nil && res.StatusCode == http.StatusNotModified {
  65816. if res.Body != nil {
  65817. res.Body.Close()
  65818. }
  65819. return nil, &googleapi.Error{
  65820. Code: res.StatusCode,
  65821. Header: res.Header,
  65822. }
  65823. }
  65824. if err != nil {
  65825. return nil, err
  65826. }
  65827. defer googleapi.CloseBody(res)
  65828. if err := googleapi.CheckResponse(res); err != nil {
  65829. return nil, err
  65830. }
  65831. ret := &Operation{
  65832. ServerResponse: googleapi.ServerResponse{
  65833. Header: res.Header,
  65834. HTTPStatusCode: res.StatusCode,
  65835. },
  65836. }
  65837. target := &ret
  65838. if err := gensupport.DecodeResponse(target, res); err != nil {
  65839. return nil, err
  65840. }
  65841. return ret, nil
  65842. // {
  65843. // "description": "Deletes an access config from an instance's network interface.",
  65844. // "httpMethod": "POST",
  65845. // "id": "compute.instances.deleteAccessConfig",
  65846. // "parameterOrder": [
  65847. // "project",
  65848. // "zone",
  65849. // "instance",
  65850. // "accessConfig",
  65851. // "networkInterface"
  65852. // ],
  65853. // "parameters": {
  65854. // "accessConfig": {
  65855. // "description": "The name of the access config to delete.",
  65856. // "location": "query",
  65857. // "required": true,
  65858. // "type": "string"
  65859. // },
  65860. // "instance": {
  65861. // "description": "The instance name for this request.",
  65862. // "location": "path",
  65863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65864. // "required": true,
  65865. // "type": "string"
  65866. // },
  65867. // "networkInterface": {
  65868. // "description": "The name of the network interface.",
  65869. // "location": "query",
  65870. // "required": true,
  65871. // "type": "string"
  65872. // },
  65873. // "project": {
  65874. // "description": "Project ID for this request.",
  65875. // "location": "path",
  65876. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65877. // "required": true,
  65878. // "type": "string"
  65879. // },
  65880. // "requestId": {
  65881. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65882. // "location": "query",
  65883. // "type": "string"
  65884. // },
  65885. // "zone": {
  65886. // "description": "The name of the zone for this request.",
  65887. // "location": "path",
  65888. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65889. // "required": true,
  65890. // "type": "string"
  65891. // }
  65892. // },
  65893. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  65894. // "response": {
  65895. // "$ref": "Operation"
  65896. // },
  65897. // "scopes": [
  65898. // "https://www.googleapis.com/auth/cloud-platform",
  65899. // "https://www.googleapis.com/auth/compute"
  65900. // ]
  65901. // }
  65902. }
  65903. // method id "compute.instances.detachDisk":
  65904. type InstancesDetachDiskCall struct {
  65905. s *Service
  65906. project string
  65907. zone string
  65908. instance string
  65909. urlParams_ gensupport.URLParams
  65910. ctx_ context.Context
  65911. header_ http.Header
  65912. }
  65913. // DetachDisk: Detaches a disk from an instance.
  65914. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  65915. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  65916. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65917. c.project = project
  65918. c.zone = zone
  65919. c.instance = instance
  65920. c.urlParams_.Set("deviceName", deviceName)
  65921. return c
  65922. }
  65923. // RequestId sets the optional parameter "requestId": An optional
  65924. // request ID to identify requests. Specify a unique request ID so that
  65925. // if you must retry your request, the server will know to ignore the
  65926. // request if it has already been completed.
  65927. //
  65928. // For example, consider a situation where you make an initial request
  65929. // and the request times out. If you make the request again with the
  65930. // same request ID, the server can check if original operation with the
  65931. // same request ID was received, and if so, will ignore the second
  65932. // request. This prevents clients from accidentally creating duplicate
  65933. // commitments.
  65934. //
  65935. // The request ID must be a valid UUID with the exception that zero UUID
  65936. // is not supported (00000000-0000-0000-0000-000000000000).
  65937. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  65938. c.urlParams_.Set("requestId", requestId)
  65939. return c
  65940. }
  65941. // Fields allows partial responses to be retrieved. See
  65942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65943. // for more information.
  65944. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  65945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65946. return c
  65947. }
  65948. // Context sets the context to be used in this call's Do method. Any
  65949. // pending HTTP request will be aborted if the provided context is
  65950. // canceled.
  65951. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  65952. c.ctx_ = ctx
  65953. return c
  65954. }
  65955. // Header returns an http.Header that can be modified by the caller to
  65956. // add HTTP headers to the request.
  65957. func (c *InstancesDetachDiskCall) Header() http.Header {
  65958. if c.header_ == nil {
  65959. c.header_ = make(http.Header)
  65960. }
  65961. return c.header_
  65962. }
  65963. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  65964. reqHeaders := make(http.Header)
  65965. for k, v := range c.header_ {
  65966. reqHeaders[k] = v
  65967. }
  65968. reqHeaders.Set("User-Agent", c.s.userAgent())
  65969. var body io.Reader = nil
  65970. c.urlParams_.Set("alt", alt)
  65971. c.urlParams_.Set("prettyPrint", "false")
  65972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  65973. urls += "?" + c.urlParams_.Encode()
  65974. req, err := http.NewRequest("POST", urls, body)
  65975. if err != nil {
  65976. return nil, err
  65977. }
  65978. req.Header = reqHeaders
  65979. googleapi.Expand(req.URL, map[string]string{
  65980. "project": c.project,
  65981. "zone": c.zone,
  65982. "instance": c.instance,
  65983. })
  65984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65985. }
  65986. // Do executes the "compute.instances.detachDisk" call.
  65987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65988. // status code is an error. Response headers are in either
  65989. // *Operation.ServerResponse.Header or (if a response was returned at
  65990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65991. // to check whether the returned error was because
  65992. // http.StatusNotModified was returned.
  65993. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65994. gensupport.SetOptions(c.urlParams_, opts...)
  65995. res, err := c.doRequest("json")
  65996. if res != nil && res.StatusCode == http.StatusNotModified {
  65997. if res.Body != nil {
  65998. res.Body.Close()
  65999. }
  66000. return nil, &googleapi.Error{
  66001. Code: res.StatusCode,
  66002. Header: res.Header,
  66003. }
  66004. }
  66005. if err != nil {
  66006. return nil, err
  66007. }
  66008. defer googleapi.CloseBody(res)
  66009. if err := googleapi.CheckResponse(res); err != nil {
  66010. return nil, err
  66011. }
  66012. ret := &Operation{
  66013. ServerResponse: googleapi.ServerResponse{
  66014. Header: res.Header,
  66015. HTTPStatusCode: res.StatusCode,
  66016. },
  66017. }
  66018. target := &ret
  66019. if err := gensupport.DecodeResponse(target, res); err != nil {
  66020. return nil, err
  66021. }
  66022. return ret, nil
  66023. // {
  66024. // "description": "Detaches a disk from an instance.",
  66025. // "httpMethod": "POST",
  66026. // "id": "compute.instances.detachDisk",
  66027. // "parameterOrder": [
  66028. // "project",
  66029. // "zone",
  66030. // "instance",
  66031. // "deviceName"
  66032. // ],
  66033. // "parameters": {
  66034. // "deviceName": {
  66035. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  66036. // "location": "query",
  66037. // "required": true,
  66038. // "type": "string"
  66039. // },
  66040. // "instance": {
  66041. // "description": "Instance name for this request.",
  66042. // "location": "path",
  66043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66044. // "required": true,
  66045. // "type": "string"
  66046. // },
  66047. // "project": {
  66048. // "description": "Project ID for this request.",
  66049. // "location": "path",
  66050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66051. // "required": true,
  66052. // "type": "string"
  66053. // },
  66054. // "requestId": {
  66055. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66056. // "location": "query",
  66057. // "type": "string"
  66058. // },
  66059. // "zone": {
  66060. // "description": "The name of the zone for this request.",
  66061. // "location": "path",
  66062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66063. // "required": true,
  66064. // "type": "string"
  66065. // }
  66066. // },
  66067. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  66068. // "response": {
  66069. // "$ref": "Operation"
  66070. // },
  66071. // "scopes": [
  66072. // "https://www.googleapis.com/auth/cloud-platform",
  66073. // "https://www.googleapis.com/auth/compute"
  66074. // ]
  66075. // }
  66076. }
  66077. // method id "compute.instances.get":
  66078. type InstancesGetCall struct {
  66079. s *Service
  66080. project string
  66081. zone string
  66082. instance string
  66083. urlParams_ gensupport.URLParams
  66084. ifNoneMatch_ string
  66085. ctx_ context.Context
  66086. header_ http.Header
  66087. }
  66088. // Get: Returns the specified Instance resource. Gets a list of
  66089. // available instances by making a list() request.
  66090. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  66091. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  66092. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66093. c.project = project
  66094. c.zone = zone
  66095. c.instance = instance
  66096. return c
  66097. }
  66098. // Fields allows partial responses to be retrieved. See
  66099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66100. // for more information.
  66101. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  66102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66103. return c
  66104. }
  66105. // IfNoneMatch sets the optional parameter which makes the operation
  66106. // fail if the object's ETag matches the given value. This is useful for
  66107. // getting updates only after the object has changed since the last
  66108. // request. Use googleapi.IsNotModified to check whether the response
  66109. // error from Do is the result of In-None-Match.
  66110. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  66111. c.ifNoneMatch_ = entityTag
  66112. return c
  66113. }
  66114. // Context sets the context to be used in this call's Do method. Any
  66115. // pending HTTP request will be aborted if the provided context is
  66116. // canceled.
  66117. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  66118. c.ctx_ = ctx
  66119. return c
  66120. }
  66121. // Header returns an http.Header that can be modified by the caller to
  66122. // add HTTP headers to the request.
  66123. func (c *InstancesGetCall) Header() http.Header {
  66124. if c.header_ == nil {
  66125. c.header_ = make(http.Header)
  66126. }
  66127. return c.header_
  66128. }
  66129. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  66130. reqHeaders := make(http.Header)
  66131. for k, v := range c.header_ {
  66132. reqHeaders[k] = v
  66133. }
  66134. reqHeaders.Set("User-Agent", c.s.userAgent())
  66135. if c.ifNoneMatch_ != "" {
  66136. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66137. }
  66138. var body io.Reader = nil
  66139. c.urlParams_.Set("alt", alt)
  66140. c.urlParams_.Set("prettyPrint", "false")
  66141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  66142. urls += "?" + c.urlParams_.Encode()
  66143. req, err := http.NewRequest("GET", urls, body)
  66144. if err != nil {
  66145. return nil, err
  66146. }
  66147. req.Header = reqHeaders
  66148. googleapi.Expand(req.URL, map[string]string{
  66149. "project": c.project,
  66150. "zone": c.zone,
  66151. "instance": c.instance,
  66152. })
  66153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66154. }
  66155. // Do executes the "compute.instances.get" call.
  66156. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  66157. // code is an error. Response headers are in either
  66158. // *Instance.ServerResponse.Header or (if a response was returned at
  66159. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66160. // to check whether the returned error was because
  66161. // http.StatusNotModified was returned.
  66162. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  66163. gensupport.SetOptions(c.urlParams_, opts...)
  66164. res, err := c.doRequest("json")
  66165. if res != nil && res.StatusCode == http.StatusNotModified {
  66166. if res.Body != nil {
  66167. res.Body.Close()
  66168. }
  66169. return nil, &googleapi.Error{
  66170. Code: res.StatusCode,
  66171. Header: res.Header,
  66172. }
  66173. }
  66174. if err != nil {
  66175. return nil, err
  66176. }
  66177. defer googleapi.CloseBody(res)
  66178. if err := googleapi.CheckResponse(res); err != nil {
  66179. return nil, err
  66180. }
  66181. ret := &Instance{
  66182. ServerResponse: googleapi.ServerResponse{
  66183. Header: res.Header,
  66184. HTTPStatusCode: res.StatusCode,
  66185. },
  66186. }
  66187. target := &ret
  66188. if err := gensupport.DecodeResponse(target, res); err != nil {
  66189. return nil, err
  66190. }
  66191. return ret, nil
  66192. // {
  66193. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  66194. // "httpMethod": "GET",
  66195. // "id": "compute.instances.get",
  66196. // "parameterOrder": [
  66197. // "project",
  66198. // "zone",
  66199. // "instance"
  66200. // ],
  66201. // "parameters": {
  66202. // "instance": {
  66203. // "description": "Name of the instance resource to return.",
  66204. // "location": "path",
  66205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66206. // "required": true,
  66207. // "type": "string"
  66208. // },
  66209. // "project": {
  66210. // "description": "Project ID for this request.",
  66211. // "location": "path",
  66212. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66213. // "required": true,
  66214. // "type": "string"
  66215. // },
  66216. // "zone": {
  66217. // "description": "The name of the zone for this request.",
  66218. // "location": "path",
  66219. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66220. // "required": true,
  66221. // "type": "string"
  66222. // }
  66223. // },
  66224. // "path": "{project}/zones/{zone}/instances/{instance}",
  66225. // "response": {
  66226. // "$ref": "Instance"
  66227. // },
  66228. // "scopes": [
  66229. // "https://www.googleapis.com/auth/cloud-platform",
  66230. // "https://www.googleapis.com/auth/compute",
  66231. // "https://www.googleapis.com/auth/compute.readonly"
  66232. // ]
  66233. // }
  66234. }
  66235. // method id "compute.instances.getGuestAttributes":
  66236. type InstancesGetGuestAttributesCall struct {
  66237. s *Service
  66238. project string
  66239. zone string
  66240. instance string
  66241. urlParams_ gensupport.URLParams
  66242. ifNoneMatch_ string
  66243. ctx_ context.Context
  66244. header_ http.Header
  66245. }
  66246. // GetGuestAttributes: Returns the specified guest attributes entry.
  66247. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  66248. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66249. c.project = project
  66250. c.zone = zone
  66251. c.instance = instance
  66252. return c
  66253. }
  66254. // QueryPath sets the optional parameter "queryPath": Specifies the
  66255. // guest attributes path to be queried.
  66256. func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
  66257. c.urlParams_.Set("queryPath", queryPath)
  66258. return c
  66259. }
  66260. // VariableKey sets the optional parameter "variableKey": Specifies the
  66261. // key for the guest attributes entry.
  66262. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  66263. c.urlParams_.Set("variableKey", variableKey)
  66264. return c
  66265. }
  66266. // Fields allows partial responses to be retrieved. See
  66267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66268. // for more information.
  66269. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  66270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66271. return c
  66272. }
  66273. // IfNoneMatch sets the optional parameter which makes the operation
  66274. // fail if the object's ETag matches the given value. This is useful for
  66275. // getting updates only after the object has changed since the last
  66276. // request. Use googleapi.IsNotModified to check whether the response
  66277. // error from Do is the result of In-None-Match.
  66278. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  66279. c.ifNoneMatch_ = entityTag
  66280. return c
  66281. }
  66282. // Context sets the context to be used in this call's Do method. Any
  66283. // pending HTTP request will be aborted if the provided context is
  66284. // canceled.
  66285. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  66286. c.ctx_ = ctx
  66287. return c
  66288. }
  66289. // Header returns an http.Header that can be modified by the caller to
  66290. // add HTTP headers to the request.
  66291. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  66292. if c.header_ == nil {
  66293. c.header_ = make(http.Header)
  66294. }
  66295. return c.header_
  66296. }
  66297. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  66298. reqHeaders := make(http.Header)
  66299. for k, v := range c.header_ {
  66300. reqHeaders[k] = v
  66301. }
  66302. reqHeaders.Set("User-Agent", c.s.userAgent())
  66303. if c.ifNoneMatch_ != "" {
  66304. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66305. }
  66306. var body io.Reader = nil
  66307. c.urlParams_.Set("alt", alt)
  66308. c.urlParams_.Set("prettyPrint", "false")
  66309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  66310. urls += "?" + c.urlParams_.Encode()
  66311. req, err := http.NewRequest("GET", urls, body)
  66312. if err != nil {
  66313. return nil, err
  66314. }
  66315. req.Header = reqHeaders
  66316. googleapi.Expand(req.URL, map[string]string{
  66317. "project": c.project,
  66318. "zone": c.zone,
  66319. "instance": c.instance,
  66320. })
  66321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66322. }
  66323. // Do executes the "compute.instances.getGuestAttributes" call.
  66324. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  66325. // status code is an error. Response headers are in either
  66326. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  66327. // at all) in error.(*googleapi.Error).Header. Use
  66328. // googleapi.IsNotModified to check whether the returned error was
  66329. // because http.StatusNotModified was returned.
  66330. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  66331. gensupport.SetOptions(c.urlParams_, opts...)
  66332. res, err := c.doRequest("json")
  66333. if res != nil && res.StatusCode == http.StatusNotModified {
  66334. if res.Body != nil {
  66335. res.Body.Close()
  66336. }
  66337. return nil, &googleapi.Error{
  66338. Code: res.StatusCode,
  66339. Header: res.Header,
  66340. }
  66341. }
  66342. if err != nil {
  66343. return nil, err
  66344. }
  66345. defer googleapi.CloseBody(res)
  66346. if err := googleapi.CheckResponse(res); err != nil {
  66347. return nil, err
  66348. }
  66349. ret := &GuestAttributes{
  66350. ServerResponse: googleapi.ServerResponse{
  66351. Header: res.Header,
  66352. HTTPStatusCode: res.StatusCode,
  66353. },
  66354. }
  66355. target := &ret
  66356. if err := gensupport.DecodeResponse(target, res); err != nil {
  66357. return nil, err
  66358. }
  66359. return ret, nil
  66360. // {
  66361. // "description": "Returns the specified guest attributes entry.",
  66362. // "httpMethod": "GET",
  66363. // "id": "compute.instances.getGuestAttributes",
  66364. // "parameterOrder": [
  66365. // "project",
  66366. // "zone",
  66367. // "instance"
  66368. // ],
  66369. // "parameters": {
  66370. // "instance": {
  66371. // "description": "Name of the instance scoping this request.",
  66372. // "location": "path",
  66373. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66374. // "required": true,
  66375. // "type": "string"
  66376. // },
  66377. // "project": {
  66378. // "description": "Project ID for this request.",
  66379. // "location": "path",
  66380. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66381. // "required": true,
  66382. // "type": "string"
  66383. // },
  66384. // "queryPath": {
  66385. // "description": "Specifies the guest attributes path to be queried.",
  66386. // "location": "query",
  66387. // "type": "string"
  66388. // },
  66389. // "variableKey": {
  66390. // "description": "Specifies the key for the guest attributes entry.",
  66391. // "location": "query",
  66392. // "type": "string"
  66393. // },
  66394. // "zone": {
  66395. // "description": "The name of the zone for this request.",
  66396. // "location": "path",
  66397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66398. // "required": true,
  66399. // "type": "string"
  66400. // }
  66401. // },
  66402. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  66403. // "response": {
  66404. // "$ref": "GuestAttributes"
  66405. // },
  66406. // "scopes": [
  66407. // "https://www.googleapis.com/auth/cloud-platform",
  66408. // "https://www.googleapis.com/auth/compute",
  66409. // "https://www.googleapis.com/auth/compute.readonly"
  66410. // ]
  66411. // }
  66412. }
  66413. // method id "compute.instances.getIamPolicy":
  66414. type InstancesGetIamPolicyCall struct {
  66415. s *Service
  66416. project string
  66417. zone string
  66418. resource string
  66419. urlParams_ gensupport.URLParams
  66420. ifNoneMatch_ string
  66421. ctx_ context.Context
  66422. header_ http.Header
  66423. }
  66424. // GetIamPolicy: Gets the access control policy for a resource. May be
  66425. // empty if no such policy or resource exists.
  66426. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  66427. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66428. c.project = project
  66429. c.zone = zone
  66430. c.resource = resource
  66431. return c
  66432. }
  66433. // Fields allows partial responses to be retrieved. See
  66434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66435. // for more information.
  66436. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  66437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66438. return c
  66439. }
  66440. // IfNoneMatch sets the optional parameter which makes the operation
  66441. // fail if the object's ETag matches the given value. This is useful for
  66442. // getting updates only after the object has changed since the last
  66443. // request. Use googleapi.IsNotModified to check whether the response
  66444. // error from Do is the result of In-None-Match.
  66445. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  66446. c.ifNoneMatch_ = entityTag
  66447. return c
  66448. }
  66449. // Context sets the context to be used in this call's Do method. Any
  66450. // pending HTTP request will be aborted if the provided context is
  66451. // canceled.
  66452. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  66453. c.ctx_ = ctx
  66454. return c
  66455. }
  66456. // Header returns an http.Header that can be modified by the caller to
  66457. // add HTTP headers to the request.
  66458. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  66459. if c.header_ == nil {
  66460. c.header_ = make(http.Header)
  66461. }
  66462. return c.header_
  66463. }
  66464. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  66465. reqHeaders := make(http.Header)
  66466. for k, v := range c.header_ {
  66467. reqHeaders[k] = v
  66468. }
  66469. reqHeaders.Set("User-Agent", c.s.userAgent())
  66470. if c.ifNoneMatch_ != "" {
  66471. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66472. }
  66473. var body io.Reader = nil
  66474. c.urlParams_.Set("alt", alt)
  66475. c.urlParams_.Set("prettyPrint", "false")
  66476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  66477. urls += "?" + c.urlParams_.Encode()
  66478. req, err := http.NewRequest("GET", urls, body)
  66479. if err != nil {
  66480. return nil, err
  66481. }
  66482. req.Header = reqHeaders
  66483. googleapi.Expand(req.URL, map[string]string{
  66484. "project": c.project,
  66485. "zone": c.zone,
  66486. "resource": c.resource,
  66487. })
  66488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66489. }
  66490. // Do executes the "compute.instances.getIamPolicy" call.
  66491. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  66492. // code is an error. Response headers are in either
  66493. // *Policy.ServerResponse.Header or (if a response was returned at all)
  66494. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  66495. // check whether the returned error was because http.StatusNotModified
  66496. // was returned.
  66497. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  66498. gensupport.SetOptions(c.urlParams_, opts...)
  66499. res, err := c.doRequest("json")
  66500. if res != nil && res.StatusCode == http.StatusNotModified {
  66501. if res.Body != nil {
  66502. res.Body.Close()
  66503. }
  66504. return nil, &googleapi.Error{
  66505. Code: res.StatusCode,
  66506. Header: res.Header,
  66507. }
  66508. }
  66509. if err != nil {
  66510. return nil, err
  66511. }
  66512. defer googleapi.CloseBody(res)
  66513. if err := googleapi.CheckResponse(res); err != nil {
  66514. return nil, err
  66515. }
  66516. ret := &Policy{
  66517. ServerResponse: googleapi.ServerResponse{
  66518. Header: res.Header,
  66519. HTTPStatusCode: res.StatusCode,
  66520. },
  66521. }
  66522. target := &ret
  66523. if err := gensupport.DecodeResponse(target, res); err != nil {
  66524. return nil, err
  66525. }
  66526. return ret, nil
  66527. // {
  66528. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  66529. // "httpMethod": "GET",
  66530. // "id": "compute.instances.getIamPolicy",
  66531. // "parameterOrder": [
  66532. // "project",
  66533. // "zone",
  66534. // "resource"
  66535. // ],
  66536. // "parameters": {
  66537. // "project": {
  66538. // "description": "Project ID for this request.",
  66539. // "location": "path",
  66540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66541. // "required": true,
  66542. // "type": "string"
  66543. // },
  66544. // "resource": {
  66545. // "description": "Name or id of the resource for this request.",
  66546. // "location": "path",
  66547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66548. // "required": true,
  66549. // "type": "string"
  66550. // },
  66551. // "zone": {
  66552. // "description": "The name of the zone for this request.",
  66553. // "location": "path",
  66554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66555. // "required": true,
  66556. // "type": "string"
  66557. // }
  66558. // },
  66559. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  66560. // "response": {
  66561. // "$ref": "Policy"
  66562. // },
  66563. // "scopes": [
  66564. // "https://www.googleapis.com/auth/cloud-platform",
  66565. // "https://www.googleapis.com/auth/compute",
  66566. // "https://www.googleapis.com/auth/compute.readonly"
  66567. // ]
  66568. // }
  66569. }
  66570. // method id "compute.instances.getSerialPortOutput":
  66571. type InstancesGetSerialPortOutputCall struct {
  66572. s *Service
  66573. project string
  66574. zone string
  66575. instance string
  66576. urlParams_ gensupport.URLParams
  66577. ifNoneMatch_ string
  66578. ctx_ context.Context
  66579. header_ http.Header
  66580. }
  66581. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  66582. // the specified instance.
  66583. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  66584. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  66585. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66586. c.project = project
  66587. c.zone = zone
  66588. c.instance = instance
  66589. return c
  66590. }
  66591. // Port sets the optional parameter "port": Specifies which COM or
  66592. // serial port to retrieve data from.
  66593. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  66594. c.urlParams_.Set("port", fmt.Sprint(port))
  66595. return c
  66596. }
  66597. // Start sets the optional parameter "start": Returns output starting
  66598. // from a specific byte position. Use this to page through output when
  66599. // the output is too large to return in a single request. For the
  66600. // initial request, leave this field unspecified. For subsequent calls,
  66601. // this field should be set to the next value returned in the previous
  66602. // call.
  66603. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  66604. c.urlParams_.Set("start", fmt.Sprint(start))
  66605. return c
  66606. }
  66607. // Fields allows partial responses to be retrieved. See
  66608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66609. // for more information.
  66610. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  66611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66612. return c
  66613. }
  66614. // IfNoneMatch sets the optional parameter which makes the operation
  66615. // fail if the object's ETag matches the given value. This is useful for
  66616. // getting updates only after the object has changed since the last
  66617. // request. Use googleapi.IsNotModified to check whether the response
  66618. // error from Do is the result of In-None-Match.
  66619. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  66620. c.ifNoneMatch_ = entityTag
  66621. return c
  66622. }
  66623. // Context sets the context to be used in this call's Do method. Any
  66624. // pending HTTP request will be aborted if the provided context is
  66625. // canceled.
  66626. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  66627. c.ctx_ = ctx
  66628. return c
  66629. }
  66630. // Header returns an http.Header that can be modified by the caller to
  66631. // add HTTP headers to the request.
  66632. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  66633. if c.header_ == nil {
  66634. c.header_ = make(http.Header)
  66635. }
  66636. return c.header_
  66637. }
  66638. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  66639. reqHeaders := make(http.Header)
  66640. for k, v := range c.header_ {
  66641. reqHeaders[k] = v
  66642. }
  66643. reqHeaders.Set("User-Agent", c.s.userAgent())
  66644. if c.ifNoneMatch_ != "" {
  66645. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66646. }
  66647. var body io.Reader = nil
  66648. c.urlParams_.Set("alt", alt)
  66649. c.urlParams_.Set("prettyPrint", "false")
  66650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  66651. urls += "?" + c.urlParams_.Encode()
  66652. req, err := http.NewRequest("GET", urls, body)
  66653. if err != nil {
  66654. return nil, err
  66655. }
  66656. req.Header = reqHeaders
  66657. googleapi.Expand(req.URL, map[string]string{
  66658. "project": c.project,
  66659. "zone": c.zone,
  66660. "instance": c.instance,
  66661. })
  66662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66663. }
  66664. // Do executes the "compute.instances.getSerialPortOutput" call.
  66665. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  66666. // non-2xx status code is an error. Response headers are in either
  66667. // *SerialPortOutput.ServerResponse.Header or (if a response was
  66668. // returned at all) in error.(*googleapi.Error).Header. Use
  66669. // googleapi.IsNotModified to check whether the returned error was
  66670. // because http.StatusNotModified was returned.
  66671. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  66672. gensupport.SetOptions(c.urlParams_, opts...)
  66673. res, err := c.doRequest("json")
  66674. if res != nil && res.StatusCode == http.StatusNotModified {
  66675. if res.Body != nil {
  66676. res.Body.Close()
  66677. }
  66678. return nil, &googleapi.Error{
  66679. Code: res.StatusCode,
  66680. Header: res.Header,
  66681. }
  66682. }
  66683. if err != nil {
  66684. return nil, err
  66685. }
  66686. defer googleapi.CloseBody(res)
  66687. if err := googleapi.CheckResponse(res); err != nil {
  66688. return nil, err
  66689. }
  66690. ret := &SerialPortOutput{
  66691. ServerResponse: googleapi.ServerResponse{
  66692. Header: res.Header,
  66693. HTTPStatusCode: res.StatusCode,
  66694. },
  66695. }
  66696. target := &ret
  66697. if err := gensupport.DecodeResponse(target, res); err != nil {
  66698. return nil, err
  66699. }
  66700. return ret, nil
  66701. // {
  66702. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  66703. // "httpMethod": "GET",
  66704. // "id": "compute.instances.getSerialPortOutput",
  66705. // "parameterOrder": [
  66706. // "project",
  66707. // "zone",
  66708. // "instance"
  66709. // ],
  66710. // "parameters": {
  66711. // "instance": {
  66712. // "description": "Name of the instance scoping this request.",
  66713. // "location": "path",
  66714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66715. // "required": true,
  66716. // "type": "string"
  66717. // },
  66718. // "port": {
  66719. // "default": "1",
  66720. // "description": "Specifies which COM or serial port to retrieve data from.",
  66721. // "format": "int32",
  66722. // "location": "query",
  66723. // "maximum": "4",
  66724. // "minimum": "1",
  66725. // "type": "integer"
  66726. // },
  66727. // "project": {
  66728. // "description": "Project ID for this request.",
  66729. // "location": "path",
  66730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66731. // "required": true,
  66732. // "type": "string"
  66733. // },
  66734. // "start": {
  66735. // "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.",
  66736. // "format": "int64",
  66737. // "location": "query",
  66738. // "type": "string"
  66739. // },
  66740. // "zone": {
  66741. // "description": "The name of the zone for this request.",
  66742. // "location": "path",
  66743. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66744. // "required": true,
  66745. // "type": "string"
  66746. // }
  66747. // },
  66748. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  66749. // "response": {
  66750. // "$ref": "SerialPortOutput"
  66751. // },
  66752. // "scopes": [
  66753. // "https://www.googleapis.com/auth/cloud-platform",
  66754. // "https://www.googleapis.com/auth/compute",
  66755. // "https://www.googleapis.com/auth/compute.readonly"
  66756. // ]
  66757. // }
  66758. }
  66759. // method id "compute.instances.getShieldedVmIdentity":
  66760. type InstancesGetShieldedVmIdentityCall struct {
  66761. s *Service
  66762. project string
  66763. zone string
  66764. instance string
  66765. urlParams_ gensupport.URLParams
  66766. ifNoneMatch_ string
  66767. ctx_ context.Context
  66768. header_ http.Header
  66769. }
  66770. // GetShieldedVmIdentity: Returns the Shielded VM Identity of an
  66771. // instance
  66772. func (r *InstancesService) GetShieldedVmIdentity(project string, zone string, instance string) *InstancesGetShieldedVmIdentityCall {
  66773. c := &InstancesGetShieldedVmIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66774. c.project = project
  66775. c.zone = zone
  66776. c.instance = instance
  66777. return c
  66778. }
  66779. // Fields allows partial responses to be retrieved. See
  66780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66781. // for more information.
  66782. func (c *InstancesGetShieldedVmIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedVmIdentityCall {
  66783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66784. return c
  66785. }
  66786. // IfNoneMatch sets the optional parameter which makes the operation
  66787. // fail if the object's ETag matches the given value. This is useful for
  66788. // getting updates only after the object has changed since the last
  66789. // request. Use googleapi.IsNotModified to check whether the response
  66790. // error from Do is the result of In-None-Match.
  66791. func (c *InstancesGetShieldedVmIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedVmIdentityCall {
  66792. c.ifNoneMatch_ = entityTag
  66793. return c
  66794. }
  66795. // Context sets the context to be used in this call's Do method. Any
  66796. // pending HTTP request will be aborted if the provided context is
  66797. // canceled.
  66798. func (c *InstancesGetShieldedVmIdentityCall) Context(ctx context.Context) *InstancesGetShieldedVmIdentityCall {
  66799. c.ctx_ = ctx
  66800. return c
  66801. }
  66802. // Header returns an http.Header that can be modified by the caller to
  66803. // add HTTP headers to the request.
  66804. func (c *InstancesGetShieldedVmIdentityCall) Header() http.Header {
  66805. if c.header_ == nil {
  66806. c.header_ = make(http.Header)
  66807. }
  66808. return c.header_
  66809. }
  66810. func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Response, error) {
  66811. reqHeaders := make(http.Header)
  66812. for k, v := range c.header_ {
  66813. reqHeaders[k] = v
  66814. }
  66815. reqHeaders.Set("User-Agent", c.s.userAgent())
  66816. if c.ifNoneMatch_ != "" {
  66817. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66818. }
  66819. var body io.Reader = nil
  66820. c.urlParams_.Set("alt", alt)
  66821. c.urlParams_.Set("prettyPrint", "false")
  66822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity")
  66823. urls += "?" + c.urlParams_.Encode()
  66824. req, err := http.NewRequest("GET", urls, body)
  66825. if err != nil {
  66826. return nil, err
  66827. }
  66828. req.Header = reqHeaders
  66829. googleapi.Expand(req.URL, map[string]string{
  66830. "project": c.project,
  66831. "zone": c.zone,
  66832. "instance": c.instance,
  66833. })
  66834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66835. }
  66836. // Do executes the "compute.instances.getShieldedVmIdentity" call.
  66837. // Exactly one of *ShieldedVmIdentity or error will be non-nil. Any
  66838. // non-2xx status code is an error. Response headers are in either
  66839. // *ShieldedVmIdentity.ServerResponse.Header or (if a response was
  66840. // returned at all) in error.(*googleapi.Error).Header. Use
  66841. // googleapi.IsNotModified to check whether the returned error was
  66842. // because http.StatusNotModified was returned.
  66843. func (c *InstancesGetShieldedVmIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedVmIdentity, error) {
  66844. gensupport.SetOptions(c.urlParams_, opts...)
  66845. res, err := c.doRequest("json")
  66846. if res != nil && res.StatusCode == http.StatusNotModified {
  66847. if res.Body != nil {
  66848. res.Body.Close()
  66849. }
  66850. return nil, &googleapi.Error{
  66851. Code: res.StatusCode,
  66852. Header: res.Header,
  66853. }
  66854. }
  66855. if err != nil {
  66856. return nil, err
  66857. }
  66858. defer googleapi.CloseBody(res)
  66859. if err := googleapi.CheckResponse(res); err != nil {
  66860. return nil, err
  66861. }
  66862. ret := &ShieldedVmIdentity{
  66863. ServerResponse: googleapi.ServerResponse{
  66864. Header: res.Header,
  66865. HTTPStatusCode: res.StatusCode,
  66866. },
  66867. }
  66868. target := &ret
  66869. if err := gensupport.DecodeResponse(target, res); err != nil {
  66870. return nil, err
  66871. }
  66872. return ret, nil
  66873. // {
  66874. // "description": "Returns the Shielded VM Identity of an instance",
  66875. // "httpMethod": "GET",
  66876. // "id": "compute.instances.getShieldedVmIdentity",
  66877. // "parameterOrder": [
  66878. // "project",
  66879. // "zone",
  66880. // "instance"
  66881. // ],
  66882. // "parameters": {
  66883. // "instance": {
  66884. // "description": "Name of the instance scoping this request.",
  66885. // "location": "path",
  66886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66887. // "required": true,
  66888. // "type": "string"
  66889. // },
  66890. // "project": {
  66891. // "description": "Project ID for this request.",
  66892. // "location": "path",
  66893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66894. // "required": true,
  66895. // "type": "string"
  66896. // },
  66897. // "zone": {
  66898. // "description": "The name of the zone for this request.",
  66899. // "location": "path",
  66900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66901. // "required": true,
  66902. // "type": "string"
  66903. // }
  66904. // },
  66905. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity",
  66906. // "response": {
  66907. // "$ref": "ShieldedVmIdentity"
  66908. // },
  66909. // "scopes": [
  66910. // "https://www.googleapis.com/auth/cloud-platform",
  66911. // "https://www.googleapis.com/auth/compute",
  66912. // "https://www.googleapis.com/auth/compute.readonly"
  66913. // ]
  66914. // }
  66915. }
  66916. // method id "compute.instances.insert":
  66917. type InstancesInsertCall struct {
  66918. s *Service
  66919. project string
  66920. zone string
  66921. instance *Instance
  66922. urlParams_ gensupport.URLParams
  66923. ctx_ context.Context
  66924. header_ http.Header
  66925. }
  66926. // Insert: Creates an instance resource in the specified project using
  66927. // the data included in the request.
  66928. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  66929. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  66930. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66931. c.project = project
  66932. c.zone = zone
  66933. c.instance = instance
  66934. return c
  66935. }
  66936. // RequestId sets the optional parameter "requestId": An optional
  66937. // request ID to identify requests. Specify a unique request ID so that
  66938. // if you must retry your request, the server will know to ignore the
  66939. // request if it has already been completed.
  66940. //
  66941. // For example, consider a situation where you make an initial request
  66942. // and the request times out. If you make the request again with the
  66943. // same request ID, the server can check if original operation with the
  66944. // same request ID was received, and if so, will ignore the second
  66945. // request. This prevents clients from accidentally creating duplicate
  66946. // commitments.
  66947. //
  66948. // The request ID must be a valid UUID with the exception that zero UUID
  66949. // is not supported (00000000-0000-0000-0000-000000000000).
  66950. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  66951. c.urlParams_.Set("requestId", requestId)
  66952. return c
  66953. }
  66954. // SourceInstanceTemplate sets the optional parameter
  66955. // "sourceInstanceTemplate": Specifies instance template to create the
  66956. // instance.
  66957. //
  66958. // This field is optional. It can be a full or partial URL. For example,
  66959. // the following are all valid URLs to an instance template:
  66960. // -
  66961. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  66962. // - projects/project/global/instanceTemplates/instanceTemplate
  66963. // - global/instanceTemplates/instanceTemplate
  66964. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  66965. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  66966. return c
  66967. }
  66968. // SourceMachineImage sets the optional parameter "sourceMachineImage":
  66969. // Specifies instance machine to create the instance.
  66970. //
  66971. // This field is optional. It can be a full or partial URL. For example,
  66972. // the following are all valid URLs to an instance template:
  66973. // -
  66974. // https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage
  66975. // - projects/project/global/global/machineImages/machineImage
  66976. // - global/machineImages/machineImage
  66977. func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall {
  66978. c.urlParams_.Set("sourceMachineImage", sourceMachineImage)
  66979. return c
  66980. }
  66981. // Fields allows partial responses to be retrieved. See
  66982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66983. // for more information.
  66984. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  66985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66986. return c
  66987. }
  66988. // Context sets the context to be used in this call's Do method. Any
  66989. // pending HTTP request will be aborted if the provided context is
  66990. // canceled.
  66991. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  66992. c.ctx_ = ctx
  66993. return c
  66994. }
  66995. // Header returns an http.Header that can be modified by the caller to
  66996. // add HTTP headers to the request.
  66997. func (c *InstancesInsertCall) Header() http.Header {
  66998. if c.header_ == nil {
  66999. c.header_ = make(http.Header)
  67000. }
  67001. return c.header_
  67002. }
  67003. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  67004. reqHeaders := make(http.Header)
  67005. for k, v := range c.header_ {
  67006. reqHeaders[k] = v
  67007. }
  67008. reqHeaders.Set("User-Agent", c.s.userAgent())
  67009. var body io.Reader = nil
  67010. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  67011. if err != nil {
  67012. return nil, err
  67013. }
  67014. reqHeaders.Set("Content-Type", "application/json")
  67015. c.urlParams_.Set("alt", alt)
  67016. c.urlParams_.Set("prettyPrint", "false")
  67017. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  67018. urls += "?" + c.urlParams_.Encode()
  67019. req, err := http.NewRequest("POST", urls, body)
  67020. if err != nil {
  67021. return nil, err
  67022. }
  67023. req.Header = reqHeaders
  67024. googleapi.Expand(req.URL, map[string]string{
  67025. "project": c.project,
  67026. "zone": c.zone,
  67027. })
  67028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67029. }
  67030. // Do executes the "compute.instances.insert" call.
  67031. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67032. // status code is an error. Response headers are in either
  67033. // *Operation.ServerResponse.Header or (if a response was returned at
  67034. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67035. // to check whether the returned error was because
  67036. // http.StatusNotModified was returned.
  67037. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67038. gensupport.SetOptions(c.urlParams_, opts...)
  67039. res, err := c.doRequest("json")
  67040. if res != nil && res.StatusCode == http.StatusNotModified {
  67041. if res.Body != nil {
  67042. res.Body.Close()
  67043. }
  67044. return nil, &googleapi.Error{
  67045. Code: res.StatusCode,
  67046. Header: res.Header,
  67047. }
  67048. }
  67049. if err != nil {
  67050. return nil, err
  67051. }
  67052. defer googleapi.CloseBody(res)
  67053. if err := googleapi.CheckResponse(res); err != nil {
  67054. return nil, err
  67055. }
  67056. ret := &Operation{
  67057. ServerResponse: googleapi.ServerResponse{
  67058. Header: res.Header,
  67059. HTTPStatusCode: res.StatusCode,
  67060. },
  67061. }
  67062. target := &ret
  67063. if err := gensupport.DecodeResponse(target, res); err != nil {
  67064. return nil, err
  67065. }
  67066. return ret, nil
  67067. // {
  67068. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  67069. // "httpMethod": "POST",
  67070. // "id": "compute.instances.insert",
  67071. // "parameterOrder": [
  67072. // "project",
  67073. // "zone"
  67074. // ],
  67075. // "parameters": {
  67076. // "project": {
  67077. // "description": "Project ID for this request.",
  67078. // "location": "path",
  67079. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67080. // "required": true,
  67081. // "type": "string"
  67082. // },
  67083. // "requestId": {
  67084. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67085. // "location": "query",
  67086. // "type": "string"
  67087. // },
  67088. // "sourceInstanceTemplate": {
  67089. // "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",
  67090. // "location": "query",
  67091. // "type": "string"
  67092. // },
  67093. // "sourceMachineImage": {
  67094. // "description": "Specifies instance machine 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/global/machineImages/machineImage \n- projects/project/global/global/machineImages/machineImage \n- global/machineImages/machineImage",
  67095. // "location": "query",
  67096. // "type": "string"
  67097. // },
  67098. // "zone": {
  67099. // "description": "The name of the zone for this request.",
  67100. // "location": "path",
  67101. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67102. // "required": true,
  67103. // "type": "string"
  67104. // }
  67105. // },
  67106. // "path": "{project}/zones/{zone}/instances",
  67107. // "request": {
  67108. // "$ref": "Instance"
  67109. // },
  67110. // "response": {
  67111. // "$ref": "Operation"
  67112. // },
  67113. // "scopes": [
  67114. // "https://www.googleapis.com/auth/cloud-platform",
  67115. // "https://www.googleapis.com/auth/compute"
  67116. // ]
  67117. // }
  67118. }
  67119. // method id "compute.instances.list":
  67120. type InstancesListCall struct {
  67121. s *Service
  67122. project string
  67123. zone string
  67124. urlParams_ gensupport.URLParams
  67125. ifNoneMatch_ string
  67126. ctx_ context.Context
  67127. header_ http.Header
  67128. }
  67129. // List: Retrieves the list of instances contained within the specified
  67130. // zone.
  67131. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  67132. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  67133. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67134. c.project = project
  67135. c.zone = zone
  67136. return c
  67137. }
  67138. // Filter sets the optional parameter "filter": A filter expression that
  67139. // filters resources listed in the response. The expression must specify
  67140. // the field name, a comparison operator, and the value that you want to
  67141. // use for filtering. The value must be a string, a number, or a
  67142. // boolean. The comparison operator must be either =, !=, >, or <.
  67143. //
  67144. // For example, if you are filtering Compute Engine instances, you can
  67145. // exclude instances named example-instance by specifying name !=
  67146. // example-instance.
  67147. //
  67148. // You can also filter nested fields. For example, you could specify
  67149. // scheduling.automaticRestart = false to include instances only if they
  67150. // are not scheduled for automatic restarts. You can use filtering on
  67151. // nested fields to filter based on resource labels.
  67152. //
  67153. // To filter on multiple expressions, provide each separate expression
  67154. // within parentheses. For example, (scheduling.automaticRestart = true)
  67155. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67156. // AND expression. However, you can include AND and OR expressions
  67157. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67158. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67159. // true).
  67160. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  67161. c.urlParams_.Set("filter", filter)
  67162. return c
  67163. }
  67164. // MaxResults sets the optional parameter "maxResults": The maximum
  67165. // number of results per page that should be returned. If the number of
  67166. // available results is larger than maxResults, Compute Engine returns a
  67167. // nextPageToken that can be used to get the next page of results in
  67168. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67169. // (Default: 500)
  67170. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  67171. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67172. return c
  67173. }
  67174. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67175. // a certain order. By default, results are returned in alphanumerical
  67176. // order based on the resource name.
  67177. //
  67178. // You can also sort results in descending order based on the creation
  67179. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67180. // based on the creationTimestamp field in reverse chronological order
  67181. // (newest result first). Use this to sort resources like operations so
  67182. // that the newest operation is returned first.
  67183. //
  67184. // Currently, only sorting by name or creationTimestamp desc is
  67185. // supported.
  67186. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  67187. c.urlParams_.Set("orderBy", orderBy)
  67188. return c
  67189. }
  67190. // PageToken sets the optional parameter "pageToken": Specifies a page
  67191. // token to use. Set pageToken to the nextPageToken returned by a
  67192. // previous list request to get the next page of results.
  67193. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  67194. c.urlParams_.Set("pageToken", pageToken)
  67195. return c
  67196. }
  67197. // Fields allows partial responses to be retrieved. See
  67198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67199. // for more information.
  67200. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  67201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67202. return c
  67203. }
  67204. // IfNoneMatch sets the optional parameter which makes the operation
  67205. // fail if the object's ETag matches the given value. This is useful for
  67206. // getting updates only after the object has changed since the last
  67207. // request. Use googleapi.IsNotModified to check whether the response
  67208. // error from Do is the result of In-None-Match.
  67209. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  67210. c.ifNoneMatch_ = entityTag
  67211. return c
  67212. }
  67213. // Context sets the context to be used in this call's Do method. Any
  67214. // pending HTTP request will be aborted if the provided context is
  67215. // canceled.
  67216. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  67217. c.ctx_ = ctx
  67218. return c
  67219. }
  67220. // Header returns an http.Header that can be modified by the caller to
  67221. // add HTTP headers to the request.
  67222. func (c *InstancesListCall) Header() http.Header {
  67223. if c.header_ == nil {
  67224. c.header_ = make(http.Header)
  67225. }
  67226. return c.header_
  67227. }
  67228. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  67229. reqHeaders := make(http.Header)
  67230. for k, v := range c.header_ {
  67231. reqHeaders[k] = v
  67232. }
  67233. reqHeaders.Set("User-Agent", c.s.userAgent())
  67234. if c.ifNoneMatch_ != "" {
  67235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67236. }
  67237. var body io.Reader = nil
  67238. c.urlParams_.Set("alt", alt)
  67239. c.urlParams_.Set("prettyPrint", "false")
  67240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  67241. urls += "?" + c.urlParams_.Encode()
  67242. req, err := http.NewRequest("GET", urls, body)
  67243. if err != nil {
  67244. return nil, err
  67245. }
  67246. req.Header = reqHeaders
  67247. googleapi.Expand(req.URL, map[string]string{
  67248. "project": c.project,
  67249. "zone": c.zone,
  67250. })
  67251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67252. }
  67253. // Do executes the "compute.instances.list" call.
  67254. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  67255. // status code is an error. Response headers are in either
  67256. // *InstanceList.ServerResponse.Header or (if a response was returned at
  67257. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67258. // to check whether the returned error was because
  67259. // http.StatusNotModified was returned.
  67260. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  67261. gensupport.SetOptions(c.urlParams_, opts...)
  67262. res, err := c.doRequest("json")
  67263. if res != nil && res.StatusCode == http.StatusNotModified {
  67264. if res.Body != nil {
  67265. res.Body.Close()
  67266. }
  67267. return nil, &googleapi.Error{
  67268. Code: res.StatusCode,
  67269. Header: res.Header,
  67270. }
  67271. }
  67272. if err != nil {
  67273. return nil, err
  67274. }
  67275. defer googleapi.CloseBody(res)
  67276. if err := googleapi.CheckResponse(res); err != nil {
  67277. return nil, err
  67278. }
  67279. ret := &InstanceList{
  67280. ServerResponse: googleapi.ServerResponse{
  67281. Header: res.Header,
  67282. HTTPStatusCode: res.StatusCode,
  67283. },
  67284. }
  67285. target := &ret
  67286. if err := gensupport.DecodeResponse(target, res); err != nil {
  67287. return nil, err
  67288. }
  67289. return ret, nil
  67290. // {
  67291. // "description": "Retrieves the list of instances contained within the specified zone.",
  67292. // "httpMethod": "GET",
  67293. // "id": "compute.instances.list",
  67294. // "parameterOrder": [
  67295. // "project",
  67296. // "zone"
  67297. // ],
  67298. // "parameters": {
  67299. // "filter": {
  67300. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67301. // "location": "query",
  67302. // "type": "string"
  67303. // },
  67304. // "maxResults": {
  67305. // "default": "500",
  67306. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67307. // "format": "uint32",
  67308. // "location": "query",
  67309. // "minimum": "0",
  67310. // "type": "integer"
  67311. // },
  67312. // "orderBy": {
  67313. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67314. // "location": "query",
  67315. // "type": "string"
  67316. // },
  67317. // "pageToken": {
  67318. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67319. // "location": "query",
  67320. // "type": "string"
  67321. // },
  67322. // "project": {
  67323. // "description": "Project ID for this request.",
  67324. // "location": "path",
  67325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67326. // "required": true,
  67327. // "type": "string"
  67328. // },
  67329. // "zone": {
  67330. // "description": "The name of the zone for this request.",
  67331. // "location": "path",
  67332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67333. // "required": true,
  67334. // "type": "string"
  67335. // }
  67336. // },
  67337. // "path": "{project}/zones/{zone}/instances",
  67338. // "response": {
  67339. // "$ref": "InstanceList"
  67340. // },
  67341. // "scopes": [
  67342. // "https://www.googleapis.com/auth/cloud-platform",
  67343. // "https://www.googleapis.com/auth/compute",
  67344. // "https://www.googleapis.com/auth/compute.readonly"
  67345. // ]
  67346. // }
  67347. }
  67348. // Pages invokes f for each page of results.
  67349. // A non-nil error returned from f will halt the iteration.
  67350. // The provided context supersedes any context provided to the Context method.
  67351. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  67352. c.ctx_ = ctx
  67353. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67354. for {
  67355. x, err := c.Do()
  67356. if err != nil {
  67357. return err
  67358. }
  67359. if err := f(x); err != nil {
  67360. return err
  67361. }
  67362. if x.NextPageToken == "" {
  67363. return nil
  67364. }
  67365. c.PageToken(x.NextPageToken)
  67366. }
  67367. }
  67368. // method id "compute.instances.listReferrers":
  67369. type InstancesListReferrersCall struct {
  67370. s *Service
  67371. project string
  67372. zone string
  67373. instance string
  67374. urlParams_ gensupport.URLParams
  67375. ifNoneMatch_ string
  67376. ctx_ context.Context
  67377. header_ http.Header
  67378. }
  67379. // ListReferrers: Retrieves the list of referrers to instances contained
  67380. // within the specified zone. For more information, read Viewing
  67381. // Referrers to VM Instances.
  67382. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  67383. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67384. c.project = project
  67385. c.zone = zone
  67386. c.instance = instance
  67387. return c
  67388. }
  67389. // Filter sets the optional parameter "filter": A filter expression that
  67390. // filters resources listed in the response. The expression must specify
  67391. // the field name, a comparison operator, and the value that you want to
  67392. // use for filtering. The value must be a string, a number, or a
  67393. // boolean. The comparison operator must be either =, !=, >, or <.
  67394. //
  67395. // For example, if you are filtering Compute Engine instances, you can
  67396. // exclude instances named example-instance by specifying name !=
  67397. // example-instance.
  67398. //
  67399. // You can also filter nested fields. For example, you could specify
  67400. // scheduling.automaticRestart = false to include instances only if they
  67401. // are not scheduled for automatic restarts. You can use filtering on
  67402. // nested fields to filter based on resource labels.
  67403. //
  67404. // To filter on multiple expressions, provide each separate expression
  67405. // within parentheses. For example, (scheduling.automaticRestart = true)
  67406. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67407. // AND expression. However, you can include AND and OR expressions
  67408. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67409. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67410. // true).
  67411. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  67412. c.urlParams_.Set("filter", filter)
  67413. return c
  67414. }
  67415. // MaxResults sets the optional parameter "maxResults": The maximum
  67416. // number of results per page that should be returned. If the number of
  67417. // available results is larger than maxResults, Compute Engine returns a
  67418. // nextPageToken that can be used to get the next page of results in
  67419. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67420. // (Default: 500)
  67421. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  67422. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67423. return c
  67424. }
  67425. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67426. // a certain order. By default, results are returned in alphanumerical
  67427. // order based on the resource name.
  67428. //
  67429. // You can also sort results in descending order based on the creation
  67430. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67431. // based on the creationTimestamp field in reverse chronological order
  67432. // (newest result first). Use this to sort resources like operations so
  67433. // that the newest operation is returned first.
  67434. //
  67435. // Currently, only sorting by name or creationTimestamp desc is
  67436. // supported.
  67437. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  67438. c.urlParams_.Set("orderBy", orderBy)
  67439. return c
  67440. }
  67441. // PageToken sets the optional parameter "pageToken": Specifies a page
  67442. // token to use. Set pageToken to the nextPageToken returned by a
  67443. // previous list request to get the next page of results.
  67444. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  67445. c.urlParams_.Set("pageToken", pageToken)
  67446. return c
  67447. }
  67448. // Fields allows partial responses to be retrieved. See
  67449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67450. // for more information.
  67451. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  67452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67453. return c
  67454. }
  67455. // IfNoneMatch sets the optional parameter which makes the operation
  67456. // fail if the object's ETag matches the given value. This is useful for
  67457. // getting updates only after the object has changed since the last
  67458. // request. Use googleapi.IsNotModified to check whether the response
  67459. // error from Do is the result of In-None-Match.
  67460. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  67461. c.ifNoneMatch_ = entityTag
  67462. return c
  67463. }
  67464. // Context sets the context to be used in this call's Do method. Any
  67465. // pending HTTP request will be aborted if the provided context is
  67466. // canceled.
  67467. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  67468. c.ctx_ = ctx
  67469. return c
  67470. }
  67471. // Header returns an http.Header that can be modified by the caller to
  67472. // add HTTP headers to the request.
  67473. func (c *InstancesListReferrersCall) Header() http.Header {
  67474. if c.header_ == nil {
  67475. c.header_ = make(http.Header)
  67476. }
  67477. return c.header_
  67478. }
  67479. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  67480. reqHeaders := make(http.Header)
  67481. for k, v := range c.header_ {
  67482. reqHeaders[k] = v
  67483. }
  67484. reqHeaders.Set("User-Agent", c.s.userAgent())
  67485. if c.ifNoneMatch_ != "" {
  67486. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67487. }
  67488. var body io.Reader = nil
  67489. c.urlParams_.Set("alt", alt)
  67490. c.urlParams_.Set("prettyPrint", "false")
  67491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  67492. urls += "?" + c.urlParams_.Encode()
  67493. req, err := http.NewRequest("GET", urls, body)
  67494. if err != nil {
  67495. return nil, err
  67496. }
  67497. req.Header = reqHeaders
  67498. googleapi.Expand(req.URL, map[string]string{
  67499. "project": c.project,
  67500. "zone": c.zone,
  67501. "instance": c.instance,
  67502. })
  67503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67504. }
  67505. // Do executes the "compute.instances.listReferrers" call.
  67506. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  67507. // non-2xx status code is an error. Response headers are in either
  67508. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  67509. // returned at all) in error.(*googleapi.Error).Header. Use
  67510. // googleapi.IsNotModified to check whether the returned error was
  67511. // because http.StatusNotModified was returned.
  67512. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  67513. gensupport.SetOptions(c.urlParams_, opts...)
  67514. res, err := c.doRequest("json")
  67515. if res != nil && res.StatusCode == http.StatusNotModified {
  67516. if res.Body != nil {
  67517. res.Body.Close()
  67518. }
  67519. return nil, &googleapi.Error{
  67520. Code: res.StatusCode,
  67521. Header: res.Header,
  67522. }
  67523. }
  67524. if err != nil {
  67525. return nil, err
  67526. }
  67527. defer googleapi.CloseBody(res)
  67528. if err := googleapi.CheckResponse(res); err != nil {
  67529. return nil, err
  67530. }
  67531. ret := &InstanceListReferrers{
  67532. ServerResponse: googleapi.ServerResponse{
  67533. Header: res.Header,
  67534. HTTPStatusCode: res.StatusCode,
  67535. },
  67536. }
  67537. target := &ret
  67538. if err := gensupport.DecodeResponse(target, res); err != nil {
  67539. return nil, err
  67540. }
  67541. return ret, nil
  67542. // {
  67543. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  67544. // "httpMethod": "GET",
  67545. // "id": "compute.instances.listReferrers",
  67546. // "parameterOrder": [
  67547. // "project",
  67548. // "zone",
  67549. // "instance"
  67550. // ],
  67551. // "parameters": {
  67552. // "filter": {
  67553. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67554. // "location": "query",
  67555. // "type": "string"
  67556. // },
  67557. // "instance": {
  67558. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  67559. // "location": "path",
  67560. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67561. // "required": true,
  67562. // "type": "string"
  67563. // },
  67564. // "maxResults": {
  67565. // "default": "500",
  67566. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67567. // "format": "uint32",
  67568. // "location": "query",
  67569. // "minimum": "0",
  67570. // "type": "integer"
  67571. // },
  67572. // "orderBy": {
  67573. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67574. // "location": "query",
  67575. // "type": "string"
  67576. // },
  67577. // "pageToken": {
  67578. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67579. // "location": "query",
  67580. // "type": "string"
  67581. // },
  67582. // "project": {
  67583. // "description": "Project ID for this request.",
  67584. // "location": "path",
  67585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67586. // "required": true,
  67587. // "type": "string"
  67588. // },
  67589. // "zone": {
  67590. // "description": "The name of the zone for this request.",
  67591. // "location": "path",
  67592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67593. // "required": true,
  67594. // "type": "string"
  67595. // }
  67596. // },
  67597. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  67598. // "response": {
  67599. // "$ref": "InstanceListReferrers"
  67600. // },
  67601. // "scopes": [
  67602. // "https://www.googleapis.com/auth/cloud-platform",
  67603. // "https://www.googleapis.com/auth/compute",
  67604. // "https://www.googleapis.com/auth/compute.readonly"
  67605. // ]
  67606. // }
  67607. }
  67608. // Pages invokes f for each page of results.
  67609. // A non-nil error returned from f will halt the iteration.
  67610. // The provided context supersedes any context provided to the Context method.
  67611. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  67612. c.ctx_ = ctx
  67613. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67614. for {
  67615. x, err := c.Do()
  67616. if err != nil {
  67617. return err
  67618. }
  67619. if err := f(x); err != nil {
  67620. return err
  67621. }
  67622. if x.NextPageToken == "" {
  67623. return nil
  67624. }
  67625. c.PageToken(x.NextPageToken)
  67626. }
  67627. }
  67628. // method id "compute.instances.removeResourcePolicies":
  67629. type InstancesRemoveResourcePoliciesCall struct {
  67630. s *Service
  67631. project string
  67632. zone string
  67633. instance string
  67634. instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest
  67635. urlParams_ gensupport.URLParams
  67636. ctx_ context.Context
  67637. header_ http.Header
  67638. }
  67639. // RemoveResourcePolicies: Removes resource policies from an instance.
  67640. func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall {
  67641. c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67642. c.project = project
  67643. c.zone = zone
  67644. c.instance = instance
  67645. c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest
  67646. return c
  67647. }
  67648. // RequestId sets the optional parameter "requestId": An optional
  67649. // request ID to identify requests. Specify a unique request ID so that
  67650. // if you must retry your request, the server will know to ignore the
  67651. // request if it has already been completed.
  67652. //
  67653. // For example, consider a situation where you make an initial request
  67654. // and the request times out. If you make the request again with the
  67655. // same request ID, the server can check if original operation with the
  67656. // same request ID was received, and if so, will ignore the second
  67657. // request. This prevents clients from accidentally creating duplicate
  67658. // commitments.
  67659. //
  67660. // The request ID must be a valid UUID with the exception that zero UUID
  67661. // is not supported (00000000-0000-0000-0000-000000000000).
  67662. func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall {
  67663. c.urlParams_.Set("requestId", requestId)
  67664. return c
  67665. }
  67666. // Fields allows partial responses to be retrieved. See
  67667. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67668. // for more information.
  67669. func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall {
  67670. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67671. return c
  67672. }
  67673. // Context sets the context to be used in this call's Do method. Any
  67674. // pending HTTP request will be aborted if the provided context is
  67675. // canceled.
  67676. func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall {
  67677. c.ctx_ = ctx
  67678. return c
  67679. }
  67680. // Header returns an http.Header that can be modified by the caller to
  67681. // add HTTP headers to the request.
  67682. func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header {
  67683. if c.header_ == nil {
  67684. c.header_ = make(http.Header)
  67685. }
  67686. return c.header_
  67687. }
  67688. func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  67689. reqHeaders := make(http.Header)
  67690. for k, v := range c.header_ {
  67691. reqHeaders[k] = v
  67692. }
  67693. reqHeaders.Set("User-Agent", c.s.userAgent())
  67694. var body io.Reader = nil
  67695. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest)
  67696. if err != nil {
  67697. return nil, err
  67698. }
  67699. reqHeaders.Set("Content-Type", "application/json")
  67700. c.urlParams_.Set("alt", alt)
  67701. c.urlParams_.Set("prettyPrint", "false")
  67702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies")
  67703. urls += "?" + c.urlParams_.Encode()
  67704. req, err := http.NewRequest("POST", urls, body)
  67705. if err != nil {
  67706. return nil, err
  67707. }
  67708. req.Header = reqHeaders
  67709. googleapi.Expand(req.URL, map[string]string{
  67710. "project": c.project,
  67711. "zone": c.zone,
  67712. "instance": c.instance,
  67713. })
  67714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67715. }
  67716. // Do executes the "compute.instances.removeResourcePolicies" call.
  67717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67718. // status code is an error. Response headers are in either
  67719. // *Operation.ServerResponse.Header or (if a response was returned at
  67720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67721. // to check whether the returned error was because
  67722. // http.StatusNotModified was returned.
  67723. func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67724. gensupport.SetOptions(c.urlParams_, opts...)
  67725. res, err := c.doRequest("json")
  67726. if res != nil && res.StatusCode == http.StatusNotModified {
  67727. if res.Body != nil {
  67728. res.Body.Close()
  67729. }
  67730. return nil, &googleapi.Error{
  67731. Code: res.StatusCode,
  67732. Header: res.Header,
  67733. }
  67734. }
  67735. if err != nil {
  67736. return nil, err
  67737. }
  67738. defer googleapi.CloseBody(res)
  67739. if err := googleapi.CheckResponse(res); err != nil {
  67740. return nil, err
  67741. }
  67742. ret := &Operation{
  67743. ServerResponse: googleapi.ServerResponse{
  67744. Header: res.Header,
  67745. HTTPStatusCode: res.StatusCode,
  67746. },
  67747. }
  67748. target := &ret
  67749. if err := gensupport.DecodeResponse(target, res); err != nil {
  67750. return nil, err
  67751. }
  67752. return ret, nil
  67753. // {
  67754. // "description": "Removes resource policies from an instance.",
  67755. // "httpMethod": "POST",
  67756. // "id": "compute.instances.removeResourcePolicies",
  67757. // "parameterOrder": [
  67758. // "project",
  67759. // "zone",
  67760. // "instance"
  67761. // ],
  67762. // "parameters": {
  67763. // "instance": {
  67764. // "description": "The instance name for this request.",
  67765. // "location": "path",
  67766. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67767. // "required": true,
  67768. // "type": "string"
  67769. // },
  67770. // "project": {
  67771. // "description": "Project ID for this request.",
  67772. // "location": "path",
  67773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67774. // "required": true,
  67775. // "type": "string"
  67776. // },
  67777. // "requestId": {
  67778. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67779. // "location": "query",
  67780. // "type": "string"
  67781. // },
  67782. // "zone": {
  67783. // "description": "The name of the zone for this request.",
  67784. // "location": "path",
  67785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67786. // "required": true,
  67787. // "type": "string"
  67788. // }
  67789. // },
  67790. // "path": "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
  67791. // "request": {
  67792. // "$ref": "InstancesRemoveResourcePoliciesRequest"
  67793. // },
  67794. // "response": {
  67795. // "$ref": "Operation"
  67796. // },
  67797. // "scopes": [
  67798. // "https://www.googleapis.com/auth/cloud-platform",
  67799. // "https://www.googleapis.com/auth/compute"
  67800. // ]
  67801. // }
  67802. }
  67803. // method id "compute.instances.reset":
  67804. type InstancesResetCall struct {
  67805. s *Service
  67806. project string
  67807. zone string
  67808. instance string
  67809. urlParams_ gensupport.URLParams
  67810. ctx_ context.Context
  67811. header_ http.Header
  67812. }
  67813. // Reset: Performs a reset on the instance. For more information, see
  67814. // Resetting an instance.
  67815. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  67816. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  67817. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67818. c.project = project
  67819. c.zone = zone
  67820. c.instance = instance
  67821. return c
  67822. }
  67823. // RequestId sets the optional parameter "requestId": An optional
  67824. // request ID to identify requests. Specify a unique request ID so that
  67825. // if you must retry your request, the server will know to ignore the
  67826. // request if it has already been completed.
  67827. //
  67828. // For example, consider a situation where you make an initial request
  67829. // and the request times out. If you make the request again with the
  67830. // same request ID, the server can check if original operation with the
  67831. // same request ID was received, and if so, will ignore the second
  67832. // request. This prevents clients from accidentally creating duplicate
  67833. // commitments.
  67834. //
  67835. // The request ID must be a valid UUID with the exception that zero UUID
  67836. // is not supported (00000000-0000-0000-0000-000000000000).
  67837. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  67838. c.urlParams_.Set("requestId", requestId)
  67839. return c
  67840. }
  67841. // Fields allows partial responses to be retrieved. See
  67842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67843. // for more information.
  67844. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  67845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67846. return c
  67847. }
  67848. // Context sets the context to be used in this call's Do method. Any
  67849. // pending HTTP request will be aborted if the provided context is
  67850. // canceled.
  67851. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  67852. c.ctx_ = ctx
  67853. return c
  67854. }
  67855. // Header returns an http.Header that can be modified by the caller to
  67856. // add HTTP headers to the request.
  67857. func (c *InstancesResetCall) Header() http.Header {
  67858. if c.header_ == nil {
  67859. c.header_ = make(http.Header)
  67860. }
  67861. return c.header_
  67862. }
  67863. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  67864. reqHeaders := make(http.Header)
  67865. for k, v := range c.header_ {
  67866. reqHeaders[k] = v
  67867. }
  67868. reqHeaders.Set("User-Agent", c.s.userAgent())
  67869. var body io.Reader = nil
  67870. c.urlParams_.Set("alt", alt)
  67871. c.urlParams_.Set("prettyPrint", "false")
  67872. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  67873. urls += "?" + c.urlParams_.Encode()
  67874. req, err := http.NewRequest("POST", urls, body)
  67875. if err != nil {
  67876. return nil, err
  67877. }
  67878. req.Header = reqHeaders
  67879. googleapi.Expand(req.URL, map[string]string{
  67880. "project": c.project,
  67881. "zone": c.zone,
  67882. "instance": c.instance,
  67883. })
  67884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67885. }
  67886. // Do executes the "compute.instances.reset" call.
  67887. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67888. // status code is an error. Response headers are in either
  67889. // *Operation.ServerResponse.Header or (if a response was returned at
  67890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67891. // to check whether the returned error was because
  67892. // http.StatusNotModified was returned.
  67893. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67894. gensupport.SetOptions(c.urlParams_, opts...)
  67895. res, err := c.doRequest("json")
  67896. if res != nil && res.StatusCode == http.StatusNotModified {
  67897. if res.Body != nil {
  67898. res.Body.Close()
  67899. }
  67900. return nil, &googleapi.Error{
  67901. Code: res.StatusCode,
  67902. Header: res.Header,
  67903. }
  67904. }
  67905. if err != nil {
  67906. return nil, err
  67907. }
  67908. defer googleapi.CloseBody(res)
  67909. if err := googleapi.CheckResponse(res); err != nil {
  67910. return nil, err
  67911. }
  67912. ret := &Operation{
  67913. ServerResponse: googleapi.ServerResponse{
  67914. Header: res.Header,
  67915. HTTPStatusCode: res.StatusCode,
  67916. },
  67917. }
  67918. target := &ret
  67919. if err := gensupport.DecodeResponse(target, res); err != nil {
  67920. return nil, err
  67921. }
  67922. return ret, nil
  67923. // {
  67924. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  67925. // "httpMethod": "POST",
  67926. // "id": "compute.instances.reset",
  67927. // "parameterOrder": [
  67928. // "project",
  67929. // "zone",
  67930. // "instance"
  67931. // ],
  67932. // "parameters": {
  67933. // "instance": {
  67934. // "description": "Name of the instance scoping this request.",
  67935. // "location": "path",
  67936. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67937. // "required": true,
  67938. // "type": "string"
  67939. // },
  67940. // "project": {
  67941. // "description": "Project ID for this request.",
  67942. // "location": "path",
  67943. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67944. // "required": true,
  67945. // "type": "string"
  67946. // },
  67947. // "requestId": {
  67948. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67949. // "location": "query",
  67950. // "type": "string"
  67951. // },
  67952. // "zone": {
  67953. // "description": "The name of the zone for this request.",
  67954. // "location": "path",
  67955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67956. // "required": true,
  67957. // "type": "string"
  67958. // }
  67959. // },
  67960. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  67961. // "response": {
  67962. // "$ref": "Operation"
  67963. // },
  67964. // "scopes": [
  67965. // "https://www.googleapis.com/auth/cloud-platform",
  67966. // "https://www.googleapis.com/auth/compute"
  67967. // ]
  67968. // }
  67969. }
  67970. // method id "compute.instances.resume":
  67971. type InstancesResumeCall struct {
  67972. s *Service
  67973. project string
  67974. zone string
  67975. instance string
  67976. instancesresumerequest *InstancesResumeRequest
  67977. urlParams_ gensupport.URLParams
  67978. ctx_ context.Context
  67979. header_ http.Header
  67980. }
  67981. // Resume: Resumes an instance that was suspended using the
  67982. // instances().suspend method.
  67983. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  67984. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67985. c.project = project
  67986. c.zone = zone
  67987. c.instance = instance
  67988. c.instancesresumerequest = instancesresumerequest
  67989. return c
  67990. }
  67991. // RequestId sets the optional parameter "requestId": An optional
  67992. // request ID to identify requests. Specify a unique request ID so that
  67993. // if you must retry your request, the server will know to ignore the
  67994. // request if it has already been completed.
  67995. //
  67996. // For example, consider a situation where you make an initial request
  67997. // and the request times out. If you make the request again with the
  67998. // same request ID, the server can check if original operation with the
  67999. // same request ID was received, and if so, will ignore the second
  68000. // request. This prevents clients from accidentally creating duplicate
  68001. // commitments.
  68002. //
  68003. // The request ID must be a valid UUID with the exception that zero UUID
  68004. // is not supported (00000000-0000-0000-0000-000000000000).
  68005. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  68006. c.urlParams_.Set("requestId", requestId)
  68007. return c
  68008. }
  68009. // Fields allows partial responses to be retrieved. See
  68010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68011. // for more information.
  68012. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  68013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68014. return c
  68015. }
  68016. // Context sets the context to be used in this call's Do method. Any
  68017. // pending HTTP request will be aborted if the provided context is
  68018. // canceled.
  68019. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  68020. c.ctx_ = ctx
  68021. return c
  68022. }
  68023. // Header returns an http.Header that can be modified by the caller to
  68024. // add HTTP headers to the request.
  68025. func (c *InstancesResumeCall) Header() http.Header {
  68026. if c.header_ == nil {
  68027. c.header_ = make(http.Header)
  68028. }
  68029. return c.header_
  68030. }
  68031. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  68032. reqHeaders := make(http.Header)
  68033. for k, v := range c.header_ {
  68034. reqHeaders[k] = v
  68035. }
  68036. reqHeaders.Set("User-Agent", c.s.userAgent())
  68037. var body io.Reader = nil
  68038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  68039. if err != nil {
  68040. return nil, err
  68041. }
  68042. reqHeaders.Set("Content-Type", "application/json")
  68043. c.urlParams_.Set("alt", alt)
  68044. c.urlParams_.Set("prettyPrint", "false")
  68045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  68046. urls += "?" + c.urlParams_.Encode()
  68047. req, err := http.NewRequest("POST", urls, body)
  68048. if err != nil {
  68049. return nil, err
  68050. }
  68051. req.Header = reqHeaders
  68052. googleapi.Expand(req.URL, map[string]string{
  68053. "project": c.project,
  68054. "zone": c.zone,
  68055. "instance": c.instance,
  68056. })
  68057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68058. }
  68059. // Do executes the "compute.instances.resume" call.
  68060. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68061. // status code is an error. Response headers are in either
  68062. // *Operation.ServerResponse.Header or (if a response was returned at
  68063. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68064. // to check whether the returned error was because
  68065. // http.StatusNotModified was returned.
  68066. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68067. gensupport.SetOptions(c.urlParams_, opts...)
  68068. res, err := c.doRequest("json")
  68069. if res != nil && res.StatusCode == http.StatusNotModified {
  68070. if res.Body != nil {
  68071. res.Body.Close()
  68072. }
  68073. return nil, &googleapi.Error{
  68074. Code: res.StatusCode,
  68075. Header: res.Header,
  68076. }
  68077. }
  68078. if err != nil {
  68079. return nil, err
  68080. }
  68081. defer googleapi.CloseBody(res)
  68082. if err := googleapi.CheckResponse(res); err != nil {
  68083. return nil, err
  68084. }
  68085. ret := &Operation{
  68086. ServerResponse: googleapi.ServerResponse{
  68087. Header: res.Header,
  68088. HTTPStatusCode: res.StatusCode,
  68089. },
  68090. }
  68091. target := &ret
  68092. if err := gensupport.DecodeResponse(target, res); err != nil {
  68093. return nil, err
  68094. }
  68095. return ret, nil
  68096. // {
  68097. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  68098. // "httpMethod": "POST",
  68099. // "id": "compute.instances.resume",
  68100. // "parameterOrder": [
  68101. // "project",
  68102. // "zone",
  68103. // "instance"
  68104. // ],
  68105. // "parameters": {
  68106. // "instance": {
  68107. // "description": "Name of the instance resource to resume.",
  68108. // "location": "path",
  68109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68110. // "required": true,
  68111. // "type": "string"
  68112. // },
  68113. // "project": {
  68114. // "description": "Project ID for this request.",
  68115. // "location": "path",
  68116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68117. // "required": true,
  68118. // "type": "string"
  68119. // },
  68120. // "requestId": {
  68121. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68122. // "location": "query",
  68123. // "type": "string"
  68124. // },
  68125. // "zone": {
  68126. // "description": "The name of the zone for this request.",
  68127. // "location": "path",
  68128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68129. // "required": true,
  68130. // "type": "string"
  68131. // }
  68132. // },
  68133. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  68134. // "request": {
  68135. // "$ref": "InstancesResumeRequest"
  68136. // },
  68137. // "response": {
  68138. // "$ref": "Operation"
  68139. // },
  68140. // "scopes": [
  68141. // "https://www.googleapis.com/auth/cloud-platform",
  68142. // "https://www.googleapis.com/auth/compute"
  68143. // ]
  68144. // }
  68145. }
  68146. // method id "compute.instances.setDeletionProtection":
  68147. type InstancesSetDeletionProtectionCall struct {
  68148. s *Service
  68149. project string
  68150. zone string
  68151. resource string
  68152. urlParams_ gensupport.URLParams
  68153. ctx_ context.Context
  68154. header_ http.Header
  68155. }
  68156. // SetDeletionProtection: Sets deletion protection on the instance.
  68157. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  68158. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68159. c.project = project
  68160. c.zone = zone
  68161. c.resource = resource
  68162. return c
  68163. }
  68164. // DeletionProtection sets the optional parameter "deletionProtection":
  68165. // Whether the resource should be protected against deletion.
  68166. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  68167. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  68168. return c
  68169. }
  68170. // RequestId sets the optional parameter "requestId": An optional
  68171. // request ID to identify requests. Specify a unique request ID so that
  68172. // if you must retry your request, the server will know to ignore the
  68173. // request if it has already been completed.
  68174. //
  68175. // For example, consider a situation where you make an initial request
  68176. // and the request times out. If you make the request again with the
  68177. // same request ID, the server can check if original operation with the
  68178. // same request ID was received, and if so, will ignore the second
  68179. // request. This prevents clients from accidentally creating duplicate
  68180. // commitments.
  68181. //
  68182. // The request ID must be a valid UUID with the exception that zero UUID
  68183. // is not supported (00000000-0000-0000-0000-000000000000).
  68184. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  68185. c.urlParams_.Set("requestId", requestId)
  68186. return c
  68187. }
  68188. // Fields allows partial responses to be retrieved. See
  68189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68190. // for more information.
  68191. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  68192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68193. return c
  68194. }
  68195. // Context sets the context to be used in this call's Do method. Any
  68196. // pending HTTP request will be aborted if the provided context is
  68197. // canceled.
  68198. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  68199. c.ctx_ = ctx
  68200. return c
  68201. }
  68202. // Header returns an http.Header that can be modified by the caller to
  68203. // add HTTP headers to the request.
  68204. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  68205. if c.header_ == nil {
  68206. c.header_ = make(http.Header)
  68207. }
  68208. return c.header_
  68209. }
  68210. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  68211. reqHeaders := make(http.Header)
  68212. for k, v := range c.header_ {
  68213. reqHeaders[k] = v
  68214. }
  68215. reqHeaders.Set("User-Agent", c.s.userAgent())
  68216. var body io.Reader = nil
  68217. c.urlParams_.Set("alt", alt)
  68218. c.urlParams_.Set("prettyPrint", "false")
  68219. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  68220. urls += "?" + c.urlParams_.Encode()
  68221. req, err := http.NewRequest("POST", urls, body)
  68222. if err != nil {
  68223. return nil, err
  68224. }
  68225. req.Header = reqHeaders
  68226. googleapi.Expand(req.URL, map[string]string{
  68227. "project": c.project,
  68228. "zone": c.zone,
  68229. "resource": c.resource,
  68230. })
  68231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68232. }
  68233. // Do executes the "compute.instances.setDeletionProtection" call.
  68234. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68235. // status code is an error. Response headers are in either
  68236. // *Operation.ServerResponse.Header or (if a response was returned at
  68237. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68238. // to check whether the returned error was because
  68239. // http.StatusNotModified was returned.
  68240. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68241. gensupport.SetOptions(c.urlParams_, opts...)
  68242. res, err := c.doRequest("json")
  68243. if res != nil && res.StatusCode == http.StatusNotModified {
  68244. if res.Body != nil {
  68245. res.Body.Close()
  68246. }
  68247. return nil, &googleapi.Error{
  68248. Code: res.StatusCode,
  68249. Header: res.Header,
  68250. }
  68251. }
  68252. if err != nil {
  68253. return nil, err
  68254. }
  68255. defer googleapi.CloseBody(res)
  68256. if err := googleapi.CheckResponse(res); err != nil {
  68257. return nil, err
  68258. }
  68259. ret := &Operation{
  68260. ServerResponse: googleapi.ServerResponse{
  68261. Header: res.Header,
  68262. HTTPStatusCode: res.StatusCode,
  68263. },
  68264. }
  68265. target := &ret
  68266. if err := gensupport.DecodeResponse(target, res); err != nil {
  68267. return nil, err
  68268. }
  68269. return ret, nil
  68270. // {
  68271. // "description": "Sets deletion protection on the instance.",
  68272. // "httpMethod": "POST",
  68273. // "id": "compute.instances.setDeletionProtection",
  68274. // "parameterOrder": [
  68275. // "project",
  68276. // "zone",
  68277. // "resource"
  68278. // ],
  68279. // "parameters": {
  68280. // "deletionProtection": {
  68281. // "default": "true",
  68282. // "description": "Whether the resource should be protected against deletion.",
  68283. // "location": "query",
  68284. // "type": "boolean"
  68285. // },
  68286. // "project": {
  68287. // "description": "Project ID for this request.",
  68288. // "location": "path",
  68289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68290. // "required": true,
  68291. // "type": "string"
  68292. // },
  68293. // "requestId": {
  68294. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68295. // "location": "query",
  68296. // "type": "string"
  68297. // },
  68298. // "resource": {
  68299. // "description": "Name or id of the resource for this request.",
  68300. // "location": "path",
  68301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68302. // "required": true,
  68303. // "type": "string"
  68304. // },
  68305. // "zone": {
  68306. // "description": "The name of the zone for this request.",
  68307. // "location": "path",
  68308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68309. // "required": true,
  68310. // "type": "string"
  68311. // }
  68312. // },
  68313. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  68314. // "response": {
  68315. // "$ref": "Operation"
  68316. // },
  68317. // "scopes": [
  68318. // "https://www.googleapis.com/auth/cloud-platform",
  68319. // "https://www.googleapis.com/auth/compute"
  68320. // ]
  68321. // }
  68322. }
  68323. // method id "compute.instances.setDiskAutoDelete":
  68324. type InstancesSetDiskAutoDeleteCall struct {
  68325. s *Service
  68326. project string
  68327. zone string
  68328. instance string
  68329. urlParams_ gensupport.URLParams
  68330. ctx_ context.Context
  68331. header_ http.Header
  68332. }
  68333. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  68334. // an instance.
  68335. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  68336. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  68337. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68338. c.project = project
  68339. c.zone = zone
  68340. c.instance = instance
  68341. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  68342. c.urlParams_.Set("deviceName", deviceName)
  68343. return c
  68344. }
  68345. // RequestId sets the optional parameter "requestId": An optional
  68346. // request ID to identify requests. Specify a unique request ID so that
  68347. // if you must retry your request, the server will know to ignore the
  68348. // request if it has already been completed.
  68349. //
  68350. // For example, consider a situation where you make an initial request
  68351. // and the request times out. If you make the request again with the
  68352. // same request ID, the server can check if original operation with the
  68353. // same request ID was received, and if so, will ignore the second
  68354. // request. This prevents clients from accidentally creating duplicate
  68355. // commitments.
  68356. //
  68357. // The request ID must be a valid UUID with the exception that zero UUID
  68358. // is not supported (00000000-0000-0000-0000-000000000000).
  68359. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  68360. c.urlParams_.Set("requestId", requestId)
  68361. return c
  68362. }
  68363. // Fields allows partial responses to be retrieved. See
  68364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68365. // for more information.
  68366. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  68367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68368. return c
  68369. }
  68370. // Context sets the context to be used in this call's Do method. Any
  68371. // pending HTTP request will be aborted if the provided context is
  68372. // canceled.
  68373. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  68374. c.ctx_ = ctx
  68375. return c
  68376. }
  68377. // Header returns an http.Header that can be modified by the caller to
  68378. // add HTTP headers to the request.
  68379. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  68380. if c.header_ == nil {
  68381. c.header_ = make(http.Header)
  68382. }
  68383. return c.header_
  68384. }
  68385. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  68386. reqHeaders := make(http.Header)
  68387. for k, v := range c.header_ {
  68388. reqHeaders[k] = v
  68389. }
  68390. reqHeaders.Set("User-Agent", c.s.userAgent())
  68391. var body io.Reader = nil
  68392. c.urlParams_.Set("alt", alt)
  68393. c.urlParams_.Set("prettyPrint", "false")
  68394. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  68395. urls += "?" + c.urlParams_.Encode()
  68396. req, err := http.NewRequest("POST", urls, body)
  68397. if err != nil {
  68398. return nil, err
  68399. }
  68400. req.Header = reqHeaders
  68401. googleapi.Expand(req.URL, map[string]string{
  68402. "project": c.project,
  68403. "zone": c.zone,
  68404. "instance": c.instance,
  68405. })
  68406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68407. }
  68408. // Do executes the "compute.instances.setDiskAutoDelete" call.
  68409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68410. // status code is an error. Response headers are in either
  68411. // *Operation.ServerResponse.Header or (if a response was returned at
  68412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68413. // to check whether the returned error was because
  68414. // http.StatusNotModified was returned.
  68415. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68416. gensupport.SetOptions(c.urlParams_, opts...)
  68417. res, err := c.doRequest("json")
  68418. if res != nil && res.StatusCode == http.StatusNotModified {
  68419. if res.Body != nil {
  68420. res.Body.Close()
  68421. }
  68422. return nil, &googleapi.Error{
  68423. Code: res.StatusCode,
  68424. Header: res.Header,
  68425. }
  68426. }
  68427. if err != nil {
  68428. return nil, err
  68429. }
  68430. defer googleapi.CloseBody(res)
  68431. if err := googleapi.CheckResponse(res); err != nil {
  68432. return nil, err
  68433. }
  68434. ret := &Operation{
  68435. ServerResponse: googleapi.ServerResponse{
  68436. Header: res.Header,
  68437. HTTPStatusCode: res.StatusCode,
  68438. },
  68439. }
  68440. target := &ret
  68441. if err := gensupport.DecodeResponse(target, res); err != nil {
  68442. return nil, err
  68443. }
  68444. return ret, nil
  68445. // {
  68446. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  68447. // "httpMethod": "POST",
  68448. // "id": "compute.instances.setDiskAutoDelete",
  68449. // "parameterOrder": [
  68450. // "project",
  68451. // "zone",
  68452. // "instance",
  68453. // "autoDelete",
  68454. // "deviceName"
  68455. // ],
  68456. // "parameters": {
  68457. // "autoDelete": {
  68458. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  68459. // "location": "query",
  68460. // "required": true,
  68461. // "type": "boolean"
  68462. // },
  68463. // "deviceName": {
  68464. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  68465. // "location": "query",
  68466. // "pattern": "\\w[\\w.-]{0,254}",
  68467. // "required": true,
  68468. // "type": "string"
  68469. // },
  68470. // "instance": {
  68471. // "description": "The instance name for this request.",
  68472. // "location": "path",
  68473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68474. // "required": true,
  68475. // "type": "string"
  68476. // },
  68477. // "project": {
  68478. // "description": "Project ID for this request.",
  68479. // "location": "path",
  68480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68481. // "required": true,
  68482. // "type": "string"
  68483. // },
  68484. // "requestId": {
  68485. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68486. // "location": "query",
  68487. // "type": "string"
  68488. // },
  68489. // "zone": {
  68490. // "description": "The name of the zone for this request.",
  68491. // "location": "path",
  68492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68493. // "required": true,
  68494. // "type": "string"
  68495. // }
  68496. // },
  68497. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  68498. // "response": {
  68499. // "$ref": "Operation"
  68500. // },
  68501. // "scopes": [
  68502. // "https://www.googleapis.com/auth/cloud-platform",
  68503. // "https://www.googleapis.com/auth/compute"
  68504. // ]
  68505. // }
  68506. }
  68507. // method id "compute.instances.setIamPolicy":
  68508. type InstancesSetIamPolicyCall struct {
  68509. s *Service
  68510. project string
  68511. zone string
  68512. resource string
  68513. zonesetpolicyrequest *ZoneSetPolicyRequest
  68514. urlParams_ gensupport.URLParams
  68515. ctx_ context.Context
  68516. header_ http.Header
  68517. }
  68518. // SetIamPolicy: Sets the access control policy on the specified
  68519. // resource. Replaces any existing policy.
  68520. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  68521. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68522. c.project = project
  68523. c.zone = zone
  68524. c.resource = resource
  68525. c.zonesetpolicyrequest = zonesetpolicyrequest
  68526. return c
  68527. }
  68528. // Fields allows partial responses to be retrieved. See
  68529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68530. // for more information.
  68531. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  68532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68533. return c
  68534. }
  68535. // Context sets the context to be used in this call's Do method. Any
  68536. // pending HTTP request will be aborted if the provided context is
  68537. // canceled.
  68538. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  68539. c.ctx_ = ctx
  68540. return c
  68541. }
  68542. // Header returns an http.Header that can be modified by the caller to
  68543. // add HTTP headers to the request.
  68544. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  68545. if c.header_ == nil {
  68546. c.header_ = make(http.Header)
  68547. }
  68548. return c.header_
  68549. }
  68550. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  68551. reqHeaders := make(http.Header)
  68552. for k, v := range c.header_ {
  68553. reqHeaders[k] = v
  68554. }
  68555. reqHeaders.Set("User-Agent", c.s.userAgent())
  68556. var body io.Reader = nil
  68557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  68558. if err != nil {
  68559. return nil, err
  68560. }
  68561. reqHeaders.Set("Content-Type", "application/json")
  68562. c.urlParams_.Set("alt", alt)
  68563. c.urlParams_.Set("prettyPrint", "false")
  68564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  68565. urls += "?" + c.urlParams_.Encode()
  68566. req, err := http.NewRequest("POST", urls, body)
  68567. if err != nil {
  68568. return nil, err
  68569. }
  68570. req.Header = reqHeaders
  68571. googleapi.Expand(req.URL, map[string]string{
  68572. "project": c.project,
  68573. "zone": c.zone,
  68574. "resource": c.resource,
  68575. })
  68576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68577. }
  68578. // Do executes the "compute.instances.setIamPolicy" call.
  68579. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  68580. // code is an error. Response headers are in either
  68581. // *Policy.ServerResponse.Header or (if a response was returned at all)
  68582. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68583. // check whether the returned error was because http.StatusNotModified
  68584. // was returned.
  68585. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  68586. gensupport.SetOptions(c.urlParams_, opts...)
  68587. res, err := c.doRequest("json")
  68588. if res != nil && res.StatusCode == http.StatusNotModified {
  68589. if res.Body != nil {
  68590. res.Body.Close()
  68591. }
  68592. return nil, &googleapi.Error{
  68593. Code: res.StatusCode,
  68594. Header: res.Header,
  68595. }
  68596. }
  68597. if err != nil {
  68598. return nil, err
  68599. }
  68600. defer googleapi.CloseBody(res)
  68601. if err := googleapi.CheckResponse(res); err != nil {
  68602. return nil, err
  68603. }
  68604. ret := &Policy{
  68605. ServerResponse: googleapi.ServerResponse{
  68606. Header: res.Header,
  68607. HTTPStatusCode: res.StatusCode,
  68608. },
  68609. }
  68610. target := &ret
  68611. if err := gensupport.DecodeResponse(target, res); err != nil {
  68612. return nil, err
  68613. }
  68614. return ret, nil
  68615. // {
  68616. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  68617. // "httpMethod": "POST",
  68618. // "id": "compute.instances.setIamPolicy",
  68619. // "parameterOrder": [
  68620. // "project",
  68621. // "zone",
  68622. // "resource"
  68623. // ],
  68624. // "parameters": {
  68625. // "project": {
  68626. // "description": "Project ID for this request.",
  68627. // "location": "path",
  68628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68629. // "required": true,
  68630. // "type": "string"
  68631. // },
  68632. // "resource": {
  68633. // "description": "Name or id of the resource for this request.",
  68634. // "location": "path",
  68635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68636. // "required": true,
  68637. // "type": "string"
  68638. // },
  68639. // "zone": {
  68640. // "description": "The name of the zone for this request.",
  68641. // "location": "path",
  68642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68643. // "required": true,
  68644. // "type": "string"
  68645. // }
  68646. // },
  68647. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  68648. // "request": {
  68649. // "$ref": "ZoneSetPolicyRequest"
  68650. // },
  68651. // "response": {
  68652. // "$ref": "Policy"
  68653. // },
  68654. // "scopes": [
  68655. // "https://www.googleapis.com/auth/cloud-platform",
  68656. // "https://www.googleapis.com/auth/compute"
  68657. // ]
  68658. // }
  68659. }
  68660. // method id "compute.instances.setLabels":
  68661. type InstancesSetLabelsCall struct {
  68662. s *Service
  68663. project string
  68664. zone string
  68665. instance string
  68666. instancessetlabelsrequest *InstancesSetLabelsRequest
  68667. urlParams_ gensupport.URLParams
  68668. ctx_ context.Context
  68669. header_ http.Header
  68670. }
  68671. // SetLabels: Sets labels on an instance. To learn more about labels,
  68672. // read the Labeling Resources documentation.
  68673. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  68674. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68675. c.project = project
  68676. c.zone = zone
  68677. c.instance = instance
  68678. c.instancessetlabelsrequest = instancessetlabelsrequest
  68679. return c
  68680. }
  68681. // RequestId sets the optional parameter "requestId": An optional
  68682. // request ID to identify requests. Specify a unique request ID so that
  68683. // if you must retry your request, the server will know to ignore the
  68684. // request if it has already been completed.
  68685. //
  68686. // For example, consider a situation where you make an initial request
  68687. // and the request times out. If you make the request again with the
  68688. // same request ID, the server can check if original operation with the
  68689. // same request ID was received, and if so, will ignore the second
  68690. // request. This prevents clients from accidentally creating duplicate
  68691. // commitments.
  68692. //
  68693. // The request ID must be a valid UUID with the exception that zero UUID
  68694. // is not supported (00000000-0000-0000-0000-000000000000).
  68695. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  68696. c.urlParams_.Set("requestId", requestId)
  68697. return c
  68698. }
  68699. // Fields allows partial responses to be retrieved. See
  68700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68701. // for more information.
  68702. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  68703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68704. return c
  68705. }
  68706. // Context sets the context to be used in this call's Do method. Any
  68707. // pending HTTP request will be aborted if the provided context is
  68708. // canceled.
  68709. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  68710. c.ctx_ = ctx
  68711. return c
  68712. }
  68713. // Header returns an http.Header that can be modified by the caller to
  68714. // add HTTP headers to the request.
  68715. func (c *InstancesSetLabelsCall) Header() http.Header {
  68716. if c.header_ == nil {
  68717. c.header_ = make(http.Header)
  68718. }
  68719. return c.header_
  68720. }
  68721. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  68722. reqHeaders := make(http.Header)
  68723. for k, v := range c.header_ {
  68724. reqHeaders[k] = v
  68725. }
  68726. reqHeaders.Set("User-Agent", c.s.userAgent())
  68727. var body io.Reader = nil
  68728. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  68729. if err != nil {
  68730. return nil, err
  68731. }
  68732. reqHeaders.Set("Content-Type", "application/json")
  68733. c.urlParams_.Set("alt", alt)
  68734. c.urlParams_.Set("prettyPrint", "false")
  68735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  68736. urls += "?" + c.urlParams_.Encode()
  68737. req, err := http.NewRequest("POST", urls, body)
  68738. if err != nil {
  68739. return nil, err
  68740. }
  68741. req.Header = reqHeaders
  68742. googleapi.Expand(req.URL, map[string]string{
  68743. "project": c.project,
  68744. "zone": c.zone,
  68745. "instance": c.instance,
  68746. })
  68747. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68748. }
  68749. // Do executes the "compute.instances.setLabels" call.
  68750. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68751. // status code is an error. Response headers are in either
  68752. // *Operation.ServerResponse.Header or (if a response was returned at
  68753. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68754. // to check whether the returned error was because
  68755. // http.StatusNotModified was returned.
  68756. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68757. gensupport.SetOptions(c.urlParams_, opts...)
  68758. res, err := c.doRequest("json")
  68759. if res != nil && res.StatusCode == http.StatusNotModified {
  68760. if res.Body != nil {
  68761. res.Body.Close()
  68762. }
  68763. return nil, &googleapi.Error{
  68764. Code: res.StatusCode,
  68765. Header: res.Header,
  68766. }
  68767. }
  68768. if err != nil {
  68769. return nil, err
  68770. }
  68771. defer googleapi.CloseBody(res)
  68772. if err := googleapi.CheckResponse(res); err != nil {
  68773. return nil, err
  68774. }
  68775. ret := &Operation{
  68776. ServerResponse: googleapi.ServerResponse{
  68777. Header: res.Header,
  68778. HTTPStatusCode: res.StatusCode,
  68779. },
  68780. }
  68781. target := &ret
  68782. if err := gensupport.DecodeResponse(target, res); err != nil {
  68783. return nil, err
  68784. }
  68785. return ret, nil
  68786. // {
  68787. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  68788. // "httpMethod": "POST",
  68789. // "id": "compute.instances.setLabels",
  68790. // "parameterOrder": [
  68791. // "project",
  68792. // "zone",
  68793. // "instance"
  68794. // ],
  68795. // "parameters": {
  68796. // "instance": {
  68797. // "description": "Name of the instance scoping this request.",
  68798. // "location": "path",
  68799. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68800. // "required": true,
  68801. // "type": "string"
  68802. // },
  68803. // "project": {
  68804. // "description": "Project ID for this request.",
  68805. // "location": "path",
  68806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68807. // "required": true,
  68808. // "type": "string"
  68809. // },
  68810. // "requestId": {
  68811. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68812. // "location": "query",
  68813. // "type": "string"
  68814. // },
  68815. // "zone": {
  68816. // "description": "The name of the zone for this request.",
  68817. // "location": "path",
  68818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68819. // "required": true,
  68820. // "type": "string"
  68821. // }
  68822. // },
  68823. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  68824. // "request": {
  68825. // "$ref": "InstancesSetLabelsRequest"
  68826. // },
  68827. // "response": {
  68828. // "$ref": "Operation"
  68829. // },
  68830. // "scopes": [
  68831. // "https://www.googleapis.com/auth/cloud-platform",
  68832. // "https://www.googleapis.com/auth/compute"
  68833. // ]
  68834. // }
  68835. }
  68836. // method id "compute.instances.setMachineResources":
  68837. type InstancesSetMachineResourcesCall struct {
  68838. s *Service
  68839. project string
  68840. zone string
  68841. instance string
  68842. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  68843. urlParams_ gensupport.URLParams
  68844. ctx_ context.Context
  68845. header_ http.Header
  68846. }
  68847. // SetMachineResources: Changes the number and/or type of accelerator
  68848. // for a stopped instance to the values specified in the request.
  68849. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  68850. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68851. c.project = project
  68852. c.zone = zone
  68853. c.instance = instance
  68854. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  68855. return c
  68856. }
  68857. // RequestId sets the optional parameter "requestId": An optional
  68858. // request ID to identify requests. Specify a unique request ID so that
  68859. // if you must retry your request, the server will know to ignore the
  68860. // request if it has already been completed.
  68861. //
  68862. // For example, consider a situation where you make an initial request
  68863. // and the request times out. If you make the request again with the
  68864. // same request ID, the server can check if original operation with the
  68865. // same request ID was received, and if so, will ignore the second
  68866. // request. This prevents clients from accidentally creating duplicate
  68867. // commitments.
  68868. //
  68869. // The request ID must be a valid UUID with the exception that zero UUID
  68870. // is not supported (00000000-0000-0000-0000-000000000000).
  68871. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  68872. c.urlParams_.Set("requestId", requestId)
  68873. return c
  68874. }
  68875. // Fields allows partial responses to be retrieved. See
  68876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68877. // for more information.
  68878. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  68879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68880. return c
  68881. }
  68882. // Context sets the context to be used in this call's Do method. Any
  68883. // pending HTTP request will be aborted if the provided context is
  68884. // canceled.
  68885. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  68886. c.ctx_ = ctx
  68887. return c
  68888. }
  68889. // Header returns an http.Header that can be modified by the caller to
  68890. // add HTTP headers to the request.
  68891. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  68892. if c.header_ == nil {
  68893. c.header_ = make(http.Header)
  68894. }
  68895. return c.header_
  68896. }
  68897. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  68898. reqHeaders := make(http.Header)
  68899. for k, v := range c.header_ {
  68900. reqHeaders[k] = v
  68901. }
  68902. reqHeaders.Set("User-Agent", c.s.userAgent())
  68903. var body io.Reader = nil
  68904. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  68905. if err != nil {
  68906. return nil, err
  68907. }
  68908. reqHeaders.Set("Content-Type", "application/json")
  68909. c.urlParams_.Set("alt", alt)
  68910. c.urlParams_.Set("prettyPrint", "false")
  68911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  68912. urls += "?" + c.urlParams_.Encode()
  68913. req, err := http.NewRequest("POST", urls, body)
  68914. if err != nil {
  68915. return nil, err
  68916. }
  68917. req.Header = reqHeaders
  68918. googleapi.Expand(req.URL, map[string]string{
  68919. "project": c.project,
  68920. "zone": c.zone,
  68921. "instance": c.instance,
  68922. })
  68923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68924. }
  68925. // Do executes the "compute.instances.setMachineResources" call.
  68926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68927. // status code is an error. Response headers are in either
  68928. // *Operation.ServerResponse.Header or (if a response was returned at
  68929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68930. // to check whether the returned error was because
  68931. // http.StatusNotModified was returned.
  68932. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68933. gensupport.SetOptions(c.urlParams_, opts...)
  68934. res, err := c.doRequest("json")
  68935. if res != nil && res.StatusCode == http.StatusNotModified {
  68936. if res.Body != nil {
  68937. res.Body.Close()
  68938. }
  68939. return nil, &googleapi.Error{
  68940. Code: res.StatusCode,
  68941. Header: res.Header,
  68942. }
  68943. }
  68944. if err != nil {
  68945. return nil, err
  68946. }
  68947. defer googleapi.CloseBody(res)
  68948. if err := googleapi.CheckResponse(res); err != nil {
  68949. return nil, err
  68950. }
  68951. ret := &Operation{
  68952. ServerResponse: googleapi.ServerResponse{
  68953. Header: res.Header,
  68954. HTTPStatusCode: res.StatusCode,
  68955. },
  68956. }
  68957. target := &ret
  68958. if err := gensupport.DecodeResponse(target, res); err != nil {
  68959. return nil, err
  68960. }
  68961. return ret, nil
  68962. // {
  68963. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  68964. // "httpMethod": "POST",
  68965. // "id": "compute.instances.setMachineResources",
  68966. // "parameterOrder": [
  68967. // "project",
  68968. // "zone",
  68969. // "instance"
  68970. // ],
  68971. // "parameters": {
  68972. // "instance": {
  68973. // "description": "Name of the instance scoping this request.",
  68974. // "location": "path",
  68975. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68976. // "required": true,
  68977. // "type": "string"
  68978. // },
  68979. // "project": {
  68980. // "description": "Project ID for this request.",
  68981. // "location": "path",
  68982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68983. // "required": true,
  68984. // "type": "string"
  68985. // },
  68986. // "requestId": {
  68987. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68988. // "location": "query",
  68989. // "type": "string"
  68990. // },
  68991. // "zone": {
  68992. // "description": "The name of the zone for this request.",
  68993. // "location": "path",
  68994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68995. // "required": true,
  68996. // "type": "string"
  68997. // }
  68998. // },
  68999. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  69000. // "request": {
  69001. // "$ref": "InstancesSetMachineResourcesRequest"
  69002. // },
  69003. // "response": {
  69004. // "$ref": "Operation"
  69005. // },
  69006. // "scopes": [
  69007. // "https://www.googleapis.com/auth/cloud-platform",
  69008. // "https://www.googleapis.com/auth/compute"
  69009. // ]
  69010. // }
  69011. }
  69012. // method id "compute.instances.setMachineType":
  69013. type InstancesSetMachineTypeCall struct {
  69014. s *Service
  69015. project string
  69016. zone string
  69017. instance string
  69018. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  69019. urlParams_ gensupport.URLParams
  69020. ctx_ context.Context
  69021. header_ http.Header
  69022. }
  69023. // SetMachineType: Changes the machine type for a stopped instance to
  69024. // the machine type specified in the request.
  69025. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  69026. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69027. c.project = project
  69028. c.zone = zone
  69029. c.instance = instance
  69030. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  69031. return c
  69032. }
  69033. // RequestId sets the optional parameter "requestId": An optional
  69034. // request ID to identify requests. Specify a unique request ID so that
  69035. // if you must retry your request, the server will know to ignore the
  69036. // request if it has already been completed.
  69037. //
  69038. // For example, consider a situation where you make an initial request
  69039. // and the request times out. If you make the request again with the
  69040. // same request ID, the server can check if original operation with the
  69041. // same request ID was received, and if so, will ignore the second
  69042. // request. This prevents clients from accidentally creating duplicate
  69043. // commitments.
  69044. //
  69045. // The request ID must be a valid UUID with the exception that zero UUID
  69046. // is not supported (00000000-0000-0000-0000-000000000000).
  69047. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  69048. c.urlParams_.Set("requestId", requestId)
  69049. return c
  69050. }
  69051. // Fields allows partial responses to be retrieved. See
  69052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69053. // for more information.
  69054. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  69055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69056. return c
  69057. }
  69058. // Context sets the context to be used in this call's Do method. Any
  69059. // pending HTTP request will be aborted if the provided context is
  69060. // canceled.
  69061. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  69062. c.ctx_ = ctx
  69063. return c
  69064. }
  69065. // Header returns an http.Header that can be modified by the caller to
  69066. // add HTTP headers to the request.
  69067. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  69068. if c.header_ == nil {
  69069. c.header_ = make(http.Header)
  69070. }
  69071. return c.header_
  69072. }
  69073. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  69074. reqHeaders := make(http.Header)
  69075. for k, v := range c.header_ {
  69076. reqHeaders[k] = v
  69077. }
  69078. reqHeaders.Set("User-Agent", c.s.userAgent())
  69079. var body io.Reader = nil
  69080. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  69081. if err != nil {
  69082. return nil, err
  69083. }
  69084. reqHeaders.Set("Content-Type", "application/json")
  69085. c.urlParams_.Set("alt", alt)
  69086. c.urlParams_.Set("prettyPrint", "false")
  69087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  69088. urls += "?" + c.urlParams_.Encode()
  69089. req, err := http.NewRequest("POST", urls, body)
  69090. if err != nil {
  69091. return nil, err
  69092. }
  69093. req.Header = reqHeaders
  69094. googleapi.Expand(req.URL, map[string]string{
  69095. "project": c.project,
  69096. "zone": c.zone,
  69097. "instance": c.instance,
  69098. })
  69099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69100. }
  69101. // Do executes the "compute.instances.setMachineType" call.
  69102. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69103. // status code is an error. Response headers are in either
  69104. // *Operation.ServerResponse.Header or (if a response was returned at
  69105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69106. // to check whether the returned error was because
  69107. // http.StatusNotModified was returned.
  69108. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69109. gensupport.SetOptions(c.urlParams_, opts...)
  69110. res, err := c.doRequest("json")
  69111. if res != nil && res.StatusCode == http.StatusNotModified {
  69112. if res.Body != nil {
  69113. res.Body.Close()
  69114. }
  69115. return nil, &googleapi.Error{
  69116. Code: res.StatusCode,
  69117. Header: res.Header,
  69118. }
  69119. }
  69120. if err != nil {
  69121. return nil, err
  69122. }
  69123. defer googleapi.CloseBody(res)
  69124. if err := googleapi.CheckResponse(res); err != nil {
  69125. return nil, err
  69126. }
  69127. ret := &Operation{
  69128. ServerResponse: googleapi.ServerResponse{
  69129. Header: res.Header,
  69130. HTTPStatusCode: res.StatusCode,
  69131. },
  69132. }
  69133. target := &ret
  69134. if err := gensupport.DecodeResponse(target, res); err != nil {
  69135. return nil, err
  69136. }
  69137. return ret, nil
  69138. // {
  69139. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  69140. // "httpMethod": "POST",
  69141. // "id": "compute.instances.setMachineType",
  69142. // "parameterOrder": [
  69143. // "project",
  69144. // "zone",
  69145. // "instance"
  69146. // ],
  69147. // "parameters": {
  69148. // "instance": {
  69149. // "description": "Name of the instance scoping this request.",
  69150. // "location": "path",
  69151. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69152. // "required": true,
  69153. // "type": "string"
  69154. // },
  69155. // "project": {
  69156. // "description": "Project ID for this request.",
  69157. // "location": "path",
  69158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69159. // "required": true,
  69160. // "type": "string"
  69161. // },
  69162. // "requestId": {
  69163. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69164. // "location": "query",
  69165. // "type": "string"
  69166. // },
  69167. // "zone": {
  69168. // "description": "The name of the zone for this request.",
  69169. // "location": "path",
  69170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69171. // "required": true,
  69172. // "type": "string"
  69173. // }
  69174. // },
  69175. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  69176. // "request": {
  69177. // "$ref": "InstancesSetMachineTypeRequest"
  69178. // },
  69179. // "response": {
  69180. // "$ref": "Operation"
  69181. // },
  69182. // "scopes": [
  69183. // "https://www.googleapis.com/auth/cloud-platform",
  69184. // "https://www.googleapis.com/auth/compute"
  69185. // ]
  69186. // }
  69187. }
  69188. // method id "compute.instances.setMetadata":
  69189. type InstancesSetMetadataCall struct {
  69190. s *Service
  69191. project string
  69192. zone string
  69193. instance string
  69194. metadata *Metadata
  69195. urlParams_ gensupport.URLParams
  69196. ctx_ context.Context
  69197. header_ http.Header
  69198. }
  69199. // SetMetadata: Sets metadata for the specified instance to the data
  69200. // included in the request.
  69201. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  69202. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  69203. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69204. c.project = project
  69205. c.zone = zone
  69206. c.instance = instance
  69207. c.metadata = metadata
  69208. return c
  69209. }
  69210. // RequestId sets the optional parameter "requestId": An optional
  69211. // request ID to identify requests. Specify a unique request ID so that
  69212. // if you must retry your request, the server will know to ignore the
  69213. // request if it has already been completed.
  69214. //
  69215. // For example, consider a situation where you make an initial request
  69216. // and the request times out. If you make the request again with the
  69217. // same request ID, the server can check if original operation with the
  69218. // same request ID was received, and if so, will ignore the second
  69219. // request. This prevents clients from accidentally creating duplicate
  69220. // commitments.
  69221. //
  69222. // The request ID must be a valid UUID with the exception that zero UUID
  69223. // is not supported (00000000-0000-0000-0000-000000000000).
  69224. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  69225. c.urlParams_.Set("requestId", requestId)
  69226. return c
  69227. }
  69228. // Fields allows partial responses to be retrieved. See
  69229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69230. // for more information.
  69231. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  69232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69233. return c
  69234. }
  69235. // Context sets the context to be used in this call's Do method. Any
  69236. // pending HTTP request will be aborted if the provided context is
  69237. // canceled.
  69238. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  69239. c.ctx_ = ctx
  69240. return c
  69241. }
  69242. // Header returns an http.Header that can be modified by the caller to
  69243. // add HTTP headers to the request.
  69244. func (c *InstancesSetMetadataCall) Header() http.Header {
  69245. if c.header_ == nil {
  69246. c.header_ = make(http.Header)
  69247. }
  69248. return c.header_
  69249. }
  69250. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  69251. reqHeaders := make(http.Header)
  69252. for k, v := range c.header_ {
  69253. reqHeaders[k] = v
  69254. }
  69255. reqHeaders.Set("User-Agent", c.s.userAgent())
  69256. var body io.Reader = nil
  69257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  69258. if err != nil {
  69259. return nil, err
  69260. }
  69261. reqHeaders.Set("Content-Type", "application/json")
  69262. c.urlParams_.Set("alt", alt)
  69263. c.urlParams_.Set("prettyPrint", "false")
  69264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  69265. urls += "?" + c.urlParams_.Encode()
  69266. req, err := http.NewRequest("POST", urls, body)
  69267. if err != nil {
  69268. return nil, err
  69269. }
  69270. req.Header = reqHeaders
  69271. googleapi.Expand(req.URL, map[string]string{
  69272. "project": c.project,
  69273. "zone": c.zone,
  69274. "instance": c.instance,
  69275. })
  69276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69277. }
  69278. // Do executes the "compute.instances.setMetadata" call.
  69279. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69280. // status code is an error. Response headers are in either
  69281. // *Operation.ServerResponse.Header or (if a response was returned at
  69282. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69283. // to check whether the returned error was because
  69284. // http.StatusNotModified was returned.
  69285. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69286. gensupport.SetOptions(c.urlParams_, opts...)
  69287. res, err := c.doRequest("json")
  69288. if res != nil && res.StatusCode == http.StatusNotModified {
  69289. if res.Body != nil {
  69290. res.Body.Close()
  69291. }
  69292. return nil, &googleapi.Error{
  69293. Code: res.StatusCode,
  69294. Header: res.Header,
  69295. }
  69296. }
  69297. if err != nil {
  69298. return nil, err
  69299. }
  69300. defer googleapi.CloseBody(res)
  69301. if err := googleapi.CheckResponse(res); err != nil {
  69302. return nil, err
  69303. }
  69304. ret := &Operation{
  69305. ServerResponse: googleapi.ServerResponse{
  69306. Header: res.Header,
  69307. HTTPStatusCode: res.StatusCode,
  69308. },
  69309. }
  69310. target := &ret
  69311. if err := gensupport.DecodeResponse(target, res); err != nil {
  69312. return nil, err
  69313. }
  69314. return ret, nil
  69315. // {
  69316. // "description": "Sets metadata for the specified instance to the data included in the request.",
  69317. // "httpMethod": "POST",
  69318. // "id": "compute.instances.setMetadata",
  69319. // "parameterOrder": [
  69320. // "project",
  69321. // "zone",
  69322. // "instance"
  69323. // ],
  69324. // "parameters": {
  69325. // "instance": {
  69326. // "description": "Name of the instance scoping this request.",
  69327. // "location": "path",
  69328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69329. // "required": true,
  69330. // "type": "string"
  69331. // },
  69332. // "project": {
  69333. // "description": "Project ID for this request.",
  69334. // "location": "path",
  69335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69336. // "required": true,
  69337. // "type": "string"
  69338. // },
  69339. // "requestId": {
  69340. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69341. // "location": "query",
  69342. // "type": "string"
  69343. // },
  69344. // "zone": {
  69345. // "description": "The name of the zone for this request.",
  69346. // "location": "path",
  69347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69348. // "required": true,
  69349. // "type": "string"
  69350. // }
  69351. // },
  69352. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  69353. // "request": {
  69354. // "$ref": "Metadata"
  69355. // },
  69356. // "response": {
  69357. // "$ref": "Operation"
  69358. // },
  69359. // "scopes": [
  69360. // "https://www.googleapis.com/auth/cloud-platform",
  69361. // "https://www.googleapis.com/auth/compute"
  69362. // ]
  69363. // }
  69364. }
  69365. // method id "compute.instances.setMinCpuPlatform":
  69366. type InstancesSetMinCpuPlatformCall struct {
  69367. s *Service
  69368. project string
  69369. zone string
  69370. instance string
  69371. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  69372. urlParams_ gensupport.URLParams
  69373. ctx_ context.Context
  69374. header_ http.Header
  69375. }
  69376. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  69377. // instance should use. This method can only be called on a stopped
  69378. // instance. For more information, read Specifying a Minimum CPU
  69379. // Platform.
  69380. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  69381. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69382. c.project = project
  69383. c.zone = zone
  69384. c.instance = instance
  69385. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  69386. return c
  69387. }
  69388. // RequestId sets the optional parameter "requestId": An optional
  69389. // request ID to identify requests. Specify a unique request ID so that
  69390. // if you must retry your request, the server will know to ignore the
  69391. // request if it has already been completed.
  69392. //
  69393. // For example, consider a situation where you make an initial request
  69394. // and the request times out. If you make the request again with the
  69395. // same request ID, the server can check if original operation with the
  69396. // same request ID was received, and if so, will ignore the second
  69397. // request. This prevents clients from accidentally creating duplicate
  69398. // commitments.
  69399. //
  69400. // The request ID must be a valid UUID with the exception that zero UUID
  69401. // is not supported (00000000-0000-0000-0000-000000000000).
  69402. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  69403. c.urlParams_.Set("requestId", requestId)
  69404. return c
  69405. }
  69406. // Fields allows partial responses to be retrieved. See
  69407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69408. // for more information.
  69409. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  69410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69411. return c
  69412. }
  69413. // Context sets the context to be used in this call's Do method. Any
  69414. // pending HTTP request will be aborted if the provided context is
  69415. // canceled.
  69416. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  69417. c.ctx_ = ctx
  69418. return c
  69419. }
  69420. // Header returns an http.Header that can be modified by the caller to
  69421. // add HTTP headers to the request.
  69422. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  69423. if c.header_ == nil {
  69424. c.header_ = make(http.Header)
  69425. }
  69426. return c.header_
  69427. }
  69428. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  69429. reqHeaders := make(http.Header)
  69430. for k, v := range c.header_ {
  69431. reqHeaders[k] = v
  69432. }
  69433. reqHeaders.Set("User-Agent", c.s.userAgent())
  69434. var body io.Reader = nil
  69435. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  69436. if err != nil {
  69437. return nil, err
  69438. }
  69439. reqHeaders.Set("Content-Type", "application/json")
  69440. c.urlParams_.Set("alt", alt)
  69441. c.urlParams_.Set("prettyPrint", "false")
  69442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  69443. urls += "?" + c.urlParams_.Encode()
  69444. req, err := http.NewRequest("POST", urls, body)
  69445. if err != nil {
  69446. return nil, err
  69447. }
  69448. req.Header = reqHeaders
  69449. googleapi.Expand(req.URL, map[string]string{
  69450. "project": c.project,
  69451. "zone": c.zone,
  69452. "instance": c.instance,
  69453. })
  69454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69455. }
  69456. // Do executes the "compute.instances.setMinCpuPlatform" call.
  69457. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69458. // status code is an error. Response headers are in either
  69459. // *Operation.ServerResponse.Header or (if a response was returned at
  69460. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69461. // to check whether the returned error was because
  69462. // http.StatusNotModified was returned.
  69463. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69464. gensupport.SetOptions(c.urlParams_, opts...)
  69465. res, err := c.doRequest("json")
  69466. if res != nil && res.StatusCode == http.StatusNotModified {
  69467. if res.Body != nil {
  69468. res.Body.Close()
  69469. }
  69470. return nil, &googleapi.Error{
  69471. Code: res.StatusCode,
  69472. Header: res.Header,
  69473. }
  69474. }
  69475. if err != nil {
  69476. return nil, err
  69477. }
  69478. defer googleapi.CloseBody(res)
  69479. if err := googleapi.CheckResponse(res); err != nil {
  69480. return nil, err
  69481. }
  69482. ret := &Operation{
  69483. ServerResponse: googleapi.ServerResponse{
  69484. Header: res.Header,
  69485. HTTPStatusCode: res.StatusCode,
  69486. },
  69487. }
  69488. target := &ret
  69489. if err := gensupport.DecodeResponse(target, res); err != nil {
  69490. return nil, err
  69491. }
  69492. return ret, nil
  69493. // {
  69494. // "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.",
  69495. // "httpMethod": "POST",
  69496. // "id": "compute.instances.setMinCpuPlatform",
  69497. // "parameterOrder": [
  69498. // "project",
  69499. // "zone",
  69500. // "instance"
  69501. // ],
  69502. // "parameters": {
  69503. // "instance": {
  69504. // "description": "Name of the instance scoping this request.",
  69505. // "location": "path",
  69506. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69507. // "required": true,
  69508. // "type": "string"
  69509. // },
  69510. // "project": {
  69511. // "description": "Project ID for this request.",
  69512. // "location": "path",
  69513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69514. // "required": true,
  69515. // "type": "string"
  69516. // },
  69517. // "requestId": {
  69518. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69519. // "location": "query",
  69520. // "type": "string"
  69521. // },
  69522. // "zone": {
  69523. // "description": "The name of the zone for this request.",
  69524. // "location": "path",
  69525. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69526. // "required": true,
  69527. // "type": "string"
  69528. // }
  69529. // },
  69530. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  69531. // "request": {
  69532. // "$ref": "InstancesSetMinCpuPlatformRequest"
  69533. // },
  69534. // "response": {
  69535. // "$ref": "Operation"
  69536. // },
  69537. // "scopes": [
  69538. // "https://www.googleapis.com/auth/cloud-platform",
  69539. // "https://www.googleapis.com/auth/compute"
  69540. // ]
  69541. // }
  69542. }
  69543. // method id "compute.instances.setScheduling":
  69544. type InstancesSetSchedulingCall struct {
  69545. s *Service
  69546. project string
  69547. zone string
  69548. instance string
  69549. scheduling *Scheduling
  69550. urlParams_ gensupport.URLParams
  69551. ctx_ context.Context
  69552. header_ http.Header
  69553. }
  69554. // SetScheduling: Sets an instance's scheduling options.
  69555. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  69556. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  69557. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69558. c.project = project
  69559. c.zone = zone
  69560. c.instance = instance
  69561. c.scheduling = scheduling
  69562. return c
  69563. }
  69564. // RequestId sets the optional parameter "requestId": An optional
  69565. // request ID to identify requests. Specify a unique request ID so that
  69566. // if you must retry your request, the server will know to ignore the
  69567. // request if it has already been completed.
  69568. //
  69569. // For example, consider a situation where you make an initial request
  69570. // and the request times out. If you make the request again with the
  69571. // same request ID, the server can check if original operation with the
  69572. // same request ID was received, and if so, will ignore the second
  69573. // request. This prevents clients from accidentally creating duplicate
  69574. // commitments.
  69575. //
  69576. // The request ID must be a valid UUID with the exception that zero UUID
  69577. // is not supported (00000000-0000-0000-0000-000000000000).
  69578. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  69579. c.urlParams_.Set("requestId", requestId)
  69580. return c
  69581. }
  69582. // Fields allows partial responses to be retrieved. See
  69583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69584. // for more information.
  69585. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  69586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69587. return c
  69588. }
  69589. // Context sets the context to be used in this call's Do method. Any
  69590. // pending HTTP request will be aborted if the provided context is
  69591. // canceled.
  69592. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  69593. c.ctx_ = ctx
  69594. return c
  69595. }
  69596. // Header returns an http.Header that can be modified by the caller to
  69597. // add HTTP headers to the request.
  69598. func (c *InstancesSetSchedulingCall) Header() http.Header {
  69599. if c.header_ == nil {
  69600. c.header_ = make(http.Header)
  69601. }
  69602. return c.header_
  69603. }
  69604. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  69605. reqHeaders := make(http.Header)
  69606. for k, v := range c.header_ {
  69607. reqHeaders[k] = v
  69608. }
  69609. reqHeaders.Set("User-Agent", c.s.userAgent())
  69610. var body io.Reader = nil
  69611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  69612. if err != nil {
  69613. return nil, err
  69614. }
  69615. reqHeaders.Set("Content-Type", "application/json")
  69616. c.urlParams_.Set("alt", alt)
  69617. c.urlParams_.Set("prettyPrint", "false")
  69618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  69619. urls += "?" + c.urlParams_.Encode()
  69620. req, err := http.NewRequest("POST", urls, body)
  69621. if err != nil {
  69622. return nil, err
  69623. }
  69624. req.Header = reqHeaders
  69625. googleapi.Expand(req.URL, map[string]string{
  69626. "project": c.project,
  69627. "zone": c.zone,
  69628. "instance": c.instance,
  69629. })
  69630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69631. }
  69632. // Do executes the "compute.instances.setScheduling" call.
  69633. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69634. // status code is an error. Response headers are in either
  69635. // *Operation.ServerResponse.Header or (if a response was returned at
  69636. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69637. // to check whether the returned error was because
  69638. // http.StatusNotModified was returned.
  69639. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69640. gensupport.SetOptions(c.urlParams_, opts...)
  69641. res, err := c.doRequest("json")
  69642. if res != nil && res.StatusCode == http.StatusNotModified {
  69643. if res.Body != nil {
  69644. res.Body.Close()
  69645. }
  69646. return nil, &googleapi.Error{
  69647. Code: res.StatusCode,
  69648. Header: res.Header,
  69649. }
  69650. }
  69651. if err != nil {
  69652. return nil, err
  69653. }
  69654. defer googleapi.CloseBody(res)
  69655. if err := googleapi.CheckResponse(res); err != nil {
  69656. return nil, err
  69657. }
  69658. ret := &Operation{
  69659. ServerResponse: googleapi.ServerResponse{
  69660. Header: res.Header,
  69661. HTTPStatusCode: res.StatusCode,
  69662. },
  69663. }
  69664. target := &ret
  69665. if err := gensupport.DecodeResponse(target, res); err != nil {
  69666. return nil, err
  69667. }
  69668. return ret, nil
  69669. // {
  69670. // "description": "Sets an instance's scheduling options.",
  69671. // "httpMethod": "POST",
  69672. // "id": "compute.instances.setScheduling",
  69673. // "parameterOrder": [
  69674. // "project",
  69675. // "zone",
  69676. // "instance"
  69677. // ],
  69678. // "parameters": {
  69679. // "instance": {
  69680. // "description": "Instance name for this request.",
  69681. // "location": "path",
  69682. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69683. // "required": true,
  69684. // "type": "string"
  69685. // },
  69686. // "project": {
  69687. // "description": "Project ID for this request.",
  69688. // "location": "path",
  69689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69690. // "required": true,
  69691. // "type": "string"
  69692. // },
  69693. // "requestId": {
  69694. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69695. // "location": "query",
  69696. // "type": "string"
  69697. // },
  69698. // "zone": {
  69699. // "description": "The name of the zone for this request.",
  69700. // "location": "path",
  69701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69702. // "required": true,
  69703. // "type": "string"
  69704. // }
  69705. // },
  69706. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  69707. // "request": {
  69708. // "$ref": "Scheduling"
  69709. // },
  69710. // "response": {
  69711. // "$ref": "Operation"
  69712. // },
  69713. // "scopes": [
  69714. // "https://www.googleapis.com/auth/cloud-platform",
  69715. // "https://www.googleapis.com/auth/compute"
  69716. // ]
  69717. // }
  69718. }
  69719. // method id "compute.instances.setServiceAccount":
  69720. type InstancesSetServiceAccountCall struct {
  69721. s *Service
  69722. project string
  69723. zone string
  69724. instance string
  69725. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  69726. urlParams_ gensupport.URLParams
  69727. ctx_ context.Context
  69728. header_ http.Header
  69729. }
  69730. // SetServiceAccount: Sets the service account on the instance. For more
  69731. // information, read Changing the service account and access scopes for
  69732. // an instance.
  69733. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  69734. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69735. c.project = project
  69736. c.zone = zone
  69737. c.instance = instance
  69738. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  69739. return c
  69740. }
  69741. // RequestId sets the optional parameter "requestId": An optional
  69742. // request ID to identify requests. Specify a unique request ID so that
  69743. // if you must retry your request, the server will know to ignore the
  69744. // request if it has already been completed.
  69745. //
  69746. // For example, consider a situation where you make an initial request
  69747. // and the request times out. If you make the request again with the
  69748. // same request ID, the server can check if original operation with the
  69749. // same request ID was received, and if so, will ignore the second
  69750. // request. This prevents clients from accidentally creating duplicate
  69751. // commitments.
  69752. //
  69753. // The request ID must be a valid UUID with the exception that zero UUID
  69754. // is not supported (00000000-0000-0000-0000-000000000000).
  69755. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  69756. c.urlParams_.Set("requestId", requestId)
  69757. return c
  69758. }
  69759. // Fields allows partial responses to be retrieved. See
  69760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69761. // for more information.
  69762. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  69763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69764. return c
  69765. }
  69766. // Context sets the context to be used in this call's Do method. Any
  69767. // pending HTTP request will be aborted if the provided context is
  69768. // canceled.
  69769. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  69770. c.ctx_ = ctx
  69771. return c
  69772. }
  69773. // Header returns an http.Header that can be modified by the caller to
  69774. // add HTTP headers to the request.
  69775. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  69776. if c.header_ == nil {
  69777. c.header_ = make(http.Header)
  69778. }
  69779. return c.header_
  69780. }
  69781. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  69782. reqHeaders := make(http.Header)
  69783. for k, v := range c.header_ {
  69784. reqHeaders[k] = v
  69785. }
  69786. reqHeaders.Set("User-Agent", c.s.userAgent())
  69787. var body io.Reader = nil
  69788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  69789. if err != nil {
  69790. return nil, err
  69791. }
  69792. reqHeaders.Set("Content-Type", "application/json")
  69793. c.urlParams_.Set("alt", alt)
  69794. c.urlParams_.Set("prettyPrint", "false")
  69795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  69796. urls += "?" + c.urlParams_.Encode()
  69797. req, err := http.NewRequest("POST", urls, body)
  69798. if err != nil {
  69799. return nil, err
  69800. }
  69801. req.Header = reqHeaders
  69802. googleapi.Expand(req.URL, map[string]string{
  69803. "project": c.project,
  69804. "zone": c.zone,
  69805. "instance": c.instance,
  69806. })
  69807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69808. }
  69809. // Do executes the "compute.instances.setServiceAccount" call.
  69810. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69811. // status code is an error. Response headers are in either
  69812. // *Operation.ServerResponse.Header or (if a response was returned at
  69813. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69814. // to check whether the returned error was because
  69815. // http.StatusNotModified was returned.
  69816. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69817. gensupport.SetOptions(c.urlParams_, opts...)
  69818. res, err := c.doRequest("json")
  69819. if res != nil && res.StatusCode == http.StatusNotModified {
  69820. if res.Body != nil {
  69821. res.Body.Close()
  69822. }
  69823. return nil, &googleapi.Error{
  69824. Code: res.StatusCode,
  69825. Header: res.Header,
  69826. }
  69827. }
  69828. if err != nil {
  69829. return nil, err
  69830. }
  69831. defer googleapi.CloseBody(res)
  69832. if err := googleapi.CheckResponse(res); err != nil {
  69833. return nil, err
  69834. }
  69835. ret := &Operation{
  69836. ServerResponse: googleapi.ServerResponse{
  69837. Header: res.Header,
  69838. HTTPStatusCode: res.StatusCode,
  69839. },
  69840. }
  69841. target := &ret
  69842. if err := gensupport.DecodeResponse(target, res); err != nil {
  69843. return nil, err
  69844. }
  69845. return ret, nil
  69846. // {
  69847. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  69848. // "httpMethod": "POST",
  69849. // "id": "compute.instances.setServiceAccount",
  69850. // "parameterOrder": [
  69851. // "project",
  69852. // "zone",
  69853. // "instance"
  69854. // ],
  69855. // "parameters": {
  69856. // "instance": {
  69857. // "description": "Name of the instance resource to start.",
  69858. // "location": "path",
  69859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69860. // "required": true,
  69861. // "type": "string"
  69862. // },
  69863. // "project": {
  69864. // "description": "Project ID for this request.",
  69865. // "location": "path",
  69866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69867. // "required": true,
  69868. // "type": "string"
  69869. // },
  69870. // "requestId": {
  69871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69872. // "location": "query",
  69873. // "type": "string"
  69874. // },
  69875. // "zone": {
  69876. // "description": "The name of the zone for this request.",
  69877. // "location": "path",
  69878. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69879. // "required": true,
  69880. // "type": "string"
  69881. // }
  69882. // },
  69883. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  69884. // "request": {
  69885. // "$ref": "InstancesSetServiceAccountRequest"
  69886. // },
  69887. // "response": {
  69888. // "$ref": "Operation"
  69889. // },
  69890. // "scopes": [
  69891. // "https://www.googleapis.com/auth/cloud-platform",
  69892. // "https://www.googleapis.com/auth/compute"
  69893. // ]
  69894. // }
  69895. }
  69896. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  69897. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  69898. s *Service
  69899. project string
  69900. zone string
  69901. instance string
  69902. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  69903. urlParams_ gensupport.URLParams
  69904. ctx_ context.Context
  69905. header_ http.Header
  69906. }
  69907. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  69908. // for a VM instance. You can only use this method on a running VM
  69909. // instance. This method supports PATCH semantics and uses the JSON
  69910. // merge patch format and processing rules.
  69911. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  69912. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69913. c.project = project
  69914. c.zone = zone
  69915. c.instance = instance
  69916. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  69917. return c
  69918. }
  69919. // RequestId sets the optional parameter "requestId": An optional
  69920. // request ID to identify requests. Specify a unique request ID so that
  69921. // if you must retry your request, the server will know to ignore the
  69922. // request if it has already been completed.
  69923. //
  69924. // For example, consider a situation where you make an initial request
  69925. // and the request times out. If you make the request again with the
  69926. // same request ID, the server can check if original operation with the
  69927. // same request ID was received, and if so, will ignore the second
  69928. // request. This prevents clients from accidentally creating duplicate
  69929. // commitments.
  69930. //
  69931. // The request ID must be a valid UUID with the exception that zero UUID
  69932. // is not supported (00000000-0000-0000-0000-000000000000).
  69933. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  69934. c.urlParams_.Set("requestId", requestId)
  69935. return c
  69936. }
  69937. // Fields allows partial responses to be retrieved. See
  69938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69939. // for more information.
  69940. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  69941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69942. return c
  69943. }
  69944. // Context sets the context to be used in this call's Do method. Any
  69945. // pending HTTP request will be aborted if the provided context is
  69946. // canceled.
  69947. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  69948. c.ctx_ = ctx
  69949. return c
  69950. }
  69951. // Header returns an http.Header that can be modified by the caller to
  69952. // add HTTP headers to the request.
  69953. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  69954. if c.header_ == nil {
  69955. c.header_ = make(http.Header)
  69956. }
  69957. return c.header_
  69958. }
  69959. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  69960. reqHeaders := make(http.Header)
  69961. for k, v := range c.header_ {
  69962. reqHeaders[k] = v
  69963. }
  69964. reqHeaders.Set("User-Agent", c.s.userAgent())
  69965. var body io.Reader = nil
  69966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  69967. if err != nil {
  69968. return nil, err
  69969. }
  69970. reqHeaders.Set("Content-Type", "application/json")
  69971. c.urlParams_.Set("alt", alt)
  69972. c.urlParams_.Set("prettyPrint", "false")
  69973. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  69974. urls += "?" + c.urlParams_.Encode()
  69975. req, err := http.NewRequest("PATCH", urls, body)
  69976. if err != nil {
  69977. return nil, err
  69978. }
  69979. req.Header = reqHeaders
  69980. googleapi.Expand(req.URL, map[string]string{
  69981. "project": c.project,
  69982. "zone": c.zone,
  69983. "instance": c.instance,
  69984. })
  69985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69986. }
  69987. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  69988. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69989. // status code is an error. Response headers are in either
  69990. // *Operation.ServerResponse.Header or (if a response was returned at
  69991. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69992. // to check whether the returned error was because
  69993. // http.StatusNotModified was returned.
  69994. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69995. gensupport.SetOptions(c.urlParams_, opts...)
  69996. res, err := c.doRequest("json")
  69997. if res != nil && res.StatusCode == http.StatusNotModified {
  69998. if res.Body != nil {
  69999. res.Body.Close()
  70000. }
  70001. return nil, &googleapi.Error{
  70002. Code: res.StatusCode,
  70003. Header: res.Header,
  70004. }
  70005. }
  70006. if err != nil {
  70007. return nil, err
  70008. }
  70009. defer googleapi.CloseBody(res)
  70010. if err := googleapi.CheckResponse(res); err != nil {
  70011. return nil, err
  70012. }
  70013. ret := &Operation{
  70014. ServerResponse: googleapi.ServerResponse{
  70015. Header: res.Header,
  70016. HTTPStatusCode: res.StatusCode,
  70017. },
  70018. }
  70019. target := &ret
  70020. if err := gensupport.DecodeResponse(target, res); err != nil {
  70021. return nil, err
  70022. }
  70023. return ret, nil
  70024. // {
  70025. // "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.",
  70026. // "httpMethod": "PATCH",
  70027. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  70028. // "parameterOrder": [
  70029. // "project",
  70030. // "zone",
  70031. // "instance"
  70032. // ],
  70033. // "parameters": {
  70034. // "instance": {
  70035. // "description": "Name of the instance scoping this request.",
  70036. // "location": "path",
  70037. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70038. // "required": true,
  70039. // "type": "string"
  70040. // },
  70041. // "project": {
  70042. // "description": "Project ID for this request.",
  70043. // "location": "path",
  70044. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70045. // "required": true,
  70046. // "type": "string"
  70047. // },
  70048. // "requestId": {
  70049. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70050. // "location": "query",
  70051. // "type": "string"
  70052. // },
  70053. // "zone": {
  70054. // "description": "The name of the zone for this request.",
  70055. // "location": "path",
  70056. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70057. // "required": true,
  70058. // "type": "string"
  70059. // }
  70060. // },
  70061. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  70062. // "request": {
  70063. // "$ref": "ShieldedVmIntegrityPolicy"
  70064. // },
  70065. // "response": {
  70066. // "$ref": "Operation"
  70067. // },
  70068. // "scopes": [
  70069. // "https://www.googleapis.com/auth/cloud-platform",
  70070. // "https://www.googleapis.com/auth/compute"
  70071. // ]
  70072. // }
  70073. }
  70074. // method id "compute.instances.setTags":
  70075. type InstancesSetTagsCall struct {
  70076. s *Service
  70077. project string
  70078. zone string
  70079. instance string
  70080. tags *Tags
  70081. urlParams_ gensupport.URLParams
  70082. ctx_ context.Context
  70083. header_ http.Header
  70084. }
  70085. // SetTags: Sets network tags for the specified instance to the data
  70086. // included in the request.
  70087. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  70088. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  70089. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70090. c.project = project
  70091. c.zone = zone
  70092. c.instance = instance
  70093. c.tags = tags
  70094. return c
  70095. }
  70096. // RequestId sets the optional parameter "requestId": An optional
  70097. // request ID to identify requests. Specify a unique request ID so that
  70098. // if you must retry your request, the server will know to ignore the
  70099. // request if it has already been completed.
  70100. //
  70101. // For example, consider a situation where you make an initial request
  70102. // and the request times out. If you make the request again with the
  70103. // same request ID, the server can check if original operation with the
  70104. // same request ID was received, and if so, will ignore the second
  70105. // request. This prevents clients from accidentally creating duplicate
  70106. // commitments.
  70107. //
  70108. // The request ID must be a valid UUID with the exception that zero UUID
  70109. // is not supported (00000000-0000-0000-0000-000000000000).
  70110. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  70111. c.urlParams_.Set("requestId", requestId)
  70112. return c
  70113. }
  70114. // Fields allows partial responses to be retrieved. See
  70115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70116. // for more information.
  70117. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  70118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70119. return c
  70120. }
  70121. // Context sets the context to be used in this call's Do method. Any
  70122. // pending HTTP request will be aborted if the provided context is
  70123. // canceled.
  70124. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  70125. c.ctx_ = ctx
  70126. return c
  70127. }
  70128. // Header returns an http.Header that can be modified by the caller to
  70129. // add HTTP headers to the request.
  70130. func (c *InstancesSetTagsCall) Header() http.Header {
  70131. if c.header_ == nil {
  70132. c.header_ = make(http.Header)
  70133. }
  70134. return c.header_
  70135. }
  70136. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  70137. reqHeaders := make(http.Header)
  70138. for k, v := range c.header_ {
  70139. reqHeaders[k] = v
  70140. }
  70141. reqHeaders.Set("User-Agent", c.s.userAgent())
  70142. var body io.Reader = nil
  70143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  70144. if err != nil {
  70145. return nil, err
  70146. }
  70147. reqHeaders.Set("Content-Type", "application/json")
  70148. c.urlParams_.Set("alt", alt)
  70149. c.urlParams_.Set("prettyPrint", "false")
  70150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  70151. urls += "?" + c.urlParams_.Encode()
  70152. req, err := http.NewRequest("POST", urls, body)
  70153. if err != nil {
  70154. return nil, err
  70155. }
  70156. req.Header = reqHeaders
  70157. googleapi.Expand(req.URL, map[string]string{
  70158. "project": c.project,
  70159. "zone": c.zone,
  70160. "instance": c.instance,
  70161. })
  70162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70163. }
  70164. // Do executes the "compute.instances.setTags" call.
  70165. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70166. // status code is an error. Response headers are in either
  70167. // *Operation.ServerResponse.Header or (if a response was returned at
  70168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70169. // to check whether the returned error was because
  70170. // http.StatusNotModified was returned.
  70171. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70172. gensupport.SetOptions(c.urlParams_, opts...)
  70173. res, err := c.doRequest("json")
  70174. if res != nil && res.StatusCode == http.StatusNotModified {
  70175. if res.Body != nil {
  70176. res.Body.Close()
  70177. }
  70178. return nil, &googleapi.Error{
  70179. Code: res.StatusCode,
  70180. Header: res.Header,
  70181. }
  70182. }
  70183. if err != nil {
  70184. return nil, err
  70185. }
  70186. defer googleapi.CloseBody(res)
  70187. if err := googleapi.CheckResponse(res); err != nil {
  70188. return nil, err
  70189. }
  70190. ret := &Operation{
  70191. ServerResponse: googleapi.ServerResponse{
  70192. Header: res.Header,
  70193. HTTPStatusCode: res.StatusCode,
  70194. },
  70195. }
  70196. target := &ret
  70197. if err := gensupport.DecodeResponse(target, res); err != nil {
  70198. return nil, err
  70199. }
  70200. return ret, nil
  70201. // {
  70202. // "description": "Sets network tags for the specified instance to the data included in the request.",
  70203. // "httpMethod": "POST",
  70204. // "id": "compute.instances.setTags",
  70205. // "parameterOrder": [
  70206. // "project",
  70207. // "zone",
  70208. // "instance"
  70209. // ],
  70210. // "parameters": {
  70211. // "instance": {
  70212. // "description": "Name of the instance scoping this request.",
  70213. // "location": "path",
  70214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70215. // "required": true,
  70216. // "type": "string"
  70217. // },
  70218. // "project": {
  70219. // "description": "Project ID for this request.",
  70220. // "location": "path",
  70221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70222. // "required": true,
  70223. // "type": "string"
  70224. // },
  70225. // "requestId": {
  70226. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70227. // "location": "query",
  70228. // "type": "string"
  70229. // },
  70230. // "zone": {
  70231. // "description": "The name of the zone for this request.",
  70232. // "location": "path",
  70233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70234. // "required": true,
  70235. // "type": "string"
  70236. // }
  70237. // },
  70238. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  70239. // "request": {
  70240. // "$ref": "Tags"
  70241. // },
  70242. // "response": {
  70243. // "$ref": "Operation"
  70244. // },
  70245. // "scopes": [
  70246. // "https://www.googleapis.com/auth/cloud-platform",
  70247. // "https://www.googleapis.com/auth/compute"
  70248. // ]
  70249. // }
  70250. }
  70251. // method id "compute.instances.simulateMaintenanceEvent":
  70252. type InstancesSimulateMaintenanceEventCall struct {
  70253. s *Service
  70254. project string
  70255. zone string
  70256. instance string
  70257. urlParams_ gensupport.URLParams
  70258. ctx_ context.Context
  70259. header_ http.Header
  70260. }
  70261. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  70262. // instance.
  70263. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  70264. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70265. c.project = project
  70266. c.zone = zone
  70267. c.instance = instance
  70268. return c
  70269. }
  70270. // Fields allows partial responses to be retrieved. See
  70271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70272. // for more information.
  70273. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  70274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70275. return c
  70276. }
  70277. // Context sets the context to be used in this call's Do method. Any
  70278. // pending HTTP request will be aborted if the provided context is
  70279. // canceled.
  70280. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  70281. c.ctx_ = ctx
  70282. return c
  70283. }
  70284. // Header returns an http.Header that can be modified by the caller to
  70285. // add HTTP headers to the request.
  70286. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  70287. if c.header_ == nil {
  70288. c.header_ = make(http.Header)
  70289. }
  70290. return c.header_
  70291. }
  70292. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  70293. reqHeaders := make(http.Header)
  70294. for k, v := range c.header_ {
  70295. reqHeaders[k] = v
  70296. }
  70297. reqHeaders.Set("User-Agent", c.s.userAgent())
  70298. var body io.Reader = nil
  70299. c.urlParams_.Set("alt", alt)
  70300. c.urlParams_.Set("prettyPrint", "false")
  70301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  70302. urls += "?" + c.urlParams_.Encode()
  70303. req, err := http.NewRequest("POST", urls, body)
  70304. if err != nil {
  70305. return nil, err
  70306. }
  70307. req.Header = reqHeaders
  70308. googleapi.Expand(req.URL, map[string]string{
  70309. "project": c.project,
  70310. "zone": c.zone,
  70311. "instance": c.instance,
  70312. })
  70313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70314. }
  70315. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  70316. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70317. // status code is an error. Response headers are in either
  70318. // *Operation.ServerResponse.Header or (if a response was returned at
  70319. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70320. // to check whether the returned error was because
  70321. // http.StatusNotModified was returned.
  70322. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70323. gensupport.SetOptions(c.urlParams_, opts...)
  70324. res, err := c.doRequest("json")
  70325. if res != nil && res.StatusCode == http.StatusNotModified {
  70326. if res.Body != nil {
  70327. res.Body.Close()
  70328. }
  70329. return nil, &googleapi.Error{
  70330. Code: res.StatusCode,
  70331. Header: res.Header,
  70332. }
  70333. }
  70334. if err != nil {
  70335. return nil, err
  70336. }
  70337. defer googleapi.CloseBody(res)
  70338. if err := googleapi.CheckResponse(res); err != nil {
  70339. return nil, err
  70340. }
  70341. ret := &Operation{
  70342. ServerResponse: googleapi.ServerResponse{
  70343. Header: res.Header,
  70344. HTTPStatusCode: res.StatusCode,
  70345. },
  70346. }
  70347. target := &ret
  70348. if err := gensupport.DecodeResponse(target, res); err != nil {
  70349. return nil, err
  70350. }
  70351. return ret, nil
  70352. // {
  70353. // "description": "Simulates a maintenance event on the instance.",
  70354. // "httpMethod": "POST",
  70355. // "id": "compute.instances.simulateMaintenanceEvent",
  70356. // "parameterOrder": [
  70357. // "project",
  70358. // "zone",
  70359. // "instance"
  70360. // ],
  70361. // "parameters": {
  70362. // "instance": {
  70363. // "description": "Name of the instance scoping this request.",
  70364. // "location": "path",
  70365. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70366. // "required": true,
  70367. // "type": "string"
  70368. // },
  70369. // "project": {
  70370. // "description": "Project ID for this request.",
  70371. // "location": "path",
  70372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70373. // "required": true,
  70374. // "type": "string"
  70375. // },
  70376. // "zone": {
  70377. // "description": "The name of the zone for this request.",
  70378. // "location": "path",
  70379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70380. // "required": true,
  70381. // "type": "string"
  70382. // }
  70383. // },
  70384. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  70385. // "response": {
  70386. // "$ref": "Operation"
  70387. // },
  70388. // "scopes": [
  70389. // "https://www.googleapis.com/auth/cloud-platform",
  70390. // "https://www.googleapis.com/auth/compute"
  70391. // ]
  70392. // }
  70393. }
  70394. // method id "compute.instances.start":
  70395. type InstancesStartCall struct {
  70396. s *Service
  70397. project string
  70398. zone string
  70399. instance string
  70400. urlParams_ gensupport.URLParams
  70401. ctx_ context.Context
  70402. header_ http.Header
  70403. }
  70404. // Start: Starts an instance that was stopped using the instances().stop
  70405. // method. For more information, see Restart an instance.
  70406. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  70407. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  70408. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70409. c.project = project
  70410. c.zone = zone
  70411. c.instance = instance
  70412. return c
  70413. }
  70414. // RequestId sets the optional parameter "requestId": An optional
  70415. // request ID to identify requests. Specify a unique request ID so that
  70416. // if you must retry your request, the server will know to ignore the
  70417. // request if it has already been completed.
  70418. //
  70419. // For example, consider a situation where you make an initial request
  70420. // and the request times out. If you make the request again with the
  70421. // same request ID, the server can check if original operation with the
  70422. // same request ID was received, and if so, will ignore the second
  70423. // request. This prevents clients from accidentally creating duplicate
  70424. // commitments.
  70425. //
  70426. // The request ID must be a valid UUID with the exception that zero UUID
  70427. // is not supported (00000000-0000-0000-0000-000000000000).
  70428. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  70429. c.urlParams_.Set("requestId", requestId)
  70430. return c
  70431. }
  70432. // Fields allows partial responses to be retrieved. See
  70433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70434. // for more information.
  70435. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  70436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70437. return c
  70438. }
  70439. // Context sets the context to be used in this call's Do method. Any
  70440. // pending HTTP request will be aborted if the provided context is
  70441. // canceled.
  70442. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  70443. c.ctx_ = ctx
  70444. return c
  70445. }
  70446. // Header returns an http.Header that can be modified by the caller to
  70447. // add HTTP headers to the request.
  70448. func (c *InstancesStartCall) Header() http.Header {
  70449. if c.header_ == nil {
  70450. c.header_ = make(http.Header)
  70451. }
  70452. return c.header_
  70453. }
  70454. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  70455. reqHeaders := make(http.Header)
  70456. for k, v := range c.header_ {
  70457. reqHeaders[k] = v
  70458. }
  70459. reqHeaders.Set("User-Agent", c.s.userAgent())
  70460. var body io.Reader = nil
  70461. c.urlParams_.Set("alt", alt)
  70462. c.urlParams_.Set("prettyPrint", "false")
  70463. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  70464. urls += "?" + c.urlParams_.Encode()
  70465. req, err := http.NewRequest("POST", urls, body)
  70466. if err != nil {
  70467. return nil, err
  70468. }
  70469. req.Header = reqHeaders
  70470. googleapi.Expand(req.URL, map[string]string{
  70471. "project": c.project,
  70472. "zone": c.zone,
  70473. "instance": c.instance,
  70474. })
  70475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70476. }
  70477. // Do executes the "compute.instances.start" call.
  70478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70479. // status code is an error. Response headers are in either
  70480. // *Operation.ServerResponse.Header or (if a response was returned at
  70481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70482. // to check whether the returned error was because
  70483. // http.StatusNotModified was returned.
  70484. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70485. gensupport.SetOptions(c.urlParams_, opts...)
  70486. res, err := c.doRequest("json")
  70487. if res != nil && res.StatusCode == http.StatusNotModified {
  70488. if res.Body != nil {
  70489. res.Body.Close()
  70490. }
  70491. return nil, &googleapi.Error{
  70492. Code: res.StatusCode,
  70493. Header: res.Header,
  70494. }
  70495. }
  70496. if err != nil {
  70497. return nil, err
  70498. }
  70499. defer googleapi.CloseBody(res)
  70500. if err := googleapi.CheckResponse(res); err != nil {
  70501. return nil, err
  70502. }
  70503. ret := &Operation{
  70504. ServerResponse: googleapi.ServerResponse{
  70505. Header: res.Header,
  70506. HTTPStatusCode: res.StatusCode,
  70507. },
  70508. }
  70509. target := &ret
  70510. if err := gensupport.DecodeResponse(target, res); err != nil {
  70511. return nil, err
  70512. }
  70513. return ret, nil
  70514. // {
  70515. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  70516. // "httpMethod": "POST",
  70517. // "id": "compute.instances.start",
  70518. // "parameterOrder": [
  70519. // "project",
  70520. // "zone",
  70521. // "instance"
  70522. // ],
  70523. // "parameters": {
  70524. // "instance": {
  70525. // "description": "Name of the instance resource to start.",
  70526. // "location": "path",
  70527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70528. // "required": true,
  70529. // "type": "string"
  70530. // },
  70531. // "project": {
  70532. // "description": "Project ID for this request.",
  70533. // "location": "path",
  70534. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70535. // "required": true,
  70536. // "type": "string"
  70537. // },
  70538. // "requestId": {
  70539. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70540. // "location": "query",
  70541. // "type": "string"
  70542. // },
  70543. // "zone": {
  70544. // "description": "The name of the zone for this request.",
  70545. // "location": "path",
  70546. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70547. // "required": true,
  70548. // "type": "string"
  70549. // }
  70550. // },
  70551. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  70552. // "response": {
  70553. // "$ref": "Operation"
  70554. // },
  70555. // "scopes": [
  70556. // "https://www.googleapis.com/auth/cloud-platform",
  70557. // "https://www.googleapis.com/auth/compute"
  70558. // ]
  70559. // }
  70560. }
  70561. // method id "compute.instances.startWithEncryptionKey":
  70562. type InstancesStartWithEncryptionKeyCall struct {
  70563. s *Service
  70564. project string
  70565. zone string
  70566. instance string
  70567. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  70568. urlParams_ gensupport.URLParams
  70569. ctx_ context.Context
  70570. header_ http.Header
  70571. }
  70572. // StartWithEncryptionKey: Starts an instance that was stopped using the
  70573. // instances().stop method. For more information, see Restart an
  70574. // instance.
  70575. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  70576. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70577. c.project = project
  70578. c.zone = zone
  70579. c.instance = instance
  70580. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  70581. return c
  70582. }
  70583. // RequestId sets the optional parameter "requestId": An optional
  70584. // request ID to identify requests. Specify a unique request ID so that
  70585. // if you must retry your request, the server will know to ignore the
  70586. // request if it has already been completed.
  70587. //
  70588. // For example, consider a situation where you make an initial request
  70589. // and the request times out. If you make the request again with the
  70590. // same request ID, the server can check if original operation with the
  70591. // same request ID was received, and if so, will ignore the second
  70592. // request. This prevents clients from accidentally creating duplicate
  70593. // commitments.
  70594. //
  70595. // The request ID must be a valid UUID with the exception that zero UUID
  70596. // is not supported (00000000-0000-0000-0000-000000000000).
  70597. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  70598. c.urlParams_.Set("requestId", requestId)
  70599. return c
  70600. }
  70601. // Fields allows partial responses to be retrieved. See
  70602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70603. // for more information.
  70604. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  70605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70606. return c
  70607. }
  70608. // Context sets the context to be used in this call's Do method. Any
  70609. // pending HTTP request will be aborted if the provided context is
  70610. // canceled.
  70611. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  70612. c.ctx_ = ctx
  70613. return c
  70614. }
  70615. // Header returns an http.Header that can be modified by the caller to
  70616. // add HTTP headers to the request.
  70617. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  70618. if c.header_ == nil {
  70619. c.header_ = make(http.Header)
  70620. }
  70621. return c.header_
  70622. }
  70623. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  70624. reqHeaders := make(http.Header)
  70625. for k, v := range c.header_ {
  70626. reqHeaders[k] = v
  70627. }
  70628. reqHeaders.Set("User-Agent", c.s.userAgent())
  70629. var body io.Reader = nil
  70630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  70631. if err != nil {
  70632. return nil, err
  70633. }
  70634. reqHeaders.Set("Content-Type", "application/json")
  70635. c.urlParams_.Set("alt", alt)
  70636. c.urlParams_.Set("prettyPrint", "false")
  70637. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  70638. urls += "?" + c.urlParams_.Encode()
  70639. req, err := http.NewRequest("POST", urls, body)
  70640. if err != nil {
  70641. return nil, err
  70642. }
  70643. req.Header = reqHeaders
  70644. googleapi.Expand(req.URL, map[string]string{
  70645. "project": c.project,
  70646. "zone": c.zone,
  70647. "instance": c.instance,
  70648. })
  70649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70650. }
  70651. // Do executes the "compute.instances.startWithEncryptionKey" call.
  70652. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70653. // status code is an error. Response headers are in either
  70654. // *Operation.ServerResponse.Header or (if a response was returned at
  70655. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70656. // to check whether the returned error was because
  70657. // http.StatusNotModified was returned.
  70658. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70659. gensupport.SetOptions(c.urlParams_, opts...)
  70660. res, err := c.doRequest("json")
  70661. if res != nil && res.StatusCode == http.StatusNotModified {
  70662. if res.Body != nil {
  70663. res.Body.Close()
  70664. }
  70665. return nil, &googleapi.Error{
  70666. Code: res.StatusCode,
  70667. Header: res.Header,
  70668. }
  70669. }
  70670. if err != nil {
  70671. return nil, err
  70672. }
  70673. defer googleapi.CloseBody(res)
  70674. if err := googleapi.CheckResponse(res); err != nil {
  70675. return nil, err
  70676. }
  70677. ret := &Operation{
  70678. ServerResponse: googleapi.ServerResponse{
  70679. Header: res.Header,
  70680. HTTPStatusCode: res.StatusCode,
  70681. },
  70682. }
  70683. target := &ret
  70684. if err := gensupport.DecodeResponse(target, res); err != nil {
  70685. return nil, err
  70686. }
  70687. return ret, nil
  70688. // {
  70689. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  70690. // "httpMethod": "POST",
  70691. // "id": "compute.instances.startWithEncryptionKey",
  70692. // "parameterOrder": [
  70693. // "project",
  70694. // "zone",
  70695. // "instance"
  70696. // ],
  70697. // "parameters": {
  70698. // "instance": {
  70699. // "description": "Name of the instance resource to start.",
  70700. // "location": "path",
  70701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70702. // "required": true,
  70703. // "type": "string"
  70704. // },
  70705. // "project": {
  70706. // "description": "Project ID for this request.",
  70707. // "location": "path",
  70708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70709. // "required": true,
  70710. // "type": "string"
  70711. // },
  70712. // "requestId": {
  70713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70714. // "location": "query",
  70715. // "type": "string"
  70716. // },
  70717. // "zone": {
  70718. // "description": "The name of the zone for this request.",
  70719. // "location": "path",
  70720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70721. // "required": true,
  70722. // "type": "string"
  70723. // }
  70724. // },
  70725. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  70726. // "request": {
  70727. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  70728. // },
  70729. // "response": {
  70730. // "$ref": "Operation"
  70731. // },
  70732. // "scopes": [
  70733. // "https://www.googleapis.com/auth/cloud-platform",
  70734. // "https://www.googleapis.com/auth/compute"
  70735. // ]
  70736. // }
  70737. }
  70738. // method id "compute.instances.stop":
  70739. type InstancesStopCall struct {
  70740. s *Service
  70741. project string
  70742. zone string
  70743. instance string
  70744. urlParams_ gensupport.URLParams
  70745. ctx_ context.Context
  70746. header_ http.Header
  70747. }
  70748. // Stop: Stops a running instance, shutting it down cleanly, and allows
  70749. // you to restart the instance at a later time. Stopped instances do not
  70750. // incur VM usage charges while they are stopped. However, resources
  70751. // that the VM is using, such as persistent disks and static IP
  70752. // addresses, will continue to be charged until they are deleted. For
  70753. // more information, see Stopping an instance.
  70754. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  70755. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  70756. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70757. c.project = project
  70758. c.zone = zone
  70759. c.instance = instance
  70760. return c
  70761. }
  70762. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  70763. // true, discard the contents of any attached localSSD partitions.
  70764. // Default value is false (== preserve localSSD data).
  70765. func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall {
  70766. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  70767. return c
  70768. }
  70769. // RequestId sets the optional parameter "requestId": An optional
  70770. // request ID to identify requests. Specify a unique request ID so that
  70771. // if you must retry your request, the server will know to ignore the
  70772. // request if it has already been completed.
  70773. //
  70774. // For example, consider a situation where you make an initial request
  70775. // and the request times out. If you make the request again with the
  70776. // same request ID, the server can check if original operation with the
  70777. // same request ID was received, and if so, will ignore the second
  70778. // request. This prevents clients from accidentally creating duplicate
  70779. // commitments.
  70780. //
  70781. // The request ID must be a valid UUID with the exception that zero UUID
  70782. // is not supported (00000000-0000-0000-0000-000000000000).
  70783. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  70784. c.urlParams_.Set("requestId", requestId)
  70785. return c
  70786. }
  70787. // Fields allows partial responses to be retrieved. See
  70788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70789. // for more information.
  70790. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  70791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70792. return c
  70793. }
  70794. // Context sets the context to be used in this call's Do method. Any
  70795. // pending HTTP request will be aborted if the provided context is
  70796. // canceled.
  70797. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  70798. c.ctx_ = ctx
  70799. return c
  70800. }
  70801. // Header returns an http.Header that can be modified by the caller to
  70802. // add HTTP headers to the request.
  70803. func (c *InstancesStopCall) Header() http.Header {
  70804. if c.header_ == nil {
  70805. c.header_ = make(http.Header)
  70806. }
  70807. return c.header_
  70808. }
  70809. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  70810. reqHeaders := make(http.Header)
  70811. for k, v := range c.header_ {
  70812. reqHeaders[k] = v
  70813. }
  70814. reqHeaders.Set("User-Agent", c.s.userAgent())
  70815. var body io.Reader = nil
  70816. c.urlParams_.Set("alt", alt)
  70817. c.urlParams_.Set("prettyPrint", "false")
  70818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  70819. urls += "?" + c.urlParams_.Encode()
  70820. req, err := http.NewRequest("POST", urls, body)
  70821. if err != nil {
  70822. return nil, err
  70823. }
  70824. req.Header = reqHeaders
  70825. googleapi.Expand(req.URL, map[string]string{
  70826. "project": c.project,
  70827. "zone": c.zone,
  70828. "instance": c.instance,
  70829. })
  70830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70831. }
  70832. // Do executes the "compute.instances.stop" call.
  70833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70834. // status code is an error. Response headers are in either
  70835. // *Operation.ServerResponse.Header or (if a response was returned at
  70836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70837. // to check whether the returned error was because
  70838. // http.StatusNotModified was returned.
  70839. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70840. gensupport.SetOptions(c.urlParams_, opts...)
  70841. res, err := c.doRequest("json")
  70842. if res != nil && res.StatusCode == http.StatusNotModified {
  70843. if res.Body != nil {
  70844. res.Body.Close()
  70845. }
  70846. return nil, &googleapi.Error{
  70847. Code: res.StatusCode,
  70848. Header: res.Header,
  70849. }
  70850. }
  70851. if err != nil {
  70852. return nil, err
  70853. }
  70854. defer googleapi.CloseBody(res)
  70855. if err := googleapi.CheckResponse(res); err != nil {
  70856. return nil, err
  70857. }
  70858. ret := &Operation{
  70859. ServerResponse: googleapi.ServerResponse{
  70860. Header: res.Header,
  70861. HTTPStatusCode: res.StatusCode,
  70862. },
  70863. }
  70864. target := &ret
  70865. if err := gensupport.DecodeResponse(target, res); err != nil {
  70866. return nil, err
  70867. }
  70868. return ret, nil
  70869. // {
  70870. // "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.",
  70871. // "httpMethod": "POST",
  70872. // "id": "compute.instances.stop",
  70873. // "parameterOrder": [
  70874. // "project",
  70875. // "zone",
  70876. // "instance"
  70877. // ],
  70878. // "parameters": {
  70879. // "discardLocalSsd": {
  70880. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  70881. // "location": "query",
  70882. // "type": "boolean"
  70883. // },
  70884. // "instance": {
  70885. // "description": "Name of the instance resource to stop.",
  70886. // "location": "path",
  70887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70888. // "required": true,
  70889. // "type": "string"
  70890. // },
  70891. // "project": {
  70892. // "description": "Project ID for this request.",
  70893. // "location": "path",
  70894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70895. // "required": true,
  70896. // "type": "string"
  70897. // },
  70898. // "requestId": {
  70899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70900. // "location": "query",
  70901. // "type": "string"
  70902. // },
  70903. // "zone": {
  70904. // "description": "The name of the zone for this request.",
  70905. // "location": "path",
  70906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70907. // "required": true,
  70908. // "type": "string"
  70909. // }
  70910. // },
  70911. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  70912. // "response": {
  70913. // "$ref": "Operation"
  70914. // },
  70915. // "scopes": [
  70916. // "https://www.googleapis.com/auth/cloud-platform",
  70917. // "https://www.googleapis.com/auth/compute"
  70918. // ]
  70919. // }
  70920. }
  70921. // method id "compute.instances.suspend":
  70922. type InstancesSuspendCall struct {
  70923. s *Service
  70924. project string
  70925. zone string
  70926. instance string
  70927. urlParams_ gensupport.URLParams
  70928. ctx_ context.Context
  70929. header_ http.Header
  70930. }
  70931. // Suspend: This method suspends a running instance, saving its state to
  70932. // persistent storage, and allows you to resume the instance at a later
  70933. // time. Suspended instances incur reduced per-minute, virtual machine
  70934. // usage charges while they are suspended. Any resources the virtual
  70935. // machine is using, such as persistent disks and static IP addresses,
  70936. // will continue to be charged until they are deleted.
  70937. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  70938. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70939. c.project = project
  70940. c.zone = zone
  70941. c.instance = instance
  70942. return c
  70943. }
  70944. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  70945. // true, discard the contents of any attached localSSD partitions.
  70946. // Default value is false (== preserve localSSD data).
  70947. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  70948. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  70949. return c
  70950. }
  70951. // RequestId sets the optional parameter "requestId": An optional
  70952. // request ID to identify requests. Specify a unique request ID so that
  70953. // if you must retry your request, the server will know to ignore the
  70954. // request if it has already been completed.
  70955. //
  70956. // For example, consider a situation where you make an initial request
  70957. // and the request times out. If you make the request again with the
  70958. // same request ID, the server can check if original operation with the
  70959. // same request ID was received, and if so, will ignore the second
  70960. // request. This prevents clients from accidentally creating duplicate
  70961. // commitments.
  70962. //
  70963. // The request ID must be a valid UUID with the exception that zero UUID
  70964. // is not supported (00000000-0000-0000-0000-000000000000).
  70965. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  70966. c.urlParams_.Set("requestId", requestId)
  70967. return c
  70968. }
  70969. // Fields allows partial responses to be retrieved. See
  70970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70971. // for more information.
  70972. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  70973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70974. return c
  70975. }
  70976. // Context sets the context to be used in this call's Do method. Any
  70977. // pending HTTP request will be aborted if the provided context is
  70978. // canceled.
  70979. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  70980. c.ctx_ = ctx
  70981. return c
  70982. }
  70983. // Header returns an http.Header that can be modified by the caller to
  70984. // add HTTP headers to the request.
  70985. func (c *InstancesSuspendCall) Header() http.Header {
  70986. if c.header_ == nil {
  70987. c.header_ = make(http.Header)
  70988. }
  70989. return c.header_
  70990. }
  70991. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  70992. reqHeaders := make(http.Header)
  70993. for k, v := range c.header_ {
  70994. reqHeaders[k] = v
  70995. }
  70996. reqHeaders.Set("User-Agent", c.s.userAgent())
  70997. var body io.Reader = nil
  70998. c.urlParams_.Set("alt", alt)
  70999. c.urlParams_.Set("prettyPrint", "false")
  71000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  71001. urls += "?" + c.urlParams_.Encode()
  71002. req, err := http.NewRequest("POST", urls, body)
  71003. if err != nil {
  71004. return nil, err
  71005. }
  71006. req.Header = reqHeaders
  71007. googleapi.Expand(req.URL, map[string]string{
  71008. "project": c.project,
  71009. "zone": c.zone,
  71010. "instance": c.instance,
  71011. })
  71012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71013. }
  71014. // Do executes the "compute.instances.suspend" call.
  71015. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71016. // status code is an error. Response headers are in either
  71017. // *Operation.ServerResponse.Header or (if a response was returned at
  71018. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71019. // to check whether the returned error was because
  71020. // http.StatusNotModified was returned.
  71021. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71022. gensupport.SetOptions(c.urlParams_, opts...)
  71023. res, err := c.doRequest("json")
  71024. if res != nil && res.StatusCode == http.StatusNotModified {
  71025. if res.Body != nil {
  71026. res.Body.Close()
  71027. }
  71028. return nil, &googleapi.Error{
  71029. Code: res.StatusCode,
  71030. Header: res.Header,
  71031. }
  71032. }
  71033. if err != nil {
  71034. return nil, err
  71035. }
  71036. defer googleapi.CloseBody(res)
  71037. if err := googleapi.CheckResponse(res); err != nil {
  71038. return nil, err
  71039. }
  71040. ret := &Operation{
  71041. ServerResponse: googleapi.ServerResponse{
  71042. Header: res.Header,
  71043. HTTPStatusCode: res.StatusCode,
  71044. },
  71045. }
  71046. target := &ret
  71047. if err := gensupport.DecodeResponse(target, res); err != nil {
  71048. return nil, err
  71049. }
  71050. return ret, nil
  71051. // {
  71052. // "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.",
  71053. // "httpMethod": "POST",
  71054. // "id": "compute.instances.suspend",
  71055. // "parameterOrder": [
  71056. // "project",
  71057. // "zone",
  71058. // "instance"
  71059. // ],
  71060. // "parameters": {
  71061. // "discardLocalSsd": {
  71062. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  71063. // "location": "query",
  71064. // "type": "boolean"
  71065. // },
  71066. // "instance": {
  71067. // "description": "Name of the instance resource to suspend.",
  71068. // "location": "path",
  71069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71070. // "required": true,
  71071. // "type": "string"
  71072. // },
  71073. // "project": {
  71074. // "description": "Project ID for this request.",
  71075. // "location": "path",
  71076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71077. // "required": true,
  71078. // "type": "string"
  71079. // },
  71080. // "requestId": {
  71081. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71082. // "location": "query",
  71083. // "type": "string"
  71084. // },
  71085. // "zone": {
  71086. // "description": "The name of the zone for this request.",
  71087. // "location": "path",
  71088. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71089. // "required": true,
  71090. // "type": "string"
  71091. // }
  71092. // },
  71093. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  71094. // "response": {
  71095. // "$ref": "Operation"
  71096. // },
  71097. // "scopes": [
  71098. // "https://www.googleapis.com/auth/cloud-platform",
  71099. // "https://www.googleapis.com/auth/compute"
  71100. // ]
  71101. // }
  71102. }
  71103. // method id "compute.instances.testIamPermissions":
  71104. type InstancesTestIamPermissionsCall struct {
  71105. s *Service
  71106. project string
  71107. zone string
  71108. resource string
  71109. testpermissionsrequest *TestPermissionsRequest
  71110. urlParams_ gensupport.URLParams
  71111. ctx_ context.Context
  71112. header_ http.Header
  71113. }
  71114. // TestIamPermissions: Returns permissions that a caller has on the
  71115. // specified resource.
  71116. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  71117. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71118. c.project = project
  71119. c.zone = zone
  71120. c.resource = resource
  71121. c.testpermissionsrequest = testpermissionsrequest
  71122. return c
  71123. }
  71124. // Fields allows partial responses to be retrieved. See
  71125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71126. // for more information.
  71127. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  71128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71129. return c
  71130. }
  71131. // Context sets the context to be used in this call's Do method. Any
  71132. // pending HTTP request will be aborted if the provided context is
  71133. // canceled.
  71134. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  71135. c.ctx_ = ctx
  71136. return c
  71137. }
  71138. // Header returns an http.Header that can be modified by the caller to
  71139. // add HTTP headers to the request.
  71140. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  71141. if c.header_ == nil {
  71142. c.header_ = make(http.Header)
  71143. }
  71144. return c.header_
  71145. }
  71146. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  71147. reqHeaders := make(http.Header)
  71148. for k, v := range c.header_ {
  71149. reqHeaders[k] = v
  71150. }
  71151. reqHeaders.Set("User-Agent", c.s.userAgent())
  71152. var body io.Reader = nil
  71153. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  71154. if err != nil {
  71155. return nil, err
  71156. }
  71157. reqHeaders.Set("Content-Type", "application/json")
  71158. c.urlParams_.Set("alt", alt)
  71159. c.urlParams_.Set("prettyPrint", "false")
  71160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  71161. urls += "?" + c.urlParams_.Encode()
  71162. req, err := http.NewRequest("POST", urls, body)
  71163. if err != nil {
  71164. return nil, err
  71165. }
  71166. req.Header = reqHeaders
  71167. googleapi.Expand(req.URL, map[string]string{
  71168. "project": c.project,
  71169. "zone": c.zone,
  71170. "resource": c.resource,
  71171. })
  71172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71173. }
  71174. // Do executes the "compute.instances.testIamPermissions" call.
  71175. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  71176. // non-2xx status code is an error. Response headers are in either
  71177. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  71178. // returned at all) in error.(*googleapi.Error).Header. Use
  71179. // googleapi.IsNotModified to check whether the returned error was
  71180. // because http.StatusNotModified was returned.
  71181. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  71182. gensupport.SetOptions(c.urlParams_, opts...)
  71183. res, err := c.doRequest("json")
  71184. if res != nil && res.StatusCode == http.StatusNotModified {
  71185. if res.Body != nil {
  71186. res.Body.Close()
  71187. }
  71188. return nil, &googleapi.Error{
  71189. Code: res.StatusCode,
  71190. Header: res.Header,
  71191. }
  71192. }
  71193. if err != nil {
  71194. return nil, err
  71195. }
  71196. defer googleapi.CloseBody(res)
  71197. if err := googleapi.CheckResponse(res); err != nil {
  71198. return nil, err
  71199. }
  71200. ret := &TestPermissionsResponse{
  71201. ServerResponse: googleapi.ServerResponse{
  71202. Header: res.Header,
  71203. HTTPStatusCode: res.StatusCode,
  71204. },
  71205. }
  71206. target := &ret
  71207. if err := gensupport.DecodeResponse(target, res); err != nil {
  71208. return nil, err
  71209. }
  71210. return ret, nil
  71211. // {
  71212. // "description": "Returns permissions that a caller has on the specified resource.",
  71213. // "httpMethod": "POST",
  71214. // "id": "compute.instances.testIamPermissions",
  71215. // "parameterOrder": [
  71216. // "project",
  71217. // "zone",
  71218. // "resource"
  71219. // ],
  71220. // "parameters": {
  71221. // "project": {
  71222. // "description": "Project ID for this request.",
  71223. // "location": "path",
  71224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71225. // "required": true,
  71226. // "type": "string"
  71227. // },
  71228. // "resource": {
  71229. // "description": "Name or id of the resource for this request.",
  71230. // "location": "path",
  71231. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71232. // "required": true,
  71233. // "type": "string"
  71234. // },
  71235. // "zone": {
  71236. // "description": "The name of the zone for this request.",
  71237. // "location": "path",
  71238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71239. // "required": true,
  71240. // "type": "string"
  71241. // }
  71242. // },
  71243. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  71244. // "request": {
  71245. // "$ref": "TestPermissionsRequest"
  71246. // },
  71247. // "response": {
  71248. // "$ref": "TestPermissionsResponse"
  71249. // },
  71250. // "scopes": [
  71251. // "https://www.googleapis.com/auth/cloud-platform",
  71252. // "https://www.googleapis.com/auth/compute",
  71253. // "https://www.googleapis.com/auth/compute.readonly"
  71254. // ]
  71255. // }
  71256. }
  71257. // method id "compute.instances.updateAccessConfig":
  71258. type InstancesUpdateAccessConfigCall struct {
  71259. s *Service
  71260. project string
  71261. zone string
  71262. instance string
  71263. accessconfig *AccessConfig
  71264. urlParams_ gensupport.URLParams
  71265. ctx_ context.Context
  71266. header_ http.Header
  71267. }
  71268. // UpdateAccessConfig: Updates the specified access config from an
  71269. // instance's network interface with the data included in the request.
  71270. // This method supports PATCH semantics and uses the JSON merge patch
  71271. // format and processing rules.
  71272. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  71273. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71274. c.project = project
  71275. c.zone = zone
  71276. c.instance = instance
  71277. c.urlParams_.Set("networkInterface", networkInterface)
  71278. c.accessconfig = accessconfig
  71279. return c
  71280. }
  71281. // RequestId sets the optional parameter "requestId": An optional
  71282. // request ID to identify requests. Specify a unique request ID so that
  71283. // if you must retry your request, the server will know to ignore the
  71284. // request if it has already been completed.
  71285. //
  71286. // For example, consider a situation where you make an initial request
  71287. // and the request times out. If you make the request again with the
  71288. // same request ID, the server can check if original operation with the
  71289. // same request ID was received, and if so, will ignore the second
  71290. // request. This prevents clients from accidentally creating duplicate
  71291. // commitments.
  71292. //
  71293. // The request ID must be a valid UUID with the exception that zero UUID
  71294. // is not supported (00000000-0000-0000-0000-000000000000).
  71295. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  71296. c.urlParams_.Set("requestId", requestId)
  71297. return c
  71298. }
  71299. // Fields allows partial responses to be retrieved. See
  71300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71301. // for more information.
  71302. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  71303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71304. return c
  71305. }
  71306. // Context sets the context to be used in this call's Do method. Any
  71307. // pending HTTP request will be aborted if the provided context is
  71308. // canceled.
  71309. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  71310. c.ctx_ = ctx
  71311. return c
  71312. }
  71313. // Header returns an http.Header that can be modified by the caller to
  71314. // add HTTP headers to the request.
  71315. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  71316. if c.header_ == nil {
  71317. c.header_ = make(http.Header)
  71318. }
  71319. return c.header_
  71320. }
  71321. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  71322. reqHeaders := make(http.Header)
  71323. for k, v := range c.header_ {
  71324. reqHeaders[k] = v
  71325. }
  71326. reqHeaders.Set("User-Agent", c.s.userAgent())
  71327. var body io.Reader = nil
  71328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  71329. if err != nil {
  71330. return nil, err
  71331. }
  71332. reqHeaders.Set("Content-Type", "application/json")
  71333. c.urlParams_.Set("alt", alt)
  71334. c.urlParams_.Set("prettyPrint", "false")
  71335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  71336. urls += "?" + c.urlParams_.Encode()
  71337. req, err := http.NewRequest("POST", urls, body)
  71338. if err != nil {
  71339. return nil, err
  71340. }
  71341. req.Header = reqHeaders
  71342. googleapi.Expand(req.URL, map[string]string{
  71343. "project": c.project,
  71344. "zone": c.zone,
  71345. "instance": c.instance,
  71346. })
  71347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71348. }
  71349. // Do executes the "compute.instances.updateAccessConfig" call.
  71350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71351. // status code is an error. Response headers are in either
  71352. // *Operation.ServerResponse.Header or (if a response was returned at
  71353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71354. // to check whether the returned error was because
  71355. // http.StatusNotModified was returned.
  71356. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71357. gensupport.SetOptions(c.urlParams_, opts...)
  71358. res, err := c.doRequest("json")
  71359. if res != nil && res.StatusCode == http.StatusNotModified {
  71360. if res.Body != nil {
  71361. res.Body.Close()
  71362. }
  71363. return nil, &googleapi.Error{
  71364. Code: res.StatusCode,
  71365. Header: res.Header,
  71366. }
  71367. }
  71368. if err != nil {
  71369. return nil, err
  71370. }
  71371. defer googleapi.CloseBody(res)
  71372. if err := googleapi.CheckResponse(res); err != nil {
  71373. return nil, err
  71374. }
  71375. ret := &Operation{
  71376. ServerResponse: googleapi.ServerResponse{
  71377. Header: res.Header,
  71378. HTTPStatusCode: res.StatusCode,
  71379. },
  71380. }
  71381. target := &ret
  71382. if err := gensupport.DecodeResponse(target, res); err != nil {
  71383. return nil, err
  71384. }
  71385. return ret, nil
  71386. // {
  71387. // "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.",
  71388. // "httpMethod": "POST",
  71389. // "id": "compute.instances.updateAccessConfig",
  71390. // "parameterOrder": [
  71391. // "project",
  71392. // "zone",
  71393. // "instance",
  71394. // "networkInterface"
  71395. // ],
  71396. // "parameters": {
  71397. // "instance": {
  71398. // "description": "The instance name for this request.",
  71399. // "location": "path",
  71400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71401. // "required": true,
  71402. // "type": "string"
  71403. // },
  71404. // "networkInterface": {
  71405. // "description": "The name of the network interface where the access config is attached.",
  71406. // "location": "query",
  71407. // "required": true,
  71408. // "type": "string"
  71409. // },
  71410. // "project": {
  71411. // "description": "Project ID for this request.",
  71412. // "location": "path",
  71413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71414. // "required": true,
  71415. // "type": "string"
  71416. // },
  71417. // "requestId": {
  71418. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71419. // "location": "query",
  71420. // "type": "string"
  71421. // },
  71422. // "zone": {
  71423. // "description": "The name of the zone for this request.",
  71424. // "location": "path",
  71425. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71426. // "required": true,
  71427. // "type": "string"
  71428. // }
  71429. // },
  71430. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  71431. // "request": {
  71432. // "$ref": "AccessConfig"
  71433. // },
  71434. // "response": {
  71435. // "$ref": "Operation"
  71436. // },
  71437. // "scopes": [
  71438. // "https://www.googleapis.com/auth/cloud-platform",
  71439. // "https://www.googleapis.com/auth/compute"
  71440. // ]
  71441. // }
  71442. }
  71443. // method id "compute.instances.updateDisplayDevice":
  71444. type InstancesUpdateDisplayDeviceCall struct {
  71445. s *Service
  71446. project string
  71447. zone string
  71448. instance string
  71449. displaydevice *DisplayDevice
  71450. urlParams_ gensupport.URLParams
  71451. ctx_ context.Context
  71452. header_ http.Header
  71453. }
  71454. // UpdateDisplayDevice: Updates the Display config for a VM instance.
  71455. // You can only use this method on a stopped VM instance. This method
  71456. // supports PATCH semantics and uses the JSON merge patch format and
  71457. // processing rules.
  71458. func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
  71459. c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71460. c.project = project
  71461. c.zone = zone
  71462. c.instance = instance
  71463. c.displaydevice = displaydevice
  71464. return c
  71465. }
  71466. // RequestId sets the optional parameter "requestId": An optional
  71467. // request ID to identify requests. Specify a unique request ID so that
  71468. // if you must retry your request, the server will know to ignore the
  71469. // request if it has already been completed.
  71470. //
  71471. // For example, consider a situation where you make an initial request
  71472. // and the request times out. If you make the request again with the
  71473. // same request ID, the server can check if original operation with the
  71474. // same request ID was received, and if so, will ignore the second
  71475. // request. This prevents clients from accidentally creating duplicate
  71476. // commitments.
  71477. //
  71478. // The request ID must be a valid UUID with the exception that zero UUID
  71479. // is not supported (00000000-0000-0000-0000-000000000000).
  71480. func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
  71481. c.urlParams_.Set("requestId", requestId)
  71482. return c
  71483. }
  71484. // Fields allows partial responses to be retrieved. See
  71485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71486. // for more information.
  71487. func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
  71488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71489. return c
  71490. }
  71491. // Context sets the context to be used in this call's Do method. Any
  71492. // pending HTTP request will be aborted if the provided context is
  71493. // canceled.
  71494. func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
  71495. c.ctx_ = ctx
  71496. return c
  71497. }
  71498. // Header returns an http.Header that can be modified by the caller to
  71499. // add HTTP headers to the request.
  71500. func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header {
  71501. if c.header_ == nil {
  71502. c.header_ = make(http.Header)
  71503. }
  71504. return c.header_
  71505. }
  71506. func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
  71507. reqHeaders := make(http.Header)
  71508. for k, v := range c.header_ {
  71509. reqHeaders[k] = v
  71510. }
  71511. reqHeaders.Set("User-Agent", c.s.userAgent())
  71512. var body io.Reader = nil
  71513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
  71514. if err != nil {
  71515. return nil, err
  71516. }
  71517. reqHeaders.Set("Content-Type", "application/json")
  71518. c.urlParams_.Set("alt", alt)
  71519. c.urlParams_.Set("prettyPrint", "false")
  71520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
  71521. urls += "?" + c.urlParams_.Encode()
  71522. req, err := http.NewRequest("PATCH", urls, body)
  71523. if err != nil {
  71524. return nil, err
  71525. }
  71526. req.Header = reqHeaders
  71527. googleapi.Expand(req.URL, map[string]string{
  71528. "project": c.project,
  71529. "zone": c.zone,
  71530. "instance": c.instance,
  71531. })
  71532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71533. }
  71534. // Do executes the "compute.instances.updateDisplayDevice" call.
  71535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71536. // status code is an error. Response headers are in either
  71537. // *Operation.ServerResponse.Header or (if a response was returned at
  71538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71539. // to check whether the returned error was because
  71540. // http.StatusNotModified was returned.
  71541. func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71542. gensupport.SetOptions(c.urlParams_, opts...)
  71543. res, err := c.doRequest("json")
  71544. if res != nil && res.StatusCode == http.StatusNotModified {
  71545. if res.Body != nil {
  71546. res.Body.Close()
  71547. }
  71548. return nil, &googleapi.Error{
  71549. Code: res.StatusCode,
  71550. Header: res.Header,
  71551. }
  71552. }
  71553. if err != nil {
  71554. return nil, err
  71555. }
  71556. defer googleapi.CloseBody(res)
  71557. if err := googleapi.CheckResponse(res); err != nil {
  71558. return nil, err
  71559. }
  71560. ret := &Operation{
  71561. ServerResponse: googleapi.ServerResponse{
  71562. Header: res.Header,
  71563. HTTPStatusCode: res.StatusCode,
  71564. },
  71565. }
  71566. target := &ret
  71567. if err := gensupport.DecodeResponse(target, res); err != nil {
  71568. return nil, err
  71569. }
  71570. return ret, nil
  71571. // {
  71572. // "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.",
  71573. // "httpMethod": "PATCH",
  71574. // "id": "compute.instances.updateDisplayDevice",
  71575. // "parameterOrder": [
  71576. // "project",
  71577. // "zone",
  71578. // "instance"
  71579. // ],
  71580. // "parameters": {
  71581. // "instance": {
  71582. // "description": "Name of the instance scoping this request.",
  71583. // "location": "path",
  71584. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71585. // "required": true,
  71586. // "type": "string"
  71587. // },
  71588. // "project": {
  71589. // "description": "Project ID for this request.",
  71590. // "location": "path",
  71591. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71592. // "required": true,
  71593. // "type": "string"
  71594. // },
  71595. // "requestId": {
  71596. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71597. // "location": "query",
  71598. // "type": "string"
  71599. // },
  71600. // "zone": {
  71601. // "description": "The name of the zone for this request.",
  71602. // "location": "path",
  71603. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71604. // "required": true,
  71605. // "type": "string"
  71606. // }
  71607. // },
  71608. // "path": "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
  71609. // "request": {
  71610. // "$ref": "DisplayDevice"
  71611. // },
  71612. // "response": {
  71613. // "$ref": "Operation"
  71614. // },
  71615. // "scopes": [
  71616. // "https://www.googleapis.com/auth/cloud-platform",
  71617. // "https://www.googleapis.com/auth/compute"
  71618. // ]
  71619. // }
  71620. }
  71621. // method id "compute.instances.updateNetworkInterface":
  71622. type InstancesUpdateNetworkInterfaceCall struct {
  71623. s *Service
  71624. project string
  71625. zone string
  71626. instance string
  71627. networkinterface *NetworkInterface
  71628. urlParams_ gensupport.URLParams
  71629. ctx_ context.Context
  71630. header_ http.Header
  71631. }
  71632. // UpdateNetworkInterface: Updates an instance's network interface. This
  71633. // method follows PATCH semantics.
  71634. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  71635. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71636. c.project = project
  71637. c.zone = zone
  71638. c.instance = instance
  71639. c.urlParams_.Set("networkInterface", networkInterface)
  71640. c.networkinterface = networkinterface
  71641. return c
  71642. }
  71643. // RequestId sets the optional parameter "requestId": An optional
  71644. // request ID to identify requests. Specify a unique request ID so that
  71645. // if you must retry your request, the server will know to ignore the
  71646. // request if it has already been completed.
  71647. //
  71648. // For example, consider a situation where you make an initial request
  71649. // and the request times out. If you make the request again with the
  71650. // same request ID, the server can check if original operation with the
  71651. // same request ID was received, and if so, will ignore the second
  71652. // request. This prevents clients from accidentally creating duplicate
  71653. // commitments.
  71654. //
  71655. // The request ID must be a valid UUID with the exception that zero UUID
  71656. // is not supported (00000000-0000-0000-0000-000000000000).
  71657. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  71658. c.urlParams_.Set("requestId", requestId)
  71659. return c
  71660. }
  71661. // Fields allows partial responses to be retrieved. See
  71662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71663. // for more information.
  71664. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  71665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71666. return c
  71667. }
  71668. // Context sets the context to be used in this call's Do method. Any
  71669. // pending HTTP request will be aborted if the provided context is
  71670. // canceled.
  71671. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  71672. c.ctx_ = ctx
  71673. return c
  71674. }
  71675. // Header returns an http.Header that can be modified by the caller to
  71676. // add HTTP headers to the request.
  71677. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  71678. if c.header_ == nil {
  71679. c.header_ = make(http.Header)
  71680. }
  71681. return c.header_
  71682. }
  71683. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  71684. reqHeaders := make(http.Header)
  71685. for k, v := range c.header_ {
  71686. reqHeaders[k] = v
  71687. }
  71688. reqHeaders.Set("User-Agent", c.s.userAgent())
  71689. var body io.Reader = nil
  71690. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  71691. if err != nil {
  71692. return nil, err
  71693. }
  71694. reqHeaders.Set("Content-Type", "application/json")
  71695. c.urlParams_.Set("alt", alt)
  71696. c.urlParams_.Set("prettyPrint", "false")
  71697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  71698. urls += "?" + c.urlParams_.Encode()
  71699. req, err := http.NewRequest("PATCH", urls, body)
  71700. if err != nil {
  71701. return nil, err
  71702. }
  71703. req.Header = reqHeaders
  71704. googleapi.Expand(req.URL, map[string]string{
  71705. "project": c.project,
  71706. "zone": c.zone,
  71707. "instance": c.instance,
  71708. })
  71709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71710. }
  71711. // Do executes the "compute.instances.updateNetworkInterface" call.
  71712. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71713. // status code is an error. Response headers are in either
  71714. // *Operation.ServerResponse.Header or (if a response was returned at
  71715. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71716. // to check whether the returned error was because
  71717. // http.StatusNotModified was returned.
  71718. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71719. gensupport.SetOptions(c.urlParams_, opts...)
  71720. res, err := c.doRequest("json")
  71721. if res != nil && res.StatusCode == http.StatusNotModified {
  71722. if res.Body != nil {
  71723. res.Body.Close()
  71724. }
  71725. return nil, &googleapi.Error{
  71726. Code: res.StatusCode,
  71727. Header: res.Header,
  71728. }
  71729. }
  71730. if err != nil {
  71731. return nil, err
  71732. }
  71733. defer googleapi.CloseBody(res)
  71734. if err := googleapi.CheckResponse(res); err != nil {
  71735. return nil, err
  71736. }
  71737. ret := &Operation{
  71738. ServerResponse: googleapi.ServerResponse{
  71739. Header: res.Header,
  71740. HTTPStatusCode: res.StatusCode,
  71741. },
  71742. }
  71743. target := &ret
  71744. if err := gensupport.DecodeResponse(target, res); err != nil {
  71745. return nil, err
  71746. }
  71747. return ret, nil
  71748. // {
  71749. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  71750. // "httpMethod": "PATCH",
  71751. // "id": "compute.instances.updateNetworkInterface",
  71752. // "parameterOrder": [
  71753. // "project",
  71754. // "zone",
  71755. // "instance",
  71756. // "networkInterface"
  71757. // ],
  71758. // "parameters": {
  71759. // "instance": {
  71760. // "description": "The instance name for this request.",
  71761. // "location": "path",
  71762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71763. // "required": true,
  71764. // "type": "string"
  71765. // },
  71766. // "networkInterface": {
  71767. // "description": "The name of the network interface to update.",
  71768. // "location": "query",
  71769. // "required": true,
  71770. // "type": "string"
  71771. // },
  71772. // "project": {
  71773. // "description": "Project ID for this request.",
  71774. // "location": "path",
  71775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71776. // "required": true,
  71777. // "type": "string"
  71778. // },
  71779. // "requestId": {
  71780. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71781. // "location": "query",
  71782. // "type": "string"
  71783. // },
  71784. // "zone": {
  71785. // "description": "The name of the zone for this request.",
  71786. // "location": "path",
  71787. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71788. // "required": true,
  71789. // "type": "string"
  71790. // }
  71791. // },
  71792. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  71793. // "request": {
  71794. // "$ref": "NetworkInterface"
  71795. // },
  71796. // "response": {
  71797. // "$ref": "Operation"
  71798. // },
  71799. // "scopes": [
  71800. // "https://www.googleapis.com/auth/cloud-platform",
  71801. // "https://www.googleapis.com/auth/compute"
  71802. // ]
  71803. // }
  71804. }
  71805. // method id "compute.instances.updateShieldedVmConfig":
  71806. type InstancesUpdateShieldedVmConfigCall struct {
  71807. s *Service
  71808. project string
  71809. zone string
  71810. instance string
  71811. shieldedvmconfig *ShieldedVmConfig
  71812. urlParams_ gensupport.URLParams
  71813. ctx_ context.Context
  71814. header_ http.Header
  71815. }
  71816. // UpdateShieldedVmConfig: Updates the Shielded VM config for a VM
  71817. // instance. You can only use this method on a stopped VM instance. This
  71818. // method supports PATCH semantics and uses the JSON merge patch format
  71819. // and processing rules.
  71820. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  71821. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71822. c.project = project
  71823. c.zone = zone
  71824. c.instance = instance
  71825. c.shieldedvmconfig = shieldedvmconfig
  71826. return c
  71827. }
  71828. // RequestId sets the optional parameter "requestId": An optional
  71829. // request ID to identify requests. Specify a unique request ID so that
  71830. // if you must retry your request, the server will know to ignore the
  71831. // request if it has already been completed.
  71832. //
  71833. // For example, consider a situation where you make an initial request
  71834. // and the request times out. If you make the request again with the
  71835. // same request ID, the server can check if original operation with the
  71836. // same request ID was received, and if so, will ignore the second
  71837. // request. This prevents clients from accidentally creating duplicate
  71838. // commitments.
  71839. //
  71840. // The request ID must be a valid UUID with the exception that zero UUID
  71841. // is not supported (00000000-0000-0000-0000-000000000000).
  71842. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  71843. c.urlParams_.Set("requestId", requestId)
  71844. return c
  71845. }
  71846. // Fields allows partial responses to be retrieved. See
  71847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71848. // for more information.
  71849. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  71850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71851. return c
  71852. }
  71853. // Context sets the context to be used in this call's Do method. Any
  71854. // pending HTTP request will be aborted if the provided context is
  71855. // canceled.
  71856. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  71857. c.ctx_ = ctx
  71858. return c
  71859. }
  71860. // Header returns an http.Header that can be modified by the caller to
  71861. // add HTTP headers to the request.
  71862. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  71863. if c.header_ == nil {
  71864. c.header_ = make(http.Header)
  71865. }
  71866. return c.header_
  71867. }
  71868. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  71869. reqHeaders := make(http.Header)
  71870. for k, v := range c.header_ {
  71871. reqHeaders[k] = v
  71872. }
  71873. reqHeaders.Set("User-Agent", c.s.userAgent())
  71874. var body io.Reader = nil
  71875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  71876. if err != nil {
  71877. return nil, err
  71878. }
  71879. reqHeaders.Set("Content-Type", "application/json")
  71880. c.urlParams_.Set("alt", alt)
  71881. c.urlParams_.Set("prettyPrint", "false")
  71882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  71883. urls += "?" + c.urlParams_.Encode()
  71884. req, err := http.NewRequest("PATCH", urls, body)
  71885. if err != nil {
  71886. return nil, err
  71887. }
  71888. req.Header = reqHeaders
  71889. googleapi.Expand(req.URL, map[string]string{
  71890. "project": c.project,
  71891. "zone": c.zone,
  71892. "instance": c.instance,
  71893. })
  71894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71895. }
  71896. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  71897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71898. // status code is an error. Response headers are in either
  71899. // *Operation.ServerResponse.Header or (if a response was returned at
  71900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71901. // to check whether the returned error was because
  71902. // http.StatusNotModified was returned.
  71903. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71904. gensupport.SetOptions(c.urlParams_, opts...)
  71905. res, err := c.doRequest("json")
  71906. if res != nil && res.StatusCode == http.StatusNotModified {
  71907. if res.Body != nil {
  71908. res.Body.Close()
  71909. }
  71910. return nil, &googleapi.Error{
  71911. Code: res.StatusCode,
  71912. Header: res.Header,
  71913. }
  71914. }
  71915. if err != nil {
  71916. return nil, err
  71917. }
  71918. defer googleapi.CloseBody(res)
  71919. if err := googleapi.CheckResponse(res); err != nil {
  71920. return nil, err
  71921. }
  71922. ret := &Operation{
  71923. ServerResponse: googleapi.ServerResponse{
  71924. Header: res.Header,
  71925. HTTPStatusCode: res.StatusCode,
  71926. },
  71927. }
  71928. target := &ret
  71929. if err := gensupport.DecodeResponse(target, res); err != nil {
  71930. return nil, err
  71931. }
  71932. return ret, nil
  71933. // {
  71934. // "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.",
  71935. // "httpMethod": "PATCH",
  71936. // "id": "compute.instances.updateShieldedVmConfig",
  71937. // "parameterOrder": [
  71938. // "project",
  71939. // "zone",
  71940. // "instance"
  71941. // ],
  71942. // "parameters": {
  71943. // "instance": {
  71944. // "description": "Name of the instance scoping this request.",
  71945. // "location": "path",
  71946. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71947. // "required": true,
  71948. // "type": "string"
  71949. // },
  71950. // "project": {
  71951. // "description": "Project ID for this request.",
  71952. // "location": "path",
  71953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71954. // "required": true,
  71955. // "type": "string"
  71956. // },
  71957. // "requestId": {
  71958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71959. // "location": "query",
  71960. // "type": "string"
  71961. // },
  71962. // "zone": {
  71963. // "description": "The name of the zone for this request.",
  71964. // "location": "path",
  71965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71966. // "required": true,
  71967. // "type": "string"
  71968. // }
  71969. // },
  71970. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  71971. // "request": {
  71972. // "$ref": "ShieldedVmConfig"
  71973. // },
  71974. // "response": {
  71975. // "$ref": "Operation"
  71976. // },
  71977. // "scopes": [
  71978. // "https://www.googleapis.com/auth/cloud-platform",
  71979. // "https://www.googleapis.com/auth/compute"
  71980. // ]
  71981. // }
  71982. }
  71983. // method id "compute.interconnectAttachments.aggregatedList":
  71984. type InterconnectAttachmentsAggregatedListCall struct {
  71985. s *Service
  71986. project string
  71987. urlParams_ gensupport.URLParams
  71988. ifNoneMatch_ string
  71989. ctx_ context.Context
  71990. header_ http.Header
  71991. }
  71992. // AggregatedList: Retrieves an aggregated list of interconnect
  71993. // attachments.
  71994. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  71995. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71996. c.project = project
  71997. return c
  71998. }
  71999. // Filter sets the optional parameter "filter": A filter expression that
  72000. // filters resources listed in the response. The expression must specify
  72001. // the field name, a comparison operator, and the value that you want to
  72002. // use for filtering. The value must be a string, a number, or a
  72003. // boolean. The comparison operator must be either =, !=, >, or <.
  72004. //
  72005. // For example, if you are filtering Compute Engine instances, you can
  72006. // exclude instances named example-instance by specifying name !=
  72007. // example-instance.
  72008. //
  72009. // You can also filter nested fields. For example, you could specify
  72010. // scheduling.automaticRestart = false to include instances only if they
  72011. // are not scheduled for automatic restarts. You can use filtering on
  72012. // nested fields to filter based on resource labels.
  72013. //
  72014. // To filter on multiple expressions, provide each separate expression
  72015. // within parentheses. For example, (scheduling.automaticRestart = true)
  72016. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72017. // AND expression. However, you can include AND and OR expressions
  72018. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72019. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72020. // true).
  72021. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  72022. c.urlParams_.Set("filter", filter)
  72023. return c
  72024. }
  72025. // MaxResults sets the optional parameter "maxResults": The maximum
  72026. // number of results per page that should be returned. If the number of
  72027. // available results is larger than maxResults, Compute Engine returns a
  72028. // nextPageToken that can be used to get the next page of results in
  72029. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72030. // (Default: 500)
  72031. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  72032. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72033. return c
  72034. }
  72035. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72036. // a certain order. By default, results are returned in alphanumerical
  72037. // order based on the resource name.
  72038. //
  72039. // You can also sort results in descending order based on the creation
  72040. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72041. // based on the creationTimestamp field in reverse chronological order
  72042. // (newest result first). Use this to sort resources like operations so
  72043. // that the newest operation is returned first.
  72044. //
  72045. // Currently, only sorting by name or creationTimestamp desc is
  72046. // supported.
  72047. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  72048. c.urlParams_.Set("orderBy", orderBy)
  72049. return c
  72050. }
  72051. // PageToken sets the optional parameter "pageToken": Specifies a page
  72052. // token to use. Set pageToken to the nextPageToken returned by a
  72053. // previous list request to get the next page of results.
  72054. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  72055. c.urlParams_.Set("pageToken", pageToken)
  72056. return c
  72057. }
  72058. // Fields allows partial responses to be retrieved. See
  72059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72060. // for more information.
  72061. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  72062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72063. return c
  72064. }
  72065. // IfNoneMatch sets the optional parameter which makes the operation
  72066. // fail if the object's ETag matches the given value. This is useful for
  72067. // getting updates only after the object has changed since the last
  72068. // request. Use googleapi.IsNotModified to check whether the response
  72069. // error from Do is the result of In-None-Match.
  72070. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  72071. c.ifNoneMatch_ = entityTag
  72072. return c
  72073. }
  72074. // Context sets the context to be used in this call's Do method. Any
  72075. // pending HTTP request will be aborted if the provided context is
  72076. // canceled.
  72077. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  72078. c.ctx_ = ctx
  72079. return c
  72080. }
  72081. // Header returns an http.Header that can be modified by the caller to
  72082. // add HTTP headers to the request.
  72083. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  72084. if c.header_ == nil {
  72085. c.header_ = make(http.Header)
  72086. }
  72087. return c.header_
  72088. }
  72089. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72090. reqHeaders := make(http.Header)
  72091. for k, v := range c.header_ {
  72092. reqHeaders[k] = v
  72093. }
  72094. reqHeaders.Set("User-Agent", c.s.userAgent())
  72095. if c.ifNoneMatch_ != "" {
  72096. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72097. }
  72098. var body io.Reader = nil
  72099. c.urlParams_.Set("alt", alt)
  72100. c.urlParams_.Set("prettyPrint", "false")
  72101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  72102. urls += "?" + c.urlParams_.Encode()
  72103. req, err := http.NewRequest("GET", urls, body)
  72104. if err != nil {
  72105. return nil, err
  72106. }
  72107. req.Header = reqHeaders
  72108. googleapi.Expand(req.URL, map[string]string{
  72109. "project": c.project,
  72110. })
  72111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72112. }
  72113. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  72114. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  72115. // non-nil. Any non-2xx status code is an error. Response headers are in
  72116. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  72117. // (if a response was returned at all) in
  72118. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  72119. // whether the returned error was because http.StatusNotModified was
  72120. // returned.
  72121. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  72122. gensupport.SetOptions(c.urlParams_, opts...)
  72123. res, err := c.doRequest("json")
  72124. if res != nil && res.StatusCode == http.StatusNotModified {
  72125. if res.Body != nil {
  72126. res.Body.Close()
  72127. }
  72128. return nil, &googleapi.Error{
  72129. Code: res.StatusCode,
  72130. Header: res.Header,
  72131. }
  72132. }
  72133. if err != nil {
  72134. return nil, err
  72135. }
  72136. defer googleapi.CloseBody(res)
  72137. if err := googleapi.CheckResponse(res); err != nil {
  72138. return nil, err
  72139. }
  72140. ret := &InterconnectAttachmentAggregatedList{
  72141. ServerResponse: googleapi.ServerResponse{
  72142. Header: res.Header,
  72143. HTTPStatusCode: res.StatusCode,
  72144. },
  72145. }
  72146. target := &ret
  72147. if err := gensupport.DecodeResponse(target, res); err != nil {
  72148. return nil, err
  72149. }
  72150. return ret, nil
  72151. // {
  72152. // "description": "Retrieves an aggregated list of interconnect attachments.",
  72153. // "httpMethod": "GET",
  72154. // "id": "compute.interconnectAttachments.aggregatedList",
  72155. // "parameterOrder": [
  72156. // "project"
  72157. // ],
  72158. // "parameters": {
  72159. // "filter": {
  72160. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72161. // "location": "query",
  72162. // "type": "string"
  72163. // },
  72164. // "maxResults": {
  72165. // "default": "500",
  72166. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72167. // "format": "uint32",
  72168. // "location": "query",
  72169. // "minimum": "0",
  72170. // "type": "integer"
  72171. // },
  72172. // "orderBy": {
  72173. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72174. // "location": "query",
  72175. // "type": "string"
  72176. // },
  72177. // "pageToken": {
  72178. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72179. // "location": "query",
  72180. // "type": "string"
  72181. // },
  72182. // "project": {
  72183. // "description": "Project ID for this request.",
  72184. // "location": "path",
  72185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72186. // "required": true,
  72187. // "type": "string"
  72188. // }
  72189. // },
  72190. // "path": "{project}/aggregated/interconnectAttachments",
  72191. // "response": {
  72192. // "$ref": "InterconnectAttachmentAggregatedList"
  72193. // },
  72194. // "scopes": [
  72195. // "https://www.googleapis.com/auth/cloud-platform",
  72196. // "https://www.googleapis.com/auth/compute",
  72197. // "https://www.googleapis.com/auth/compute.readonly"
  72198. // ]
  72199. // }
  72200. }
  72201. // Pages invokes f for each page of results.
  72202. // A non-nil error returned from f will halt the iteration.
  72203. // The provided context supersedes any context provided to the Context method.
  72204. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  72205. c.ctx_ = ctx
  72206. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72207. for {
  72208. x, err := c.Do()
  72209. if err != nil {
  72210. return err
  72211. }
  72212. if err := f(x); err != nil {
  72213. return err
  72214. }
  72215. if x.NextPageToken == "" {
  72216. return nil
  72217. }
  72218. c.PageToken(x.NextPageToken)
  72219. }
  72220. }
  72221. // method id "compute.interconnectAttachments.delete":
  72222. type InterconnectAttachmentsDeleteCall struct {
  72223. s *Service
  72224. project string
  72225. region string
  72226. interconnectAttachment string
  72227. urlParams_ gensupport.URLParams
  72228. ctx_ context.Context
  72229. header_ http.Header
  72230. }
  72231. // Delete: Deletes the specified interconnect attachment.
  72232. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  72233. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72234. c.project = project
  72235. c.region = region
  72236. c.interconnectAttachment = interconnectAttachment
  72237. return c
  72238. }
  72239. // RequestId sets the optional parameter "requestId": An optional
  72240. // request ID to identify requests. Specify a unique request ID so that
  72241. // if you must retry your request, the server will know to ignore the
  72242. // request if it has already been completed.
  72243. //
  72244. // For example, consider a situation where you make an initial request
  72245. // and the request times out. If you make the request again with the
  72246. // same request ID, the server can check if original operation with the
  72247. // same request ID was received, and if so, will ignore the second
  72248. // request. This prevents clients from accidentally creating duplicate
  72249. // commitments.
  72250. //
  72251. // The request ID must be a valid UUID with the exception that zero UUID
  72252. // is not supported (00000000-0000-0000-0000-000000000000).
  72253. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  72254. c.urlParams_.Set("requestId", requestId)
  72255. return c
  72256. }
  72257. // Fields allows partial responses to be retrieved. See
  72258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72259. // for more information.
  72260. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  72261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72262. return c
  72263. }
  72264. // Context sets the context to be used in this call's Do method. Any
  72265. // pending HTTP request will be aborted if the provided context is
  72266. // canceled.
  72267. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  72268. c.ctx_ = ctx
  72269. return c
  72270. }
  72271. // Header returns an http.Header that can be modified by the caller to
  72272. // add HTTP headers to the request.
  72273. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  72274. if c.header_ == nil {
  72275. c.header_ = make(http.Header)
  72276. }
  72277. return c.header_
  72278. }
  72279. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  72280. reqHeaders := make(http.Header)
  72281. for k, v := range c.header_ {
  72282. reqHeaders[k] = v
  72283. }
  72284. reqHeaders.Set("User-Agent", c.s.userAgent())
  72285. var body io.Reader = nil
  72286. c.urlParams_.Set("alt", alt)
  72287. c.urlParams_.Set("prettyPrint", "false")
  72288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  72289. urls += "?" + c.urlParams_.Encode()
  72290. req, err := http.NewRequest("DELETE", urls, body)
  72291. if err != nil {
  72292. return nil, err
  72293. }
  72294. req.Header = reqHeaders
  72295. googleapi.Expand(req.URL, map[string]string{
  72296. "project": c.project,
  72297. "region": c.region,
  72298. "interconnectAttachment": c.interconnectAttachment,
  72299. })
  72300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72301. }
  72302. // Do executes the "compute.interconnectAttachments.delete" call.
  72303. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72304. // status code is an error. Response headers are in either
  72305. // *Operation.ServerResponse.Header or (if a response was returned at
  72306. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72307. // to check whether the returned error was because
  72308. // http.StatusNotModified was returned.
  72309. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72310. gensupport.SetOptions(c.urlParams_, opts...)
  72311. res, err := c.doRequest("json")
  72312. if res != nil && res.StatusCode == http.StatusNotModified {
  72313. if res.Body != nil {
  72314. res.Body.Close()
  72315. }
  72316. return nil, &googleapi.Error{
  72317. Code: res.StatusCode,
  72318. Header: res.Header,
  72319. }
  72320. }
  72321. if err != nil {
  72322. return nil, err
  72323. }
  72324. defer googleapi.CloseBody(res)
  72325. if err := googleapi.CheckResponse(res); err != nil {
  72326. return nil, err
  72327. }
  72328. ret := &Operation{
  72329. ServerResponse: googleapi.ServerResponse{
  72330. Header: res.Header,
  72331. HTTPStatusCode: res.StatusCode,
  72332. },
  72333. }
  72334. target := &ret
  72335. if err := gensupport.DecodeResponse(target, res); err != nil {
  72336. return nil, err
  72337. }
  72338. return ret, nil
  72339. // {
  72340. // "description": "Deletes the specified interconnect attachment.",
  72341. // "httpMethod": "DELETE",
  72342. // "id": "compute.interconnectAttachments.delete",
  72343. // "parameterOrder": [
  72344. // "project",
  72345. // "region",
  72346. // "interconnectAttachment"
  72347. // ],
  72348. // "parameters": {
  72349. // "interconnectAttachment": {
  72350. // "description": "Name of the interconnect attachment to delete.",
  72351. // "location": "path",
  72352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72353. // "required": true,
  72354. // "type": "string"
  72355. // },
  72356. // "project": {
  72357. // "description": "Project ID for this request.",
  72358. // "location": "path",
  72359. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72360. // "required": true,
  72361. // "type": "string"
  72362. // },
  72363. // "region": {
  72364. // "description": "Name of the region for this request.",
  72365. // "location": "path",
  72366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72367. // "required": true,
  72368. // "type": "string"
  72369. // },
  72370. // "requestId": {
  72371. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72372. // "location": "query",
  72373. // "type": "string"
  72374. // }
  72375. // },
  72376. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  72377. // "response": {
  72378. // "$ref": "Operation"
  72379. // },
  72380. // "scopes": [
  72381. // "https://www.googleapis.com/auth/cloud-platform",
  72382. // "https://www.googleapis.com/auth/compute"
  72383. // ]
  72384. // }
  72385. }
  72386. // method id "compute.interconnectAttachments.get":
  72387. type InterconnectAttachmentsGetCall struct {
  72388. s *Service
  72389. project string
  72390. region string
  72391. interconnectAttachment string
  72392. urlParams_ gensupport.URLParams
  72393. ifNoneMatch_ string
  72394. ctx_ context.Context
  72395. header_ http.Header
  72396. }
  72397. // Get: Returns the specified interconnect attachment.
  72398. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  72399. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72400. c.project = project
  72401. c.region = region
  72402. c.interconnectAttachment = interconnectAttachment
  72403. return c
  72404. }
  72405. // Fields allows partial responses to be retrieved. See
  72406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72407. // for more information.
  72408. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  72409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72410. return c
  72411. }
  72412. // IfNoneMatch sets the optional parameter which makes the operation
  72413. // fail if the object's ETag matches the given value. This is useful for
  72414. // getting updates only after the object has changed since the last
  72415. // request. Use googleapi.IsNotModified to check whether the response
  72416. // error from Do is the result of In-None-Match.
  72417. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  72418. c.ifNoneMatch_ = entityTag
  72419. return c
  72420. }
  72421. // Context sets the context to be used in this call's Do method. Any
  72422. // pending HTTP request will be aborted if the provided context is
  72423. // canceled.
  72424. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  72425. c.ctx_ = ctx
  72426. return c
  72427. }
  72428. // Header returns an http.Header that can be modified by the caller to
  72429. // add HTTP headers to the request.
  72430. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  72431. if c.header_ == nil {
  72432. c.header_ = make(http.Header)
  72433. }
  72434. return c.header_
  72435. }
  72436. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  72437. reqHeaders := make(http.Header)
  72438. for k, v := range c.header_ {
  72439. reqHeaders[k] = v
  72440. }
  72441. reqHeaders.Set("User-Agent", c.s.userAgent())
  72442. if c.ifNoneMatch_ != "" {
  72443. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72444. }
  72445. var body io.Reader = nil
  72446. c.urlParams_.Set("alt", alt)
  72447. c.urlParams_.Set("prettyPrint", "false")
  72448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  72449. urls += "?" + c.urlParams_.Encode()
  72450. req, err := http.NewRequest("GET", urls, body)
  72451. if err != nil {
  72452. return nil, err
  72453. }
  72454. req.Header = reqHeaders
  72455. googleapi.Expand(req.URL, map[string]string{
  72456. "project": c.project,
  72457. "region": c.region,
  72458. "interconnectAttachment": c.interconnectAttachment,
  72459. })
  72460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72461. }
  72462. // Do executes the "compute.interconnectAttachments.get" call.
  72463. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  72464. // non-2xx status code is an error. Response headers are in either
  72465. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  72466. // returned at all) in error.(*googleapi.Error).Header. Use
  72467. // googleapi.IsNotModified to check whether the returned error was
  72468. // because http.StatusNotModified was returned.
  72469. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  72470. gensupport.SetOptions(c.urlParams_, opts...)
  72471. res, err := c.doRequest("json")
  72472. if res != nil && res.StatusCode == http.StatusNotModified {
  72473. if res.Body != nil {
  72474. res.Body.Close()
  72475. }
  72476. return nil, &googleapi.Error{
  72477. Code: res.StatusCode,
  72478. Header: res.Header,
  72479. }
  72480. }
  72481. if err != nil {
  72482. return nil, err
  72483. }
  72484. defer googleapi.CloseBody(res)
  72485. if err := googleapi.CheckResponse(res); err != nil {
  72486. return nil, err
  72487. }
  72488. ret := &InterconnectAttachment{
  72489. ServerResponse: googleapi.ServerResponse{
  72490. Header: res.Header,
  72491. HTTPStatusCode: res.StatusCode,
  72492. },
  72493. }
  72494. target := &ret
  72495. if err := gensupport.DecodeResponse(target, res); err != nil {
  72496. return nil, err
  72497. }
  72498. return ret, nil
  72499. // {
  72500. // "description": "Returns the specified interconnect attachment.",
  72501. // "httpMethod": "GET",
  72502. // "id": "compute.interconnectAttachments.get",
  72503. // "parameterOrder": [
  72504. // "project",
  72505. // "region",
  72506. // "interconnectAttachment"
  72507. // ],
  72508. // "parameters": {
  72509. // "interconnectAttachment": {
  72510. // "description": "Name of the interconnect attachment to return.",
  72511. // "location": "path",
  72512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72513. // "required": true,
  72514. // "type": "string"
  72515. // },
  72516. // "project": {
  72517. // "description": "Project ID for this request.",
  72518. // "location": "path",
  72519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72520. // "required": true,
  72521. // "type": "string"
  72522. // },
  72523. // "region": {
  72524. // "description": "Name of the region for this request.",
  72525. // "location": "path",
  72526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72527. // "required": true,
  72528. // "type": "string"
  72529. // }
  72530. // },
  72531. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  72532. // "response": {
  72533. // "$ref": "InterconnectAttachment"
  72534. // },
  72535. // "scopes": [
  72536. // "https://www.googleapis.com/auth/cloud-platform",
  72537. // "https://www.googleapis.com/auth/compute",
  72538. // "https://www.googleapis.com/auth/compute.readonly"
  72539. // ]
  72540. // }
  72541. }
  72542. // method id "compute.interconnectAttachments.getIamPolicy":
  72543. type InterconnectAttachmentsGetIamPolicyCall struct {
  72544. s *Service
  72545. project string
  72546. region string
  72547. resource string
  72548. urlParams_ gensupport.URLParams
  72549. ifNoneMatch_ string
  72550. ctx_ context.Context
  72551. header_ http.Header
  72552. }
  72553. // GetIamPolicy: Gets the access control policy for a resource. May be
  72554. // empty if no such policy or resource exists.
  72555. func (r *InterconnectAttachmentsService) GetIamPolicy(project string, region string, resource string) *InterconnectAttachmentsGetIamPolicyCall {
  72556. c := &InterconnectAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72557. c.project = project
  72558. c.region = region
  72559. c.resource = resource
  72560. return c
  72561. }
  72562. // Fields allows partial responses to be retrieved. See
  72563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72564. // for more information.
  72565. func (c *InterconnectAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetIamPolicyCall {
  72566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72567. return c
  72568. }
  72569. // IfNoneMatch sets the optional parameter which makes the operation
  72570. // fail if the object's ETag matches the given value. This is useful for
  72571. // getting updates only after the object has changed since the last
  72572. // request. Use googleapi.IsNotModified to check whether the response
  72573. // error from Do is the result of In-None-Match.
  72574. func (c *InterconnectAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetIamPolicyCall {
  72575. c.ifNoneMatch_ = entityTag
  72576. return c
  72577. }
  72578. // Context sets the context to be used in this call's Do method. Any
  72579. // pending HTTP request will be aborted if the provided context is
  72580. // canceled.
  72581. func (c *InterconnectAttachmentsGetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsGetIamPolicyCall {
  72582. c.ctx_ = ctx
  72583. return c
  72584. }
  72585. // Header returns an http.Header that can be modified by the caller to
  72586. // add HTTP headers to the request.
  72587. func (c *InterconnectAttachmentsGetIamPolicyCall) Header() http.Header {
  72588. if c.header_ == nil {
  72589. c.header_ = make(http.Header)
  72590. }
  72591. return c.header_
  72592. }
  72593. func (c *InterconnectAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  72594. reqHeaders := make(http.Header)
  72595. for k, v := range c.header_ {
  72596. reqHeaders[k] = v
  72597. }
  72598. reqHeaders.Set("User-Agent", c.s.userAgent())
  72599. if c.ifNoneMatch_ != "" {
  72600. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72601. }
  72602. var body io.Reader = nil
  72603. c.urlParams_.Set("alt", alt)
  72604. c.urlParams_.Set("prettyPrint", "false")
  72605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy")
  72606. urls += "?" + c.urlParams_.Encode()
  72607. req, err := http.NewRequest("GET", urls, body)
  72608. if err != nil {
  72609. return nil, err
  72610. }
  72611. req.Header = reqHeaders
  72612. googleapi.Expand(req.URL, map[string]string{
  72613. "project": c.project,
  72614. "region": c.region,
  72615. "resource": c.resource,
  72616. })
  72617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72618. }
  72619. // Do executes the "compute.interconnectAttachments.getIamPolicy" call.
  72620. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  72621. // code is an error. Response headers are in either
  72622. // *Policy.ServerResponse.Header or (if a response was returned at all)
  72623. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  72624. // check whether the returned error was because http.StatusNotModified
  72625. // was returned.
  72626. func (c *InterconnectAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  72627. gensupport.SetOptions(c.urlParams_, opts...)
  72628. res, err := c.doRequest("json")
  72629. if res != nil && res.StatusCode == http.StatusNotModified {
  72630. if res.Body != nil {
  72631. res.Body.Close()
  72632. }
  72633. return nil, &googleapi.Error{
  72634. Code: res.StatusCode,
  72635. Header: res.Header,
  72636. }
  72637. }
  72638. if err != nil {
  72639. return nil, err
  72640. }
  72641. defer googleapi.CloseBody(res)
  72642. if err := googleapi.CheckResponse(res); err != nil {
  72643. return nil, err
  72644. }
  72645. ret := &Policy{
  72646. ServerResponse: googleapi.ServerResponse{
  72647. Header: res.Header,
  72648. HTTPStatusCode: res.StatusCode,
  72649. },
  72650. }
  72651. target := &ret
  72652. if err := gensupport.DecodeResponse(target, res); err != nil {
  72653. return nil, err
  72654. }
  72655. return ret, nil
  72656. // {
  72657. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  72658. // "httpMethod": "GET",
  72659. // "id": "compute.interconnectAttachments.getIamPolicy",
  72660. // "parameterOrder": [
  72661. // "project",
  72662. // "region",
  72663. // "resource"
  72664. // ],
  72665. // "parameters": {
  72666. // "project": {
  72667. // "description": "Project ID for this request.",
  72668. // "location": "path",
  72669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72670. // "required": true,
  72671. // "type": "string"
  72672. // },
  72673. // "region": {
  72674. // "description": "The name of the region for this request.",
  72675. // "location": "path",
  72676. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72677. // "required": true,
  72678. // "type": "string"
  72679. // },
  72680. // "resource": {
  72681. // "description": "Name or id of the resource for this request.",
  72682. // "location": "path",
  72683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72684. // "required": true,
  72685. // "type": "string"
  72686. // }
  72687. // },
  72688. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy",
  72689. // "response": {
  72690. // "$ref": "Policy"
  72691. // },
  72692. // "scopes": [
  72693. // "https://www.googleapis.com/auth/cloud-platform",
  72694. // "https://www.googleapis.com/auth/compute",
  72695. // "https://www.googleapis.com/auth/compute.readonly"
  72696. // ]
  72697. // }
  72698. }
  72699. // method id "compute.interconnectAttachments.insert":
  72700. type InterconnectAttachmentsInsertCall struct {
  72701. s *Service
  72702. project string
  72703. region string
  72704. interconnectattachment *InterconnectAttachment
  72705. urlParams_ gensupport.URLParams
  72706. ctx_ context.Context
  72707. header_ http.Header
  72708. }
  72709. // Insert: Creates an InterconnectAttachment in the specified project
  72710. // using the data included in the request.
  72711. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  72712. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72713. c.project = project
  72714. c.region = region
  72715. c.interconnectattachment = interconnectattachment
  72716. return c
  72717. }
  72718. // RequestId sets the optional parameter "requestId": An optional
  72719. // request ID to identify requests. Specify a unique request ID so that
  72720. // if you must retry your request, the server will know to ignore the
  72721. // request if it has already been completed.
  72722. //
  72723. // For example, consider a situation where you make an initial request
  72724. // and the request times out. If you make the request again with the
  72725. // same request ID, the server can check if original operation with the
  72726. // same request ID was received, and if so, will ignore the second
  72727. // request. This prevents clients from accidentally creating duplicate
  72728. // commitments.
  72729. //
  72730. // The request ID must be a valid UUID with the exception that zero UUID
  72731. // is not supported (00000000-0000-0000-0000-000000000000).
  72732. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  72733. c.urlParams_.Set("requestId", requestId)
  72734. return c
  72735. }
  72736. // Fields allows partial responses to be retrieved. See
  72737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72738. // for more information.
  72739. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  72740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72741. return c
  72742. }
  72743. // Context sets the context to be used in this call's Do method. Any
  72744. // pending HTTP request will be aborted if the provided context is
  72745. // canceled.
  72746. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  72747. c.ctx_ = ctx
  72748. return c
  72749. }
  72750. // Header returns an http.Header that can be modified by the caller to
  72751. // add HTTP headers to the request.
  72752. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  72753. if c.header_ == nil {
  72754. c.header_ = make(http.Header)
  72755. }
  72756. return c.header_
  72757. }
  72758. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  72759. reqHeaders := make(http.Header)
  72760. for k, v := range c.header_ {
  72761. reqHeaders[k] = v
  72762. }
  72763. reqHeaders.Set("User-Agent", c.s.userAgent())
  72764. var body io.Reader = nil
  72765. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  72766. if err != nil {
  72767. return nil, err
  72768. }
  72769. reqHeaders.Set("Content-Type", "application/json")
  72770. c.urlParams_.Set("alt", alt)
  72771. c.urlParams_.Set("prettyPrint", "false")
  72772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  72773. urls += "?" + c.urlParams_.Encode()
  72774. req, err := http.NewRequest("POST", urls, body)
  72775. if err != nil {
  72776. return nil, err
  72777. }
  72778. req.Header = reqHeaders
  72779. googleapi.Expand(req.URL, map[string]string{
  72780. "project": c.project,
  72781. "region": c.region,
  72782. })
  72783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72784. }
  72785. // Do executes the "compute.interconnectAttachments.insert" call.
  72786. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72787. // status code is an error. Response headers are in either
  72788. // *Operation.ServerResponse.Header or (if a response was returned at
  72789. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72790. // to check whether the returned error was because
  72791. // http.StatusNotModified was returned.
  72792. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72793. gensupport.SetOptions(c.urlParams_, opts...)
  72794. res, err := c.doRequest("json")
  72795. if res != nil && res.StatusCode == http.StatusNotModified {
  72796. if res.Body != nil {
  72797. res.Body.Close()
  72798. }
  72799. return nil, &googleapi.Error{
  72800. Code: res.StatusCode,
  72801. Header: res.Header,
  72802. }
  72803. }
  72804. if err != nil {
  72805. return nil, err
  72806. }
  72807. defer googleapi.CloseBody(res)
  72808. if err := googleapi.CheckResponse(res); err != nil {
  72809. return nil, err
  72810. }
  72811. ret := &Operation{
  72812. ServerResponse: googleapi.ServerResponse{
  72813. Header: res.Header,
  72814. HTTPStatusCode: res.StatusCode,
  72815. },
  72816. }
  72817. target := &ret
  72818. if err := gensupport.DecodeResponse(target, res); err != nil {
  72819. return nil, err
  72820. }
  72821. return ret, nil
  72822. // {
  72823. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  72824. // "httpMethod": "POST",
  72825. // "id": "compute.interconnectAttachments.insert",
  72826. // "parameterOrder": [
  72827. // "project",
  72828. // "region"
  72829. // ],
  72830. // "parameters": {
  72831. // "project": {
  72832. // "description": "Project ID for this request.",
  72833. // "location": "path",
  72834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72835. // "required": true,
  72836. // "type": "string"
  72837. // },
  72838. // "region": {
  72839. // "description": "Name of the region for this request.",
  72840. // "location": "path",
  72841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72842. // "required": true,
  72843. // "type": "string"
  72844. // },
  72845. // "requestId": {
  72846. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72847. // "location": "query",
  72848. // "type": "string"
  72849. // }
  72850. // },
  72851. // "path": "{project}/regions/{region}/interconnectAttachments",
  72852. // "request": {
  72853. // "$ref": "InterconnectAttachment"
  72854. // },
  72855. // "response": {
  72856. // "$ref": "Operation"
  72857. // },
  72858. // "scopes": [
  72859. // "https://www.googleapis.com/auth/cloud-platform",
  72860. // "https://www.googleapis.com/auth/compute"
  72861. // ]
  72862. // }
  72863. }
  72864. // method id "compute.interconnectAttachments.list":
  72865. type InterconnectAttachmentsListCall struct {
  72866. s *Service
  72867. project string
  72868. region string
  72869. urlParams_ gensupport.URLParams
  72870. ifNoneMatch_ string
  72871. ctx_ context.Context
  72872. header_ http.Header
  72873. }
  72874. // List: Retrieves the list of interconnect attachments contained within
  72875. // the specified region.
  72876. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  72877. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72878. c.project = project
  72879. c.region = region
  72880. return c
  72881. }
  72882. // Filter sets the optional parameter "filter": A filter expression that
  72883. // filters resources listed in the response. The expression must specify
  72884. // the field name, a comparison operator, and the value that you want to
  72885. // use for filtering. The value must be a string, a number, or a
  72886. // boolean. The comparison operator must be either =, !=, >, or <.
  72887. //
  72888. // For example, if you are filtering Compute Engine instances, you can
  72889. // exclude instances named example-instance by specifying name !=
  72890. // example-instance.
  72891. //
  72892. // You can also filter nested fields. For example, you could specify
  72893. // scheduling.automaticRestart = false to include instances only if they
  72894. // are not scheduled for automatic restarts. You can use filtering on
  72895. // nested fields to filter based on resource labels.
  72896. //
  72897. // To filter on multiple expressions, provide each separate expression
  72898. // within parentheses. For example, (scheduling.automaticRestart = true)
  72899. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72900. // AND expression. However, you can include AND and OR expressions
  72901. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72902. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72903. // true).
  72904. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  72905. c.urlParams_.Set("filter", filter)
  72906. return c
  72907. }
  72908. // MaxResults sets the optional parameter "maxResults": The maximum
  72909. // number of results per page that should be returned. If the number of
  72910. // available results is larger than maxResults, Compute Engine returns a
  72911. // nextPageToken that can be used to get the next page of results in
  72912. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72913. // (Default: 500)
  72914. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  72915. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72916. return c
  72917. }
  72918. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72919. // a certain order. By default, results are returned in alphanumerical
  72920. // order based on the resource name.
  72921. //
  72922. // You can also sort results in descending order based on the creation
  72923. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72924. // based on the creationTimestamp field in reverse chronological order
  72925. // (newest result first). Use this to sort resources like operations so
  72926. // that the newest operation is returned first.
  72927. //
  72928. // Currently, only sorting by name or creationTimestamp desc is
  72929. // supported.
  72930. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  72931. c.urlParams_.Set("orderBy", orderBy)
  72932. return c
  72933. }
  72934. // PageToken sets the optional parameter "pageToken": Specifies a page
  72935. // token to use. Set pageToken to the nextPageToken returned by a
  72936. // previous list request to get the next page of results.
  72937. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  72938. c.urlParams_.Set("pageToken", pageToken)
  72939. return c
  72940. }
  72941. // Fields allows partial responses to be retrieved. See
  72942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72943. // for more information.
  72944. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  72945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72946. return c
  72947. }
  72948. // IfNoneMatch sets the optional parameter which makes the operation
  72949. // fail if the object's ETag matches the given value. This is useful for
  72950. // getting updates only after the object has changed since the last
  72951. // request. Use googleapi.IsNotModified to check whether the response
  72952. // error from Do is the result of In-None-Match.
  72953. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  72954. c.ifNoneMatch_ = entityTag
  72955. return c
  72956. }
  72957. // Context sets the context to be used in this call's Do method. Any
  72958. // pending HTTP request will be aborted if the provided context is
  72959. // canceled.
  72960. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  72961. c.ctx_ = ctx
  72962. return c
  72963. }
  72964. // Header returns an http.Header that can be modified by the caller to
  72965. // add HTTP headers to the request.
  72966. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  72967. if c.header_ == nil {
  72968. c.header_ = make(http.Header)
  72969. }
  72970. return c.header_
  72971. }
  72972. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  72973. reqHeaders := make(http.Header)
  72974. for k, v := range c.header_ {
  72975. reqHeaders[k] = v
  72976. }
  72977. reqHeaders.Set("User-Agent", c.s.userAgent())
  72978. if c.ifNoneMatch_ != "" {
  72979. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72980. }
  72981. var body io.Reader = nil
  72982. c.urlParams_.Set("alt", alt)
  72983. c.urlParams_.Set("prettyPrint", "false")
  72984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  72985. urls += "?" + c.urlParams_.Encode()
  72986. req, err := http.NewRequest("GET", urls, body)
  72987. if err != nil {
  72988. return nil, err
  72989. }
  72990. req.Header = reqHeaders
  72991. googleapi.Expand(req.URL, map[string]string{
  72992. "project": c.project,
  72993. "region": c.region,
  72994. })
  72995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72996. }
  72997. // Do executes the "compute.interconnectAttachments.list" call.
  72998. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  72999. // Any non-2xx status code is an error. Response headers are in either
  73000. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  73001. // was returned at all) in error.(*googleapi.Error).Header. Use
  73002. // googleapi.IsNotModified to check whether the returned error was
  73003. // because http.StatusNotModified was returned.
  73004. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  73005. gensupport.SetOptions(c.urlParams_, opts...)
  73006. res, err := c.doRequest("json")
  73007. if res != nil && res.StatusCode == http.StatusNotModified {
  73008. if res.Body != nil {
  73009. res.Body.Close()
  73010. }
  73011. return nil, &googleapi.Error{
  73012. Code: res.StatusCode,
  73013. Header: res.Header,
  73014. }
  73015. }
  73016. if err != nil {
  73017. return nil, err
  73018. }
  73019. defer googleapi.CloseBody(res)
  73020. if err := googleapi.CheckResponse(res); err != nil {
  73021. return nil, err
  73022. }
  73023. ret := &InterconnectAttachmentList{
  73024. ServerResponse: googleapi.ServerResponse{
  73025. Header: res.Header,
  73026. HTTPStatusCode: res.StatusCode,
  73027. },
  73028. }
  73029. target := &ret
  73030. if err := gensupport.DecodeResponse(target, res); err != nil {
  73031. return nil, err
  73032. }
  73033. return ret, nil
  73034. // {
  73035. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  73036. // "httpMethod": "GET",
  73037. // "id": "compute.interconnectAttachments.list",
  73038. // "parameterOrder": [
  73039. // "project",
  73040. // "region"
  73041. // ],
  73042. // "parameters": {
  73043. // "filter": {
  73044. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73045. // "location": "query",
  73046. // "type": "string"
  73047. // },
  73048. // "maxResults": {
  73049. // "default": "500",
  73050. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73051. // "format": "uint32",
  73052. // "location": "query",
  73053. // "minimum": "0",
  73054. // "type": "integer"
  73055. // },
  73056. // "orderBy": {
  73057. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73058. // "location": "query",
  73059. // "type": "string"
  73060. // },
  73061. // "pageToken": {
  73062. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73063. // "location": "query",
  73064. // "type": "string"
  73065. // },
  73066. // "project": {
  73067. // "description": "Project ID for this request.",
  73068. // "location": "path",
  73069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73070. // "required": true,
  73071. // "type": "string"
  73072. // },
  73073. // "region": {
  73074. // "description": "Name of the region for this request.",
  73075. // "location": "path",
  73076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73077. // "required": true,
  73078. // "type": "string"
  73079. // }
  73080. // },
  73081. // "path": "{project}/regions/{region}/interconnectAttachments",
  73082. // "response": {
  73083. // "$ref": "InterconnectAttachmentList"
  73084. // },
  73085. // "scopes": [
  73086. // "https://www.googleapis.com/auth/cloud-platform",
  73087. // "https://www.googleapis.com/auth/compute",
  73088. // "https://www.googleapis.com/auth/compute.readonly"
  73089. // ]
  73090. // }
  73091. }
  73092. // Pages invokes f for each page of results.
  73093. // A non-nil error returned from f will halt the iteration.
  73094. // The provided context supersedes any context provided to the Context method.
  73095. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  73096. c.ctx_ = ctx
  73097. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73098. for {
  73099. x, err := c.Do()
  73100. if err != nil {
  73101. return err
  73102. }
  73103. if err := f(x); err != nil {
  73104. return err
  73105. }
  73106. if x.NextPageToken == "" {
  73107. return nil
  73108. }
  73109. c.PageToken(x.NextPageToken)
  73110. }
  73111. }
  73112. // method id "compute.interconnectAttachments.patch":
  73113. type InterconnectAttachmentsPatchCall struct {
  73114. s *Service
  73115. project string
  73116. region string
  73117. interconnectAttachment string
  73118. interconnectattachment *InterconnectAttachment
  73119. urlParams_ gensupport.URLParams
  73120. ctx_ context.Context
  73121. header_ http.Header
  73122. }
  73123. // Patch: Updates the specified interconnect attachment with the data
  73124. // included in the request. This method supports PATCH semantics and
  73125. // uses the JSON merge patch format and processing rules.
  73126. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  73127. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73128. c.project = project
  73129. c.region = region
  73130. c.interconnectAttachment = interconnectAttachment
  73131. c.interconnectattachment = interconnectattachment
  73132. return c
  73133. }
  73134. // RequestId sets the optional parameter "requestId": An optional
  73135. // request ID to identify requests. Specify a unique request ID so that
  73136. // if you must retry your request, the server will know to ignore the
  73137. // request if it has already been completed.
  73138. //
  73139. // For example, consider a situation where you make an initial request
  73140. // and the request times out. If you make the request again with the
  73141. // same request ID, the server can check if original operation with the
  73142. // same request ID was received, and if so, will ignore the second
  73143. // request. This prevents clients from accidentally creating duplicate
  73144. // commitments.
  73145. //
  73146. // The request ID must be a valid UUID with the exception that zero UUID
  73147. // is not supported (00000000-0000-0000-0000-000000000000).
  73148. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  73149. c.urlParams_.Set("requestId", requestId)
  73150. return c
  73151. }
  73152. // Fields allows partial responses to be retrieved. See
  73153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73154. // for more information.
  73155. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  73156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73157. return c
  73158. }
  73159. // Context sets the context to be used in this call's Do method. Any
  73160. // pending HTTP request will be aborted if the provided context is
  73161. // canceled.
  73162. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  73163. c.ctx_ = ctx
  73164. return c
  73165. }
  73166. // Header returns an http.Header that can be modified by the caller to
  73167. // add HTTP headers to the request.
  73168. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  73169. if c.header_ == nil {
  73170. c.header_ = make(http.Header)
  73171. }
  73172. return c.header_
  73173. }
  73174. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  73175. reqHeaders := make(http.Header)
  73176. for k, v := range c.header_ {
  73177. reqHeaders[k] = v
  73178. }
  73179. reqHeaders.Set("User-Agent", c.s.userAgent())
  73180. var body io.Reader = nil
  73181. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  73182. if err != nil {
  73183. return nil, err
  73184. }
  73185. reqHeaders.Set("Content-Type", "application/json")
  73186. c.urlParams_.Set("alt", alt)
  73187. c.urlParams_.Set("prettyPrint", "false")
  73188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  73189. urls += "?" + c.urlParams_.Encode()
  73190. req, err := http.NewRequest("PATCH", urls, body)
  73191. if err != nil {
  73192. return nil, err
  73193. }
  73194. req.Header = reqHeaders
  73195. googleapi.Expand(req.URL, map[string]string{
  73196. "project": c.project,
  73197. "region": c.region,
  73198. "interconnectAttachment": c.interconnectAttachment,
  73199. })
  73200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73201. }
  73202. // Do executes the "compute.interconnectAttachments.patch" call.
  73203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73204. // status code is an error. Response headers are in either
  73205. // *Operation.ServerResponse.Header or (if a response was returned at
  73206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73207. // to check whether the returned error was because
  73208. // http.StatusNotModified was returned.
  73209. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73210. gensupport.SetOptions(c.urlParams_, opts...)
  73211. res, err := c.doRequest("json")
  73212. if res != nil && res.StatusCode == http.StatusNotModified {
  73213. if res.Body != nil {
  73214. res.Body.Close()
  73215. }
  73216. return nil, &googleapi.Error{
  73217. Code: res.StatusCode,
  73218. Header: res.Header,
  73219. }
  73220. }
  73221. if err != nil {
  73222. return nil, err
  73223. }
  73224. defer googleapi.CloseBody(res)
  73225. if err := googleapi.CheckResponse(res); err != nil {
  73226. return nil, err
  73227. }
  73228. ret := &Operation{
  73229. ServerResponse: googleapi.ServerResponse{
  73230. Header: res.Header,
  73231. HTTPStatusCode: res.StatusCode,
  73232. },
  73233. }
  73234. target := &ret
  73235. if err := gensupport.DecodeResponse(target, res); err != nil {
  73236. return nil, err
  73237. }
  73238. return ret, nil
  73239. // {
  73240. // "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.",
  73241. // "httpMethod": "PATCH",
  73242. // "id": "compute.interconnectAttachments.patch",
  73243. // "parameterOrder": [
  73244. // "project",
  73245. // "region",
  73246. // "interconnectAttachment"
  73247. // ],
  73248. // "parameters": {
  73249. // "interconnectAttachment": {
  73250. // "description": "Name of the interconnect attachment to patch.",
  73251. // "location": "path",
  73252. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73253. // "required": true,
  73254. // "type": "string"
  73255. // },
  73256. // "project": {
  73257. // "description": "Project ID for this request.",
  73258. // "location": "path",
  73259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73260. // "required": true,
  73261. // "type": "string"
  73262. // },
  73263. // "region": {
  73264. // "description": "Name of the region scoping this request.",
  73265. // "location": "path",
  73266. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73267. // "required": true,
  73268. // "type": "string"
  73269. // },
  73270. // "requestId": {
  73271. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73272. // "location": "query",
  73273. // "type": "string"
  73274. // }
  73275. // },
  73276. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  73277. // "request": {
  73278. // "$ref": "InterconnectAttachment"
  73279. // },
  73280. // "response": {
  73281. // "$ref": "Operation"
  73282. // },
  73283. // "scopes": [
  73284. // "https://www.googleapis.com/auth/cloud-platform",
  73285. // "https://www.googleapis.com/auth/compute"
  73286. // ]
  73287. // }
  73288. }
  73289. // method id "compute.interconnectAttachments.setIamPolicy":
  73290. type InterconnectAttachmentsSetIamPolicyCall struct {
  73291. s *Service
  73292. project string
  73293. region string
  73294. resource string
  73295. regionsetpolicyrequest *RegionSetPolicyRequest
  73296. urlParams_ gensupport.URLParams
  73297. ctx_ context.Context
  73298. header_ http.Header
  73299. }
  73300. // SetIamPolicy: Sets the access control policy on the specified
  73301. // resource. Replaces any existing policy.
  73302. func (r *InterconnectAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *InterconnectAttachmentsSetIamPolicyCall {
  73303. c := &InterconnectAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73304. c.project = project
  73305. c.region = region
  73306. c.resource = resource
  73307. c.regionsetpolicyrequest = regionsetpolicyrequest
  73308. return c
  73309. }
  73310. // Fields allows partial responses to be retrieved. See
  73311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73312. // for more information.
  73313. func (c *InterconnectAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetIamPolicyCall {
  73314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73315. return c
  73316. }
  73317. // Context sets the context to be used in this call's Do method. Any
  73318. // pending HTTP request will be aborted if the provided context is
  73319. // canceled.
  73320. func (c *InterconnectAttachmentsSetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsSetIamPolicyCall {
  73321. c.ctx_ = ctx
  73322. return c
  73323. }
  73324. // Header returns an http.Header that can be modified by the caller to
  73325. // add HTTP headers to the request.
  73326. func (c *InterconnectAttachmentsSetIamPolicyCall) Header() http.Header {
  73327. if c.header_ == nil {
  73328. c.header_ = make(http.Header)
  73329. }
  73330. return c.header_
  73331. }
  73332. func (c *InterconnectAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  73333. reqHeaders := make(http.Header)
  73334. for k, v := range c.header_ {
  73335. reqHeaders[k] = v
  73336. }
  73337. reqHeaders.Set("User-Agent", c.s.userAgent())
  73338. var body io.Reader = nil
  73339. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  73340. if err != nil {
  73341. return nil, err
  73342. }
  73343. reqHeaders.Set("Content-Type", "application/json")
  73344. c.urlParams_.Set("alt", alt)
  73345. c.urlParams_.Set("prettyPrint", "false")
  73346. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy")
  73347. urls += "?" + c.urlParams_.Encode()
  73348. req, err := http.NewRequest("POST", urls, body)
  73349. if err != nil {
  73350. return nil, err
  73351. }
  73352. req.Header = reqHeaders
  73353. googleapi.Expand(req.URL, map[string]string{
  73354. "project": c.project,
  73355. "region": c.region,
  73356. "resource": c.resource,
  73357. })
  73358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73359. }
  73360. // Do executes the "compute.interconnectAttachments.setIamPolicy" call.
  73361. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  73362. // code is an error. Response headers are in either
  73363. // *Policy.ServerResponse.Header or (if a response was returned at all)
  73364. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  73365. // check whether the returned error was because http.StatusNotModified
  73366. // was returned.
  73367. func (c *InterconnectAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  73368. gensupport.SetOptions(c.urlParams_, opts...)
  73369. res, err := c.doRequest("json")
  73370. if res != nil && res.StatusCode == http.StatusNotModified {
  73371. if res.Body != nil {
  73372. res.Body.Close()
  73373. }
  73374. return nil, &googleapi.Error{
  73375. Code: res.StatusCode,
  73376. Header: res.Header,
  73377. }
  73378. }
  73379. if err != nil {
  73380. return nil, err
  73381. }
  73382. defer googleapi.CloseBody(res)
  73383. if err := googleapi.CheckResponse(res); err != nil {
  73384. return nil, err
  73385. }
  73386. ret := &Policy{
  73387. ServerResponse: googleapi.ServerResponse{
  73388. Header: res.Header,
  73389. HTTPStatusCode: res.StatusCode,
  73390. },
  73391. }
  73392. target := &ret
  73393. if err := gensupport.DecodeResponse(target, res); err != nil {
  73394. return nil, err
  73395. }
  73396. return ret, nil
  73397. // {
  73398. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  73399. // "httpMethod": "POST",
  73400. // "id": "compute.interconnectAttachments.setIamPolicy",
  73401. // "parameterOrder": [
  73402. // "project",
  73403. // "region",
  73404. // "resource"
  73405. // ],
  73406. // "parameters": {
  73407. // "project": {
  73408. // "description": "Project ID for this request.",
  73409. // "location": "path",
  73410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73411. // "required": true,
  73412. // "type": "string"
  73413. // },
  73414. // "region": {
  73415. // "description": "The name of the region for this request.",
  73416. // "location": "path",
  73417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73418. // "required": true,
  73419. // "type": "string"
  73420. // },
  73421. // "resource": {
  73422. // "description": "Name or id of the resource for this request.",
  73423. // "location": "path",
  73424. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73425. // "required": true,
  73426. // "type": "string"
  73427. // }
  73428. // },
  73429. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy",
  73430. // "request": {
  73431. // "$ref": "RegionSetPolicyRequest"
  73432. // },
  73433. // "response": {
  73434. // "$ref": "Policy"
  73435. // },
  73436. // "scopes": [
  73437. // "https://www.googleapis.com/auth/cloud-platform",
  73438. // "https://www.googleapis.com/auth/compute"
  73439. // ]
  73440. // }
  73441. }
  73442. // method id "compute.interconnectAttachments.setLabels":
  73443. type InterconnectAttachmentsSetLabelsCall struct {
  73444. s *Service
  73445. project string
  73446. region string
  73447. resource string
  73448. regionsetlabelsrequest *RegionSetLabelsRequest
  73449. urlParams_ gensupport.URLParams
  73450. ctx_ context.Context
  73451. header_ http.Header
  73452. }
  73453. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  73454. // more about labels, read the Labeling Resources documentation.
  73455. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  73456. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73457. c.project = project
  73458. c.region = region
  73459. c.resource = resource
  73460. c.regionsetlabelsrequest = regionsetlabelsrequest
  73461. return c
  73462. }
  73463. // RequestId sets the optional parameter "requestId": An optional
  73464. // request ID to identify requests. Specify a unique request ID so that
  73465. // if you must retry your request, the server will know to ignore the
  73466. // request if it has already been completed.
  73467. //
  73468. // For example, consider a situation where you make an initial request
  73469. // and the request times out. If you make the request again with the
  73470. // same request ID, the server can check if original operation with the
  73471. // same request ID was received, and if so, will ignore the second
  73472. // request. This prevents clients from accidentally creating duplicate
  73473. // commitments.
  73474. //
  73475. // The request ID must be a valid UUID with the exception that zero UUID
  73476. // is not supported (00000000-0000-0000-0000-000000000000).
  73477. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  73478. c.urlParams_.Set("requestId", requestId)
  73479. return c
  73480. }
  73481. // Fields allows partial responses to be retrieved. See
  73482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73483. // for more information.
  73484. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  73485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73486. return c
  73487. }
  73488. // Context sets the context to be used in this call's Do method. Any
  73489. // pending HTTP request will be aborted if the provided context is
  73490. // canceled.
  73491. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  73492. c.ctx_ = ctx
  73493. return c
  73494. }
  73495. // Header returns an http.Header that can be modified by the caller to
  73496. // add HTTP headers to the request.
  73497. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  73498. if c.header_ == nil {
  73499. c.header_ = make(http.Header)
  73500. }
  73501. return c.header_
  73502. }
  73503. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  73504. reqHeaders := make(http.Header)
  73505. for k, v := range c.header_ {
  73506. reqHeaders[k] = v
  73507. }
  73508. reqHeaders.Set("User-Agent", c.s.userAgent())
  73509. var body io.Reader = nil
  73510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  73511. if err != nil {
  73512. return nil, err
  73513. }
  73514. reqHeaders.Set("Content-Type", "application/json")
  73515. c.urlParams_.Set("alt", alt)
  73516. c.urlParams_.Set("prettyPrint", "false")
  73517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  73518. urls += "?" + c.urlParams_.Encode()
  73519. req, err := http.NewRequest("POST", urls, body)
  73520. if err != nil {
  73521. return nil, err
  73522. }
  73523. req.Header = reqHeaders
  73524. googleapi.Expand(req.URL, map[string]string{
  73525. "project": c.project,
  73526. "region": c.region,
  73527. "resource": c.resource,
  73528. })
  73529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73530. }
  73531. // Do executes the "compute.interconnectAttachments.setLabels" call.
  73532. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73533. // status code is an error. Response headers are in either
  73534. // *Operation.ServerResponse.Header or (if a response was returned at
  73535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73536. // to check whether the returned error was because
  73537. // http.StatusNotModified was returned.
  73538. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73539. gensupport.SetOptions(c.urlParams_, opts...)
  73540. res, err := c.doRequest("json")
  73541. if res != nil && res.StatusCode == http.StatusNotModified {
  73542. if res.Body != nil {
  73543. res.Body.Close()
  73544. }
  73545. return nil, &googleapi.Error{
  73546. Code: res.StatusCode,
  73547. Header: res.Header,
  73548. }
  73549. }
  73550. if err != nil {
  73551. return nil, err
  73552. }
  73553. defer googleapi.CloseBody(res)
  73554. if err := googleapi.CheckResponse(res); err != nil {
  73555. return nil, err
  73556. }
  73557. ret := &Operation{
  73558. ServerResponse: googleapi.ServerResponse{
  73559. Header: res.Header,
  73560. HTTPStatusCode: res.StatusCode,
  73561. },
  73562. }
  73563. target := &ret
  73564. if err := gensupport.DecodeResponse(target, res); err != nil {
  73565. return nil, err
  73566. }
  73567. return ret, nil
  73568. // {
  73569. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  73570. // "httpMethod": "POST",
  73571. // "id": "compute.interconnectAttachments.setLabels",
  73572. // "parameterOrder": [
  73573. // "project",
  73574. // "region",
  73575. // "resource"
  73576. // ],
  73577. // "parameters": {
  73578. // "project": {
  73579. // "description": "Project ID for this request.",
  73580. // "location": "path",
  73581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73582. // "required": true,
  73583. // "type": "string"
  73584. // },
  73585. // "region": {
  73586. // "description": "The region for this request.",
  73587. // "location": "path",
  73588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73589. // "required": true,
  73590. // "type": "string"
  73591. // },
  73592. // "requestId": {
  73593. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73594. // "location": "query",
  73595. // "type": "string"
  73596. // },
  73597. // "resource": {
  73598. // "description": "Name or id of the resource for this request.",
  73599. // "location": "path",
  73600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73601. // "required": true,
  73602. // "type": "string"
  73603. // }
  73604. // },
  73605. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  73606. // "request": {
  73607. // "$ref": "RegionSetLabelsRequest"
  73608. // },
  73609. // "response": {
  73610. // "$ref": "Operation"
  73611. // },
  73612. // "scopes": [
  73613. // "https://www.googleapis.com/auth/cloud-platform",
  73614. // "https://www.googleapis.com/auth/compute"
  73615. // ]
  73616. // }
  73617. }
  73618. // method id "compute.interconnectAttachments.testIamPermissions":
  73619. type InterconnectAttachmentsTestIamPermissionsCall struct {
  73620. s *Service
  73621. project string
  73622. region string
  73623. resource string
  73624. testpermissionsrequest *TestPermissionsRequest
  73625. urlParams_ gensupport.URLParams
  73626. ctx_ context.Context
  73627. header_ http.Header
  73628. }
  73629. // TestIamPermissions: Returns permissions that a caller has on the
  73630. // specified resource.
  73631. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  73632. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73633. c.project = project
  73634. c.region = region
  73635. c.resource = resource
  73636. c.testpermissionsrequest = testpermissionsrequest
  73637. return c
  73638. }
  73639. // Fields allows partial responses to be retrieved. See
  73640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73641. // for more information.
  73642. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  73643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73644. return c
  73645. }
  73646. // Context sets the context to be used in this call's Do method. Any
  73647. // pending HTTP request will be aborted if the provided context is
  73648. // canceled.
  73649. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  73650. c.ctx_ = ctx
  73651. return c
  73652. }
  73653. // Header returns an http.Header that can be modified by the caller to
  73654. // add HTTP headers to the request.
  73655. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  73656. if c.header_ == nil {
  73657. c.header_ = make(http.Header)
  73658. }
  73659. return c.header_
  73660. }
  73661. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  73662. reqHeaders := make(http.Header)
  73663. for k, v := range c.header_ {
  73664. reqHeaders[k] = v
  73665. }
  73666. reqHeaders.Set("User-Agent", c.s.userAgent())
  73667. var body io.Reader = nil
  73668. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  73669. if err != nil {
  73670. return nil, err
  73671. }
  73672. reqHeaders.Set("Content-Type", "application/json")
  73673. c.urlParams_.Set("alt", alt)
  73674. c.urlParams_.Set("prettyPrint", "false")
  73675. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  73676. urls += "?" + c.urlParams_.Encode()
  73677. req, err := http.NewRequest("POST", urls, body)
  73678. if err != nil {
  73679. return nil, err
  73680. }
  73681. req.Header = reqHeaders
  73682. googleapi.Expand(req.URL, map[string]string{
  73683. "project": c.project,
  73684. "region": c.region,
  73685. "resource": c.resource,
  73686. })
  73687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73688. }
  73689. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  73690. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  73691. // non-2xx status code is an error. Response headers are in either
  73692. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  73693. // returned at all) in error.(*googleapi.Error).Header. Use
  73694. // googleapi.IsNotModified to check whether the returned error was
  73695. // because http.StatusNotModified was returned.
  73696. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  73697. gensupport.SetOptions(c.urlParams_, opts...)
  73698. res, err := c.doRequest("json")
  73699. if res != nil && res.StatusCode == http.StatusNotModified {
  73700. if res.Body != nil {
  73701. res.Body.Close()
  73702. }
  73703. return nil, &googleapi.Error{
  73704. Code: res.StatusCode,
  73705. Header: res.Header,
  73706. }
  73707. }
  73708. if err != nil {
  73709. return nil, err
  73710. }
  73711. defer googleapi.CloseBody(res)
  73712. if err := googleapi.CheckResponse(res); err != nil {
  73713. return nil, err
  73714. }
  73715. ret := &TestPermissionsResponse{
  73716. ServerResponse: googleapi.ServerResponse{
  73717. Header: res.Header,
  73718. HTTPStatusCode: res.StatusCode,
  73719. },
  73720. }
  73721. target := &ret
  73722. if err := gensupport.DecodeResponse(target, res); err != nil {
  73723. return nil, err
  73724. }
  73725. return ret, nil
  73726. // {
  73727. // "description": "Returns permissions that a caller has on the specified resource.",
  73728. // "httpMethod": "POST",
  73729. // "id": "compute.interconnectAttachments.testIamPermissions",
  73730. // "parameterOrder": [
  73731. // "project",
  73732. // "region",
  73733. // "resource"
  73734. // ],
  73735. // "parameters": {
  73736. // "project": {
  73737. // "description": "Project ID for this request.",
  73738. // "location": "path",
  73739. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73740. // "required": true,
  73741. // "type": "string"
  73742. // },
  73743. // "region": {
  73744. // "description": "The name of the region for this request.",
  73745. // "location": "path",
  73746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73747. // "required": true,
  73748. // "type": "string"
  73749. // },
  73750. // "resource": {
  73751. // "description": "Name or id of the resource for this request.",
  73752. // "location": "path",
  73753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73754. // "required": true,
  73755. // "type": "string"
  73756. // }
  73757. // },
  73758. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  73759. // "request": {
  73760. // "$ref": "TestPermissionsRequest"
  73761. // },
  73762. // "response": {
  73763. // "$ref": "TestPermissionsResponse"
  73764. // },
  73765. // "scopes": [
  73766. // "https://www.googleapis.com/auth/cloud-platform",
  73767. // "https://www.googleapis.com/auth/compute",
  73768. // "https://www.googleapis.com/auth/compute.readonly"
  73769. // ]
  73770. // }
  73771. }
  73772. // method id "compute.interconnectLocations.get":
  73773. type InterconnectLocationsGetCall struct {
  73774. s *Service
  73775. project string
  73776. interconnectLocation string
  73777. urlParams_ gensupport.URLParams
  73778. ifNoneMatch_ string
  73779. ctx_ context.Context
  73780. header_ http.Header
  73781. }
  73782. // Get: Returns the details for the specified interconnect location.
  73783. // Gets a list of available interconnect locations by making a list()
  73784. // request.
  73785. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  73786. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73787. c.project = project
  73788. c.interconnectLocation = interconnectLocation
  73789. return c
  73790. }
  73791. // Fields allows partial responses to be retrieved. See
  73792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73793. // for more information.
  73794. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  73795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73796. return c
  73797. }
  73798. // IfNoneMatch sets the optional parameter which makes the operation
  73799. // fail if the object's ETag matches the given value. This is useful for
  73800. // getting updates only after the object has changed since the last
  73801. // request. Use googleapi.IsNotModified to check whether the response
  73802. // error from Do is the result of In-None-Match.
  73803. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  73804. c.ifNoneMatch_ = entityTag
  73805. return c
  73806. }
  73807. // Context sets the context to be used in this call's Do method. Any
  73808. // pending HTTP request will be aborted if the provided context is
  73809. // canceled.
  73810. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  73811. c.ctx_ = ctx
  73812. return c
  73813. }
  73814. // Header returns an http.Header that can be modified by the caller to
  73815. // add HTTP headers to the request.
  73816. func (c *InterconnectLocationsGetCall) Header() http.Header {
  73817. if c.header_ == nil {
  73818. c.header_ = make(http.Header)
  73819. }
  73820. return c.header_
  73821. }
  73822. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  73823. reqHeaders := make(http.Header)
  73824. for k, v := range c.header_ {
  73825. reqHeaders[k] = v
  73826. }
  73827. reqHeaders.Set("User-Agent", c.s.userAgent())
  73828. if c.ifNoneMatch_ != "" {
  73829. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73830. }
  73831. var body io.Reader = nil
  73832. c.urlParams_.Set("alt", alt)
  73833. c.urlParams_.Set("prettyPrint", "false")
  73834. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  73835. urls += "?" + c.urlParams_.Encode()
  73836. req, err := http.NewRequest("GET", urls, body)
  73837. if err != nil {
  73838. return nil, err
  73839. }
  73840. req.Header = reqHeaders
  73841. googleapi.Expand(req.URL, map[string]string{
  73842. "project": c.project,
  73843. "interconnectLocation": c.interconnectLocation,
  73844. })
  73845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73846. }
  73847. // Do executes the "compute.interconnectLocations.get" call.
  73848. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  73849. // non-2xx status code is an error. Response headers are in either
  73850. // *InterconnectLocation.ServerResponse.Header or (if a response was
  73851. // returned at all) in error.(*googleapi.Error).Header. Use
  73852. // googleapi.IsNotModified to check whether the returned error was
  73853. // because http.StatusNotModified was returned.
  73854. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  73855. gensupport.SetOptions(c.urlParams_, opts...)
  73856. res, err := c.doRequest("json")
  73857. if res != nil && res.StatusCode == http.StatusNotModified {
  73858. if res.Body != nil {
  73859. res.Body.Close()
  73860. }
  73861. return nil, &googleapi.Error{
  73862. Code: res.StatusCode,
  73863. Header: res.Header,
  73864. }
  73865. }
  73866. if err != nil {
  73867. return nil, err
  73868. }
  73869. defer googleapi.CloseBody(res)
  73870. if err := googleapi.CheckResponse(res); err != nil {
  73871. return nil, err
  73872. }
  73873. ret := &InterconnectLocation{
  73874. ServerResponse: googleapi.ServerResponse{
  73875. Header: res.Header,
  73876. HTTPStatusCode: res.StatusCode,
  73877. },
  73878. }
  73879. target := &ret
  73880. if err := gensupport.DecodeResponse(target, res); err != nil {
  73881. return nil, err
  73882. }
  73883. return ret, nil
  73884. // {
  73885. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  73886. // "httpMethod": "GET",
  73887. // "id": "compute.interconnectLocations.get",
  73888. // "parameterOrder": [
  73889. // "project",
  73890. // "interconnectLocation"
  73891. // ],
  73892. // "parameters": {
  73893. // "interconnectLocation": {
  73894. // "description": "Name of the interconnect location to return.",
  73895. // "location": "path",
  73896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73897. // "required": true,
  73898. // "type": "string"
  73899. // },
  73900. // "project": {
  73901. // "description": "Project ID for this request.",
  73902. // "location": "path",
  73903. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73904. // "required": true,
  73905. // "type": "string"
  73906. // }
  73907. // },
  73908. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  73909. // "response": {
  73910. // "$ref": "InterconnectLocation"
  73911. // },
  73912. // "scopes": [
  73913. // "https://www.googleapis.com/auth/cloud-platform",
  73914. // "https://www.googleapis.com/auth/compute",
  73915. // "https://www.googleapis.com/auth/compute.readonly"
  73916. // ]
  73917. // }
  73918. }
  73919. // method id "compute.interconnectLocations.list":
  73920. type InterconnectLocationsListCall struct {
  73921. s *Service
  73922. project string
  73923. urlParams_ gensupport.URLParams
  73924. ifNoneMatch_ string
  73925. ctx_ context.Context
  73926. header_ http.Header
  73927. }
  73928. // List: Retrieves the list of interconnect locations available to the
  73929. // specified project.
  73930. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  73931. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73932. c.project = project
  73933. return c
  73934. }
  73935. // Filter sets the optional parameter "filter": A filter expression that
  73936. // filters resources listed in the response. The expression must specify
  73937. // the field name, a comparison operator, and the value that you want to
  73938. // use for filtering. The value must be a string, a number, or a
  73939. // boolean. The comparison operator must be either =, !=, >, or <.
  73940. //
  73941. // For example, if you are filtering Compute Engine instances, you can
  73942. // exclude instances named example-instance by specifying name !=
  73943. // example-instance.
  73944. //
  73945. // You can also filter nested fields. For example, you could specify
  73946. // scheduling.automaticRestart = false to include instances only if they
  73947. // are not scheduled for automatic restarts. You can use filtering on
  73948. // nested fields to filter based on resource labels.
  73949. //
  73950. // To filter on multiple expressions, provide each separate expression
  73951. // within parentheses. For example, (scheduling.automaticRestart = true)
  73952. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73953. // AND expression. However, you can include AND and OR expressions
  73954. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73955. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73956. // true).
  73957. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  73958. c.urlParams_.Set("filter", filter)
  73959. return c
  73960. }
  73961. // MaxResults sets the optional parameter "maxResults": The maximum
  73962. // number of results per page that should be returned. If the number of
  73963. // available results is larger than maxResults, Compute Engine returns a
  73964. // nextPageToken that can be used to get the next page of results in
  73965. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73966. // (Default: 500)
  73967. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  73968. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73969. return c
  73970. }
  73971. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73972. // a certain order. By default, results are returned in alphanumerical
  73973. // order based on the resource name.
  73974. //
  73975. // You can also sort results in descending order based on the creation
  73976. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73977. // based on the creationTimestamp field in reverse chronological order
  73978. // (newest result first). Use this to sort resources like operations so
  73979. // that the newest operation is returned first.
  73980. //
  73981. // Currently, only sorting by name or creationTimestamp desc is
  73982. // supported.
  73983. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  73984. c.urlParams_.Set("orderBy", orderBy)
  73985. return c
  73986. }
  73987. // PageToken sets the optional parameter "pageToken": Specifies a page
  73988. // token to use. Set pageToken to the nextPageToken returned by a
  73989. // previous list request to get the next page of results.
  73990. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  73991. c.urlParams_.Set("pageToken", pageToken)
  73992. return c
  73993. }
  73994. // Fields allows partial responses to be retrieved. See
  73995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73996. // for more information.
  73997. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  73998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73999. return c
  74000. }
  74001. // IfNoneMatch sets the optional parameter which makes the operation
  74002. // fail if the object's ETag matches the given value. This is useful for
  74003. // getting updates only after the object has changed since the last
  74004. // request. Use googleapi.IsNotModified to check whether the response
  74005. // error from Do is the result of In-None-Match.
  74006. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  74007. c.ifNoneMatch_ = entityTag
  74008. return c
  74009. }
  74010. // Context sets the context to be used in this call's Do method. Any
  74011. // pending HTTP request will be aborted if the provided context is
  74012. // canceled.
  74013. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  74014. c.ctx_ = ctx
  74015. return c
  74016. }
  74017. // Header returns an http.Header that can be modified by the caller to
  74018. // add HTTP headers to the request.
  74019. func (c *InterconnectLocationsListCall) Header() http.Header {
  74020. if c.header_ == nil {
  74021. c.header_ = make(http.Header)
  74022. }
  74023. return c.header_
  74024. }
  74025. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  74026. reqHeaders := make(http.Header)
  74027. for k, v := range c.header_ {
  74028. reqHeaders[k] = v
  74029. }
  74030. reqHeaders.Set("User-Agent", c.s.userAgent())
  74031. if c.ifNoneMatch_ != "" {
  74032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74033. }
  74034. var body io.Reader = nil
  74035. c.urlParams_.Set("alt", alt)
  74036. c.urlParams_.Set("prettyPrint", "false")
  74037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  74038. urls += "?" + c.urlParams_.Encode()
  74039. req, err := http.NewRequest("GET", urls, body)
  74040. if err != nil {
  74041. return nil, err
  74042. }
  74043. req.Header = reqHeaders
  74044. googleapi.Expand(req.URL, map[string]string{
  74045. "project": c.project,
  74046. })
  74047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74048. }
  74049. // Do executes the "compute.interconnectLocations.list" call.
  74050. // Exactly one of *InterconnectLocationList or error will be non-nil.
  74051. // Any non-2xx status code is an error. Response headers are in either
  74052. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  74053. // returned at all) in error.(*googleapi.Error).Header. Use
  74054. // googleapi.IsNotModified to check whether the returned error was
  74055. // because http.StatusNotModified was returned.
  74056. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  74057. gensupport.SetOptions(c.urlParams_, opts...)
  74058. res, err := c.doRequest("json")
  74059. if res != nil && res.StatusCode == http.StatusNotModified {
  74060. if res.Body != nil {
  74061. res.Body.Close()
  74062. }
  74063. return nil, &googleapi.Error{
  74064. Code: res.StatusCode,
  74065. Header: res.Header,
  74066. }
  74067. }
  74068. if err != nil {
  74069. return nil, err
  74070. }
  74071. defer googleapi.CloseBody(res)
  74072. if err := googleapi.CheckResponse(res); err != nil {
  74073. return nil, err
  74074. }
  74075. ret := &InterconnectLocationList{
  74076. ServerResponse: googleapi.ServerResponse{
  74077. Header: res.Header,
  74078. HTTPStatusCode: res.StatusCode,
  74079. },
  74080. }
  74081. target := &ret
  74082. if err := gensupport.DecodeResponse(target, res); err != nil {
  74083. return nil, err
  74084. }
  74085. return ret, nil
  74086. // {
  74087. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  74088. // "httpMethod": "GET",
  74089. // "id": "compute.interconnectLocations.list",
  74090. // "parameterOrder": [
  74091. // "project"
  74092. // ],
  74093. // "parameters": {
  74094. // "filter": {
  74095. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74096. // "location": "query",
  74097. // "type": "string"
  74098. // },
  74099. // "maxResults": {
  74100. // "default": "500",
  74101. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74102. // "format": "uint32",
  74103. // "location": "query",
  74104. // "minimum": "0",
  74105. // "type": "integer"
  74106. // },
  74107. // "orderBy": {
  74108. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74109. // "location": "query",
  74110. // "type": "string"
  74111. // },
  74112. // "pageToken": {
  74113. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74114. // "location": "query",
  74115. // "type": "string"
  74116. // },
  74117. // "project": {
  74118. // "description": "Project ID for this request.",
  74119. // "location": "path",
  74120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74121. // "required": true,
  74122. // "type": "string"
  74123. // }
  74124. // },
  74125. // "path": "{project}/global/interconnectLocations",
  74126. // "response": {
  74127. // "$ref": "InterconnectLocationList"
  74128. // },
  74129. // "scopes": [
  74130. // "https://www.googleapis.com/auth/cloud-platform",
  74131. // "https://www.googleapis.com/auth/compute",
  74132. // "https://www.googleapis.com/auth/compute.readonly"
  74133. // ]
  74134. // }
  74135. }
  74136. // Pages invokes f for each page of results.
  74137. // A non-nil error returned from f will halt the iteration.
  74138. // The provided context supersedes any context provided to the Context method.
  74139. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  74140. c.ctx_ = ctx
  74141. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74142. for {
  74143. x, err := c.Do()
  74144. if err != nil {
  74145. return err
  74146. }
  74147. if err := f(x); err != nil {
  74148. return err
  74149. }
  74150. if x.NextPageToken == "" {
  74151. return nil
  74152. }
  74153. c.PageToken(x.NextPageToken)
  74154. }
  74155. }
  74156. // method id "compute.interconnectLocations.testIamPermissions":
  74157. type InterconnectLocationsTestIamPermissionsCall struct {
  74158. s *Service
  74159. project string
  74160. resource string
  74161. testpermissionsrequest *TestPermissionsRequest
  74162. urlParams_ gensupport.URLParams
  74163. ctx_ context.Context
  74164. header_ http.Header
  74165. }
  74166. // TestIamPermissions: Returns permissions that a caller has on the
  74167. // specified resource.
  74168. func (r *InterconnectLocationsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectLocationsTestIamPermissionsCall {
  74169. c := &InterconnectLocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74170. c.project = project
  74171. c.resource = resource
  74172. c.testpermissionsrequest = testpermissionsrequest
  74173. return c
  74174. }
  74175. // Fields allows partial responses to be retrieved. See
  74176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74177. // for more information.
  74178. func (c *InterconnectLocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectLocationsTestIamPermissionsCall {
  74179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74180. return c
  74181. }
  74182. // Context sets the context to be used in this call's Do method. Any
  74183. // pending HTTP request will be aborted if the provided context is
  74184. // canceled.
  74185. func (c *InterconnectLocationsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectLocationsTestIamPermissionsCall {
  74186. c.ctx_ = ctx
  74187. return c
  74188. }
  74189. // Header returns an http.Header that can be modified by the caller to
  74190. // add HTTP headers to the request.
  74191. func (c *InterconnectLocationsTestIamPermissionsCall) Header() http.Header {
  74192. if c.header_ == nil {
  74193. c.header_ = make(http.Header)
  74194. }
  74195. return c.header_
  74196. }
  74197. func (c *InterconnectLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  74198. reqHeaders := make(http.Header)
  74199. for k, v := range c.header_ {
  74200. reqHeaders[k] = v
  74201. }
  74202. reqHeaders.Set("User-Agent", c.s.userAgent())
  74203. var body io.Reader = nil
  74204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  74205. if err != nil {
  74206. return nil, err
  74207. }
  74208. reqHeaders.Set("Content-Type", "application/json")
  74209. c.urlParams_.Set("alt", alt)
  74210. c.urlParams_.Set("prettyPrint", "false")
  74211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{resource}/testIamPermissions")
  74212. urls += "?" + c.urlParams_.Encode()
  74213. req, err := http.NewRequest("POST", urls, body)
  74214. if err != nil {
  74215. return nil, err
  74216. }
  74217. req.Header = reqHeaders
  74218. googleapi.Expand(req.URL, map[string]string{
  74219. "project": c.project,
  74220. "resource": c.resource,
  74221. })
  74222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74223. }
  74224. // Do executes the "compute.interconnectLocations.testIamPermissions" call.
  74225. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  74226. // non-2xx status code is an error. Response headers are in either
  74227. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  74228. // returned at all) in error.(*googleapi.Error).Header. Use
  74229. // googleapi.IsNotModified to check whether the returned error was
  74230. // because http.StatusNotModified was returned.
  74231. func (c *InterconnectLocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  74232. gensupport.SetOptions(c.urlParams_, opts...)
  74233. res, err := c.doRequest("json")
  74234. if res != nil && res.StatusCode == http.StatusNotModified {
  74235. if res.Body != nil {
  74236. res.Body.Close()
  74237. }
  74238. return nil, &googleapi.Error{
  74239. Code: res.StatusCode,
  74240. Header: res.Header,
  74241. }
  74242. }
  74243. if err != nil {
  74244. return nil, err
  74245. }
  74246. defer googleapi.CloseBody(res)
  74247. if err := googleapi.CheckResponse(res); err != nil {
  74248. return nil, err
  74249. }
  74250. ret := &TestPermissionsResponse{
  74251. ServerResponse: googleapi.ServerResponse{
  74252. Header: res.Header,
  74253. HTTPStatusCode: res.StatusCode,
  74254. },
  74255. }
  74256. target := &ret
  74257. if err := gensupport.DecodeResponse(target, res); err != nil {
  74258. return nil, err
  74259. }
  74260. return ret, nil
  74261. // {
  74262. // "description": "Returns permissions that a caller has on the specified resource.",
  74263. // "httpMethod": "POST",
  74264. // "id": "compute.interconnectLocations.testIamPermissions",
  74265. // "parameterOrder": [
  74266. // "project",
  74267. // "resource"
  74268. // ],
  74269. // "parameters": {
  74270. // "project": {
  74271. // "description": "Project ID for this request.",
  74272. // "location": "path",
  74273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74274. // "required": true,
  74275. // "type": "string"
  74276. // },
  74277. // "resource": {
  74278. // "description": "Name or id of the resource for this request.",
  74279. // "location": "path",
  74280. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74281. // "required": true,
  74282. // "type": "string"
  74283. // }
  74284. // },
  74285. // "path": "{project}/global/interconnectLocations/{resource}/testIamPermissions",
  74286. // "request": {
  74287. // "$ref": "TestPermissionsRequest"
  74288. // },
  74289. // "response": {
  74290. // "$ref": "TestPermissionsResponse"
  74291. // },
  74292. // "scopes": [
  74293. // "https://www.googleapis.com/auth/cloud-platform",
  74294. // "https://www.googleapis.com/auth/compute",
  74295. // "https://www.googleapis.com/auth/compute.readonly"
  74296. // ]
  74297. // }
  74298. }
  74299. // method id "compute.interconnects.delete":
  74300. type InterconnectsDeleteCall struct {
  74301. s *Service
  74302. project string
  74303. interconnect string
  74304. urlParams_ gensupport.URLParams
  74305. ctx_ context.Context
  74306. header_ http.Header
  74307. }
  74308. // Delete: Deletes the specified interconnect.
  74309. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  74310. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74311. c.project = project
  74312. c.interconnect = interconnect
  74313. return c
  74314. }
  74315. // RequestId sets the optional parameter "requestId": An optional
  74316. // request ID to identify requests. Specify a unique request ID so that
  74317. // if you must retry your request, the server will know to ignore the
  74318. // request if it has already been completed.
  74319. //
  74320. // For example, consider a situation where you make an initial request
  74321. // and the request times out. If you make the request again with the
  74322. // same request ID, the server can check if original operation with the
  74323. // same request ID was received, and if so, will ignore the second
  74324. // request. This prevents clients from accidentally creating duplicate
  74325. // commitments.
  74326. //
  74327. // The request ID must be a valid UUID with the exception that zero UUID
  74328. // is not supported (00000000-0000-0000-0000-000000000000).
  74329. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  74330. c.urlParams_.Set("requestId", requestId)
  74331. return c
  74332. }
  74333. // Fields allows partial responses to be retrieved. See
  74334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74335. // for more information.
  74336. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  74337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74338. return c
  74339. }
  74340. // Context sets the context to be used in this call's Do method. Any
  74341. // pending HTTP request will be aborted if the provided context is
  74342. // canceled.
  74343. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  74344. c.ctx_ = ctx
  74345. return c
  74346. }
  74347. // Header returns an http.Header that can be modified by the caller to
  74348. // add HTTP headers to the request.
  74349. func (c *InterconnectsDeleteCall) Header() http.Header {
  74350. if c.header_ == nil {
  74351. c.header_ = make(http.Header)
  74352. }
  74353. return c.header_
  74354. }
  74355. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  74356. reqHeaders := make(http.Header)
  74357. for k, v := range c.header_ {
  74358. reqHeaders[k] = v
  74359. }
  74360. reqHeaders.Set("User-Agent", c.s.userAgent())
  74361. var body io.Reader = nil
  74362. c.urlParams_.Set("alt", alt)
  74363. c.urlParams_.Set("prettyPrint", "false")
  74364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  74365. urls += "?" + c.urlParams_.Encode()
  74366. req, err := http.NewRequest("DELETE", urls, body)
  74367. if err != nil {
  74368. return nil, err
  74369. }
  74370. req.Header = reqHeaders
  74371. googleapi.Expand(req.URL, map[string]string{
  74372. "project": c.project,
  74373. "interconnect": c.interconnect,
  74374. })
  74375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74376. }
  74377. // Do executes the "compute.interconnects.delete" call.
  74378. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74379. // status code is an error. Response headers are in either
  74380. // *Operation.ServerResponse.Header or (if a response was returned at
  74381. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74382. // to check whether the returned error was because
  74383. // http.StatusNotModified was returned.
  74384. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74385. gensupport.SetOptions(c.urlParams_, opts...)
  74386. res, err := c.doRequest("json")
  74387. if res != nil && res.StatusCode == http.StatusNotModified {
  74388. if res.Body != nil {
  74389. res.Body.Close()
  74390. }
  74391. return nil, &googleapi.Error{
  74392. Code: res.StatusCode,
  74393. Header: res.Header,
  74394. }
  74395. }
  74396. if err != nil {
  74397. return nil, err
  74398. }
  74399. defer googleapi.CloseBody(res)
  74400. if err := googleapi.CheckResponse(res); err != nil {
  74401. return nil, err
  74402. }
  74403. ret := &Operation{
  74404. ServerResponse: googleapi.ServerResponse{
  74405. Header: res.Header,
  74406. HTTPStatusCode: res.StatusCode,
  74407. },
  74408. }
  74409. target := &ret
  74410. if err := gensupport.DecodeResponse(target, res); err != nil {
  74411. return nil, err
  74412. }
  74413. return ret, nil
  74414. // {
  74415. // "description": "Deletes the specified interconnect.",
  74416. // "httpMethod": "DELETE",
  74417. // "id": "compute.interconnects.delete",
  74418. // "parameterOrder": [
  74419. // "project",
  74420. // "interconnect"
  74421. // ],
  74422. // "parameters": {
  74423. // "interconnect": {
  74424. // "description": "Name of the interconnect to delete.",
  74425. // "location": "path",
  74426. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74427. // "required": true,
  74428. // "type": "string"
  74429. // },
  74430. // "project": {
  74431. // "description": "Project ID for this request.",
  74432. // "location": "path",
  74433. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74434. // "required": true,
  74435. // "type": "string"
  74436. // },
  74437. // "requestId": {
  74438. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74439. // "location": "query",
  74440. // "type": "string"
  74441. // }
  74442. // },
  74443. // "path": "{project}/global/interconnects/{interconnect}",
  74444. // "response": {
  74445. // "$ref": "Operation"
  74446. // },
  74447. // "scopes": [
  74448. // "https://www.googleapis.com/auth/cloud-platform",
  74449. // "https://www.googleapis.com/auth/compute"
  74450. // ]
  74451. // }
  74452. }
  74453. // method id "compute.interconnects.get":
  74454. type InterconnectsGetCall struct {
  74455. s *Service
  74456. project string
  74457. interconnect string
  74458. urlParams_ gensupport.URLParams
  74459. ifNoneMatch_ string
  74460. ctx_ context.Context
  74461. header_ http.Header
  74462. }
  74463. // Get: Returns the specified interconnect. Get a list of available
  74464. // interconnects by making a list() request.
  74465. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  74466. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74467. c.project = project
  74468. c.interconnect = interconnect
  74469. return c
  74470. }
  74471. // Fields allows partial responses to be retrieved. See
  74472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74473. // for more information.
  74474. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  74475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74476. return c
  74477. }
  74478. // IfNoneMatch sets the optional parameter which makes the operation
  74479. // fail if the object's ETag matches the given value. This is useful for
  74480. // getting updates only after the object has changed since the last
  74481. // request. Use googleapi.IsNotModified to check whether the response
  74482. // error from Do is the result of In-None-Match.
  74483. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  74484. c.ifNoneMatch_ = entityTag
  74485. return c
  74486. }
  74487. // Context sets the context to be used in this call's Do method. Any
  74488. // pending HTTP request will be aborted if the provided context is
  74489. // canceled.
  74490. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  74491. c.ctx_ = ctx
  74492. return c
  74493. }
  74494. // Header returns an http.Header that can be modified by the caller to
  74495. // add HTTP headers to the request.
  74496. func (c *InterconnectsGetCall) Header() http.Header {
  74497. if c.header_ == nil {
  74498. c.header_ = make(http.Header)
  74499. }
  74500. return c.header_
  74501. }
  74502. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  74503. reqHeaders := make(http.Header)
  74504. for k, v := range c.header_ {
  74505. reqHeaders[k] = v
  74506. }
  74507. reqHeaders.Set("User-Agent", c.s.userAgent())
  74508. if c.ifNoneMatch_ != "" {
  74509. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74510. }
  74511. var body io.Reader = nil
  74512. c.urlParams_.Set("alt", alt)
  74513. c.urlParams_.Set("prettyPrint", "false")
  74514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  74515. urls += "?" + c.urlParams_.Encode()
  74516. req, err := http.NewRequest("GET", urls, body)
  74517. if err != nil {
  74518. return nil, err
  74519. }
  74520. req.Header = reqHeaders
  74521. googleapi.Expand(req.URL, map[string]string{
  74522. "project": c.project,
  74523. "interconnect": c.interconnect,
  74524. })
  74525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74526. }
  74527. // Do executes the "compute.interconnects.get" call.
  74528. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  74529. // status code is an error. Response headers are in either
  74530. // *Interconnect.ServerResponse.Header or (if a response was returned at
  74531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74532. // to check whether the returned error was because
  74533. // http.StatusNotModified was returned.
  74534. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  74535. gensupport.SetOptions(c.urlParams_, opts...)
  74536. res, err := c.doRequest("json")
  74537. if res != nil && res.StatusCode == http.StatusNotModified {
  74538. if res.Body != nil {
  74539. res.Body.Close()
  74540. }
  74541. return nil, &googleapi.Error{
  74542. Code: res.StatusCode,
  74543. Header: res.Header,
  74544. }
  74545. }
  74546. if err != nil {
  74547. return nil, err
  74548. }
  74549. defer googleapi.CloseBody(res)
  74550. if err := googleapi.CheckResponse(res); err != nil {
  74551. return nil, err
  74552. }
  74553. ret := &Interconnect{
  74554. ServerResponse: googleapi.ServerResponse{
  74555. Header: res.Header,
  74556. HTTPStatusCode: res.StatusCode,
  74557. },
  74558. }
  74559. target := &ret
  74560. if err := gensupport.DecodeResponse(target, res); err != nil {
  74561. return nil, err
  74562. }
  74563. return ret, nil
  74564. // {
  74565. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  74566. // "httpMethod": "GET",
  74567. // "id": "compute.interconnects.get",
  74568. // "parameterOrder": [
  74569. // "project",
  74570. // "interconnect"
  74571. // ],
  74572. // "parameters": {
  74573. // "interconnect": {
  74574. // "description": "Name of the interconnect to return.",
  74575. // "location": "path",
  74576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74577. // "required": true,
  74578. // "type": "string"
  74579. // },
  74580. // "project": {
  74581. // "description": "Project ID for this request.",
  74582. // "location": "path",
  74583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74584. // "required": true,
  74585. // "type": "string"
  74586. // }
  74587. // },
  74588. // "path": "{project}/global/interconnects/{interconnect}",
  74589. // "response": {
  74590. // "$ref": "Interconnect"
  74591. // },
  74592. // "scopes": [
  74593. // "https://www.googleapis.com/auth/cloud-platform",
  74594. // "https://www.googleapis.com/auth/compute",
  74595. // "https://www.googleapis.com/auth/compute.readonly"
  74596. // ]
  74597. // }
  74598. }
  74599. // method id "compute.interconnects.getDiagnostics":
  74600. type InterconnectsGetDiagnosticsCall struct {
  74601. s *Service
  74602. project string
  74603. interconnect string
  74604. urlParams_ gensupport.URLParams
  74605. ifNoneMatch_ string
  74606. ctx_ context.Context
  74607. header_ http.Header
  74608. }
  74609. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  74610. // interconnect.
  74611. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  74612. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74613. c.project = project
  74614. c.interconnect = interconnect
  74615. return c
  74616. }
  74617. // Fields allows partial responses to be retrieved. See
  74618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74619. // for more information.
  74620. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  74621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74622. return c
  74623. }
  74624. // IfNoneMatch sets the optional parameter which makes the operation
  74625. // fail if the object's ETag matches the given value. This is useful for
  74626. // getting updates only after the object has changed since the last
  74627. // request. Use googleapi.IsNotModified to check whether the response
  74628. // error from Do is the result of In-None-Match.
  74629. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  74630. c.ifNoneMatch_ = entityTag
  74631. return c
  74632. }
  74633. // Context sets the context to be used in this call's Do method. Any
  74634. // pending HTTP request will be aborted if the provided context is
  74635. // canceled.
  74636. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  74637. c.ctx_ = ctx
  74638. return c
  74639. }
  74640. // Header returns an http.Header that can be modified by the caller to
  74641. // add HTTP headers to the request.
  74642. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  74643. if c.header_ == nil {
  74644. c.header_ = make(http.Header)
  74645. }
  74646. return c.header_
  74647. }
  74648. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  74649. reqHeaders := make(http.Header)
  74650. for k, v := range c.header_ {
  74651. reqHeaders[k] = v
  74652. }
  74653. reqHeaders.Set("User-Agent", c.s.userAgent())
  74654. if c.ifNoneMatch_ != "" {
  74655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74656. }
  74657. var body io.Reader = nil
  74658. c.urlParams_.Set("alt", alt)
  74659. c.urlParams_.Set("prettyPrint", "false")
  74660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  74661. urls += "?" + c.urlParams_.Encode()
  74662. req, err := http.NewRequest("GET", urls, body)
  74663. if err != nil {
  74664. return nil, err
  74665. }
  74666. req.Header = reqHeaders
  74667. googleapi.Expand(req.URL, map[string]string{
  74668. "project": c.project,
  74669. "interconnect": c.interconnect,
  74670. })
  74671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74672. }
  74673. // Do executes the "compute.interconnects.getDiagnostics" call.
  74674. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  74675. // non-nil. Any non-2xx status code is an error. Response headers are in
  74676. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  74677. // (if a response was returned at all) in
  74678. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74679. // whether the returned error was because http.StatusNotModified was
  74680. // returned.
  74681. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  74682. gensupport.SetOptions(c.urlParams_, opts...)
  74683. res, err := c.doRequest("json")
  74684. if res != nil && res.StatusCode == http.StatusNotModified {
  74685. if res.Body != nil {
  74686. res.Body.Close()
  74687. }
  74688. return nil, &googleapi.Error{
  74689. Code: res.StatusCode,
  74690. Header: res.Header,
  74691. }
  74692. }
  74693. if err != nil {
  74694. return nil, err
  74695. }
  74696. defer googleapi.CloseBody(res)
  74697. if err := googleapi.CheckResponse(res); err != nil {
  74698. return nil, err
  74699. }
  74700. ret := &InterconnectsGetDiagnosticsResponse{
  74701. ServerResponse: googleapi.ServerResponse{
  74702. Header: res.Header,
  74703. HTTPStatusCode: res.StatusCode,
  74704. },
  74705. }
  74706. target := &ret
  74707. if err := gensupport.DecodeResponse(target, res); err != nil {
  74708. return nil, err
  74709. }
  74710. return ret, nil
  74711. // {
  74712. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  74713. // "httpMethod": "GET",
  74714. // "id": "compute.interconnects.getDiagnostics",
  74715. // "parameterOrder": [
  74716. // "project",
  74717. // "interconnect"
  74718. // ],
  74719. // "parameters": {
  74720. // "interconnect": {
  74721. // "description": "Name of the interconnect resource to query.",
  74722. // "location": "path",
  74723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74724. // "required": true,
  74725. // "type": "string"
  74726. // },
  74727. // "project": {
  74728. // "description": "Project ID for this request.",
  74729. // "location": "path",
  74730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74731. // "required": true,
  74732. // "type": "string"
  74733. // }
  74734. // },
  74735. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  74736. // "response": {
  74737. // "$ref": "InterconnectsGetDiagnosticsResponse"
  74738. // },
  74739. // "scopes": [
  74740. // "https://www.googleapis.com/auth/cloud-platform",
  74741. // "https://www.googleapis.com/auth/compute",
  74742. // "https://www.googleapis.com/auth/compute.readonly"
  74743. // ]
  74744. // }
  74745. }
  74746. // method id "compute.interconnects.getIamPolicy":
  74747. type InterconnectsGetIamPolicyCall struct {
  74748. s *Service
  74749. project string
  74750. resource string
  74751. urlParams_ gensupport.URLParams
  74752. ifNoneMatch_ string
  74753. ctx_ context.Context
  74754. header_ http.Header
  74755. }
  74756. // GetIamPolicy: Gets the access control policy for a resource. May be
  74757. // empty if no such policy or resource exists.
  74758. func (r *InterconnectsService) GetIamPolicy(project string, resource string) *InterconnectsGetIamPolicyCall {
  74759. c := &InterconnectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74760. c.project = project
  74761. c.resource = resource
  74762. return c
  74763. }
  74764. // Fields allows partial responses to be retrieved. See
  74765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74766. // for more information.
  74767. func (c *InterconnectsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsGetIamPolicyCall {
  74768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74769. return c
  74770. }
  74771. // IfNoneMatch sets the optional parameter which makes the operation
  74772. // fail if the object's ETag matches the given value. This is useful for
  74773. // getting updates only after the object has changed since the last
  74774. // request. Use googleapi.IsNotModified to check whether the response
  74775. // error from Do is the result of In-None-Match.
  74776. func (c *InterconnectsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectsGetIamPolicyCall {
  74777. c.ifNoneMatch_ = entityTag
  74778. return c
  74779. }
  74780. // Context sets the context to be used in this call's Do method. Any
  74781. // pending HTTP request will be aborted if the provided context is
  74782. // canceled.
  74783. func (c *InterconnectsGetIamPolicyCall) Context(ctx context.Context) *InterconnectsGetIamPolicyCall {
  74784. c.ctx_ = ctx
  74785. return c
  74786. }
  74787. // Header returns an http.Header that can be modified by the caller to
  74788. // add HTTP headers to the request.
  74789. func (c *InterconnectsGetIamPolicyCall) Header() http.Header {
  74790. if c.header_ == nil {
  74791. c.header_ = make(http.Header)
  74792. }
  74793. return c.header_
  74794. }
  74795. func (c *InterconnectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  74796. reqHeaders := make(http.Header)
  74797. for k, v := range c.header_ {
  74798. reqHeaders[k] = v
  74799. }
  74800. reqHeaders.Set("User-Agent", c.s.userAgent())
  74801. if c.ifNoneMatch_ != "" {
  74802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74803. }
  74804. var body io.Reader = nil
  74805. c.urlParams_.Set("alt", alt)
  74806. c.urlParams_.Set("prettyPrint", "false")
  74807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/getIamPolicy")
  74808. urls += "?" + c.urlParams_.Encode()
  74809. req, err := http.NewRequest("GET", urls, body)
  74810. if err != nil {
  74811. return nil, err
  74812. }
  74813. req.Header = reqHeaders
  74814. googleapi.Expand(req.URL, map[string]string{
  74815. "project": c.project,
  74816. "resource": c.resource,
  74817. })
  74818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74819. }
  74820. // Do executes the "compute.interconnects.getIamPolicy" call.
  74821. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  74822. // code is an error. Response headers are in either
  74823. // *Policy.ServerResponse.Header or (if a response was returned at all)
  74824. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  74825. // check whether the returned error was because http.StatusNotModified
  74826. // was returned.
  74827. func (c *InterconnectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  74828. gensupport.SetOptions(c.urlParams_, opts...)
  74829. res, err := c.doRequest("json")
  74830. if res != nil && res.StatusCode == http.StatusNotModified {
  74831. if res.Body != nil {
  74832. res.Body.Close()
  74833. }
  74834. return nil, &googleapi.Error{
  74835. Code: res.StatusCode,
  74836. Header: res.Header,
  74837. }
  74838. }
  74839. if err != nil {
  74840. return nil, err
  74841. }
  74842. defer googleapi.CloseBody(res)
  74843. if err := googleapi.CheckResponse(res); err != nil {
  74844. return nil, err
  74845. }
  74846. ret := &Policy{
  74847. ServerResponse: googleapi.ServerResponse{
  74848. Header: res.Header,
  74849. HTTPStatusCode: res.StatusCode,
  74850. },
  74851. }
  74852. target := &ret
  74853. if err := gensupport.DecodeResponse(target, res); err != nil {
  74854. return nil, err
  74855. }
  74856. return ret, nil
  74857. // {
  74858. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  74859. // "httpMethod": "GET",
  74860. // "id": "compute.interconnects.getIamPolicy",
  74861. // "parameterOrder": [
  74862. // "project",
  74863. // "resource"
  74864. // ],
  74865. // "parameters": {
  74866. // "project": {
  74867. // "description": "Project ID for this request.",
  74868. // "location": "path",
  74869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74870. // "required": true,
  74871. // "type": "string"
  74872. // },
  74873. // "resource": {
  74874. // "description": "Name or id of the resource for this request.",
  74875. // "location": "path",
  74876. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74877. // "required": true,
  74878. // "type": "string"
  74879. // }
  74880. // },
  74881. // "path": "{project}/global/interconnects/{resource}/getIamPolicy",
  74882. // "response": {
  74883. // "$ref": "Policy"
  74884. // },
  74885. // "scopes": [
  74886. // "https://www.googleapis.com/auth/cloud-platform",
  74887. // "https://www.googleapis.com/auth/compute",
  74888. // "https://www.googleapis.com/auth/compute.readonly"
  74889. // ]
  74890. // }
  74891. }
  74892. // method id "compute.interconnects.insert":
  74893. type InterconnectsInsertCall struct {
  74894. s *Service
  74895. project string
  74896. interconnect *Interconnect
  74897. urlParams_ gensupport.URLParams
  74898. ctx_ context.Context
  74899. header_ http.Header
  74900. }
  74901. // Insert: Creates a Interconnect in the specified project using the
  74902. // data included in the request.
  74903. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  74904. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74905. c.project = project
  74906. c.interconnect = interconnect
  74907. return c
  74908. }
  74909. // RequestId sets the optional parameter "requestId": An optional
  74910. // request ID to identify requests. Specify a unique request ID so that
  74911. // if you must retry your request, the server will know to ignore the
  74912. // request if it has already been completed.
  74913. //
  74914. // For example, consider a situation where you make an initial request
  74915. // and the request times out. If you make the request again with the
  74916. // same request ID, the server can check if original operation with the
  74917. // same request ID was received, and if so, will ignore the second
  74918. // request. This prevents clients from accidentally creating duplicate
  74919. // commitments.
  74920. //
  74921. // The request ID must be a valid UUID with the exception that zero UUID
  74922. // is not supported (00000000-0000-0000-0000-000000000000).
  74923. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  74924. c.urlParams_.Set("requestId", requestId)
  74925. return c
  74926. }
  74927. // Fields allows partial responses to be retrieved. See
  74928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74929. // for more information.
  74930. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  74931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74932. return c
  74933. }
  74934. // Context sets the context to be used in this call's Do method. Any
  74935. // pending HTTP request will be aborted if the provided context is
  74936. // canceled.
  74937. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  74938. c.ctx_ = ctx
  74939. return c
  74940. }
  74941. // Header returns an http.Header that can be modified by the caller to
  74942. // add HTTP headers to the request.
  74943. func (c *InterconnectsInsertCall) Header() http.Header {
  74944. if c.header_ == nil {
  74945. c.header_ = make(http.Header)
  74946. }
  74947. return c.header_
  74948. }
  74949. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  74950. reqHeaders := make(http.Header)
  74951. for k, v := range c.header_ {
  74952. reqHeaders[k] = v
  74953. }
  74954. reqHeaders.Set("User-Agent", c.s.userAgent())
  74955. var body io.Reader = nil
  74956. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  74957. if err != nil {
  74958. return nil, err
  74959. }
  74960. reqHeaders.Set("Content-Type", "application/json")
  74961. c.urlParams_.Set("alt", alt)
  74962. c.urlParams_.Set("prettyPrint", "false")
  74963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  74964. urls += "?" + c.urlParams_.Encode()
  74965. req, err := http.NewRequest("POST", urls, body)
  74966. if err != nil {
  74967. return nil, err
  74968. }
  74969. req.Header = reqHeaders
  74970. googleapi.Expand(req.URL, map[string]string{
  74971. "project": c.project,
  74972. })
  74973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74974. }
  74975. // Do executes the "compute.interconnects.insert" call.
  74976. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74977. // status code is an error. Response headers are in either
  74978. // *Operation.ServerResponse.Header or (if a response was returned at
  74979. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74980. // to check whether the returned error was because
  74981. // http.StatusNotModified was returned.
  74982. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74983. gensupport.SetOptions(c.urlParams_, opts...)
  74984. res, err := c.doRequest("json")
  74985. if res != nil && res.StatusCode == http.StatusNotModified {
  74986. if res.Body != nil {
  74987. res.Body.Close()
  74988. }
  74989. return nil, &googleapi.Error{
  74990. Code: res.StatusCode,
  74991. Header: res.Header,
  74992. }
  74993. }
  74994. if err != nil {
  74995. return nil, err
  74996. }
  74997. defer googleapi.CloseBody(res)
  74998. if err := googleapi.CheckResponse(res); err != nil {
  74999. return nil, err
  75000. }
  75001. ret := &Operation{
  75002. ServerResponse: googleapi.ServerResponse{
  75003. Header: res.Header,
  75004. HTTPStatusCode: res.StatusCode,
  75005. },
  75006. }
  75007. target := &ret
  75008. if err := gensupport.DecodeResponse(target, res); err != nil {
  75009. return nil, err
  75010. }
  75011. return ret, nil
  75012. // {
  75013. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  75014. // "httpMethod": "POST",
  75015. // "id": "compute.interconnects.insert",
  75016. // "parameterOrder": [
  75017. // "project"
  75018. // ],
  75019. // "parameters": {
  75020. // "project": {
  75021. // "description": "Project ID for this request.",
  75022. // "location": "path",
  75023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75024. // "required": true,
  75025. // "type": "string"
  75026. // },
  75027. // "requestId": {
  75028. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75029. // "location": "query",
  75030. // "type": "string"
  75031. // }
  75032. // },
  75033. // "path": "{project}/global/interconnects",
  75034. // "request": {
  75035. // "$ref": "Interconnect"
  75036. // },
  75037. // "response": {
  75038. // "$ref": "Operation"
  75039. // },
  75040. // "scopes": [
  75041. // "https://www.googleapis.com/auth/cloud-platform",
  75042. // "https://www.googleapis.com/auth/compute"
  75043. // ]
  75044. // }
  75045. }
  75046. // method id "compute.interconnects.list":
  75047. type InterconnectsListCall struct {
  75048. s *Service
  75049. project string
  75050. urlParams_ gensupport.URLParams
  75051. ifNoneMatch_ string
  75052. ctx_ context.Context
  75053. header_ http.Header
  75054. }
  75055. // List: Retrieves the list of interconnect available to the specified
  75056. // project.
  75057. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  75058. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75059. c.project = project
  75060. return c
  75061. }
  75062. // Filter sets the optional parameter "filter": A filter expression that
  75063. // filters resources listed in the response. The expression must specify
  75064. // the field name, a comparison operator, and the value that you want to
  75065. // use for filtering. The value must be a string, a number, or a
  75066. // boolean. The comparison operator must be either =, !=, >, or <.
  75067. //
  75068. // For example, if you are filtering Compute Engine instances, you can
  75069. // exclude instances named example-instance by specifying name !=
  75070. // example-instance.
  75071. //
  75072. // You can also filter nested fields. For example, you could specify
  75073. // scheduling.automaticRestart = false to include instances only if they
  75074. // are not scheduled for automatic restarts. You can use filtering on
  75075. // nested fields to filter based on resource labels.
  75076. //
  75077. // To filter on multiple expressions, provide each separate expression
  75078. // within parentheses. For example, (scheduling.automaticRestart = true)
  75079. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75080. // AND expression. However, you can include AND and OR expressions
  75081. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75082. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75083. // true).
  75084. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  75085. c.urlParams_.Set("filter", filter)
  75086. return c
  75087. }
  75088. // MaxResults sets the optional parameter "maxResults": The maximum
  75089. // number of results per page that should be returned. If the number of
  75090. // available results is larger than maxResults, Compute Engine returns a
  75091. // nextPageToken that can be used to get the next page of results in
  75092. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75093. // (Default: 500)
  75094. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  75095. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75096. return c
  75097. }
  75098. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75099. // a certain order. By default, results are returned in alphanumerical
  75100. // order based on the resource name.
  75101. //
  75102. // You can also sort results in descending order based on the creation
  75103. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75104. // based on the creationTimestamp field in reverse chronological order
  75105. // (newest result first). Use this to sort resources like operations so
  75106. // that the newest operation is returned first.
  75107. //
  75108. // Currently, only sorting by name or creationTimestamp desc is
  75109. // supported.
  75110. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  75111. c.urlParams_.Set("orderBy", orderBy)
  75112. return c
  75113. }
  75114. // PageToken sets the optional parameter "pageToken": Specifies a page
  75115. // token to use. Set pageToken to the nextPageToken returned by a
  75116. // previous list request to get the next page of results.
  75117. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  75118. c.urlParams_.Set("pageToken", pageToken)
  75119. return c
  75120. }
  75121. // Fields allows partial responses to be retrieved. See
  75122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75123. // for more information.
  75124. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  75125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75126. return c
  75127. }
  75128. // IfNoneMatch sets the optional parameter which makes the operation
  75129. // fail if the object's ETag matches the given value. This is useful for
  75130. // getting updates only after the object has changed since the last
  75131. // request. Use googleapi.IsNotModified to check whether the response
  75132. // error from Do is the result of In-None-Match.
  75133. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  75134. c.ifNoneMatch_ = entityTag
  75135. return c
  75136. }
  75137. // Context sets the context to be used in this call's Do method. Any
  75138. // pending HTTP request will be aborted if the provided context is
  75139. // canceled.
  75140. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  75141. c.ctx_ = ctx
  75142. return c
  75143. }
  75144. // Header returns an http.Header that can be modified by the caller to
  75145. // add HTTP headers to the request.
  75146. func (c *InterconnectsListCall) Header() http.Header {
  75147. if c.header_ == nil {
  75148. c.header_ = make(http.Header)
  75149. }
  75150. return c.header_
  75151. }
  75152. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  75153. reqHeaders := make(http.Header)
  75154. for k, v := range c.header_ {
  75155. reqHeaders[k] = v
  75156. }
  75157. reqHeaders.Set("User-Agent", c.s.userAgent())
  75158. if c.ifNoneMatch_ != "" {
  75159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75160. }
  75161. var body io.Reader = nil
  75162. c.urlParams_.Set("alt", alt)
  75163. c.urlParams_.Set("prettyPrint", "false")
  75164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  75165. urls += "?" + c.urlParams_.Encode()
  75166. req, err := http.NewRequest("GET", urls, body)
  75167. if err != nil {
  75168. return nil, err
  75169. }
  75170. req.Header = reqHeaders
  75171. googleapi.Expand(req.URL, map[string]string{
  75172. "project": c.project,
  75173. })
  75174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75175. }
  75176. // Do executes the "compute.interconnects.list" call.
  75177. // Exactly one of *InterconnectList or error will be non-nil. Any
  75178. // non-2xx status code is an error. Response headers are in either
  75179. // *InterconnectList.ServerResponse.Header or (if a response was
  75180. // returned at all) in error.(*googleapi.Error).Header. Use
  75181. // googleapi.IsNotModified to check whether the returned error was
  75182. // because http.StatusNotModified was returned.
  75183. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  75184. gensupport.SetOptions(c.urlParams_, opts...)
  75185. res, err := c.doRequest("json")
  75186. if res != nil && res.StatusCode == http.StatusNotModified {
  75187. if res.Body != nil {
  75188. res.Body.Close()
  75189. }
  75190. return nil, &googleapi.Error{
  75191. Code: res.StatusCode,
  75192. Header: res.Header,
  75193. }
  75194. }
  75195. if err != nil {
  75196. return nil, err
  75197. }
  75198. defer googleapi.CloseBody(res)
  75199. if err := googleapi.CheckResponse(res); err != nil {
  75200. return nil, err
  75201. }
  75202. ret := &InterconnectList{
  75203. ServerResponse: googleapi.ServerResponse{
  75204. Header: res.Header,
  75205. HTTPStatusCode: res.StatusCode,
  75206. },
  75207. }
  75208. target := &ret
  75209. if err := gensupport.DecodeResponse(target, res); err != nil {
  75210. return nil, err
  75211. }
  75212. return ret, nil
  75213. // {
  75214. // "description": "Retrieves the list of interconnect available to the specified project.",
  75215. // "httpMethod": "GET",
  75216. // "id": "compute.interconnects.list",
  75217. // "parameterOrder": [
  75218. // "project"
  75219. // ],
  75220. // "parameters": {
  75221. // "filter": {
  75222. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  75223. // "location": "query",
  75224. // "type": "string"
  75225. // },
  75226. // "maxResults": {
  75227. // "default": "500",
  75228. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  75229. // "format": "uint32",
  75230. // "location": "query",
  75231. // "minimum": "0",
  75232. // "type": "integer"
  75233. // },
  75234. // "orderBy": {
  75235. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  75236. // "location": "query",
  75237. // "type": "string"
  75238. // },
  75239. // "pageToken": {
  75240. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  75241. // "location": "query",
  75242. // "type": "string"
  75243. // },
  75244. // "project": {
  75245. // "description": "Project ID for this request.",
  75246. // "location": "path",
  75247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75248. // "required": true,
  75249. // "type": "string"
  75250. // }
  75251. // },
  75252. // "path": "{project}/global/interconnects",
  75253. // "response": {
  75254. // "$ref": "InterconnectList"
  75255. // },
  75256. // "scopes": [
  75257. // "https://www.googleapis.com/auth/cloud-platform",
  75258. // "https://www.googleapis.com/auth/compute",
  75259. // "https://www.googleapis.com/auth/compute.readonly"
  75260. // ]
  75261. // }
  75262. }
  75263. // Pages invokes f for each page of results.
  75264. // A non-nil error returned from f will halt the iteration.
  75265. // The provided context supersedes any context provided to the Context method.
  75266. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  75267. c.ctx_ = ctx
  75268. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75269. for {
  75270. x, err := c.Do()
  75271. if err != nil {
  75272. return err
  75273. }
  75274. if err := f(x); err != nil {
  75275. return err
  75276. }
  75277. if x.NextPageToken == "" {
  75278. return nil
  75279. }
  75280. c.PageToken(x.NextPageToken)
  75281. }
  75282. }
  75283. // method id "compute.interconnects.patch":
  75284. type InterconnectsPatchCall struct {
  75285. s *Service
  75286. project string
  75287. interconnect string
  75288. interconnect2 *Interconnect
  75289. urlParams_ gensupport.URLParams
  75290. ctx_ context.Context
  75291. header_ http.Header
  75292. }
  75293. // Patch: Updates the specified interconnect with the data included in
  75294. // the request. This method supports PATCH semantics and uses the JSON
  75295. // merge patch format and processing rules.
  75296. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  75297. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75298. c.project = project
  75299. c.interconnect = interconnect
  75300. c.interconnect2 = interconnect2
  75301. return c
  75302. }
  75303. // RequestId sets the optional parameter "requestId": An optional
  75304. // request ID to identify requests. Specify a unique request ID so that
  75305. // if you must retry your request, the server will know to ignore the
  75306. // request if it has already been completed.
  75307. //
  75308. // For example, consider a situation where you make an initial request
  75309. // and the request times out. If you make the request again with the
  75310. // same request ID, the server can check if original operation with the
  75311. // same request ID was received, and if so, will ignore the second
  75312. // request. This prevents clients from accidentally creating duplicate
  75313. // commitments.
  75314. //
  75315. // The request ID must be a valid UUID with the exception that zero UUID
  75316. // is not supported (00000000-0000-0000-0000-000000000000).
  75317. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  75318. c.urlParams_.Set("requestId", requestId)
  75319. return c
  75320. }
  75321. // Fields allows partial responses to be retrieved. See
  75322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75323. // for more information.
  75324. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  75325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75326. return c
  75327. }
  75328. // Context sets the context to be used in this call's Do method. Any
  75329. // pending HTTP request will be aborted if the provided context is
  75330. // canceled.
  75331. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  75332. c.ctx_ = ctx
  75333. return c
  75334. }
  75335. // Header returns an http.Header that can be modified by the caller to
  75336. // add HTTP headers to the request.
  75337. func (c *InterconnectsPatchCall) Header() http.Header {
  75338. if c.header_ == nil {
  75339. c.header_ = make(http.Header)
  75340. }
  75341. return c.header_
  75342. }
  75343. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  75344. reqHeaders := make(http.Header)
  75345. for k, v := range c.header_ {
  75346. reqHeaders[k] = v
  75347. }
  75348. reqHeaders.Set("User-Agent", c.s.userAgent())
  75349. var body io.Reader = nil
  75350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  75351. if err != nil {
  75352. return nil, err
  75353. }
  75354. reqHeaders.Set("Content-Type", "application/json")
  75355. c.urlParams_.Set("alt", alt)
  75356. c.urlParams_.Set("prettyPrint", "false")
  75357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  75358. urls += "?" + c.urlParams_.Encode()
  75359. req, err := http.NewRequest("PATCH", urls, body)
  75360. if err != nil {
  75361. return nil, err
  75362. }
  75363. req.Header = reqHeaders
  75364. googleapi.Expand(req.URL, map[string]string{
  75365. "project": c.project,
  75366. "interconnect": c.interconnect,
  75367. })
  75368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75369. }
  75370. // Do executes the "compute.interconnects.patch" call.
  75371. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75372. // status code is an error. Response headers are in either
  75373. // *Operation.ServerResponse.Header or (if a response was returned at
  75374. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75375. // to check whether the returned error was because
  75376. // http.StatusNotModified was returned.
  75377. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75378. gensupport.SetOptions(c.urlParams_, opts...)
  75379. res, err := c.doRequest("json")
  75380. if res != nil && res.StatusCode == http.StatusNotModified {
  75381. if res.Body != nil {
  75382. res.Body.Close()
  75383. }
  75384. return nil, &googleapi.Error{
  75385. Code: res.StatusCode,
  75386. Header: res.Header,
  75387. }
  75388. }
  75389. if err != nil {
  75390. return nil, err
  75391. }
  75392. defer googleapi.CloseBody(res)
  75393. if err := googleapi.CheckResponse(res); err != nil {
  75394. return nil, err
  75395. }
  75396. ret := &Operation{
  75397. ServerResponse: googleapi.ServerResponse{
  75398. Header: res.Header,
  75399. HTTPStatusCode: res.StatusCode,
  75400. },
  75401. }
  75402. target := &ret
  75403. if err := gensupport.DecodeResponse(target, res); err != nil {
  75404. return nil, err
  75405. }
  75406. return ret, nil
  75407. // {
  75408. // "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.",
  75409. // "httpMethod": "PATCH",
  75410. // "id": "compute.interconnects.patch",
  75411. // "parameterOrder": [
  75412. // "project",
  75413. // "interconnect"
  75414. // ],
  75415. // "parameters": {
  75416. // "interconnect": {
  75417. // "description": "Name of the interconnect to update.",
  75418. // "location": "path",
  75419. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75420. // "required": true,
  75421. // "type": "string"
  75422. // },
  75423. // "project": {
  75424. // "description": "Project ID for this request.",
  75425. // "location": "path",
  75426. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75427. // "required": true,
  75428. // "type": "string"
  75429. // },
  75430. // "requestId": {
  75431. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75432. // "location": "query",
  75433. // "type": "string"
  75434. // }
  75435. // },
  75436. // "path": "{project}/global/interconnects/{interconnect}",
  75437. // "request": {
  75438. // "$ref": "Interconnect"
  75439. // },
  75440. // "response": {
  75441. // "$ref": "Operation"
  75442. // },
  75443. // "scopes": [
  75444. // "https://www.googleapis.com/auth/cloud-platform",
  75445. // "https://www.googleapis.com/auth/compute"
  75446. // ]
  75447. // }
  75448. }
  75449. // method id "compute.interconnects.setIamPolicy":
  75450. type InterconnectsSetIamPolicyCall struct {
  75451. s *Service
  75452. project string
  75453. resource string
  75454. globalsetpolicyrequest *GlobalSetPolicyRequest
  75455. urlParams_ gensupport.URLParams
  75456. ctx_ context.Context
  75457. header_ http.Header
  75458. }
  75459. // SetIamPolicy: Sets the access control policy on the specified
  75460. // resource. Replaces any existing policy.
  75461. func (r *InterconnectsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InterconnectsSetIamPolicyCall {
  75462. c := &InterconnectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75463. c.project = project
  75464. c.resource = resource
  75465. c.globalsetpolicyrequest = globalsetpolicyrequest
  75466. return c
  75467. }
  75468. // Fields allows partial responses to be retrieved. See
  75469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75470. // for more information.
  75471. func (c *InterconnectsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsSetIamPolicyCall {
  75472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75473. return c
  75474. }
  75475. // Context sets the context to be used in this call's Do method. Any
  75476. // pending HTTP request will be aborted if the provided context is
  75477. // canceled.
  75478. func (c *InterconnectsSetIamPolicyCall) Context(ctx context.Context) *InterconnectsSetIamPolicyCall {
  75479. c.ctx_ = ctx
  75480. return c
  75481. }
  75482. // Header returns an http.Header that can be modified by the caller to
  75483. // add HTTP headers to the request.
  75484. func (c *InterconnectsSetIamPolicyCall) Header() http.Header {
  75485. if c.header_ == nil {
  75486. c.header_ = make(http.Header)
  75487. }
  75488. return c.header_
  75489. }
  75490. func (c *InterconnectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  75491. reqHeaders := make(http.Header)
  75492. for k, v := range c.header_ {
  75493. reqHeaders[k] = v
  75494. }
  75495. reqHeaders.Set("User-Agent", c.s.userAgent())
  75496. var body io.Reader = nil
  75497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  75498. if err != nil {
  75499. return nil, err
  75500. }
  75501. reqHeaders.Set("Content-Type", "application/json")
  75502. c.urlParams_.Set("alt", alt)
  75503. c.urlParams_.Set("prettyPrint", "false")
  75504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setIamPolicy")
  75505. urls += "?" + c.urlParams_.Encode()
  75506. req, err := http.NewRequest("POST", urls, body)
  75507. if err != nil {
  75508. return nil, err
  75509. }
  75510. req.Header = reqHeaders
  75511. googleapi.Expand(req.URL, map[string]string{
  75512. "project": c.project,
  75513. "resource": c.resource,
  75514. })
  75515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75516. }
  75517. // Do executes the "compute.interconnects.setIamPolicy" call.
  75518. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  75519. // code is an error. Response headers are in either
  75520. // *Policy.ServerResponse.Header or (if a response was returned at all)
  75521. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75522. // check whether the returned error was because http.StatusNotModified
  75523. // was returned.
  75524. func (c *InterconnectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  75525. gensupport.SetOptions(c.urlParams_, opts...)
  75526. res, err := c.doRequest("json")
  75527. if res != nil && res.StatusCode == http.StatusNotModified {
  75528. if res.Body != nil {
  75529. res.Body.Close()
  75530. }
  75531. return nil, &googleapi.Error{
  75532. Code: res.StatusCode,
  75533. Header: res.Header,
  75534. }
  75535. }
  75536. if err != nil {
  75537. return nil, err
  75538. }
  75539. defer googleapi.CloseBody(res)
  75540. if err := googleapi.CheckResponse(res); err != nil {
  75541. return nil, err
  75542. }
  75543. ret := &Policy{
  75544. ServerResponse: googleapi.ServerResponse{
  75545. Header: res.Header,
  75546. HTTPStatusCode: res.StatusCode,
  75547. },
  75548. }
  75549. target := &ret
  75550. if err := gensupport.DecodeResponse(target, res); err != nil {
  75551. return nil, err
  75552. }
  75553. return ret, nil
  75554. // {
  75555. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  75556. // "httpMethod": "POST",
  75557. // "id": "compute.interconnects.setIamPolicy",
  75558. // "parameterOrder": [
  75559. // "project",
  75560. // "resource"
  75561. // ],
  75562. // "parameters": {
  75563. // "project": {
  75564. // "description": "Project ID for this request.",
  75565. // "location": "path",
  75566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75567. // "required": true,
  75568. // "type": "string"
  75569. // },
  75570. // "resource": {
  75571. // "description": "Name or id of the resource for this request.",
  75572. // "location": "path",
  75573. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75574. // "required": true,
  75575. // "type": "string"
  75576. // }
  75577. // },
  75578. // "path": "{project}/global/interconnects/{resource}/setIamPolicy",
  75579. // "request": {
  75580. // "$ref": "GlobalSetPolicyRequest"
  75581. // },
  75582. // "response": {
  75583. // "$ref": "Policy"
  75584. // },
  75585. // "scopes": [
  75586. // "https://www.googleapis.com/auth/cloud-platform",
  75587. // "https://www.googleapis.com/auth/compute"
  75588. // ]
  75589. // }
  75590. }
  75591. // method id "compute.interconnects.setLabels":
  75592. type InterconnectsSetLabelsCall struct {
  75593. s *Service
  75594. project string
  75595. resource string
  75596. globalsetlabelsrequest *GlobalSetLabelsRequest
  75597. urlParams_ gensupport.URLParams
  75598. ctx_ context.Context
  75599. header_ http.Header
  75600. }
  75601. // SetLabels: Sets the labels on an Interconnect. To learn more about
  75602. // labels, read the Labeling Resources documentation.
  75603. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  75604. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75605. c.project = project
  75606. c.resource = resource
  75607. c.globalsetlabelsrequest = globalsetlabelsrequest
  75608. return c
  75609. }
  75610. // Fields allows partial responses to be retrieved. See
  75611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75612. // for more information.
  75613. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  75614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75615. return c
  75616. }
  75617. // Context sets the context to be used in this call's Do method. Any
  75618. // pending HTTP request will be aborted if the provided context is
  75619. // canceled.
  75620. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  75621. c.ctx_ = ctx
  75622. return c
  75623. }
  75624. // Header returns an http.Header that can be modified by the caller to
  75625. // add HTTP headers to the request.
  75626. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  75627. if c.header_ == nil {
  75628. c.header_ = make(http.Header)
  75629. }
  75630. return c.header_
  75631. }
  75632. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  75633. reqHeaders := make(http.Header)
  75634. for k, v := range c.header_ {
  75635. reqHeaders[k] = v
  75636. }
  75637. reqHeaders.Set("User-Agent", c.s.userAgent())
  75638. var body io.Reader = nil
  75639. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  75640. if err != nil {
  75641. return nil, err
  75642. }
  75643. reqHeaders.Set("Content-Type", "application/json")
  75644. c.urlParams_.Set("alt", alt)
  75645. c.urlParams_.Set("prettyPrint", "false")
  75646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  75647. urls += "?" + c.urlParams_.Encode()
  75648. req, err := http.NewRequest("POST", urls, body)
  75649. if err != nil {
  75650. return nil, err
  75651. }
  75652. req.Header = reqHeaders
  75653. googleapi.Expand(req.URL, map[string]string{
  75654. "project": c.project,
  75655. "resource": c.resource,
  75656. })
  75657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75658. }
  75659. // Do executes the "compute.interconnects.setLabels" call.
  75660. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75661. // status code is an error. Response headers are in either
  75662. // *Operation.ServerResponse.Header or (if a response was returned at
  75663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75664. // to check whether the returned error was because
  75665. // http.StatusNotModified was returned.
  75666. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75667. gensupport.SetOptions(c.urlParams_, opts...)
  75668. res, err := c.doRequest("json")
  75669. if res != nil && res.StatusCode == http.StatusNotModified {
  75670. if res.Body != nil {
  75671. res.Body.Close()
  75672. }
  75673. return nil, &googleapi.Error{
  75674. Code: res.StatusCode,
  75675. Header: res.Header,
  75676. }
  75677. }
  75678. if err != nil {
  75679. return nil, err
  75680. }
  75681. defer googleapi.CloseBody(res)
  75682. if err := googleapi.CheckResponse(res); err != nil {
  75683. return nil, err
  75684. }
  75685. ret := &Operation{
  75686. ServerResponse: googleapi.ServerResponse{
  75687. Header: res.Header,
  75688. HTTPStatusCode: res.StatusCode,
  75689. },
  75690. }
  75691. target := &ret
  75692. if err := gensupport.DecodeResponse(target, res); err != nil {
  75693. return nil, err
  75694. }
  75695. return ret, nil
  75696. // {
  75697. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  75698. // "httpMethod": "POST",
  75699. // "id": "compute.interconnects.setLabels",
  75700. // "parameterOrder": [
  75701. // "project",
  75702. // "resource"
  75703. // ],
  75704. // "parameters": {
  75705. // "project": {
  75706. // "description": "Project ID for this request.",
  75707. // "location": "path",
  75708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75709. // "required": true,
  75710. // "type": "string"
  75711. // },
  75712. // "resource": {
  75713. // "description": "Name or id of the resource for this request.",
  75714. // "location": "path",
  75715. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75716. // "required": true,
  75717. // "type": "string"
  75718. // }
  75719. // },
  75720. // "path": "{project}/global/interconnects/{resource}/setLabels",
  75721. // "request": {
  75722. // "$ref": "GlobalSetLabelsRequest"
  75723. // },
  75724. // "response": {
  75725. // "$ref": "Operation"
  75726. // },
  75727. // "scopes": [
  75728. // "https://www.googleapis.com/auth/cloud-platform",
  75729. // "https://www.googleapis.com/auth/compute"
  75730. // ]
  75731. // }
  75732. }
  75733. // method id "compute.interconnects.testIamPermissions":
  75734. type InterconnectsTestIamPermissionsCall struct {
  75735. s *Service
  75736. project string
  75737. resource string
  75738. testpermissionsrequest *TestPermissionsRequest
  75739. urlParams_ gensupport.URLParams
  75740. ctx_ context.Context
  75741. header_ http.Header
  75742. }
  75743. // TestIamPermissions: Returns permissions that a caller has on the
  75744. // specified resource.
  75745. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  75746. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75747. c.project = project
  75748. c.resource = resource
  75749. c.testpermissionsrequest = testpermissionsrequest
  75750. return c
  75751. }
  75752. // Fields allows partial responses to be retrieved. See
  75753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75754. // for more information.
  75755. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  75756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75757. return c
  75758. }
  75759. // Context sets the context to be used in this call's Do method. Any
  75760. // pending HTTP request will be aborted if the provided context is
  75761. // canceled.
  75762. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  75763. c.ctx_ = ctx
  75764. return c
  75765. }
  75766. // Header returns an http.Header that can be modified by the caller to
  75767. // add HTTP headers to the request.
  75768. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  75769. if c.header_ == nil {
  75770. c.header_ = make(http.Header)
  75771. }
  75772. return c.header_
  75773. }
  75774. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  75775. reqHeaders := make(http.Header)
  75776. for k, v := range c.header_ {
  75777. reqHeaders[k] = v
  75778. }
  75779. reqHeaders.Set("User-Agent", c.s.userAgent())
  75780. var body io.Reader = nil
  75781. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  75782. if err != nil {
  75783. return nil, err
  75784. }
  75785. reqHeaders.Set("Content-Type", "application/json")
  75786. c.urlParams_.Set("alt", alt)
  75787. c.urlParams_.Set("prettyPrint", "false")
  75788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  75789. urls += "?" + c.urlParams_.Encode()
  75790. req, err := http.NewRequest("POST", urls, body)
  75791. if err != nil {
  75792. return nil, err
  75793. }
  75794. req.Header = reqHeaders
  75795. googleapi.Expand(req.URL, map[string]string{
  75796. "project": c.project,
  75797. "resource": c.resource,
  75798. })
  75799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75800. }
  75801. // Do executes the "compute.interconnects.testIamPermissions" call.
  75802. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  75803. // non-2xx status code is an error. Response headers are in either
  75804. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  75805. // returned at all) in error.(*googleapi.Error).Header. Use
  75806. // googleapi.IsNotModified to check whether the returned error was
  75807. // because http.StatusNotModified was returned.
  75808. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  75809. gensupport.SetOptions(c.urlParams_, opts...)
  75810. res, err := c.doRequest("json")
  75811. if res != nil && res.StatusCode == http.StatusNotModified {
  75812. if res.Body != nil {
  75813. res.Body.Close()
  75814. }
  75815. return nil, &googleapi.Error{
  75816. Code: res.StatusCode,
  75817. Header: res.Header,
  75818. }
  75819. }
  75820. if err != nil {
  75821. return nil, err
  75822. }
  75823. defer googleapi.CloseBody(res)
  75824. if err := googleapi.CheckResponse(res); err != nil {
  75825. return nil, err
  75826. }
  75827. ret := &TestPermissionsResponse{
  75828. ServerResponse: googleapi.ServerResponse{
  75829. Header: res.Header,
  75830. HTTPStatusCode: res.StatusCode,
  75831. },
  75832. }
  75833. target := &ret
  75834. if err := gensupport.DecodeResponse(target, res); err != nil {
  75835. return nil, err
  75836. }
  75837. return ret, nil
  75838. // {
  75839. // "description": "Returns permissions that a caller has on the specified resource.",
  75840. // "httpMethod": "POST",
  75841. // "id": "compute.interconnects.testIamPermissions",
  75842. // "parameterOrder": [
  75843. // "project",
  75844. // "resource"
  75845. // ],
  75846. // "parameters": {
  75847. // "project": {
  75848. // "description": "Project ID for this request.",
  75849. // "location": "path",
  75850. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75851. // "required": true,
  75852. // "type": "string"
  75853. // },
  75854. // "resource": {
  75855. // "description": "Name or id of the resource for this request.",
  75856. // "location": "path",
  75857. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75858. // "required": true,
  75859. // "type": "string"
  75860. // }
  75861. // },
  75862. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  75863. // "request": {
  75864. // "$ref": "TestPermissionsRequest"
  75865. // },
  75866. // "response": {
  75867. // "$ref": "TestPermissionsResponse"
  75868. // },
  75869. // "scopes": [
  75870. // "https://www.googleapis.com/auth/cloud-platform",
  75871. // "https://www.googleapis.com/auth/compute",
  75872. // "https://www.googleapis.com/auth/compute.readonly"
  75873. // ]
  75874. // }
  75875. }
  75876. // method id "compute.licenseCodes.get":
  75877. type LicenseCodesGetCall struct {
  75878. s *Service
  75879. project string
  75880. licenseCode string
  75881. urlParams_ gensupport.URLParams
  75882. ifNoneMatch_ string
  75883. ctx_ context.Context
  75884. header_ http.Header
  75885. }
  75886. // Get: Return a specified license code. License codes are mirrored
  75887. // across all projects that have permissions to read the License Code.
  75888. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  75889. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75890. c.project = project
  75891. c.licenseCode = licenseCode
  75892. return c
  75893. }
  75894. // Fields allows partial responses to be retrieved. See
  75895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75896. // for more information.
  75897. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  75898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75899. return c
  75900. }
  75901. // IfNoneMatch sets the optional parameter which makes the operation
  75902. // fail if the object's ETag matches the given value. This is useful for
  75903. // getting updates only after the object has changed since the last
  75904. // request. Use googleapi.IsNotModified to check whether the response
  75905. // error from Do is the result of In-None-Match.
  75906. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  75907. c.ifNoneMatch_ = entityTag
  75908. return c
  75909. }
  75910. // Context sets the context to be used in this call's Do method. Any
  75911. // pending HTTP request will be aborted if the provided context is
  75912. // canceled.
  75913. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  75914. c.ctx_ = ctx
  75915. return c
  75916. }
  75917. // Header returns an http.Header that can be modified by the caller to
  75918. // add HTTP headers to the request.
  75919. func (c *LicenseCodesGetCall) Header() http.Header {
  75920. if c.header_ == nil {
  75921. c.header_ = make(http.Header)
  75922. }
  75923. return c.header_
  75924. }
  75925. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  75926. reqHeaders := make(http.Header)
  75927. for k, v := range c.header_ {
  75928. reqHeaders[k] = v
  75929. }
  75930. reqHeaders.Set("User-Agent", c.s.userAgent())
  75931. if c.ifNoneMatch_ != "" {
  75932. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75933. }
  75934. var body io.Reader = nil
  75935. c.urlParams_.Set("alt", alt)
  75936. c.urlParams_.Set("prettyPrint", "false")
  75937. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  75938. urls += "?" + c.urlParams_.Encode()
  75939. req, err := http.NewRequest("GET", urls, body)
  75940. if err != nil {
  75941. return nil, err
  75942. }
  75943. req.Header = reqHeaders
  75944. googleapi.Expand(req.URL, map[string]string{
  75945. "project": c.project,
  75946. "licenseCode": c.licenseCode,
  75947. })
  75948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75949. }
  75950. // Do executes the "compute.licenseCodes.get" call.
  75951. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  75952. // status code is an error. Response headers are in either
  75953. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  75954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75955. // to check whether the returned error was because
  75956. // http.StatusNotModified was returned.
  75957. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  75958. gensupport.SetOptions(c.urlParams_, opts...)
  75959. res, err := c.doRequest("json")
  75960. if res != nil && res.StatusCode == http.StatusNotModified {
  75961. if res.Body != nil {
  75962. res.Body.Close()
  75963. }
  75964. return nil, &googleapi.Error{
  75965. Code: res.StatusCode,
  75966. Header: res.Header,
  75967. }
  75968. }
  75969. if err != nil {
  75970. return nil, err
  75971. }
  75972. defer googleapi.CloseBody(res)
  75973. if err := googleapi.CheckResponse(res); err != nil {
  75974. return nil, err
  75975. }
  75976. ret := &LicenseCode{
  75977. ServerResponse: googleapi.ServerResponse{
  75978. Header: res.Header,
  75979. HTTPStatusCode: res.StatusCode,
  75980. },
  75981. }
  75982. target := &ret
  75983. if err := gensupport.DecodeResponse(target, res); err != nil {
  75984. return nil, err
  75985. }
  75986. return ret, nil
  75987. // {
  75988. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  75989. // "httpMethod": "GET",
  75990. // "id": "compute.licenseCodes.get",
  75991. // "parameterOrder": [
  75992. // "project",
  75993. // "licenseCode"
  75994. // ],
  75995. // "parameters": {
  75996. // "licenseCode": {
  75997. // "description": "Number corresponding to the License code resource to return.",
  75998. // "location": "path",
  75999. // "pattern": "[0-9]{0,61}?",
  76000. // "required": true,
  76001. // "type": "string"
  76002. // },
  76003. // "project": {
  76004. // "description": "Project ID for this request.",
  76005. // "location": "path",
  76006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76007. // "required": true,
  76008. // "type": "string"
  76009. // }
  76010. // },
  76011. // "path": "{project}/global/licenseCodes/{licenseCode}",
  76012. // "response": {
  76013. // "$ref": "LicenseCode"
  76014. // },
  76015. // "scopes": [
  76016. // "https://www.googleapis.com/auth/cloud-platform",
  76017. // "https://www.googleapis.com/auth/compute",
  76018. // "https://www.googleapis.com/auth/compute.readonly"
  76019. // ]
  76020. // }
  76021. }
  76022. // method id "compute.licenseCodes.getIamPolicy":
  76023. type LicenseCodesGetIamPolicyCall struct {
  76024. s *Service
  76025. project string
  76026. resource string
  76027. urlParams_ gensupport.URLParams
  76028. ifNoneMatch_ string
  76029. ctx_ context.Context
  76030. header_ http.Header
  76031. }
  76032. // GetIamPolicy: Gets the access control policy for a resource. May be
  76033. // empty if no such policy or resource exists.
  76034. func (r *LicenseCodesService) GetIamPolicy(project string, resource string) *LicenseCodesGetIamPolicyCall {
  76035. c := &LicenseCodesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76036. c.project = project
  76037. c.resource = resource
  76038. return c
  76039. }
  76040. // Fields allows partial responses to be retrieved. See
  76041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76042. // for more information.
  76043. func (c *LicenseCodesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesGetIamPolicyCall {
  76044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76045. return c
  76046. }
  76047. // IfNoneMatch sets the optional parameter which makes the operation
  76048. // fail if the object's ETag matches the given value. This is useful for
  76049. // getting updates only after the object has changed since the last
  76050. // request. Use googleapi.IsNotModified to check whether the response
  76051. // error from Do is the result of In-None-Match.
  76052. func (c *LicenseCodesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicenseCodesGetIamPolicyCall {
  76053. c.ifNoneMatch_ = entityTag
  76054. return c
  76055. }
  76056. // Context sets the context to be used in this call's Do method. Any
  76057. // pending HTTP request will be aborted if the provided context is
  76058. // canceled.
  76059. func (c *LicenseCodesGetIamPolicyCall) Context(ctx context.Context) *LicenseCodesGetIamPolicyCall {
  76060. c.ctx_ = ctx
  76061. return c
  76062. }
  76063. // Header returns an http.Header that can be modified by the caller to
  76064. // add HTTP headers to the request.
  76065. func (c *LicenseCodesGetIamPolicyCall) Header() http.Header {
  76066. if c.header_ == nil {
  76067. c.header_ = make(http.Header)
  76068. }
  76069. return c.header_
  76070. }
  76071. func (c *LicenseCodesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  76072. reqHeaders := make(http.Header)
  76073. for k, v := range c.header_ {
  76074. reqHeaders[k] = v
  76075. }
  76076. reqHeaders.Set("User-Agent", c.s.userAgent())
  76077. if c.ifNoneMatch_ != "" {
  76078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76079. }
  76080. var body io.Reader = nil
  76081. c.urlParams_.Set("alt", alt)
  76082. c.urlParams_.Set("prettyPrint", "false")
  76083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/getIamPolicy")
  76084. urls += "?" + c.urlParams_.Encode()
  76085. req, err := http.NewRequest("GET", urls, body)
  76086. if err != nil {
  76087. return nil, err
  76088. }
  76089. req.Header = reqHeaders
  76090. googleapi.Expand(req.URL, map[string]string{
  76091. "project": c.project,
  76092. "resource": c.resource,
  76093. })
  76094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76095. }
  76096. // Do executes the "compute.licenseCodes.getIamPolicy" call.
  76097. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  76098. // code is an error. Response headers are in either
  76099. // *Policy.ServerResponse.Header or (if a response was returned at all)
  76100. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76101. // check whether the returned error was because http.StatusNotModified
  76102. // was returned.
  76103. func (c *LicenseCodesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  76104. gensupport.SetOptions(c.urlParams_, opts...)
  76105. res, err := c.doRequest("json")
  76106. if res != nil && res.StatusCode == http.StatusNotModified {
  76107. if res.Body != nil {
  76108. res.Body.Close()
  76109. }
  76110. return nil, &googleapi.Error{
  76111. Code: res.StatusCode,
  76112. Header: res.Header,
  76113. }
  76114. }
  76115. if err != nil {
  76116. return nil, err
  76117. }
  76118. defer googleapi.CloseBody(res)
  76119. if err := googleapi.CheckResponse(res); err != nil {
  76120. return nil, err
  76121. }
  76122. ret := &Policy{
  76123. ServerResponse: googleapi.ServerResponse{
  76124. Header: res.Header,
  76125. HTTPStatusCode: res.StatusCode,
  76126. },
  76127. }
  76128. target := &ret
  76129. if err := gensupport.DecodeResponse(target, res); err != nil {
  76130. return nil, err
  76131. }
  76132. return ret, nil
  76133. // {
  76134. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  76135. // "httpMethod": "GET",
  76136. // "id": "compute.licenseCodes.getIamPolicy",
  76137. // "parameterOrder": [
  76138. // "project",
  76139. // "resource"
  76140. // ],
  76141. // "parameters": {
  76142. // "project": {
  76143. // "description": "Project ID for this request.",
  76144. // "location": "path",
  76145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76146. // "required": true,
  76147. // "type": "string"
  76148. // },
  76149. // "resource": {
  76150. // "description": "Name or id of the resource for this request.",
  76151. // "location": "path",
  76152. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76153. // "required": true,
  76154. // "type": "string"
  76155. // }
  76156. // },
  76157. // "path": "{project}/global/licenseCodes/{resource}/getIamPolicy",
  76158. // "response": {
  76159. // "$ref": "Policy"
  76160. // },
  76161. // "scopes": [
  76162. // "https://www.googleapis.com/auth/cloud-platform",
  76163. // "https://www.googleapis.com/auth/compute",
  76164. // "https://www.googleapis.com/auth/compute.readonly"
  76165. // ]
  76166. // }
  76167. }
  76168. // method id "compute.licenseCodes.setIamPolicy":
  76169. type LicenseCodesSetIamPolicyCall struct {
  76170. s *Service
  76171. project string
  76172. resource string
  76173. globalsetpolicyrequest *GlobalSetPolicyRequest
  76174. urlParams_ gensupport.URLParams
  76175. ctx_ context.Context
  76176. header_ http.Header
  76177. }
  76178. // SetIamPolicy: Sets the access control policy on the specified
  76179. // resource. Replaces any existing policy.
  76180. func (r *LicenseCodesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicenseCodesSetIamPolicyCall {
  76181. c := &LicenseCodesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76182. c.project = project
  76183. c.resource = resource
  76184. c.globalsetpolicyrequest = globalsetpolicyrequest
  76185. return c
  76186. }
  76187. // Fields allows partial responses to be retrieved. See
  76188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76189. // for more information.
  76190. func (c *LicenseCodesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesSetIamPolicyCall {
  76191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76192. return c
  76193. }
  76194. // Context sets the context to be used in this call's Do method. Any
  76195. // pending HTTP request will be aborted if the provided context is
  76196. // canceled.
  76197. func (c *LicenseCodesSetIamPolicyCall) Context(ctx context.Context) *LicenseCodesSetIamPolicyCall {
  76198. c.ctx_ = ctx
  76199. return c
  76200. }
  76201. // Header returns an http.Header that can be modified by the caller to
  76202. // add HTTP headers to the request.
  76203. func (c *LicenseCodesSetIamPolicyCall) Header() http.Header {
  76204. if c.header_ == nil {
  76205. c.header_ = make(http.Header)
  76206. }
  76207. return c.header_
  76208. }
  76209. func (c *LicenseCodesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  76210. reqHeaders := make(http.Header)
  76211. for k, v := range c.header_ {
  76212. reqHeaders[k] = v
  76213. }
  76214. reqHeaders.Set("User-Agent", c.s.userAgent())
  76215. var body io.Reader = nil
  76216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  76217. if err != nil {
  76218. return nil, err
  76219. }
  76220. reqHeaders.Set("Content-Type", "application/json")
  76221. c.urlParams_.Set("alt", alt)
  76222. c.urlParams_.Set("prettyPrint", "false")
  76223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/setIamPolicy")
  76224. urls += "?" + c.urlParams_.Encode()
  76225. req, err := http.NewRequest("POST", urls, body)
  76226. if err != nil {
  76227. return nil, err
  76228. }
  76229. req.Header = reqHeaders
  76230. googleapi.Expand(req.URL, map[string]string{
  76231. "project": c.project,
  76232. "resource": c.resource,
  76233. })
  76234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76235. }
  76236. // Do executes the "compute.licenseCodes.setIamPolicy" call.
  76237. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  76238. // code is an error. Response headers are in either
  76239. // *Policy.ServerResponse.Header or (if a response was returned at all)
  76240. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76241. // check whether the returned error was because http.StatusNotModified
  76242. // was returned.
  76243. func (c *LicenseCodesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  76244. gensupport.SetOptions(c.urlParams_, opts...)
  76245. res, err := c.doRequest("json")
  76246. if res != nil && res.StatusCode == http.StatusNotModified {
  76247. if res.Body != nil {
  76248. res.Body.Close()
  76249. }
  76250. return nil, &googleapi.Error{
  76251. Code: res.StatusCode,
  76252. Header: res.Header,
  76253. }
  76254. }
  76255. if err != nil {
  76256. return nil, err
  76257. }
  76258. defer googleapi.CloseBody(res)
  76259. if err := googleapi.CheckResponse(res); err != nil {
  76260. return nil, err
  76261. }
  76262. ret := &Policy{
  76263. ServerResponse: googleapi.ServerResponse{
  76264. Header: res.Header,
  76265. HTTPStatusCode: res.StatusCode,
  76266. },
  76267. }
  76268. target := &ret
  76269. if err := gensupport.DecodeResponse(target, res); err != nil {
  76270. return nil, err
  76271. }
  76272. return ret, nil
  76273. // {
  76274. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  76275. // "httpMethod": "POST",
  76276. // "id": "compute.licenseCodes.setIamPolicy",
  76277. // "parameterOrder": [
  76278. // "project",
  76279. // "resource"
  76280. // ],
  76281. // "parameters": {
  76282. // "project": {
  76283. // "description": "Project ID for this request.",
  76284. // "location": "path",
  76285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76286. // "required": true,
  76287. // "type": "string"
  76288. // },
  76289. // "resource": {
  76290. // "description": "Name or id of the resource for this request.",
  76291. // "location": "path",
  76292. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76293. // "required": true,
  76294. // "type": "string"
  76295. // }
  76296. // },
  76297. // "path": "{project}/global/licenseCodes/{resource}/setIamPolicy",
  76298. // "request": {
  76299. // "$ref": "GlobalSetPolicyRequest"
  76300. // },
  76301. // "response": {
  76302. // "$ref": "Policy"
  76303. // },
  76304. // "scopes": [
  76305. // "https://www.googleapis.com/auth/cloud-platform",
  76306. // "https://www.googleapis.com/auth/compute"
  76307. // ]
  76308. // }
  76309. }
  76310. // method id "compute.licenseCodes.testIamPermissions":
  76311. type LicenseCodesTestIamPermissionsCall struct {
  76312. s *Service
  76313. project string
  76314. resource string
  76315. testpermissionsrequest *TestPermissionsRequest
  76316. urlParams_ gensupport.URLParams
  76317. ctx_ context.Context
  76318. header_ http.Header
  76319. }
  76320. // TestIamPermissions: Returns permissions that a caller has on the
  76321. // specified resource.
  76322. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  76323. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76324. c.project = project
  76325. c.resource = resource
  76326. c.testpermissionsrequest = testpermissionsrequest
  76327. return c
  76328. }
  76329. // Fields allows partial responses to be retrieved. See
  76330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76331. // for more information.
  76332. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  76333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76334. return c
  76335. }
  76336. // Context sets the context to be used in this call's Do method. Any
  76337. // pending HTTP request will be aborted if the provided context is
  76338. // canceled.
  76339. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  76340. c.ctx_ = ctx
  76341. return c
  76342. }
  76343. // Header returns an http.Header that can be modified by the caller to
  76344. // add HTTP headers to the request.
  76345. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  76346. if c.header_ == nil {
  76347. c.header_ = make(http.Header)
  76348. }
  76349. return c.header_
  76350. }
  76351. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  76352. reqHeaders := make(http.Header)
  76353. for k, v := range c.header_ {
  76354. reqHeaders[k] = v
  76355. }
  76356. reqHeaders.Set("User-Agent", c.s.userAgent())
  76357. var body io.Reader = nil
  76358. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  76359. if err != nil {
  76360. return nil, err
  76361. }
  76362. reqHeaders.Set("Content-Type", "application/json")
  76363. c.urlParams_.Set("alt", alt)
  76364. c.urlParams_.Set("prettyPrint", "false")
  76365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  76366. urls += "?" + c.urlParams_.Encode()
  76367. req, err := http.NewRequest("POST", urls, body)
  76368. if err != nil {
  76369. return nil, err
  76370. }
  76371. req.Header = reqHeaders
  76372. googleapi.Expand(req.URL, map[string]string{
  76373. "project": c.project,
  76374. "resource": c.resource,
  76375. })
  76376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76377. }
  76378. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  76379. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  76380. // non-2xx status code is an error. Response headers are in either
  76381. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  76382. // returned at all) in error.(*googleapi.Error).Header. Use
  76383. // googleapi.IsNotModified to check whether the returned error was
  76384. // because http.StatusNotModified was returned.
  76385. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  76386. gensupport.SetOptions(c.urlParams_, opts...)
  76387. res, err := c.doRequest("json")
  76388. if res != nil && res.StatusCode == http.StatusNotModified {
  76389. if res.Body != nil {
  76390. res.Body.Close()
  76391. }
  76392. return nil, &googleapi.Error{
  76393. Code: res.StatusCode,
  76394. Header: res.Header,
  76395. }
  76396. }
  76397. if err != nil {
  76398. return nil, err
  76399. }
  76400. defer googleapi.CloseBody(res)
  76401. if err := googleapi.CheckResponse(res); err != nil {
  76402. return nil, err
  76403. }
  76404. ret := &TestPermissionsResponse{
  76405. ServerResponse: googleapi.ServerResponse{
  76406. Header: res.Header,
  76407. HTTPStatusCode: res.StatusCode,
  76408. },
  76409. }
  76410. target := &ret
  76411. if err := gensupport.DecodeResponse(target, res); err != nil {
  76412. return nil, err
  76413. }
  76414. return ret, nil
  76415. // {
  76416. // "description": "Returns permissions that a caller has on the specified resource.",
  76417. // "httpMethod": "POST",
  76418. // "id": "compute.licenseCodes.testIamPermissions",
  76419. // "parameterOrder": [
  76420. // "project",
  76421. // "resource"
  76422. // ],
  76423. // "parameters": {
  76424. // "project": {
  76425. // "description": "Project ID for this request.",
  76426. // "location": "path",
  76427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76428. // "required": true,
  76429. // "type": "string"
  76430. // },
  76431. // "resource": {
  76432. // "description": "Name or id of the resource for this request.",
  76433. // "location": "path",
  76434. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76435. // "required": true,
  76436. // "type": "string"
  76437. // }
  76438. // },
  76439. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  76440. // "request": {
  76441. // "$ref": "TestPermissionsRequest"
  76442. // },
  76443. // "response": {
  76444. // "$ref": "TestPermissionsResponse"
  76445. // },
  76446. // "scopes": [
  76447. // "https://www.googleapis.com/auth/cloud-platform",
  76448. // "https://www.googleapis.com/auth/compute",
  76449. // "https://www.googleapis.com/auth/compute.readonly"
  76450. // ]
  76451. // }
  76452. }
  76453. // method id "compute.licenses.delete":
  76454. type LicensesDeleteCall struct {
  76455. s *Service
  76456. project string
  76457. license string
  76458. urlParams_ gensupport.URLParams
  76459. ctx_ context.Context
  76460. header_ http.Header
  76461. }
  76462. // Delete: Deletes the specified license.
  76463. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  76464. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76465. c.project = project
  76466. c.license = license
  76467. return c
  76468. }
  76469. // RequestId sets the optional parameter "requestId": An optional
  76470. // request ID to identify requests. Specify a unique request ID so that
  76471. // if you must retry your request, the server will know to ignore the
  76472. // request if it has already been completed.
  76473. //
  76474. // For example, consider a situation where you make an initial request
  76475. // and the request times out. If you make the request again with the
  76476. // same request ID, the server can check if original operation with the
  76477. // same request ID was received, and if so, will ignore the second
  76478. // request. This prevents clients from accidentally creating duplicate
  76479. // commitments.
  76480. //
  76481. // The request ID must be a valid UUID with the exception that zero UUID
  76482. // is not supported (00000000-0000-0000-0000-000000000000).
  76483. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  76484. c.urlParams_.Set("requestId", requestId)
  76485. return c
  76486. }
  76487. // Fields allows partial responses to be retrieved. See
  76488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76489. // for more information.
  76490. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  76491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76492. return c
  76493. }
  76494. // Context sets the context to be used in this call's Do method. Any
  76495. // pending HTTP request will be aborted if the provided context is
  76496. // canceled.
  76497. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  76498. c.ctx_ = ctx
  76499. return c
  76500. }
  76501. // Header returns an http.Header that can be modified by the caller to
  76502. // add HTTP headers to the request.
  76503. func (c *LicensesDeleteCall) Header() http.Header {
  76504. if c.header_ == nil {
  76505. c.header_ = make(http.Header)
  76506. }
  76507. return c.header_
  76508. }
  76509. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  76510. reqHeaders := make(http.Header)
  76511. for k, v := range c.header_ {
  76512. reqHeaders[k] = v
  76513. }
  76514. reqHeaders.Set("User-Agent", c.s.userAgent())
  76515. var body io.Reader = nil
  76516. c.urlParams_.Set("alt", alt)
  76517. c.urlParams_.Set("prettyPrint", "false")
  76518. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  76519. urls += "?" + c.urlParams_.Encode()
  76520. req, err := http.NewRequest("DELETE", urls, body)
  76521. if err != nil {
  76522. return nil, err
  76523. }
  76524. req.Header = reqHeaders
  76525. googleapi.Expand(req.URL, map[string]string{
  76526. "project": c.project,
  76527. "license": c.license,
  76528. })
  76529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76530. }
  76531. // Do executes the "compute.licenses.delete" call.
  76532. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76533. // status code is an error. Response headers are in either
  76534. // *Operation.ServerResponse.Header or (if a response was returned at
  76535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76536. // to check whether the returned error was because
  76537. // http.StatusNotModified was returned.
  76538. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76539. gensupport.SetOptions(c.urlParams_, opts...)
  76540. res, err := c.doRequest("json")
  76541. if res != nil && res.StatusCode == http.StatusNotModified {
  76542. if res.Body != nil {
  76543. res.Body.Close()
  76544. }
  76545. return nil, &googleapi.Error{
  76546. Code: res.StatusCode,
  76547. Header: res.Header,
  76548. }
  76549. }
  76550. if err != nil {
  76551. return nil, err
  76552. }
  76553. defer googleapi.CloseBody(res)
  76554. if err := googleapi.CheckResponse(res); err != nil {
  76555. return nil, err
  76556. }
  76557. ret := &Operation{
  76558. ServerResponse: googleapi.ServerResponse{
  76559. Header: res.Header,
  76560. HTTPStatusCode: res.StatusCode,
  76561. },
  76562. }
  76563. target := &ret
  76564. if err := gensupport.DecodeResponse(target, res); err != nil {
  76565. return nil, err
  76566. }
  76567. return ret, nil
  76568. // {
  76569. // "description": "Deletes the specified license.",
  76570. // "httpMethod": "DELETE",
  76571. // "id": "compute.licenses.delete",
  76572. // "parameterOrder": [
  76573. // "project",
  76574. // "license"
  76575. // ],
  76576. // "parameters": {
  76577. // "license": {
  76578. // "description": "Name of the license resource to delete.",
  76579. // "location": "path",
  76580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76581. // "required": true,
  76582. // "type": "string"
  76583. // },
  76584. // "project": {
  76585. // "description": "Project ID for this request.",
  76586. // "location": "path",
  76587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76588. // "required": true,
  76589. // "type": "string"
  76590. // },
  76591. // "requestId": {
  76592. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76593. // "location": "query",
  76594. // "type": "string"
  76595. // }
  76596. // },
  76597. // "path": "{project}/global/licenses/{license}",
  76598. // "response": {
  76599. // "$ref": "Operation"
  76600. // },
  76601. // "scopes": [
  76602. // "https://www.googleapis.com/auth/cloud-platform",
  76603. // "https://www.googleapis.com/auth/compute"
  76604. // ]
  76605. // }
  76606. }
  76607. // method id "compute.licenses.get":
  76608. type LicensesGetCall struct {
  76609. s *Service
  76610. project string
  76611. license string
  76612. urlParams_ gensupport.URLParams
  76613. ifNoneMatch_ string
  76614. ctx_ context.Context
  76615. header_ http.Header
  76616. }
  76617. // Get: Returns the specified License resource.
  76618. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  76619. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  76620. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76621. c.project = project
  76622. c.license = license
  76623. return c
  76624. }
  76625. // Fields allows partial responses to be retrieved. See
  76626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76627. // for more information.
  76628. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  76629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76630. return c
  76631. }
  76632. // IfNoneMatch sets the optional parameter which makes the operation
  76633. // fail if the object's ETag matches the given value. This is useful for
  76634. // getting updates only after the object has changed since the last
  76635. // request. Use googleapi.IsNotModified to check whether the response
  76636. // error from Do is the result of In-None-Match.
  76637. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  76638. c.ifNoneMatch_ = entityTag
  76639. return c
  76640. }
  76641. // Context sets the context to be used in this call's Do method. Any
  76642. // pending HTTP request will be aborted if the provided context is
  76643. // canceled.
  76644. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  76645. c.ctx_ = ctx
  76646. return c
  76647. }
  76648. // Header returns an http.Header that can be modified by the caller to
  76649. // add HTTP headers to the request.
  76650. func (c *LicensesGetCall) Header() http.Header {
  76651. if c.header_ == nil {
  76652. c.header_ = make(http.Header)
  76653. }
  76654. return c.header_
  76655. }
  76656. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  76657. reqHeaders := make(http.Header)
  76658. for k, v := range c.header_ {
  76659. reqHeaders[k] = v
  76660. }
  76661. reqHeaders.Set("User-Agent", c.s.userAgent())
  76662. if c.ifNoneMatch_ != "" {
  76663. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76664. }
  76665. var body io.Reader = nil
  76666. c.urlParams_.Set("alt", alt)
  76667. c.urlParams_.Set("prettyPrint", "false")
  76668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  76669. urls += "?" + c.urlParams_.Encode()
  76670. req, err := http.NewRequest("GET", urls, body)
  76671. if err != nil {
  76672. return nil, err
  76673. }
  76674. req.Header = reqHeaders
  76675. googleapi.Expand(req.URL, map[string]string{
  76676. "project": c.project,
  76677. "license": c.license,
  76678. })
  76679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76680. }
  76681. // Do executes the "compute.licenses.get" call.
  76682. // Exactly one of *License or error will be non-nil. Any non-2xx status
  76683. // code is an error. Response headers are in either
  76684. // *License.ServerResponse.Header or (if a response was returned at all)
  76685. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76686. // check whether the returned error was because http.StatusNotModified
  76687. // was returned.
  76688. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  76689. gensupport.SetOptions(c.urlParams_, opts...)
  76690. res, err := c.doRequest("json")
  76691. if res != nil && res.StatusCode == http.StatusNotModified {
  76692. if res.Body != nil {
  76693. res.Body.Close()
  76694. }
  76695. return nil, &googleapi.Error{
  76696. Code: res.StatusCode,
  76697. Header: res.Header,
  76698. }
  76699. }
  76700. if err != nil {
  76701. return nil, err
  76702. }
  76703. defer googleapi.CloseBody(res)
  76704. if err := googleapi.CheckResponse(res); err != nil {
  76705. return nil, err
  76706. }
  76707. ret := &License{
  76708. ServerResponse: googleapi.ServerResponse{
  76709. Header: res.Header,
  76710. HTTPStatusCode: res.StatusCode,
  76711. },
  76712. }
  76713. target := &ret
  76714. if err := gensupport.DecodeResponse(target, res); err != nil {
  76715. return nil, err
  76716. }
  76717. return ret, nil
  76718. // {
  76719. // "description": "Returns the specified License resource.",
  76720. // "httpMethod": "GET",
  76721. // "id": "compute.licenses.get",
  76722. // "parameterOrder": [
  76723. // "project",
  76724. // "license"
  76725. // ],
  76726. // "parameters": {
  76727. // "license": {
  76728. // "description": "Name of the License resource to return.",
  76729. // "location": "path",
  76730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76731. // "required": true,
  76732. // "type": "string"
  76733. // },
  76734. // "project": {
  76735. // "description": "Project ID for this request.",
  76736. // "location": "path",
  76737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76738. // "required": true,
  76739. // "type": "string"
  76740. // }
  76741. // },
  76742. // "path": "{project}/global/licenses/{license}",
  76743. // "response": {
  76744. // "$ref": "License"
  76745. // },
  76746. // "scopes": [
  76747. // "https://www.googleapis.com/auth/cloud-platform",
  76748. // "https://www.googleapis.com/auth/compute",
  76749. // "https://www.googleapis.com/auth/compute.readonly"
  76750. // ]
  76751. // }
  76752. }
  76753. // method id "compute.licenses.getIamPolicy":
  76754. type LicensesGetIamPolicyCall struct {
  76755. s *Service
  76756. project string
  76757. resource string
  76758. urlParams_ gensupport.URLParams
  76759. ifNoneMatch_ string
  76760. ctx_ context.Context
  76761. header_ http.Header
  76762. }
  76763. // GetIamPolicy: Gets the access control policy for a resource. May be
  76764. // empty if no such policy or resource exists.
  76765. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  76766. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76767. c.project = project
  76768. c.resource = resource
  76769. return c
  76770. }
  76771. // Fields allows partial responses to be retrieved. See
  76772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76773. // for more information.
  76774. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  76775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76776. return c
  76777. }
  76778. // IfNoneMatch sets the optional parameter which makes the operation
  76779. // fail if the object's ETag matches the given value. This is useful for
  76780. // getting updates only after the object has changed since the last
  76781. // request. Use googleapi.IsNotModified to check whether the response
  76782. // error from Do is the result of In-None-Match.
  76783. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  76784. c.ifNoneMatch_ = entityTag
  76785. return c
  76786. }
  76787. // Context sets the context to be used in this call's Do method. Any
  76788. // pending HTTP request will be aborted if the provided context is
  76789. // canceled.
  76790. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  76791. c.ctx_ = ctx
  76792. return c
  76793. }
  76794. // Header returns an http.Header that can be modified by the caller to
  76795. // add HTTP headers to the request.
  76796. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  76797. if c.header_ == nil {
  76798. c.header_ = make(http.Header)
  76799. }
  76800. return c.header_
  76801. }
  76802. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  76803. reqHeaders := make(http.Header)
  76804. for k, v := range c.header_ {
  76805. reqHeaders[k] = v
  76806. }
  76807. reqHeaders.Set("User-Agent", c.s.userAgent())
  76808. if c.ifNoneMatch_ != "" {
  76809. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76810. }
  76811. var body io.Reader = nil
  76812. c.urlParams_.Set("alt", alt)
  76813. c.urlParams_.Set("prettyPrint", "false")
  76814. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  76815. urls += "?" + c.urlParams_.Encode()
  76816. req, err := http.NewRequest("GET", urls, body)
  76817. if err != nil {
  76818. return nil, err
  76819. }
  76820. req.Header = reqHeaders
  76821. googleapi.Expand(req.URL, map[string]string{
  76822. "project": c.project,
  76823. "resource": c.resource,
  76824. })
  76825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76826. }
  76827. // Do executes the "compute.licenses.getIamPolicy" call.
  76828. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  76829. // code is an error. Response headers are in either
  76830. // *Policy.ServerResponse.Header or (if a response was returned at all)
  76831. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76832. // check whether the returned error was because http.StatusNotModified
  76833. // was returned.
  76834. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  76835. gensupport.SetOptions(c.urlParams_, opts...)
  76836. res, err := c.doRequest("json")
  76837. if res != nil && res.StatusCode == http.StatusNotModified {
  76838. if res.Body != nil {
  76839. res.Body.Close()
  76840. }
  76841. return nil, &googleapi.Error{
  76842. Code: res.StatusCode,
  76843. Header: res.Header,
  76844. }
  76845. }
  76846. if err != nil {
  76847. return nil, err
  76848. }
  76849. defer googleapi.CloseBody(res)
  76850. if err := googleapi.CheckResponse(res); err != nil {
  76851. return nil, err
  76852. }
  76853. ret := &Policy{
  76854. ServerResponse: googleapi.ServerResponse{
  76855. Header: res.Header,
  76856. HTTPStatusCode: res.StatusCode,
  76857. },
  76858. }
  76859. target := &ret
  76860. if err := gensupport.DecodeResponse(target, res); err != nil {
  76861. return nil, err
  76862. }
  76863. return ret, nil
  76864. // {
  76865. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  76866. // "httpMethod": "GET",
  76867. // "id": "compute.licenses.getIamPolicy",
  76868. // "parameterOrder": [
  76869. // "project",
  76870. // "resource"
  76871. // ],
  76872. // "parameters": {
  76873. // "project": {
  76874. // "description": "Project ID for this request.",
  76875. // "location": "path",
  76876. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76877. // "required": true,
  76878. // "type": "string"
  76879. // },
  76880. // "resource": {
  76881. // "description": "Name or id of the resource for this request.",
  76882. // "location": "path",
  76883. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76884. // "required": true,
  76885. // "type": "string"
  76886. // }
  76887. // },
  76888. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  76889. // "response": {
  76890. // "$ref": "Policy"
  76891. // },
  76892. // "scopes": [
  76893. // "https://www.googleapis.com/auth/cloud-platform",
  76894. // "https://www.googleapis.com/auth/compute",
  76895. // "https://www.googleapis.com/auth/compute.readonly"
  76896. // ]
  76897. // }
  76898. }
  76899. // method id "compute.licenses.insert":
  76900. type LicensesInsertCall struct {
  76901. s *Service
  76902. project string
  76903. license *License
  76904. urlParams_ gensupport.URLParams
  76905. ctx_ context.Context
  76906. header_ http.Header
  76907. }
  76908. // Insert: Create a License resource in the specified project.
  76909. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  76910. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76911. c.project = project
  76912. c.license = license
  76913. return c
  76914. }
  76915. // RequestId sets the optional parameter "requestId": An optional
  76916. // request ID to identify requests. Specify a unique request ID so that
  76917. // if you must retry your request, the server will know to ignore the
  76918. // request if it has already been completed.
  76919. //
  76920. // For example, consider a situation where you make an initial request
  76921. // and the request times out. If you make the request again with the
  76922. // same request ID, the server can check if original operation with the
  76923. // same request ID was received, and if so, will ignore the second
  76924. // request. This prevents clients from accidentally creating duplicate
  76925. // commitments.
  76926. //
  76927. // The request ID must be a valid UUID with the exception that zero UUID
  76928. // is not supported (00000000-0000-0000-0000-000000000000).
  76929. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  76930. c.urlParams_.Set("requestId", requestId)
  76931. return c
  76932. }
  76933. // Fields allows partial responses to be retrieved. See
  76934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76935. // for more information.
  76936. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  76937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76938. return c
  76939. }
  76940. // Context sets the context to be used in this call's Do method. Any
  76941. // pending HTTP request will be aborted if the provided context is
  76942. // canceled.
  76943. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  76944. c.ctx_ = ctx
  76945. return c
  76946. }
  76947. // Header returns an http.Header that can be modified by the caller to
  76948. // add HTTP headers to the request.
  76949. func (c *LicensesInsertCall) Header() http.Header {
  76950. if c.header_ == nil {
  76951. c.header_ = make(http.Header)
  76952. }
  76953. return c.header_
  76954. }
  76955. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  76956. reqHeaders := make(http.Header)
  76957. for k, v := range c.header_ {
  76958. reqHeaders[k] = v
  76959. }
  76960. reqHeaders.Set("User-Agent", c.s.userAgent())
  76961. var body io.Reader = nil
  76962. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  76963. if err != nil {
  76964. return nil, err
  76965. }
  76966. reqHeaders.Set("Content-Type", "application/json")
  76967. c.urlParams_.Set("alt", alt)
  76968. c.urlParams_.Set("prettyPrint", "false")
  76969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  76970. urls += "?" + c.urlParams_.Encode()
  76971. req, err := http.NewRequest("POST", urls, body)
  76972. if err != nil {
  76973. return nil, err
  76974. }
  76975. req.Header = reqHeaders
  76976. googleapi.Expand(req.URL, map[string]string{
  76977. "project": c.project,
  76978. })
  76979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76980. }
  76981. // Do executes the "compute.licenses.insert" call.
  76982. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76983. // status code is an error. Response headers are in either
  76984. // *Operation.ServerResponse.Header or (if a response was returned at
  76985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76986. // to check whether the returned error was because
  76987. // http.StatusNotModified was returned.
  76988. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76989. gensupport.SetOptions(c.urlParams_, opts...)
  76990. res, err := c.doRequest("json")
  76991. if res != nil && res.StatusCode == http.StatusNotModified {
  76992. if res.Body != nil {
  76993. res.Body.Close()
  76994. }
  76995. return nil, &googleapi.Error{
  76996. Code: res.StatusCode,
  76997. Header: res.Header,
  76998. }
  76999. }
  77000. if err != nil {
  77001. return nil, err
  77002. }
  77003. defer googleapi.CloseBody(res)
  77004. if err := googleapi.CheckResponse(res); err != nil {
  77005. return nil, err
  77006. }
  77007. ret := &Operation{
  77008. ServerResponse: googleapi.ServerResponse{
  77009. Header: res.Header,
  77010. HTTPStatusCode: res.StatusCode,
  77011. },
  77012. }
  77013. target := &ret
  77014. if err := gensupport.DecodeResponse(target, res); err != nil {
  77015. return nil, err
  77016. }
  77017. return ret, nil
  77018. // {
  77019. // "description": "Create a License resource in the specified project.",
  77020. // "httpMethod": "POST",
  77021. // "id": "compute.licenses.insert",
  77022. // "parameterOrder": [
  77023. // "project"
  77024. // ],
  77025. // "parameters": {
  77026. // "project": {
  77027. // "description": "Project ID for this request.",
  77028. // "location": "path",
  77029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77030. // "required": true,
  77031. // "type": "string"
  77032. // },
  77033. // "requestId": {
  77034. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77035. // "location": "query",
  77036. // "type": "string"
  77037. // }
  77038. // },
  77039. // "path": "{project}/global/licenses",
  77040. // "request": {
  77041. // "$ref": "License"
  77042. // },
  77043. // "response": {
  77044. // "$ref": "Operation"
  77045. // },
  77046. // "scopes": [
  77047. // "https://www.googleapis.com/auth/cloud-platform",
  77048. // "https://www.googleapis.com/auth/compute",
  77049. // "https://www.googleapis.com/auth/devstorage.full_control",
  77050. // "https://www.googleapis.com/auth/devstorage.read_only",
  77051. // "https://www.googleapis.com/auth/devstorage.read_write"
  77052. // ]
  77053. // }
  77054. }
  77055. // method id "compute.licenses.list":
  77056. type LicensesListCall struct {
  77057. s *Service
  77058. project string
  77059. urlParams_ gensupport.URLParams
  77060. ifNoneMatch_ string
  77061. ctx_ context.Context
  77062. header_ http.Header
  77063. }
  77064. // List: Retrieves the list of licenses available in the specified
  77065. // project. This method does not get any licenses that belong to other
  77066. // projects, including licenses attached to publicly-available images,
  77067. // like Debian 9. If you want to get a list of publicly-available
  77068. // licenses, use this method to make a request to the respective image
  77069. // project, such as debian-cloud or windows-cloud.
  77070. func (r *LicensesService) List(project string) *LicensesListCall {
  77071. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77072. c.project = project
  77073. return c
  77074. }
  77075. // Filter sets the optional parameter "filter": A filter expression that
  77076. // filters resources listed in the response. The expression must specify
  77077. // the field name, a comparison operator, and the value that you want to
  77078. // use for filtering. The value must be a string, a number, or a
  77079. // boolean. The comparison operator must be either =, !=, >, or <.
  77080. //
  77081. // For example, if you are filtering Compute Engine instances, you can
  77082. // exclude instances named example-instance by specifying name !=
  77083. // example-instance.
  77084. //
  77085. // You can also filter nested fields. For example, you could specify
  77086. // scheduling.automaticRestart = false to include instances only if they
  77087. // are not scheduled for automatic restarts. You can use filtering on
  77088. // nested fields to filter based on resource labels.
  77089. //
  77090. // To filter on multiple expressions, provide each separate expression
  77091. // within parentheses. For example, (scheduling.automaticRestart = true)
  77092. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77093. // AND expression. However, you can include AND and OR expressions
  77094. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77095. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77096. // true).
  77097. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  77098. c.urlParams_.Set("filter", filter)
  77099. return c
  77100. }
  77101. // MaxResults sets the optional parameter "maxResults": The maximum
  77102. // number of results per page that should be returned. If the number of
  77103. // available results is larger than maxResults, Compute Engine returns a
  77104. // nextPageToken that can be used to get the next page of results in
  77105. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77106. // (Default: 500)
  77107. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  77108. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77109. return c
  77110. }
  77111. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77112. // a certain order. By default, results are returned in alphanumerical
  77113. // order based on the resource name.
  77114. //
  77115. // You can also sort results in descending order based on the creation
  77116. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77117. // based on the creationTimestamp field in reverse chronological order
  77118. // (newest result first). Use this to sort resources like operations so
  77119. // that the newest operation is returned first.
  77120. //
  77121. // Currently, only sorting by name or creationTimestamp desc is
  77122. // supported.
  77123. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  77124. c.urlParams_.Set("orderBy", orderBy)
  77125. return c
  77126. }
  77127. // PageToken sets the optional parameter "pageToken": Specifies a page
  77128. // token to use. Set pageToken to the nextPageToken returned by a
  77129. // previous list request to get the next page of results.
  77130. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  77131. c.urlParams_.Set("pageToken", pageToken)
  77132. return c
  77133. }
  77134. // Fields allows partial responses to be retrieved. See
  77135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77136. // for more information.
  77137. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  77138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77139. return c
  77140. }
  77141. // IfNoneMatch sets the optional parameter which makes the operation
  77142. // fail if the object's ETag matches the given value. This is useful for
  77143. // getting updates only after the object has changed since the last
  77144. // request. Use googleapi.IsNotModified to check whether the response
  77145. // error from Do is the result of In-None-Match.
  77146. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  77147. c.ifNoneMatch_ = entityTag
  77148. return c
  77149. }
  77150. // Context sets the context to be used in this call's Do method. Any
  77151. // pending HTTP request will be aborted if the provided context is
  77152. // canceled.
  77153. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  77154. c.ctx_ = ctx
  77155. return c
  77156. }
  77157. // Header returns an http.Header that can be modified by the caller to
  77158. // add HTTP headers to the request.
  77159. func (c *LicensesListCall) Header() http.Header {
  77160. if c.header_ == nil {
  77161. c.header_ = make(http.Header)
  77162. }
  77163. return c.header_
  77164. }
  77165. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  77166. reqHeaders := make(http.Header)
  77167. for k, v := range c.header_ {
  77168. reqHeaders[k] = v
  77169. }
  77170. reqHeaders.Set("User-Agent", c.s.userAgent())
  77171. if c.ifNoneMatch_ != "" {
  77172. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77173. }
  77174. var body io.Reader = nil
  77175. c.urlParams_.Set("alt", alt)
  77176. c.urlParams_.Set("prettyPrint", "false")
  77177. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  77178. urls += "?" + c.urlParams_.Encode()
  77179. req, err := http.NewRequest("GET", urls, body)
  77180. if err != nil {
  77181. return nil, err
  77182. }
  77183. req.Header = reqHeaders
  77184. googleapi.Expand(req.URL, map[string]string{
  77185. "project": c.project,
  77186. })
  77187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77188. }
  77189. // Do executes the "compute.licenses.list" call.
  77190. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  77191. // non-2xx status code is an error. Response headers are in either
  77192. // *LicensesListResponse.ServerResponse.Header or (if a response was
  77193. // returned at all) in error.(*googleapi.Error).Header. Use
  77194. // googleapi.IsNotModified to check whether the returned error was
  77195. // because http.StatusNotModified was returned.
  77196. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  77197. gensupport.SetOptions(c.urlParams_, opts...)
  77198. res, err := c.doRequest("json")
  77199. if res != nil && res.StatusCode == http.StatusNotModified {
  77200. if res.Body != nil {
  77201. res.Body.Close()
  77202. }
  77203. return nil, &googleapi.Error{
  77204. Code: res.StatusCode,
  77205. Header: res.Header,
  77206. }
  77207. }
  77208. if err != nil {
  77209. return nil, err
  77210. }
  77211. defer googleapi.CloseBody(res)
  77212. if err := googleapi.CheckResponse(res); err != nil {
  77213. return nil, err
  77214. }
  77215. ret := &LicensesListResponse{
  77216. ServerResponse: googleapi.ServerResponse{
  77217. Header: res.Header,
  77218. HTTPStatusCode: res.StatusCode,
  77219. },
  77220. }
  77221. target := &ret
  77222. if err := gensupport.DecodeResponse(target, res); err != nil {
  77223. return nil, err
  77224. }
  77225. return ret, nil
  77226. // {
  77227. // "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.",
  77228. // "httpMethod": "GET",
  77229. // "id": "compute.licenses.list",
  77230. // "parameterOrder": [
  77231. // "project"
  77232. // ],
  77233. // "parameters": {
  77234. // "filter": {
  77235. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  77236. // "location": "query",
  77237. // "type": "string"
  77238. // },
  77239. // "maxResults": {
  77240. // "default": "500",
  77241. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  77242. // "format": "uint32",
  77243. // "location": "query",
  77244. // "minimum": "0",
  77245. // "type": "integer"
  77246. // },
  77247. // "orderBy": {
  77248. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  77249. // "location": "query",
  77250. // "type": "string"
  77251. // },
  77252. // "pageToken": {
  77253. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  77254. // "location": "query",
  77255. // "type": "string"
  77256. // },
  77257. // "project": {
  77258. // "description": "Project ID for this request.",
  77259. // "location": "path",
  77260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77261. // "required": true,
  77262. // "type": "string"
  77263. // }
  77264. // },
  77265. // "path": "{project}/global/licenses",
  77266. // "response": {
  77267. // "$ref": "LicensesListResponse"
  77268. // },
  77269. // "scopes": [
  77270. // "https://www.googleapis.com/auth/cloud-platform",
  77271. // "https://www.googleapis.com/auth/compute",
  77272. // "https://www.googleapis.com/auth/compute.readonly"
  77273. // ]
  77274. // }
  77275. }
  77276. // Pages invokes f for each page of results.
  77277. // A non-nil error returned from f will halt the iteration.
  77278. // The provided context supersedes any context provided to the Context method.
  77279. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  77280. c.ctx_ = ctx
  77281. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77282. for {
  77283. x, err := c.Do()
  77284. if err != nil {
  77285. return err
  77286. }
  77287. if err := f(x); err != nil {
  77288. return err
  77289. }
  77290. if x.NextPageToken == "" {
  77291. return nil
  77292. }
  77293. c.PageToken(x.NextPageToken)
  77294. }
  77295. }
  77296. // method id "compute.licenses.setIamPolicy":
  77297. type LicensesSetIamPolicyCall struct {
  77298. s *Service
  77299. project string
  77300. resource string
  77301. globalsetpolicyrequest *GlobalSetPolicyRequest
  77302. urlParams_ gensupport.URLParams
  77303. ctx_ context.Context
  77304. header_ http.Header
  77305. }
  77306. // SetIamPolicy: Sets the access control policy on the specified
  77307. // resource. Replaces any existing policy.
  77308. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  77309. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77310. c.project = project
  77311. c.resource = resource
  77312. c.globalsetpolicyrequest = globalsetpolicyrequest
  77313. return c
  77314. }
  77315. // Fields allows partial responses to be retrieved. See
  77316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77317. // for more information.
  77318. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  77319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77320. return c
  77321. }
  77322. // Context sets the context to be used in this call's Do method. Any
  77323. // pending HTTP request will be aborted if the provided context is
  77324. // canceled.
  77325. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  77326. c.ctx_ = ctx
  77327. return c
  77328. }
  77329. // Header returns an http.Header that can be modified by the caller to
  77330. // add HTTP headers to the request.
  77331. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  77332. if c.header_ == nil {
  77333. c.header_ = make(http.Header)
  77334. }
  77335. return c.header_
  77336. }
  77337. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77338. reqHeaders := make(http.Header)
  77339. for k, v := range c.header_ {
  77340. reqHeaders[k] = v
  77341. }
  77342. reqHeaders.Set("User-Agent", c.s.userAgent())
  77343. var body io.Reader = nil
  77344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  77345. if err != nil {
  77346. return nil, err
  77347. }
  77348. reqHeaders.Set("Content-Type", "application/json")
  77349. c.urlParams_.Set("alt", alt)
  77350. c.urlParams_.Set("prettyPrint", "false")
  77351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  77352. urls += "?" + c.urlParams_.Encode()
  77353. req, err := http.NewRequest("POST", urls, body)
  77354. if err != nil {
  77355. return nil, err
  77356. }
  77357. req.Header = reqHeaders
  77358. googleapi.Expand(req.URL, map[string]string{
  77359. "project": c.project,
  77360. "resource": c.resource,
  77361. })
  77362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77363. }
  77364. // Do executes the "compute.licenses.setIamPolicy" call.
  77365. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77366. // code is an error. Response headers are in either
  77367. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77368. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77369. // check whether the returned error was because http.StatusNotModified
  77370. // was returned.
  77371. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77372. gensupport.SetOptions(c.urlParams_, opts...)
  77373. res, err := c.doRequest("json")
  77374. if res != nil && res.StatusCode == http.StatusNotModified {
  77375. if res.Body != nil {
  77376. res.Body.Close()
  77377. }
  77378. return nil, &googleapi.Error{
  77379. Code: res.StatusCode,
  77380. Header: res.Header,
  77381. }
  77382. }
  77383. if err != nil {
  77384. return nil, err
  77385. }
  77386. defer googleapi.CloseBody(res)
  77387. if err := googleapi.CheckResponse(res); err != nil {
  77388. return nil, err
  77389. }
  77390. ret := &Policy{
  77391. ServerResponse: googleapi.ServerResponse{
  77392. Header: res.Header,
  77393. HTTPStatusCode: res.StatusCode,
  77394. },
  77395. }
  77396. target := &ret
  77397. if err := gensupport.DecodeResponse(target, res); err != nil {
  77398. return nil, err
  77399. }
  77400. return ret, nil
  77401. // {
  77402. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  77403. // "httpMethod": "POST",
  77404. // "id": "compute.licenses.setIamPolicy",
  77405. // "parameterOrder": [
  77406. // "project",
  77407. // "resource"
  77408. // ],
  77409. // "parameters": {
  77410. // "project": {
  77411. // "description": "Project ID for this request.",
  77412. // "location": "path",
  77413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77414. // "required": true,
  77415. // "type": "string"
  77416. // },
  77417. // "resource": {
  77418. // "description": "Name or id of the resource for this request.",
  77419. // "location": "path",
  77420. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77421. // "required": true,
  77422. // "type": "string"
  77423. // }
  77424. // },
  77425. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  77426. // "request": {
  77427. // "$ref": "GlobalSetPolicyRequest"
  77428. // },
  77429. // "response": {
  77430. // "$ref": "Policy"
  77431. // },
  77432. // "scopes": [
  77433. // "https://www.googleapis.com/auth/cloud-platform",
  77434. // "https://www.googleapis.com/auth/compute"
  77435. // ]
  77436. // }
  77437. }
  77438. // method id "compute.licenses.testIamPermissions":
  77439. type LicensesTestIamPermissionsCall struct {
  77440. s *Service
  77441. project string
  77442. resource string
  77443. testpermissionsrequest *TestPermissionsRequest
  77444. urlParams_ gensupport.URLParams
  77445. ctx_ context.Context
  77446. header_ http.Header
  77447. }
  77448. // TestIamPermissions: Returns permissions that a caller has on the
  77449. // specified resource.
  77450. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  77451. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77452. c.project = project
  77453. c.resource = resource
  77454. c.testpermissionsrequest = testpermissionsrequest
  77455. return c
  77456. }
  77457. // Fields allows partial responses to be retrieved. See
  77458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77459. // for more information.
  77460. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  77461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77462. return c
  77463. }
  77464. // Context sets the context to be used in this call's Do method. Any
  77465. // pending HTTP request will be aborted if the provided context is
  77466. // canceled.
  77467. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  77468. c.ctx_ = ctx
  77469. return c
  77470. }
  77471. // Header returns an http.Header that can be modified by the caller to
  77472. // add HTTP headers to the request.
  77473. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  77474. if c.header_ == nil {
  77475. c.header_ = make(http.Header)
  77476. }
  77477. return c.header_
  77478. }
  77479. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  77480. reqHeaders := make(http.Header)
  77481. for k, v := range c.header_ {
  77482. reqHeaders[k] = v
  77483. }
  77484. reqHeaders.Set("User-Agent", c.s.userAgent())
  77485. var body io.Reader = nil
  77486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  77487. if err != nil {
  77488. return nil, err
  77489. }
  77490. reqHeaders.Set("Content-Type", "application/json")
  77491. c.urlParams_.Set("alt", alt)
  77492. c.urlParams_.Set("prettyPrint", "false")
  77493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  77494. urls += "?" + c.urlParams_.Encode()
  77495. req, err := http.NewRequest("POST", urls, body)
  77496. if err != nil {
  77497. return nil, err
  77498. }
  77499. req.Header = reqHeaders
  77500. googleapi.Expand(req.URL, map[string]string{
  77501. "project": c.project,
  77502. "resource": c.resource,
  77503. })
  77504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77505. }
  77506. // Do executes the "compute.licenses.testIamPermissions" call.
  77507. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  77508. // non-2xx status code is an error. Response headers are in either
  77509. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  77510. // returned at all) in error.(*googleapi.Error).Header. Use
  77511. // googleapi.IsNotModified to check whether the returned error was
  77512. // because http.StatusNotModified was returned.
  77513. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  77514. gensupport.SetOptions(c.urlParams_, opts...)
  77515. res, err := c.doRequest("json")
  77516. if res != nil && res.StatusCode == http.StatusNotModified {
  77517. if res.Body != nil {
  77518. res.Body.Close()
  77519. }
  77520. return nil, &googleapi.Error{
  77521. Code: res.StatusCode,
  77522. Header: res.Header,
  77523. }
  77524. }
  77525. if err != nil {
  77526. return nil, err
  77527. }
  77528. defer googleapi.CloseBody(res)
  77529. if err := googleapi.CheckResponse(res); err != nil {
  77530. return nil, err
  77531. }
  77532. ret := &TestPermissionsResponse{
  77533. ServerResponse: googleapi.ServerResponse{
  77534. Header: res.Header,
  77535. HTTPStatusCode: res.StatusCode,
  77536. },
  77537. }
  77538. target := &ret
  77539. if err := gensupport.DecodeResponse(target, res); err != nil {
  77540. return nil, err
  77541. }
  77542. return ret, nil
  77543. // {
  77544. // "description": "Returns permissions that a caller has on the specified resource.",
  77545. // "httpMethod": "POST",
  77546. // "id": "compute.licenses.testIamPermissions",
  77547. // "parameterOrder": [
  77548. // "project",
  77549. // "resource"
  77550. // ],
  77551. // "parameters": {
  77552. // "project": {
  77553. // "description": "Project ID for this request.",
  77554. // "location": "path",
  77555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77556. // "required": true,
  77557. // "type": "string"
  77558. // },
  77559. // "resource": {
  77560. // "description": "Name or id of the resource for this request.",
  77561. // "location": "path",
  77562. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77563. // "required": true,
  77564. // "type": "string"
  77565. // }
  77566. // },
  77567. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  77568. // "request": {
  77569. // "$ref": "TestPermissionsRequest"
  77570. // },
  77571. // "response": {
  77572. // "$ref": "TestPermissionsResponse"
  77573. // },
  77574. // "scopes": [
  77575. // "https://www.googleapis.com/auth/cloud-platform",
  77576. // "https://www.googleapis.com/auth/compute",
  77577. // "https://www.googleapis.com/auth/compute.readonly"
  77578. // ]
  77579. // }
  77580. }
  77581. // method id "compute.machineImages.delete":
  77582. type MachineImagesDeleteCall struct {
  77583. s *Service
  77584. project string
  77585. machineImage string
  77586. urlParams_ gensupport.URLParams
  77587. ctx_ context.Context
  77588. header_ http.Header
  77589. }
  77590. // Delete: Deletes the specified machine image. Deleting a machine image
  77591. // is permanent and cannot be undone.
  77592. func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall {
  77593. c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77594. c.project = project
  77595. c.machineImage = machineImage
  77596. return c
  77597. }
  77598. // RequestId sets the optional parameter "requestId": An optional
  77599. // request ID to identify requests. Specify a unique request ID so that
  77600. // if you must retry your request, the server will know to ignore the
  77601. // request if it has already been completed.
  77602. //
  77603. // For example, consider a situation where you make an initial request
  77604. // and the request times out. If you make the request again with the
  77605. // same request ID, the server can check if original operation with the
  77606. // same request ID was received, and if so, will ignore the second
  77607. // request. This prevents clients from accidentally creating duplicate
  77608. // commitments.
  77609. //
  77610. // The request ID must be a valid UUID with the exception that zero UUID
  77611. // is not supported (00000000-0000-0000-0000-000000000000).
  77612. func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall {
  77613. c.urlParams_.Set("requestId", requestId)
  77614. return c
  77615. }
  77616. // Fields allows partial responses to be retrieved. See
  77617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77618. // for more information.
  77619. func (c *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall {
  77620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77621. return c
  77622. }
  77623. // Context sets the context to be used in this call's Do method. Any
  77624. // pending HTTP request will be aborted if the provided context is
  77625. // canceled.
  77626. func (c *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall {
  77627. c.ctx_ = ctx
  77628. return c
  77629. }
  77630. // Header returns an http.Header that can be modified by the caller to
  77631. // add HTTP headers to the request.
  77632. func (c *MachineImagesDeleteCall) Header() http.Header {
  77633. if c.header_ == nil {
  77634. c.header_ = make(http.Header)
  77635. }
  77636. return c.header_
  77637. }
  77638. func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  77639. reqHeaders := make(http.Header)
  77640. for k, v := range c.header_ {
  77641. reqHeaders[k] = v
  77642. }
  77643. reqHeaders.Set("User-Agent", c.s.userAgent())
  77644. var body io.Reader = nil
  77645. c.urlParams_.Set("alt", alt)
  77646. c.urlParams_.Set("prettyPrint", "false")
  77647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  77648. urls += "?" + c.urlParams_.Encode()
  77649. req, err := http.NewRequest("DELETE", urls, body)
  77650. if err != nil {
  77651. return nil, err
  77652. }
  77653. req.Header = reqHeaders
  77654. googleapi.Expand(req.URL, map[string]string{
  77655. "project": c.project,
  77656. "machineImage": c.machineImage,
  77657. })
  77658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77659. }
  77660. // Do executes the "compute.machineImages.delete" call.
  77661. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77662. // status code is an error. Response headers are in either
  77663. // *Operation.ServerResponse.Header or (if a response was returned at
  77664. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77665. // to check whether the returned error was because
  77666. // http.StatusNotModified was returned.
  77667. func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77668. gensupport.SetOptions(c.urlParams_, opts...)
  77669. res, err := c.doRequest("json")
  77670. if res != nil && res.StatusCode == http.StatusNotModified {
  77671. if res.Body != nil {
  77672. res.Body.Close()
  77673. }
  77674. return nil, &googleapi.Error{
  77675. Code: res.StatusCode,
  77676. Header: res.Header,
  77677. }
  77678. }
  77679. if err != nil {
  77680. return nil, err
  77681. }
  77682. defer googleapi.CloseBody(res)
  77683. if err := googleapi.CheckResponse(res); err != nil {
  77684. return nil, err
  77685. }
  77686. ret := &Operation{
  77687. ServerResponse: googleapi.ServerResponse{
  77688. Header: res.Header,
  77689. HTTPStatusCode: res.StatusCode,
  77690. },
  77691. }
  77692. target := &ret
  77693. if err := gensupport.DecodeResponse(target, res); err != nil {
  77694. return nil, err
  77695. }
  77696. return ret, nil
  77697. // {
  77698. // "description": "Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone.",
  77699. // "httpMethod": "DELETE",
  77700. // "id": "compute.machineImages.delete",
  77701. // "parameterOrder": [
  77702. // "project",
  77703. // "machineImage"
  77704. // ],
  77705. // "parameters": {
  77706. // "machineImage": {
  77707. // "description": "The name of the machine image to delete.",
  77708. // "location": "path",
  77709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77710. // "required": true,
  77711. // "type": "string"
  77712. // },
  77713. // "project": {
  77714. // "description": "Project ID for this request.",
  77715. // "location": "path",
  77716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77717. // "required": true,
  77718. // "type": "string"
  77719. // },
  77720. // "requestId": {
  77721. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77722. // "location": "query",
  77723. // "type": "string"
  77724. // }
  77725. // },
  77726. // "path": "{project}/global/machineImages/{machineImage}",
  77727. // "response": {
  77728. // "$ref": "Operation"
  77729. // },
  77730. // "scopes": [
  77731. // "https://www.googleapis.com/auth/cloud-platform",
  77732. // "https://www.googleapis.com/auth/compute"
  77733. // ]
  77734. // }
  77735. }
  77736. // method id "compute.machineImages.get":
  77737. type MachineImagesGetCall struct {
  77738. s *Service
  77739. project string
  77740. machineImage string
  77741. urlParams_ gensupport.URLParams
  77742. ifNoneMatch_ string
  77743. ctx_ context.Context
  77744. header_ http.Header
  77745. }
  77746. // Get: Returns the specified machine image. Gets a list of available
  77747. // machine images by making a list() request.
  77748. func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall {
  77749. c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77750. c.project = project
  77751. c.machineImage = machineImage
  77752. return c
  77753. }
  77754. // Fields allows partial responses to be retrieved. See
  77755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77756. // for more information.
  77757. func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall {
  77758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77759. return c
  77760. }
  77761. // IfNoneMatch sets the optional parameter which makes the operation
  77762. // fail if the object's ETag matches the given value. This is useful for
  77763. // getting updates only after the object has changed since the last
  77764. // request. Use googleapi.IsNotModified to check whether the response
  77765. // error from Do is the result of In-None-Match.
  77766. func (c *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall {
  77767. c.ifNoneMatch_ = entityTag
  77768. return c
  77769. }
  77770. // Context sets the context to be used in this call's Do method. Any
  77771. // pending HTTP request will be aborted if the provided context is
  77772. // canceled.
  77773. func (c *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall {
  77774. c.ctx_ = ctx
  77775. return c
  77776. }
  77777. // Header returns an http.Header that can be modified by the caller to
  77778. // add HTTP headers to the request.
  77779. func (c *MachineImagesGetCall) Header() http.Header {
  77780. if c.header_ == nil {
  77781. c.header_ = make(http.Header)
  77782. }
  77783. return c.header_
  77784. }
  77785. func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) {
  77786. reqHeaders := make(http.Header)
  77787. for k, v := range c.header_ {
  77788. reqHeaders[k] = v
  77789. }
  77790. reqHeaders.Set("User-Agent", c.s.userAgent())
  77791. if c.ifNoneMatch_ != "" {
  77792. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77793. }
  77794. var body io.Reader = nil
  77795. c.urlParams_.Set("alt", alt)
  77796. c.urlParams_.Set("prettyPrint", "false")
  77797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  77798. urls += "?" + c.urlParams_.Encode()
  77799. req, err := http.NewRequest("GET", urls, body)
  77800. if err != nil {
  77801. return nil, err
  77802. }
  77803. req.Header = reqHeaders
  77804. googleapi.Expand(req.URL, map[string]string{
  77805. "project": c.project,
  77806. "machineImage": c.machineImage,
  77807. })
  77808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77809. }
  77810. // Do executes the "compute.machineImages.get" call.
  77811. // Exactly one of *MachineImage or error will be non-nil. Any non-2xx
  77812. // status code is an error. Response headers are in either
  77813. // *MachineImage.ServerResponse.Header or (if a response was returned at
  77814. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77815. // to check whether the returned error was because
  77816. // http.StatusNotModified was returned.
  77817. func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, error) {
  77818. gensupport.SetOptions(c.urlParams_, opts...)
  77819. res, err := c.doRequest("json")
  77820. if res != nil && res.StatusCode == http.StatusNotModified {
  77821. if res.Body != nil {
  77822. res.Body.Close()
  77823. }
  77824. return nil, &googleapi.Error{
  77825. Code: res.StatusCode,
  77826. Header: res.Header,
  77827. }
  77828. }
  77829. if err != nil {
  77830. return nil, err
  77831. }
  77832. defer googleapi.CloseBody(res)
  77833. if err := googleapi.CheckResponse(res); err != nil {
  77834. return nil, err
  77835. }
  77836. ret := &MachineImage{
  77837. ServerResponse: googleapi.ServerResponse{
  77838. Header: res.Header,
  77839. HTTPStatusCode: res.StatusCode,
  77840. },
  77841. }
  77842. target := &ret
  77843. if err := gensupport.DecodeResponse(target, res); err != nil {
  77844. return nil, err
  77845. }
  77846. return ret, nil
  77847. // {
  77848. // "description": "Returns the specified machine image. Gets a list of available machine images by making a list() request.",
  77849. // "httpMethod": "GET",
  77850. // "id": "compute.machineImages.get",
  77851. // "parameterOrder": [
  77852. // "project",
  77853. // "machineImage"
  77854. // ],
  77855. // "parameters": {
  77856. // "machineImage": {
  77857. // "description": "The name of the machine image.",
  77858. // "location": "path",
  77859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77860. // "required": true,
  77861. // "type": "string"
  77862. // },
  77863. // "project": {
  77864. // "description": "Project ID for this request.",
  77865. // "location": "path",
  77866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77867. // "required": true,
  77868. // "type": "string"
  77869. // }
  77870. // },
  77871. // "path": "{project}/global/machineImages/{machineImage}",
  77872. // "response": {
  77873. // "$ref": "MachineImage"
  77874. // },
  77875. // "scopes": [
  77876. // "https://www.googleapis.com/auth/cloud-platform",
  77877. // "https://www.googleapis.com/auth/compute",
  77878. // "https://www.googleapis.com/auth/compute.readonly"
  77879. // ]
  77880. // }
  77881. }
  77882. // method id "compute.machineImages.getIamPolicy":
  77883. type MachineImagesGetIamPolicyCall struct {
  77884. s *Service
  77885. project string
  77886. resource string
  77887. urlParams_ gensupport.URLParams
  77888. ifNoneMatch_ string
  77889. ctx_ context.Context
  77890. header_ http.Header
  77891. }
  77892. // GetIamPolicy: Gets the access control policy for a resource. May be
  77893. // empty if no such policy or resource exists.
  77894. func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall {
  77895. c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77896. c.project = project
  77897. c.resource = resource
  77898. return c
  77899. }
  77900. // Fields allows partial responses to be retrieved. See
  77901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77902. // for more information.
  77903. func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall {
  77904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77905. return c
  77906. }
  77907. // IfNoneMatch sets the optional parameter which makes the operation
  77908. // fail if the object's ETag matches the given value. This is useful for
  77909. // getting updates only after the object has changed since the last
  77910. // request. Use googleapi.IsNotModified to check whether the response
  77911. // error from Do is the result of In-None-Match.
  77912. func (c *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall {
  77913. c.ifNoneMatch_ = entityTag
  77914. return c
  77915. }
  77916. // Context sets the context to be used in this call's Do method. Any
  77917. // pending HTTP request will be aborted if the provided context is
  77918. // canceled.
  77919. func (c *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall {
  77920. c.ctx_ = ctx
  77921. return c
  77922. }
  77923. // Header returns an http.Header that can be modified by the caller to
  77924. // add HTTP headers to the request.
  77925. func (c *MachineImagesGetIamPolicyCall) Header() http.Header {
  77926. if c.header_ == nil {
  77927. c.header_ = make(http.Header)
  77928. }
  77929. return c.header_
  77930. }
  77931. func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77932. reqHeaders := make(http.Header)
  77933. for k, v := range c.header_ {
  77934. reqHeaders[k] = v
  77935. }
  77936. reqHeaders.Set("User-Agent", c.s.userAgent())
  77937. if c.ifNoneMatch_ != "" {
  77938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77939. }
  77940. var body io.Reader = nil
  77941. c.urlParams_.Set("alt", alt)
  77942. c.urlParams_.Set("prettyPrint", "false")
  77943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/getIamPolicy")
  77944. urls += "?" + c.urlParams_.Encode()
  77945. req, err := http.NewRequest("GET", urls, body)
  77946. if err != nil {
  77947. return nil, err
  77948. }
  77949. req.Header = reqHeaders
  77950. googleapi.Expand(req.URL, map[string]string{
  77951. "project": c.project,
  77952. "resource": c.resource,
  77953. })
  77954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77955. }
  77956. // Do executes the "compute.machineImages.getIamPolicy" call.
  77957. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77958. // code is an error. Response headers are in either
  77959. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77960. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77961. // check whether the returned error was because http.StatusNotModified
  77962. // was returned.
  77963. func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77964. gensupport.SetOptions(c.urlParams_, opts...)
  77965. res, err := c.doRequest("json")
  77966. if res != nil && res.StatusCode == http.StatusNotModified {
  77967. if res.Body != nil {
  77968. res.Body.Close()
  77969. }
  77970. return nil, &googleapi.Error{
  77971. Code: res.StatusCode,
  77972. Header: res.Header,
  77973. }
  77974. }
  77975. if err != nil {
  77976. return nil, err
  77977. }
  77978. defer googleapi.CloseBody(res)
  77979. if err := googleapi.CheckResponse(res); err != nil {
  77980. return nil, err
  77981. }
  77982. ret := &Policy{
  77983. ServerResponse: googleapi.ServerResponse{
  77984. Header: res.Header,
  77985. HTTPStatusCode: res.StatusCode,
  77986. },
  77987. }
  77988. target := &ret
  77989. if err := gensupport.DecodeResponse(target, res); err != nil {
  77990. return nil, err
  77991. }
  77992. return ret, nil
  77993. // {
  77994. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  77995. // "httpMethod": "GET",
  77996. // "id": "compute.machineImages.getIamPolicy",
  77997. // "parameterOrder": [
  77998. // "project",
  77999. // "resource"
  78000. // ],
  78001. // "parameters": {
  78002. // "project": {
  78003. // "description": "Project ID for this request.",
  78004. // "location": "path",
  78005. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78006. // "required": true,
  78007. // "type": "string"
  78008. // },
  78009. // "resource": {
  78010. // "description": "Name or id of the resource for this request.",
  78011. // "location": "path",
  78012. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78013. // "required": true,
  78014. // "type": "string"
  78015. // }
  78016. // },
  78017. // "path": "{project}/global/machineImages/{resource}/getIamPolicy",
  78018. // "response": {
  78019. // "$ref": "Policy"
  78020. // },
  78021. // "scopes": [
  78022. // "https://www.googleapis.com/auth/cloud-platform",
  78023. // "https://www.googleapis.com/auth/compute",
  78024. // "https://www.googleapis.com/auth/compute.readonly"
  78025. // ]
  78026. // }
  78027. }
  78028. // method id "compute.machineImages.insert":
  78029. type MachineImagesInsertCall struct {
  78030. s *Service
  78031. project string
  78032. machineimage *MachineImage
  78033. urlParams_ gensupport.URLParams
  78034. ctx_ context.Context
  78035. header_ http.Header
  78036. }
  78037. // Insert: Creates a machine image in the specified project using the
  78038. // data that is included in the request. If you are creating a new
  78039. // machine image to update an existing instance, your new machine image
  78040. // should use the same network or, if applicable, the same subnetwork as
  78041. // the original instance.
  78042. func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall {
  78043. c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78044. c.project = project
  78045. c.machineimage = machineimage
  78046. return c
  78047. }
  78048. // RequestId sets the optional parameter "requestId": An optional
  78049. // request ID to identify requests. Specify a unique request ID so that
  78050. // if you must retry your request, the server will know to ignore the
  78051. // request if it has already been completed.
  78052. //
  78053. // For example, consider a situation where you make an initial request
  78054. // and the request times out. If you make the request again with the
  78055. // same request ID, the server can check if original operation with the
  78056. // same request ID was received, and if so, will ignore the second
  78057. // request. This prevents clients from accidentally creating duplicate
  78058. // commitments.
  78059. //
  78060. // The request ID must be a valid UUID with the exception that zero UUID
  78061. // is not supported (00000000-0000-0000-0000-000000000000).
  78062. func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall {
  78063. c.urlParams_.Set("requestId", requestId)
  78064. return c
  78065. }
  78066. // SourceInstance sets the optional parameter "sourceInstance":
  78067. // Required. Source instance that is used to create the machine image
  78068. // from.
  78069. func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall {
  78070. c.urlParams_.Set("sourceInstance", sourceInstance)
  78071. return c
  78072. }
  78073. // Fields allows partial responses to be retrieved. See
  78074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78075. // for more information.
  78076. func (c *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall {
  78077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78078. return c
  78079. }
  78080. // Context sets the context to be used in this call's Do method. Any
  78081. // pending HTTP request will be aborted if the provided context is
  78082. // canceled.
  78083. func (c *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall {
  78084. c.ctx_ = ctx
  78085. return c
  78086. }
  78087. // Header returns an http.Header that can be modified by the caller to
  78088. // add HTTP headers to the request.
  78089. func (c *MachineImagesInsertCall) Header() http.Header {
  78090. if c.header_ == nil {
  78091. c.header_ = make(http.Header)
  78092. }
  78093. return c.header_
  78094. }
  78095. func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  78096. reqHeaders := make(http.Header)
  78097. for k, v := range c.header_ {
  78098. reqHeaders[k] = v
  78099. }
  78100. reqHeaders.Set("User-Agent", c.s.userAgent())
  78101. var body io.Reader = nil
  78102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage)
  78103. if err != nil {
  78104. return nil, err
  78105. }
  78106. reqHeaders.Set("Content-Type", "application/json")
  78107. c.urlParams_.Set("alt", alt)
  78108. c.urlParams_.Set("prettyPrint", "false")
  78109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  78110. urls += "?" + c.urlParams_.Encode()
  78111. req, err := http.NewRequest("POST", urls, body)
  78112. if err != nil {
  78113. return nil, err
  78114. }
  78115. req.Header = reqHeaders
  78116. googleapi.Expand(req.URL, map[string]string{
  78117. "project": c.project,
  78118. })
  78119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78120. }
  78121. // Do executes the "compute.machineImages.insert" call.
  78122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78123. // status code is an error. Response headers are in either
  78124. // *Operation.ServerResponse.Header or (if a response was returned at
  78125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78126. // to check whether the returned error was because
  78127. // http.StatusNotModified was returned.
  78128. func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78129. gensupport.SetOptions(c.urlParams_, opts...)
  78130. res, err := c.doRequest("json")
  78131. if res != nil && res.StatusCode == http.StatusNotModified {
  78132. if res.Body != nil {
  78133. res.Body.Close()
  78134. }
  78135. return nil, &googleapi.Error{
  78136. Code: res.StatusCode,
  78137. Header: res.Header,
  78138. }
  78139. }
  78140. if err != nil {
  78141. return nil, err
  78142. }
  78143. defer googleapi.CloseBody(res)
  78144. if err := googleapi.CheckResponse(res); err != nil {
  78145. return nil, err
  78146. }
  78147. ret := &Operation{
  78148. ServerResponse: googleapi.ServerResponse{
  78149. Header: res.Header,
  78150. HTTPStatusCode: res.StatusCode,
  78151. },
  78152. }
  78153. target := &ret
  78154. if err := gensupport.DecodeResponse(target, res); err != nil {
  78155. return nil, err
  78156. }
  78157. return ret, nil
  78158. // {
  78159. // "description": "Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance.",
  78160. // "httpMethod": "POST",
  78161. // "id": "compute.machineImages.insert",
  78162. // "parameterOrder": [
  78163. // "project"
  78164. // ],
  78165. // "parameters": {
  78166. // "project": {
  78167. // "description": "Project ID for this request.",
  78168. // "location": "path",
  78169. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78170. // "required": true,
  78171. // "type": "string"
  78172. // },
  78173. // "requestId": {
  78174. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78175. // "location": "query",
  78176. // "type": "string"
  78177. // },
  78178. // "sourceInstance": {
  78179. // "description": "Required. Source instance that is used to create the machine image from.",
  78180. // "location": "query",
  78181. // "type": "string"
  78182. // }
  78183. // },
  78184. // "path": "{project}/global/machineImages",
  78185. // "request": {
  78186. // "$ref": "MachineImage"
  78187. // },
  78188. // "response": {
  78189. // "$ref": "Operation"
  78190. // },
  78191. // "scopes": [
  78192. // "https://www.googleapis.com/auth/cloud-platform",
  78193. // "https://www.googleapis.com/auth/compute"
  78194. // ]
  78195. // }
  78196. }
  78197. // method id "compute.machineImages.list":
  78198. type MachineImagesListCall struct {
  78199. s *Service
  78200. project string
  78201. urlParams_ gensupport.URLParams
  78202. ifNoneMatch_ string
  78203. ctx_ context.Context
  78204. header_ http.Header
  78205. }
  78206. // List: Retrieves a list of machine images that are contained within
  78207. // the specified project.
  78208. func (r *MachineImagesService) List(project string) *MachineImagesListCall {
  78209. c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78210. c.project = project
  78211. return c
  78212. }
  78213. // Filter sets the optional parameter "filter": A filter expression that
  78214. // filters resources listed in the response. The expression must specify
  78215. // the field name, a comparison operator, and the value that you want to
  78216. // use for filtering. The value must be a string, a number, or a
  78217. // boolean. The comparison operator must be either =, !=, >, or <.
  78218. //
  78219. // For example, if you are filtering Compute Engine instances, you can
  78220. // exclude instances named example-instance by specifying name !=
  78221. // example-instance.
  78222. //
  78223. // You can also filter nested fields. For example, you could specify
  78224. // scheduling.automaticRestart = false to include instances only if they
  78225. // are not scheduled for automatic restarts. You can use filtering on
  78226. // nested fields to filter based on resource labels.
  78227. //
  78228. // To filter on multiple expressions, provide each separate expression
  78229. // within parentheses. For example, (scheduling.automaticRestart = true)
  78230. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78231. // AND expression. However, you can include AND and OR expressions
  78232. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78233. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78234. // true).
  78235. func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall {
  78236. c.urlParams_.Set("filter", filter)
  78237. return c
  78238. }
  78239. // MaxResults sets the optional parameter "maxResults": The maximum
  78240. // number of results per page that should be returned. If the number of
  78241. // available results is larger than maxResults, Compute Engine returns a
  78242. // nextPageToken that can be used to get the next page of results in
  78243. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78244. // (Default: 500)
  78245. func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall {
  78246. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78247. return c
  78248. }
  78249. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78250. // a certain order. By default, results are returned in alphanumerical
  78251. // order based on the resource name.
  78252. //
  78253. // You can also sort results in descending order based on the creation
  78254. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78255. // based on the creationTimestamp field in reverse chronological order
  78256. // (newest result first). Use this to sort resources like operations so
  78257. // that the newest operation is returned first.
  78258. //
  78259. // Currently, only sorting by name or creationTimestamp desc is
  78260. // supported.
  78261. func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall {
  78262. c.urlParams_.Set("orderBy", orderBy)
  78263. return c
  78264. }
  78265. // PageToken sets the optional parameter "pageToken": Specifies a page
  78266. // token to use. Set pageToken to the nextPageToken returned by a
  78267. // previous list request to get the next page of results.
  78268. func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall {
  78269. c.urlParams_.Set("pageToken", pageToken)
  78270. return c
  78271. }
  78272. // Fields allows partial responses to be retrieved. See
  78273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78274. // for more information.
  78275. func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall {
  78276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78277. return c
  78278. }
  78279. // IfNoneMatch sets the optional parameter which makes the operation
  78280. // fail if the object's ETag matches the given value. This is useful for
  78281. // getting updates only after the object has changed since the last
  78282. // request. Use googleapi.IsNotModified to check whether the response
  78283. // error from Do is the result of In-None-Match.
  78284. func (c *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall {
  78285. c.ifNoneMatch_ = entityTag
  78286. return c
  78287. }
  78288. // Context sets the context to be used in this call's Do method. Any
  78289. // pending HTTP request will be aborted if the provided context is
  78290. // canceled.
  78291. func (c *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall {
  78292. c.ctx_ = ctx
  78293. return c
  78294. }
  78295. // Header returns an http.Header that can be modified by the caller to
  78296. // add HTTP headers to the request.
  78297. func (c *MachineImagesListCall) Header() http.Header {
  78298. if c.header_ == nil {
  78299. c.header_ = make(http.Header)
  78300. }
  78301. return c.header_
  78302. }
  78303. func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) {
  78304. reqHeaders := make(http.Header)
  78305. for k, v := range c.header_ {
  78306. reqHeaders[k] = v
  78307. }
  78308. reqHeaders.Set("User-Agent", c.s.userAgent())
  78309. if c.ifNoneMatch_ != "" {
  78310. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78311. }
  78312. var body io.Reader = nil
  78313. c.urlParams_.Set("alt", alt)
  78314. c.urlParams_.Set("prettyPrint", "false")
  78315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  78316. urls += "?" + c.urlParams_.Encode()
  78317. req, err := http.NewRequest("GET", urls, body)
  78318. if err != nil {
  78319. return nil, err
  78320. }
  78321. req.Header = reqHeaders
  78322. googleapi.Expand(req.URL, map[string]string{
  78323. "project": c.project,
  78324. })
  78325. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78326. }
  78327. // Do executes the "compute.machineImages.list" call.
  78328. // Exactly one of *MachineImageList or error will be non-nil. Any
  78329. // non-2xx status code is an error. Response headers are in either
  78330. // *MachineImageList.ServerResponse.Header or (if a response was
  78331. // returned at all) in error.(*googleapi.Error).Header. Use
  78332. // googleapi.IsNotModified to check whether the returned error was
  78333. // because http.StatusNotModified was returned.
  78334. func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, error) {
  78335. gensupport.SetOptions(c.urlParams_, opts...)
  78336. res, err := c.doRequest("json")
  78337. if res != nil && res.StatusCode == http.StatusNotModified {
  78338. if res.Body != nil {
  78339. res.Body.Close()
  78340. }
  78341. return nil, &googleapi.Error{
  78342. Code: res.StatusCode,
  78343. Header: res.Header,
  78344. }
  78345. }
  78346. if err != nil {
  78347. return nil, err
  78348. }
  78349. defer googleapi.CloseBody(res)
  78350. if err := googleapi.CheckResponse(res); err != nil {
  78351. return nil, err
  78352. }
  78353. ret := &MachineImageList{
  78354. ServerResponse: googleapi.ServerResponse{
  78355. Header: res.Header,
  78356. HTTPStatusCode: res.StatusCode,
  78357. },
  78358. }
  78359. target := &ret
  78360. if err := gensupport.DecodeResponse(target, res); err != nil {
  78361. return nil, err
  78362. }
  78363. return ret, nil
  78364. // {
  78365. // "description": "Retrieves a list of machine images that are contained within the specified project.",
  78366. // "httpMethod": "GET",
  78367. // "id": "compute.machineImages.list",
  78368. // "parameterOrder": [
  78369. // "project"
  78370. // ],
  78371. // "parameters": {
  78372. // "filter": {
  78373. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78374. // "location": "query",
  78375. // "type": "string"
  78376. // },
  78377. // "maxResults": {
  78378. // "default": "500",
  78379. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78380. // "format": "uint32",
  78381. // "location": "query",
  78382. // "minimum": "0",
  78383. // "type": "integer"
  78384. // },
  78385. // "orderBy": {
  78386. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78387. // "location": "query",
  78388. // "type": "string"
  78389. // },
  78390. // "pageToken": {
  78391. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78392. // "location": "query",
  78393. // "type": "string"
  78394. // },
  78395. // "project": {
  78396. // "description": "Project ID for this request.",
  78397. // "location": "path",
  78398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78399. // "required": true,
  78400. // "type": "string"
  78401. // }
  78402. // },
  78403. // "path": "{project}/global/machineImages",
  78404. // "response": {
  78405. // "$ref": "MachineImageList"
  78406. // },
  78407. // "scopes": [
  78408. // "https://www.googleapis.com/auth/cloud-platform",
  78409. // "https://www.googleapis.com/auth/compute",
  78410. // "https://www.googleapis.com/auth/compute.readonly"
  78411. // ]
  78412. // }
  78413. }
  78414. // Pages invokes f for each page of results.
  78415. // A non-nil error returned from f will halt the iteration.
  78416. // The provided context supersedes any context provided to the Context method.
  78417. func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) error) error {
  78418. c.ctx_ = ctx
  78419. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78420. for {
  78421. x, err := c.Do()
  78422. if err != nil {
  78423. return err
  78424. }
  78425. if err := f(x); err != nil {
  78426. return err
  78427. }
  78428. if x.NextPageToken == "" {
  78429. return nil
  78430. }
  78431. c.PageToken(x.NextPageToken)
  78432. }
  78433. }
  78434. // method id "compute.machineImages.setIamPolicy":
  78435. type MachineImagesSetIamPolicyCall struct {
  78436. s *Service
  78437. project string
  78438. resource string
  78439. globalsetpolicyrequest *GlobalSetPolicyRequest
  78440. urlParams_ gensupport.URLParams
  78441. ctx_ context.Context
  78442. header_ http.Header
  78443. }
  78444. // SetIamPolicy: Sets the access control policy on the specified
  78445. // resource. Replaces any existing policy.
  78446. func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall {
  78447. c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78448. c.project = project
  78449. c.resource = resource
  78450. c.globalsetpolicyrequest = globalsetpolicyrequest
  78451. return c
  78452. }
  78453. // Fields allows partial responses to be retrieved. See
  78454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78455. // for more information.
  78456. func (c *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall {
  78457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78458. return c
  78459. }
  78460. // Context sets the context to be used in this call's Do method. Any
  78461. // pending HTTP request will be aborted if the provided context is
  78462. // canceled.
  78463. func (c *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall {
  78464. c.ctx_ = ctx
  78465. return c
  78466. }
  78467. // Header returns an http.Header that can be modified by the caller to
  78468. // add HTTP headers to the request.
  78469. func (c *MachineImagesSetIamPolicyCall) Header() http.Header {
  78470. if c.header_ == nil {
  78471. c.header_ = make(http.Header)
  78472. }
  78473. return c.header_
  78474. }
  78475. func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  78476. reqHeaders := make(http.Header)
  78477. for k, v := range c.header_ {
  78478. reqHeaders[k] = v
  78479. }
  78480. reqHeaders.Set("User-Agent", c.s.userAgent())
  78481. var body io.Reader = nil
  78482. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  78483. if err != nil {
  78484. return nil, err
  78485. }
  78486. reqHeaders.Set("Content-Type", "application/json")
  78487. c.urlParams_.Set("alt", alt)
  78488. c.urlParams_.Set("prettyPrint", "false")
  78489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/setIamPolicy")
  78490. urls += "?" + c.urlParams_.Encode()
  78491. req, err := http.NewRequest("POST", urls, body)
  78492. if err != nil {
  78493. return nil, err
  78494. }
  78495. req.Header = reqHeaders
  78496. googleapi.Expand(req.URL, map[string]string{
  78497. "project": c.project,
  78498. "resource": c.resource,
  78499. })
  78500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78501. }
  78502. // Do executes the "compute.machineImages.setIamPolicy" call.
  78503. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  78504. // code is an error. Response headers are in either
  78505. // *Policy.ServerResponse.Header or (if a response was returned at all)
  78506. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78507. // check whether the returned error was because http.StatusNotModified
  78508. // was returned.
  78509. func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  78510. gensupport.SetOptions(c.urlParams_, opts...)
  78511. res, err := c.doRequest("json")
  78512. if res != nil && res.StatusCode == http.StatusNotModified {
  78513. if res.Body != nil {
  78514. res.Body.Close()
  78515. }
  78516. return nil, &googleapi.Error{
  78517. Code: res.StatusCode,
  78518. Header: res.Header,
  78519. }
  78520. }
  78521. if err != nil {
  78522. return nil, err
  78523. }
  78524. defer googleapi.CloseBody(res)
  78525. if err := googleapi.CheckResponse(res); err != nil {
  78526. return nil, err
  78527. }
  78528. ret := &Policy{
  78529. ServerResponse: googleapi.ServerResponse{
  78530. Header: res.Header,
  78531. HTTPStatusCode: res.StatusCode,
  78532. },
  78533. }
  78534. target := &ret
  78535. if err := gensupport.DecodeResponse(target, res); err != nil {
  78536. return nil, err
  78537. }
  78538. return ret, nil
  78539. // {
  78540. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  78541. // "httpMethod": "POST",
  78542. // "id": "compute.machineImages.setIamPolicy",
  78543. // "parameterOrder": [
  78544. // "project",
  78545. // "resource"
  78546. // ],
  78547. // "parameters": {
  78548. // "project": {
  78549. // "description": "Project ID for this request.",
  78550. // "location": "path",
  78551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78552. // "required": true,
  78553. // "type": "string"
  78554. // },
  78555. // "resource": {
  78556. // "description": "Name or id of the resource for this request.",
  78557. // "location": "path",
  78558. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78559. // "required": true,
  78560. // "type": "string"
  78561. // }
  78562. // },
  78563. // "path": "{project}/global/machineImages/{resource}/setIamPolicy",
  78564. // "request": {
  78565. // "$ref": "GlobalSetPolicyRequest"
  78566. // },
  78567. // "response": {
  78568. // "$ref": "Policy"
  78569. // },
  78570. // "scopes": [
  78571. // "https://www.googleapis.com/auth/cloud-platform",
  78572. // "https://www.googleapis.com/auth/compute"
  78573. // ]
  78574. // }
  78575. }
  78576. // method id "compute.machineImages.testIamPermissions":
  78577. type MachineImagesTestIamPermissionsCall struct {
  78578. s *Service
  78579. project string
  78580. resource string
  78581. testpermissionsrequest *TestPermissionsRequest
  78582. urlParams_ gensupport.URLParams
  78583. ctx_ context.Context
  78584. header_ http.Header
  78585. }
  78586. // TestIamPermissions: Returns permissions that a caller has on the
  78587. // specified resource.
  78588. func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall {
  78589. c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78590. c.project = project
  78591. c.resource = resource
  78592. c.testpermissionsrequest = testpermissionsrequest
  78593. return c
  78594. }
  78595. // Fields allows partial responses to be retrieved. See
  78596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78597. // for more information.
  78598. func (c *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall {
  78599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78600. return c
  78601. }
  78602. // Context sets the context to be used in this call's Do method. Any
  78603. // pending HTTP request will be aborted if the provided context is
  78604. // canceled.
  78605. func (c *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall {
  78606. c.ctx_ = ctx
  78607. return c
  78608. }
  78609. // Header returns an http.Header that can be modified by the caller to
  78610. // add HTTP headers to the request.
  78611. func (c *MachineImagesTestIamPermissionsCall) Header() http.Header {
  78612. if c.header_ == nil {
  78613. c.header_ = make(http.Header)
  78614. }
  78615. return c.header_
  78616. }
  78617. func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  78618. reqHeaders := make(http.Header)
  78619. for k, v := range c.header_ {
  78620. reqHeaders[k] = v
  78621. }
  78622. reqHeaders.Set("User-Agent", c.s.userAgent())
  78623. var body io.Reader = nil
  78624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  78625. if err != nil {
  78626. return nil, err
  78627. }
  78628. reqHeaders.Set("Content-Type", "application/json")
  78629. c.urlParams_.Set("alt", alt)
  78630. c.urlParams_.Set("prettyPrint", "false")
  78631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/testIamPermissions")
  78632. urls += "?" + c.urlParams_.Encode()
  78633. req, err := http.NewRequest("POST", urls, body)
  78634. if err != nil {
  78635. return nil, err
  78636. }
  78637. req.Header = reqHeaders
  78638. googleapi.Expand(req.URL, map[string]string{
  78639. "project": c.project,
  78640. "resource": c.resource,
  78641. })
  78642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78643. }
  78644. // Do executes the "compute.machineImages.testIamPermissions" call.
  78645. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  78646. // non-2xx status code is an error. Response headers are in either
  78647. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  78648. // returned at all) in error.(*googleapi.Error).Header. Use
  78649. // googleapi.IsNotModified to check whether the returned error was
  78650. // because http.StatusNotModified was returned.
  78651. func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  78652. gensupport.SetOptions(c.urlParams_, opts...)
  78653. res, err := c.doRequest("json")
  78654. if res != nil && res.StatusCode == http.StatusNotModified {
  78655. if res.Body != nil {
  78656. res.Body.Close()
  78657. }
  78658. return nil, &googleapi.Error{
  78659. Code: res.StatusCode,
  78660. Header: res.Header,
  78661. }
  78662. }
  78663. if err != nil {
  78664. return nil, err
  78665. }
  78666. defer googleapi.CloseBody(res)
  78667. if err := googleapi.CheckResponse(res); err != nil {
  78668. return nil, err
  78669. }
  78670. ret := &TestPermissionsResponse{
  78671. ServerResponse: googleapi.ServerResponse{
  78672. Header: res.Header,
  78673. HTTPStatusCode: res.StatusCode,
  78674. },
  78675. }
  78676. target := &ret
  78677. if err := gensupport.DecodeResponse(target, res); err != nil {
  78678. return nil, err
  78679. }
  78680. return ret, nil
  78681. // {
  78682. // "description": "Returns permissions that a caller has on the specified resource.",
  78683. // "httpMethod": "POST",
  78684. // "id": "compute.machineImages.testIamPermissions",
  78685. // "parameterOrder": [
  78686. // "project",
  78687. // "resource"
  78688. // ],
  78689. // "parameters": {
  78690. // "project": {
  78691. // "description": "Project ID for this request.",
  78692. // "location": "path",
  78693. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78694. // "required": true,
  78695. // "type": "string"
  78696. // },
  78697. // "resource": {
  78698. // "description": "Name or id of the resource for this request.",
  78699. // "location": "path",
  78700. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78701. // "required": true,
  78702. // "type": "string"
  78703. // }
  78704. // },
  78705. // "path": "{project}/global/machineImages/{resource}/testIamPermissions",
  78706. // "request": {
  78707. // "$ref": "TestPermissionsRequest"
  78708. // },
  78709. // "response": {
  78710. // "$ref": "TestPermissionsResponse"
  78711. // },
  78712. // "scopes": [
  78713. // "https://www.googleapis.com/auth/cloud-platform",
  78714. // "https://www.googleapis.com/auth/compute",
  78715. // "https://www.googleapis.com/auth/compute.readonly"
  78716. // ]
  78717. // }
  78718. }
  78719. // method id "compute.machineTypes.aggregatedList":
  78720. type MachineTypesAggregatedListCall struct {
  78721. s *Service
  78722. project string
  78723. urlParams_ gensupport.URLParams
  78724. ifNoneMatch_ string
  78725. ctx_ context.Context
  78726. header_ http.Header
  78727. }
  78728. // AggregatedList: Retrieves an aggregated list of machine types.
  78729. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  78730. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  78731. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78732. c.project = project
  78733. return c
  78734. }
  78735. // Filter sets the optional parameter "filter": A filter expression that
  78736. // filters resources listed in the response. The expression must specify
  78737. // the field name, a comparison operator, and the value that you want to
  78738. // use for filtering. The value must be a string, a number, or a
  78739. // boolean. The comparison operator must be either =, !=, >, or <.
  78740. //
  78741. // For example, if you are filtering Compute Engine instances, you can
  78742. // exclude instances named example-instance by specifying name !=
  78743. // example-instance.
  78744. //
  78745. // You can also filter nested fields. For example, you could specify
  78746. // scheduling.automaticRestart = false to include instances only if they
  78747. // are not scheduled for automatic restarts. You can use filtering on
  78748. // nested fields to filter based on resource labels.
  78749. //
  78750. // To filter on multiple expressions, provide each separate expression
  78751. // within parentheses. For example, (scheduling.automaticRestart = true)
  78752. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78753. // AND expression. However, you can include AND and OR expressions
  78754. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78755. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78756. // true).
  78757. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  78758. c.urlParams_.Set("filter", filter)
  78759. return c
  78760. }
  78761. // MaxResults sets the optional parameter "maxResults": The maximum
  78762. // number of results per page that should be returned. If the number of
  78763. // available results is larger than maxResults, Compute Engine returns a
  78764. // nextPageToken that can be used to get the next page of results in
  78765. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78766. // (Default: 500)
  78767. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  78768. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78769. return c
  78770. }
  78771. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78772. // a certain order. By default, results are returned in alphanumerical
  78773. // order based on the resource name.
  78774. //
  78775. // You can also sort results in descending order based on the creation
  78776. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78777. // based on the creationTimestamp field in reverse chronological order
  78778. // (newest result first). Use this to sort resources like operations so
  78779. // that the newest operation is returned first.
  78780. //
  78781. // Currently, only sorting by name or creationTimestamp desc is
  78782. // supported.
  78783. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  78784. c.urlParams_.Set("orderBy", orderBy)
  78785. return c
  78786. }
  78787. // PageToken sets the optional parameter "pageToken": Specifies a page
  78788. // token to use. Set pageToken to the nextPageToken returned by a
  78789. // previous list request to get the next page of results.
  78790. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  78791. c.urlParams_.Set("pageToken", pageToken)
  78792. return c
  78793. }
  78794. // Fields allows partial responses to be retrieved. See
  78795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78796. // for more information.
  78797. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  78798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78799. return c
  78800. }
  78801. // IfNoneMatch sets the optional parameter which makes the operation
  78802. // fail if the object's ETag matches the given value. This is useful for
  78803. // getting updates only after the object has changed since the last
  78804. // request. Use googleapi.IsNotModified to check whether the response
  78805. // error from Do is the result of In-None-Match.
  78806. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  78807. c.ifNoneMatch_ = entityTag
  78808. return c
  78809. }
  78810. // Context sets the context to be used in this call's Do method. Any
  78811. // pending HTTP request will be aborted if the provided context is
  78812. // canceled.
  78813. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  78814. c.ctx_ = ctx
  78815. return c
  78816. }
  78817. // Header returns an http.Header that can be modified by the caller to
  78818. // add HTTP headers to the request.
  78819. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  78820. if c.header_ == nil {
  78821. c.header_ = make(http.Header)
  78822. }
  78823. return c.header_
  78824. }
  78825. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  78826. reqHeaders := make(http.Header)
  78827. for k, v := range c.header_ {
  78828. reqHeaders[k] = v
  78829. }
  78830. reqHeaders.Set("User-Agent", c.s.userAgent())
  78831. if c.ifNoneMatch_ != "" {
  78832. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78833. }
  78834. var body io.Reader = nil
  78835. c.urlParams_.Set("alt", alt)
  78836. c.urlParams_.Set("prettyPrint", "false")
  78837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  78838. urls += "?" + c.urlParams_.Encode()
  78839. req, err := http.NewRequest("GET", urls, body)
  78840. if err != nil {
  78841. return nil, err
  78842. }
  78843. req.Header = reqHeaders
  78844. googleapi.Expand(req.URL, map[string]string{
  78845. "project": c.project,
  78846. })
  78847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78848. }
  78849. // Do executes the "compute.machineTypes.aggregatedList" call.
  78850. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  78851. // Any non-2xx status code is an error. Response headers are in either
  78852. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  78853. // was returned at all) in error.(*googleapi.Error).Header. Use
  78854. // googleapi.IsNotModified to check whether the returned error was
  78855. // because http.StatusNotModified was returned.
  78856. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  78857. gensupport.SetOptions(c.urlParams_, opts...)
  78858. res, err := c.doRequest("json")
  78859. if res != nil && res.StatusCode == http.StatusNotModified {
  78860. if res.Body != nil {
  78861. res.Body.Close()
  78862. }
  78863. return nil, &googleapi.Error{
  78864. Code: res.StatusCode,
  78865. Header: res.Header,
  78866. }
  78867. }
  78868. if err != nil {
  78869. return nil, err
  78870. }
  78871. defer googleapi.CloseBody(res)
  78872. if err := googleapi.CheckResponse(res); err != nil {
  78873. return nil, err
  78874. }
  78875. ret := &MachineTypeAggregatedList{
  78876. ServerResponse: googleapi.ServerResponse{
  78877. Header: res.Header,
  78878. HTTPStatusCode: res.StatusCode,
  78879. },
  78880. }
  78881. target := &ret
  78882. if err := gensupport.DecodeResponse(target, res); err != nil {
  78883. return nil, err
  78884. }
  78885. return ret, nil
  78886. // {
  78887. // "description": "Retrieves an aggregated list of machine types.",
  78888. // "httpMethod": "GET",
  78889. // "id": "compute.machineTypes.aggregatedList",
  78890. // "parameterOrder": [
  78891. // "project"
  78892. // ],
  78893. // "parameters": {
  78894. // "filter": {
  78895. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78896. // "location": "query",
  78897. // "type": "string"
  78898. // },
  78899. // "maxResults": {
  78900. // "default": "500",
  78901. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78902. // "format": "uint32",
  78903. // "location": "query",
  78904. // "minimum": "0",
  78905. // "type": "integer"
  78906. // },
  78907. // "orderBy": {
  78908. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78909. // "location": "query",
  78910. // "type": "string"
  78911. // },
  78912. // "pageToken": {
  78913. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78914. // "location": "query",
  78915. // "type": "string"
  78916. // },
  78917. // "project": {
  78918. // "description": "Project ID for this request.",
  78919. // "location": "path",
  78920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78921. // "required": true,
  78922. // "type": "string"
  78923. // }
  78924. // },
  78925. // "path": "{project}/aggregated/machineTypes",
  78926. // "response": {
  78927. // "$ref": "MachineTypeAggregatedList"
  78928. // },
  78929. // "scopes": [
  78930. // "https://www.googleapis.com/auth/cloud-platform",
  78931. // "https://www.googleapis.com/auth/compute",
  78932. // "https://www.googleapis.com/auth/compute.readonly"
  78933. // ]
  78934. // }
  78935. }
  78936. // Pages invokes f for each page of results.
  78937. // A non-nil error returned from f will halt the iteration.
  78938. // The provided context supersedes any context provided to the Context method.
  78939. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  78940. c.ctx_ = ctx
  78941. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78942. for {
  78943. x, err := c.Do()
  78944. if err != nil {
  78945. return err
  78946. }
  78947. if err := f(x); err != nil {
  78948. return err
  78949. }
  78950. if x.NextPageToken == "" {
  78951. return nil
  78952. }
  78953. c.PageToken(x.NextPageToken)
  78954. }
  78955. }
  78956. // method id "compute.machineTypes.get":
  78957. type MachineTypesGetCall struct {
  78958. s *Service
  78959. project string
  78960. zone string
  78961. machineType string
  78962. urlParams_ gensupport.URLParams
  78963. ifNoneMatch_ string
  78964. ctx_ context.Context
  78965. header_ http.Header
  78966. }
  78967. // Get: Returns the specified machine type. Gets a list of available
  78968. // machine types by making a list() request.
  78969. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  78970. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  78971. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78972. c.project = project
  78973. c.zone = zone
  78974. c.machineType = machineType
  78975. return c
  78976. }
  78977. // Fields allows partial responses to be retrieved. See
  78978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78979. // for more information.
  78980. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  78981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78982. return c
  78983. }
  78984. // IfNoneMatch sets the optional parameter which makes the operation
  78985. // fail if the object's ETag matches the given value. This is useful for
  78986. // getting updates only after the object has changed since the last
  78987. // request. Use googleapi.IsNotModified to check whether the response
  78988. // error from Do is the result of In-None-Match.
  78989. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  78990. c.ifNoneMatch_ = entityTag
  78991. return c
  78992. }
  78993. // Context sets the context to be used in this call's Do method. Any
  78994. // pending HTTP request will be aborted if the provided context is
  78995. // canceled.
  78996. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  78997. c.ctx_ = ctx
  78998. return c
  78999. }
  79000. // Header returns an http.Header that can be modified by the caller to
  79001. // add HTTP headers to the request.
  79002. func (c *MachineTypesGetCall) Header() http.Header {
  79003. if c.header_ == nil {
  79004. c.header_ = make(http.Header)
  79005. }
  79006. return c.header_
  79007. }
  79008. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  79009. reqHeaders := make(http.Header)
  79010. for k, v := range c.header_ {
  79011. reqHeaders[k] = v
  79012. }
  79013. reqHeaders.Set("User-Agent", c.s.userAgent())
  79014. if c.ifNoneMatch_ != "" {
  79015. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79016. }
  79017. var body io.Reader = nil
  79018. c.urlParams_.Set("alt", alt)
  79019. c.urlParams_.Set("prettyPrint", "false")
  79020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  79021. urls += "?" + c.urlParams_.Encode()
  79022. req, err := http.NewRequest("GET", urls, body)
  79023. if err != nil {
  79024. return nil, err
  79025. }
  79026. req.Header = reqHeaders
  79027. googleapi.Expand(req.URL, map[string]string{
  79028. "project": c.project,
  79029. "zone": c.zone,
  79030. "machineType": c.machineType,
  79031. })
  79032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79033. }
  79034. // Do executes the "compute.machineTypes.get" call.
  79035. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  79036. // status code is an error. Response headers are in either
  79037. // *MachineType.ServerResponse.Header or (if a response was returned at
  79038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79039. // to check whether the returned error was because
  79040. // http.StatusNotModified was returned.
  79041. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  79042. gensupport.SetOptions(c.urlParams_, opts...)
  79043. res, err := c.doRequest("json")
  79044. if res != nil && res.StatusCode == http.StatusNotModified {
  79045. if res.Body != nil {
  79046. res.Body.Close()
  79047. }
  79048. return nil, &googleapi.Error{
  79049. Code: res.StatusCode,
  79050. Header: res.Header,
  79051. }
  79052. }
  79053. if err != nil {
  79054. return nil, err
  79055. }
  79056. defer googleapi.CloseBody(res)
  79057. if err := googleapi.CheckResponse(res); err != nil {
  79058. return nil, err
  79059. }
  79060. ret := &MachineType{
  79061. ServerResponse: googleapi.ServerResponse{
  79062. Header: res.Header,
  79063. HTTPStatusCode: res.StatusCode,
  79064. },
  79065. }
  79066. target := &ret
  79067. if err := gensupport.DecodeResponse(target, res); err != nil {
  79068. return nil, err
  79069. }
  79070. return ret, nil
  79071. // {
  79072. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  79073. // "httpMethod": "GET",
  79074. // "id": "compute.machineTypes.get",
  79075. // "parameterOrder": [
  79076. // "project",
  79077. // "zone",
  79078. // "machineType"
  79079. // ],
  79080. // "parameters": {
  79081. // "machineType": {
  79082. // "description": "Name of the machine type to return.",
  79083. // "location": "path",
  79084. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79085. // "required": true,
  79086. // "type": "string"
  79087. // },
  79088. // "project": {
  79089. // "description": "Project ID for this request.",
  79090. // "location": "path",
  79091. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79092. // "required": true,
  79093. // "type": "string"
  79094. // },
  79095. // "zone": {
  79096. // "description": "The name of the zone for this request.",
  79097. // "location": "path",
  79098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79099. // "required": true,
  79100. // "type": "string"
  79101. // }
  79102. // },
  79103. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  79104. // "response": {
  79105. // "$ref": "MachineType"
  79106. // },
  79107. // "scopes": [
  79108. // "https://www.googleapis.com/auth/cloud-platform",
  79109. // "https://www.googleapis.com/auth/compute",
  79110. // "https://www.googleapis.com/auth/compute.readonly"
  79111. // ]
  79112. // }
  79113. }
  79114. // method id "compute.machineTypes.list":
  79115. type MachineTypesListCall struct {
  79116. s *Service
  79117. project string
  79118. zone string
  79119. urlParams_ gensupport.URLParams
  79120. ifNoneMatch_ string
  79121. ctx_ context.Context
  79122. header_ http.Header
  79123. }
  79124. // List: Retrieves a list of machine types available to the specified
  79125. // project.
  79126. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  79127. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  79128. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79129. c.project = project
  79130. c.zone = zone
  79131. return c
  79132. }
  79133. // Filter sets the optional parameter "filter": A filter expression that
  79134. // filters resources listed in the response. The expression must specify
  79135. // the field name, a comparison operator, and the value that you want to
  79136. // use for filtering. The value must be a string, a number, or a
  79137. // boolean. The comparison operator must be either =, !=, >, or <.
  79138. //
  79139. // For example, if you are filtering Compute Engine instances, you can
  79140. // exclude instances named example-instance by specifying name !=
  79141. // example-instance.
  79142. //
  79143. // You can also filter nested fields. For example, you could specify
  79144. // scheduling.automaticRestart = false to include instances only if they
  79145. // are not scheduled for automatic restarts. You can use filtering on
  79146. // nested fields to filter based on resource labels.
  79147. //
  79148. // To filter on multiple expressions, provide each separate expression
  79149. // within parentheses. For example, (scheduling.automaticRestart = true)
  79150. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79151. // AND expression. However, you can include AND and OR expressions
  79152. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79153. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79154. // true).
  79155. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  79156. c.urlParams_.Set("filter", filter)
  79157. return c
  79158. }
  79159. // MaxResults sets the optional parameter "maxResults": The maximum
  79160. // number of results per page that should be returned. If the number of
  79161. // available results is larger than maxResults, Compute Engine returns a
  79162. // nextPageToken that can be used to get the next page of results in
  79163. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79164. // (Default: 500)
  79165. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  79166. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79167. return c
  79168. }
  79169. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79170. // a certain order. By default, results are returned in alphanumerical
  79171. // order based on the resource name.
  79172. //
  79173. // You can also sort results in descending order based on the creation
  79174. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79175. // based on the creationTimestamp field in reverse chronological order
  79176. // (newest result first). Use this to sort resources like operations so
  79177. // that the newest operation is returned first.
  79178. //
  79179. // Currently, only sorting by name or creationTimestamp desc is
  79180. // supported.
  79181. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  79182. c.urlParams_.Set("orderBy", orderBy)
  79183. return c
  79184. }
  79185. // PageToken sets the optional parameter "pageToken": Specifies a page
  79186. // token to use. Set pageToken to the nextPageToken returned by a
  79187. // previous list request to get the next page of results.
  79188. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  79189. c.urlParams_.Set("pageToken", pageToken)
  79190. return c
  79191. }
  79192. // Fields allows partial responses to be retrieved. See
  79193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79194. // for more information.
  79195. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  79196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79197. return c
  79198. }
  79199. // IfNoneMatch sets the optional parameter which makes the operation
  79200. // fail if the object's ETag matches the given value. This is useful for
  79201. // getting updates only after the object has changed since the last
  79202. // request. Use googleapi.IsNotModified to check whether the response
  79203. // error from Do is the result of In-None-Match.
  79204. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  79205. c.ifNoneMatch_ = entityTag
  79206. return c
  79207. }
  79208. // Context sets the context to be used in this call's Do method. Any
  79209. // pending HTTP request will be aborted if the provided context is
  79210. // canceled.
  79211. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  79212. c.ctx_ = ctx
  79213. return c
  79214. }
  79215. // Header returns an http.Header that can be modified by the caller to
  79216. // add HTTP headers to the request.
  79217. func (c *MachineTypesListCall) Header() http.Header {
  79218. if c.header_ == nil {
  79219. c.header_ = make(http.Header)
  79220. }
  79221. return c.header_
  79222. }
  79223. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  79224. reqHeaders := make(http.Header)
  79225. for k, v := range c.header_ {
  79226. reqHeaders[k] = v
  79227. }
  79228. reqHeaders.Set("User-Agent", c.s.userAgent())
  79229. if c.ifNoneMatch_ != "" {
  79230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79231. }
  79232. var body io.Reader = nil
  79233. c.urlParams_.Set("alt", alt)
  79234. c.urlParams_.Set("prettyPrint", "false")
  79235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  79236. urls += "?" + c.urlParams_.Encode()
  79237. req, err := http.NewRequest("GET", urls, body)
  79238. if err != nil {
  79239. return nil, err
  79240. }
  79241. req.Header = reqHeaders
  79242. googleapi.Expand(req.URL, map[string]string{
  79243. "project": c.project,
  79244. "zone": c.zone,
  79245. })
  79246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79247. }
  79248. // Do executes the "compute.machineTypes.list" call.
  79249. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  79250. // status code is an error. Response headers are in either
  79251. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  79252. // at all) in error.(*googleapi.Error).Header. Use
  79253. // googleapi.IsNotModified to check whether the returned error was
  79254. // because http.StatusNotModified was returned.
  79255. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  79256. gensupport.SetOptions(c.urlParams_, opts...)
  79257. res, err := c.doRequest("json")
  79258. if res != nil && res.StatusCode == http.StatusNotModified {
  79259. if res.Body != nil {
  79260. res.Body.Close()
  79261. }
  79262. return nil, &googleapi.Error{
  79263. Code: res.StatusCode,
  79264. Header: res.Header,
  79265. }
  79266. }
  79267. if err != nil {
  79268. return nil, err
  79269. }
  79270. defer googleapi.CloseBody(res)
  79271. if err := googleapi.CheckResponse(res); err != nil {
  79272. return nil, err
  79273. }
  79274. ret := &MachineTypeList{
  79275. ServerResponse: googleapi.ServerResponse{
  79276. Header: res.Header,
  79277. HTTPStatusCode: res.StatusCode,
  79278. },
  79279. }
  79280. target := &ret
  79281. if err := gensupport.DecodeResponse(target, res); err != nil {
  79282. return nil, err
  79283. }
  79284. return ret, nil
  79285. // {
  79286. // "description": "Retrieves a list of machine types available to the specified project.",
  79287. // "httpMethod": "GET",
  79288. // "id": "compute.machineTypes.list",
  79289. // "parameterOrder": [
  79290. // "project",
  79291. // "zone"
  79292. // ],
  79293. // "parameters": {
  79294. // "filter": {
  79295. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79296. // "location": "query",
  79297. // "type": "string"
  79298. // },
  79299. // "maxResults": {
  79300. // "default": "500",
  79301. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79302. // "format": "uint32",
  79303. // "location": "query",
  79304. // "minimum": "0",
  79305. // "type": "integer"
  79306. // },
  79307. // "orderBy": {
  79308. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79309. // "location": "query",
  79310. // "type": "string"
  79311. // },
  79312. // "pageToken": {
  79313. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79314. // "location": "query",
  79315. // "type": "string"
  79316. // },
  79317. // "project": {
  79318. // "description": "Project ID for this request.",
  79319. // "location": "path",
  79320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79321. // "required": true,
  79322. // "type": "string"
  79323. // },
  79324. // "zone": {
  79325. // "description": "The name of the zone for this request.",
  79326. // "location": "path",
  79327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79328. // "required": true,
  79329. // "type": "string"
  79330. // }
  79331. // },
  79332. // "path": "{project}/zones/{zone}/machineTypes",
  79333. // "response": {
  79334. // "$ref": "MachineTypeList"
  79335. // },
  79336. // "scopes": [
  79337. // "https://www.googleapis.com/auth/cloud-platform",
  79338. // "https://www.googleapis.com/auth/compute",
  79339. // "https://www.googleapis.com/auth/compute.readonly"
  79340. // ]
  79341. // }
  79342. }
  79343. // Pages invokes f for each page of results.
  79344. // A non-nil error returned from f will halt the iteration.
  79345. // The provided context supersedes any context provided to the Context method.
  79346. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  79347. c.ctx_ = ctx
  79348. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79349. for {
  79350. x, err := c.Do()
  79351. if err != nil {
  79352. return err
  79353. }
  79354. if err := f(x); err != nil {
  79355. return err
  79356. }
  79357. if x.NextPageToken == "" {
  79358. return nil
  79359. }
  79360. c.PageToken(x.NextPageToken)
  79361. }
  79362. }
  79363. // method id "compute.networkEndpointGroups.aggregatedList":
  79364. type NetworkEndpointGroupsAggregatedListCall struct {
  79365. s *Service
  79366. project string
  79367. urlParams_ gensupport.URLParams
  79368. ifNoneMatch_ string
  79369. ctx_ context.Context
  79370. header_ http.Header
  79371. }
  79372. // AggregatedList: Retrieves the list of network endpoint groups and
  79373. // sorts them by zone.
  79374. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  79375. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79376. c.project = project
  79377. return c
  79378. }
  79379. // Filter sets the optional parameter "filter": A filter expression that
  79380. // filters resources listed in the response. The expression must specify
  79381. // the field name, a comparison operator, and the value that you want to
  79382. // use for filtering. The value must be a string, a number, or a
  79383. // boolean. The comparison operator must be either =, !=, >, or <.
  79384. //
  79385. // For example, if you are filtering Compute Engine instances, you can
  79386. // exclude instances named example-instance by specifying name !=
  79387. // example-instance.
  79388. //
  79389. // You can also filter nested fields. For example, you could specify
  79390. // scheduling.automaticRestart = false to include instances only if they
  79391. // are not scheduled for automatic restarts. You can use filtering on
  79392. // nested fields to filter based on resource labels.
  79393. //
  79394. // To filter on multiple expressions, provide each separate expression
  79395. // within parentheses. For example, (scheduling.automaticRestart = true)
  79396. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79397. // AND expression. However, you can include AND and OR expressions
  79398. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79399. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79400. // true).
  79401. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  79402. c.urlParams_.Set("filter", filter)
  79403. return c
  79404. }
  79405. // MaxResults sets the optional parameter "maxResults": The maximum
  79406. // number of results per page that should be returned. If the number of
  79407. // available results is larger than maxResults, Compute Engine returns a
  79408. // nextPageToken that can be used to get the next page of results in
  79409. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79410. // (Default: 500)
  79411. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  79412. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79413. return c
  79414. }
  79415. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79416. // a certain order. By default, results are returned in alphanumerical
  79417. // order based on the resource name.
  79418. //
  79419. // You can also sort results in descending order based on the creation
  79420. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79421. // based on the creationTimestamp field in reverse chronological order
  79422. // (newest result first). Use this to sort resources like operations so
  79423. // that the newest operation is returned first.
  79424. //
  79425. // Currently, only sorting by name or creationTimestamp desc is
  79426. // supported.
  79427. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  79428. c.urlParams_.Set("orderBy", orderBy)
  79429. return c
  79430. }
  79431. // PageToken sets the optional parameter "pageToken": Specifies a page
  79432. // token to use. Set pageToken to the nextPageToken returned by a
  79433. // previous list request to get the next page of results.
  79434. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  79435. c.urlParams_.Set("pageToken", pageToken)
  79436. return c
  79437. }
  79438. // Fields allows partial responses to be retrieved. See
  79439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79440. // for more information.
  79441. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  79442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79443. return c
  79444. }
  79445. // IfNoneMatch sets the optional parameter which makes the operation
  79446. // fail if the object's ETag matches the given value. This is useful for
  79447. // getting updates only after the object has changed since the last
  79448. // request. Use googleapi.IsNotModified to check whether the response
  79449. // error from Do is the result of In-None-Match.
  79450. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  79451. c.ifNoneMatch_ = entityTag
  79452. return c
  79453. }
  79454. // Context sets the context to be used in this call's Do method. Any
  79455. // pending HTTP request will be aborted if the provided context is
  79456. // canceled.
  79457. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  79458. c.ctx_ = ctx
  79459. return c
  79460. }
  79461. // Header returns an http.Header that can be modified by the caller to
  79462. // add HTTP headers to the request.
  79463. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  79464. if c.header_ == nil {
  79465. c.header_ = make(http.Header)
  79466. }
  79467. return c.header_
  79468. }
  79469. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  79470. reqHeaders := make(http.Header)
  79471. for k, v := range c.header_ {
  79472. reqHeaders[k] = v
  79473. }
  79474. reqHeaders.Set("User-Agent", c.s.userAgent())
  79475. if c.ifNoneMatch_ != "" {
  79476. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79477. }
  79478. var body io.Reader = nil
  79479. c.urlParams_.Set("alt", alt)
  79480. c.urlParams_.Set("prettyPrint", "false")
  79481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  79482. urls += "?" + c.urlParams_.Encode()
  79483. req, err := http.NewRequest("GET", urls, body)
  79484. if err != nil {
  79485. return nil, err
  79486. }
  79487. req.Header = reqHeaders
  79488. googleapi.Expand(req.URL, map[string]string{
  79489. "project": c.project,
  79490. })
  79491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79492. }
  79493. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  79494. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  79495. // non-nil. Any non-2xx status code is an error. Response headers are in
  79496. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  79497. // (if a response was returned at all) in
  79498. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  79499. // whether the returned error was because http.StatusNotModified was
  79500. // returned.
  79501. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  79502. gensupport.SetOptions(c.urlParams_, opts...)
  79503. res, err := c.doRequest("json")
  79504. if res != nil && res.StatusCode == http.StatusNotModified {
  79505. if res.Body != nil {
  79506. res.Body.Close()
  79507. }
  79508. return nil, &googleapi.Error{
  79509. Code: res.StatusCode,
  79510. Header: res.Header,
  79511. }
  79512. }
  79513. if err != nil {
  79514. return nil, err
  79515. }
  79516. defer googleapi.CloseBody(res)
  79517. if err := googleapi.CheckResponse(res); err != nil {
  79518. return nil, err
  79519. }
  79520. ret := &NetworkEndpointGroupAggregatedList{
  79521. ServerResponse: googleapi.ServerResponse{
  79522. Header: res.Header,
  79523. HTTPStatusCode: res.StatusCode,
  79524. },
  79525. }
  79526. target := &ret
  79527. if err := gensupport.DecodeResponse(target, res); err != nil {
  79528. return nil, err
  79529. }
  79530. return ret, nil
  79531. // {
  79532. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  79533. // "httpMethod": "GET",
  79534. // "id": "compute.networkEndpointGroups.aggregatedList",
  79535. // "parameterOrder": [
  79536. // "project"
  79537. // ],
  79538. // "parameters": {
  79539. // "filter": {
  79540. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79541. // "location": "query",
  79542. // "type": "string"
  79543. // },
  79544. // "maxResults": {
  79545. // "default": "500",
  79546. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79547. // "format": "uint32",
  79548. // "location": "query",
  79549. // "minimum": "0",
  79550. // "type": "integer"
  79551. // },
  79552. // "orderBy": {
  79553. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79554. // "location": "query",
  79555. // "type": "string"
  79556. // },
  79557. // "pageToken": {
  79558. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79559. // "location": "query",
  79560. // "type": "string"
  79561. // },
  79562. // "project": {
  79563. // "description": "Project ID for this request.",
  79564. // "location": "path",
  79565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79566. // "required": true,
  79567. // "type": "string"
  79568. // }
  79569. // },
  79570. // "path": "{project}/aggregated/networkEndpointGroups",
  79571. // "response": {
  79572. // "$ref": "NetworkEndpointGroupAggregatedList"
  79573. // },
  79574. // "scopes": [
  79575. // "https://www.googleapis.com/auth/cloud-platform",
  79576. // "https://www.googleapis.com/auth/compute",
  79577. // "https://www.googleapis.com/auth/compute.readonly"
  79578. // ]
  79579. // }
  79580. }
  79581. // Pages invokes f for each page of results.
  79582. // A non-nil error returned from f will halt the iteration.
  79583. // The provided context supersedes any context provided to the Context method.
  79584. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  79585. c.ctx_ = ctx
  79586. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79587. for {
  79588. x, err := c.Do()
  79589. if err != nil {
  79590. return err
  79591. }
  79592. if err := f(x); err != nil {
  79593. return err
  79594. }
  79595. if x.NextPageToken == "" {
  79596. return nil
  79597. }
  79598. c.PageToken(x.NextPageToken)
  79599. }
  79600. }
  79601. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  79602. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  79603. s *Service
  79604. project string
  79605. zone string
  79606. networkEndpointGroup string
  79607. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  79608. urlParams_ gensupport.URLParams
  79609. ctx_ context.Context
  79610. header_ http.Header
  79611. }
  79612. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  79613. // specified network endpoint group.
  79614. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  79615. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79616. c.project = project
  79617. c.zone = zone
  79618. c.networkEndpointGroup = networkEndpointGroup
  79619. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  79620. return c
  79621. }
  79622. // RequestId sets the optional parameter "requestId": An optional
  79623. // request ID to identify requests. Specify a unique request ID so that
  79624. // if you must retry your request, the server will know to ignore the
  79625. // request if it has already been completed.
  79626. //
  79627. // For example, consider a situation where you make an initial request
  79628. // and the request times out. If you make the request again with the
  79629. // same request ID, the server can check if original operation with the
  79630. // same request ID was received, and if so, will ignore the second
  79631. // request. This prevents clients from accidentally creating duplicate
  79632. // commitments.
  79633. //
  79634. // The request ID must be a valid UUID with the exception that zero UUID
  79635. // is not supported (00000000-0000-0000-0000-000000000000).
  79636. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  79637. c.urlParams_.Set("requestId", requestId)
  79638. return c
  79639. }
  79640. // Fields allows partial responses to be retrieved. See
  79641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79642. // for more information.
  79643. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  79644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79645. return c
  79646. }
  79647. // Context sets the context to be used in this call's Do method. Any
  79648. // pending HTTP request will be aborted if the provided context is
  79649. // canceled.
  79650. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  79651. c.ctx_ = ctx
  79652. return c
  79653. }
  79654. // Header returns an http.Header that can be modified by the caller to
  79655. // add HTTP headers to the request.
  79656. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  79657. if c.header_ == nil {
  79658. c.header_ = make(http.Header)
  79659. }
  79660. return c.header_
  79661. }
  79662. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  79663. reqHeaders := make(http.Header)
  79664. for k, v := range c.header_ {
  79665. reqHeaders[k] = v
  79666. }
  79667. reqHeaders.Set("User-Agent", c.s.userAgent())
  79668. var body io.Reader = nil
  79669. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  79670. if err != nil {
  79671. return nil, err
  79672. }
  79673. reqHeaders.Set("Content-Type", "application/json")
  79674. c.urlParams_.Set("alt", alt)
  79675. c.urlParams_.Set("prettyPrint", "false")
  79676. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  79677. urls += "?" + c.urlParams_.Encode()
  79678. req, err := http.NewRequest("POST", urls, body)
  79679. if err != nil {
  79680. return nil, err
  79681. }
  79682. req.Header = reqHeaders
  79683. googleapi.Expand(req.URL, map[string]string{
  79684. "project": c.project,
  79685. "zone": c.zone,
  79686. "networkEndpointGroup": c.networkEndpointGroup,
  79687. })
  79688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79689. }
  79690. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  79691. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79692. // status code is an error. Response headers are in either
  79693. // *Operation.ServerResponse.Header or (if a response was returned at
  79694. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79695. // to check whether the returned error was because
  79696. // http.StatusNotModified was returned.
  79697. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79698. gensupport.SetOptions(c.urlParams_, opts...)
  79699. res, err := c.doRequest("json")
  79700. if res != nil && res.StatusCode == http.StatusNotModified {
  79701. if res.Body != nil {
  79702. res.Body.Close()
  79703. }
  79704. return nil, &googleapi.Error{
  79705. Code: res.StatusCode,
  79706. Header: res.Header,
  79707. }
  79708. }
  79709. if err != nil {
  79710. return nil, err
  79711. }
  79712. defer googleapi.CloseBody(res)
  79713. if err := googleapi.CheckResponse(res); err != nil {
  79714. return nil, err
  79715. }
  79716. ret := &Operation{
  79717. ServerResponse: googleapi.ServerResponse{
  79718. Header: res.Header,
  79719. HTTPStatusCode: res.StatusCode,
  79720. },
  79721. }
  79722. target := &ret
  79723. if err := gensupport.DecodeResponse(target, res); err != nil {
  79724. return nil, err
  79725. }
  79726. return ret, nil
  79727. // {
  79728. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  79729. // "httpMethod": "POST",
  79730. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  79731. // "parameterOrder": [
  79732. // "project",
  79733. // "zone",
  79734. // "networkEndpointGroup"
  79735. // ],
  79736. // "parameters": {
  79737. // "networkEndpointGroup": {
  79738. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  79739. // "location": "path",
  79740. // "required": true,
  79741. // "type": "string"
  79742. // },
  79743. // "project": {
  79744. // "description": "Project ID for this request.",
  79745. // "location": "path",
  79746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79747. // "required": true,
  79748. // "type": "string"
  79749. // },
  79750. // "requestId": {
  79751. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79752. // "location": "query",
  79753. // "type": "string"
  79754. // },
  79755. // "zone": {
  79756. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  79757. // "location": "path",
  79758. // "required": true,
  79759. // "type": "string"
  79760. // }
  79761. // },
  79762. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  79763. // "request": {
  79764. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  79765. // },
  79766. // "response": {
  79767. // "$ref": "Operation"
  79768. // },
  79769. // "scopes": [
  79770. // "https://www.googleapis.com/auth/cloud-platform",
  79771. // "https://www.googleapis.com/auth/compute"
  79772. // ]
  79773. // }
  79774. }
  79775. // method id "compute.networkEndpointGroups.delete":
  79776. type NetworkEndpointGroupsDeleteCall struct {
  79777. s *Service
  79778. project string
  79779. zone string
  79780. networkEndpointGroup string
  79781. urlParams_ gensupport.URLParams
  79782. ctx_ context.Context
  79783. header_ http.Header
  79784. }
  79785. // Delete: Deletes the specified network endpoint group. The network
  79786. // endpoints in the NEG and the VM instances they belong to are not
  79787. // terminated when the NEG is deleted. Note that the NEG cannot be
  79788. // deleted if there are backend services referencing it.
  79789. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  79790. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79791. c.project = project
  79792. c.zone = zone
  79793. c.networkEndpointGroup = networkEndpointGroup
  79794. return c
  79795. }
  79796. // RequestId sets the optional parameter "requestId": An optional
  79797. // request ID to identify requests. Specify a unique request ID so that
  79798. // if you must retry your request, the server will know to ignore the
  79799. // request if it has already been completed.
  79800. //
  79801. // For example, consider a situation where you make an initial request
  79802. // and the request times out. If you make the request again with the
  79803. // same request ID, the server can check if original operation with the
  79804. // same request ID was received, and if so, will ignore the second
  79805. // request. This prevents clients from accidentally creating duplicate
  79806. // commitments.
  79807. //
  79808. // The request ID must be a valid UUID with the exception that zero UUID
  79809. // is not supported (00000000-0000-0000-0000-000000000000).
  79810. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  79811. c.urlParams_.Set("requestId", requestId)
  79812. return c
  79813. }
  79814. // Fields allows partial responses to be retrieved. See
  79815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79816. // for more information.
  79817. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  79818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79819. return c
  79820. }
  79821. // Context sets the context to be used in this call's Do method. Any
  79822. // pending HTTP request will be aborted if the provided context is
  79823. // canceled.
  79824. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  79825. c.ctx_ = ctx
  79826. return c
  79827. }
  79828. // Header returns an http.Header that can be modified by the caller to
  79829. // add HTTP headers to the request.
  79830. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  79831. if c.header_ == nil {
  79832. c.header_ = make(http.Header)
  79833. }
  79834. return c.header_
  79835. }
  79836. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  79837. reqHeaders := make(http.Header)
  79838. for k, v := range c.header_ {
  79839. reqHeaders[k] = v
  79840. }
  79841. reqHeaders.Set("User-Agent", c.s.userAgent())
  79842. var body io.Reader = nil
  79843. c.urlParams_.Set("alt", alt)
  79844. c.urlParams_.Set("prettyPrint", "false")
  79845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  79846. urls += "?" + c.urlParams_.Encode()
  79847. req, err := http.NewRequest("DELETE", urls, body)
  79848. if err != nil {
  79849. return nil, err
  79850. }
  79851. req.Header = reqHeaders
  79852. googleapi.Expand(req.URL, map[string]string{
  79853. "project": c.project,
  79854. "zone": c.zone,
  79855. "networkEndpointGroup": c.networkEndpointGroup,
  79856. })
  79857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79858. }
  79859. // Do executes the "compute.networkEndpointGroups.delete" call.
  79860. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79861. // status code is an error. Response headers are in either
  79862. // *Operation.ServerResponse.Header or (if a response was returned at
  79863. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79864. // to check whether the returned error was because
  79865. // http.StatusNotModified was returned.
  79866. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79867. gensupport.SetOptions(c.urlParams_, opts...)
  79868. res, err := c.doRequest("json")
  79869. if res != nil && res.StatusCode == http.StatusNotModified {
  79870. if res.Body != nil {
  79871. res.Body.Close()
  79872. }
  79873. return nil, &googleapi.Error{
  79874. Code: res.StatusCode,
  79875. Header: res.Header,
  79876. }
  79877. }
  79878. if err != nil {
  79879. return nil, err
  79880. }
  79881. defer googleapi.CloseBody(res)
  79882. if err := googleapi.CheckResponse(res); err != nil {
  79883. return nil, err
  79884. }
  79885. ret := &Operation{
  79886. ServerResponse: googleapi.ServerResponse{
  79887. Header: res.Header,
  79888. HTTPStatusCode: res.StatusCode,
  79889. },
  79890. }
  79891. target := &ret
  79892. if err := gensupport.DecodeResponse(target, res); err != nil {
  79893. return nil, err
  79894. }
  79895. return ret, nil
  79896. // {
  79897. // "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.",
  79898. // "httpMethod": "DELETE",
  79899. // "id": "compute.networkEndpointGroups.delete",
  79900. // "parameterOrder": [
  79901. // "project",
  79902. // "zone",
  79903. // "networkEndpointGroup"
  79904. // ],
  79905. // "parameters": {
  79906. // "networkEndpointGroup": {
  79907. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  79908. // "location": "path",
  79909. // "required": true,
  79910. // "type": "string"
  79911. // },
  79912. // "project": {
  79913. // "description": "Project ID for this request.",
  79914. // "location": "path",
  79915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79916. // "required": true,
  79917. // "type": "string"
  79918. // },
  79919. // "requestId": {
  79920. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79921. // "location": "query",
  79922. // "type": "string"
  79923. // },
  79924. // "zone": {
  79925. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  79926. // "location": "path",
  79927. // "required": true,
  79928. // "type": "string"
  79929. // }
  79930. // },
  79931. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  79932. // "response": {
  79933. // "$ref": "Operation"
  79934. // },
  79935. // "scopes": [
  79936. // "https://www.googleapis.com/auth/cloud-platform",
  79937. // "https://www.googleapis.com/auth/compute"
  79938. // ]
  79939. // }
  79940. }
  79941. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  79942. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  79943. s *Service
  79944. project string
  79945. zone string
  79946. networkEndpointGroup string
  79947. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  79948. urlParams_ gensupport.URLParams
  79949. ctx_ context.Context
  79950. header_ http.Header
  79951. }
  79952. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  79953. // specified network endpoint group.
  79954. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  79955. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79956. c.project = project
  79957. c.zone = zone
  79958. c.networkEndpointGroup = networkEndpointGroup
  79959. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  79960. return c
  79961. }
  79962. // RequestId sets the optional parameter "requestId": An optional
  79963. // request ID to identify requests. Specify a unique request ID so that
  79964. // if you must retry your request, the server will know to ignore the
  79965. // request if it has already been completed.
  79966. //
  79967. // For example, consider a situation where you make an initial request
  79968. // and the request times out. If you make the request again with the
  79969. // same request ID, the server can check if original operation with the
  79970. // same request ID was received, and if so, will ignore the second
  79971. // request. This prevents clients from accidentally creating duplicate
  79972. // commitments.
  79973. //
  79974. // The request ID must be a valid UUID with the exception that zero UUID
  79975. // is not supported (00000000-0000-0000-0000-000000000000).
  79976. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  79977. c.urlParams_.Set("requestId", requestId)
  79978. return c
  79979. }
  79980. // Fields allows partial responses to be retrieved. See
  79981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79982. // for more information.
  79983. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  79984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79985. return c
  79986. }
  79987. // Context sets the context to be used in this call's Do method. Any
  79988. // pending HTTP request will be aborted if the provided context is
  79989. // canceled.
  79990. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  79991. c.ctx_ = ctx
  79992. return c
  79993. }
  79994. // Header returns an http.Header that can be modified by the caller to
  79995. // add HTTP headers to the request.
  79996. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  79997. if c.header_ == nil {
  79998. c.header_ = make(http.Header)
  79999. }
  80000. return c.header_
  80001. }
  80002. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  80003. reqHeaders := make(http.Header)
  80004. for k, v := range c.header_ {
  80005. reqHeaders[k] = v
  80006. }
  80007. reqHeaders.Set("User-Agent", c.s.userAgent())
  80008. var body io.Reader = nil
  80009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  80010. if err != nil {
  80011. return nil, err
  80012. }
  80013. reqHeaders.Set("Content-Type", "application/json")
  80014. c.urlParams_.Set("alt", alt)
  80015. c.urlParams_.Set("prettyPrint", "false")
  80016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  80017. urls += "?" + c.urlParams_.Encode()
  80018. req, err := http.NewRequest("POST", urls, body)
  80019. if err != nil {
  80020. return nil, err
  80021. }
  80022. req.Header = reqHeaders
  80023. googleapi.Expand(req.URL, map[string]string{
  80024. "project": c.project,
  80025. "zone": c.zone,
  80026. "networkEndpointGroup": c.networkEndpointGroup,
  80027. })
  80028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80029. }
  80030. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  80031. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80032. // status code is an error. Response headers are in either
  80033. // *Operation.ServerResponse.Header or (if a response was returned at
  80034. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80035. // to check whether the returned error was because
  80036. // http.StatusNotModified was returned.
  80037. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80038. gensupport.SetOptions(c.urlParams_, opts...)
  80039. res, err := c.doRequest("json")
  80040. if res != nil && res.StatusCode == http.StatusNotModified {
  80041. if res.Body != nil {
  80042. res.Body.Close()
  80043. }
  80044. return nil, &googleapi.Error{
  80045. Code: res.StatusCode,
  80046. Header: res.Header,
  80047. }
  80048. }
  80049. if err != nil {
  80050. return nil, err
  80051. }
  80052. defer googleapi.CloseBody(res)
  80053. if err := googleapi.CheckResponse(res); err != nil {
  80054. return nil, err
  80055. }
  80056. ret := &Operation{
  80057. ServerResponse: googleapi.ServerResponse{
  80058. Header: res.Header,
  80059. HTTPStatusCode: res.StatusCode,
  80060. },
  80061. }
  80062. target := &ret
  80063. if err := gensupport.DecodeResponse(target, res); err != nil {
  80064. return nil, err
  80065. }
  80066. return ret, nil
  80067. // {
  80068. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  80069. // "httpMethod": "POST",
  80070. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  80071. // "parameterOrder": [
  80072. // "project",
  80073. // "zone",
  80074. // "networkEndpointGroup"
  80075. // ],
  80076. // "parameters": {
  80077. // "networkEndpointGroup": {
  80078. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  80079. // "location": "path",
  80080. // "required": true,
  80081. // "type": "string"
  80082. // },
  80083. // "project": {
  80084. // "description": "Project ID for this request.",
  80085. // "location": "path",
  80086. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80087. // "required": true,
  80088. // "type": "string"
  80089. // },
  80090. // "requestId": {
  80091. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80092. // "location": "query",
  80093. // "type": "string"
  80094. // },
  80095. // "zone": {
  80096. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  80097. // "location": "path",
  80098. // "required": true,
  80099. // "type": "string"
  80100. // }
  80101. // },
  80102. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  80103. // "request": {
  80104. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  80105. // },
  80106. // "response": {
  80107. // "$ref": "Operation"
  80108. // },
  80109. // "scopes": [
  80110. // "https://www.googleapis.com/auth/cloud-platform",
  80111. // "https://www.googleapis.com/auth/compute"
  80112. // ]
  80113. // }
  80114. }
  80115. // method id "compute.networkEndpointGroups.get":
  80116. type NetworkEndpointGroupsGetCall struct {
  80117. s *Service
  80118. project string
  80119. zone string
  80120. networkEndpointGroup string
  80121. urlParams_ gensupport.URLParams
  80122. ifNoneMatch_ string
  80123. ctx_ context.Context
  80124. header_ http.Header
  80125. }
  80126. // Get: Returns the specified network endpoint group. Gets a list of
  80127. // available network endpoint groups by making a list() request.
  80128. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  80129. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80130. c.project = project
  80131. c.zone = zone
  80132. c.networkEndpointGroup = networkEndpointGroup
  80133. return c
  80134. }
  80135. // Fields allows partial responses to be retrieved. See
  80136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80137. // for more information.
  80138. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  80139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80140. return c
  80141. }
  80142. // IfNoneMatch sets the optional parameter which makes the operation
  80143. // fail if the object's ETag matches the given value. This is useful for
  80144. // getting updates only after the object has changed since the last
  80145. // request. Use googleapi.IsNotModified to check whether the response
  80146. // error from Do is the result of In-None-Match.
  80147. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  80148. c.ifNoneMatch_ = entityTag
  80149. return c
  80150. }
  80151. // Context sets the context to be used in this call's Do method. Any
  80152. // pending HTTP request will be aborted if the provided context is
  80153. // canceled.
  80154. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  80155. c.ctx_ = ctx
  80156. return c
  80157. }
  80158. // Header returns an http.Header that can be modified by the caller to
  80159. // add HTTP headers to the request.
  80160. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  80161. if c.header_ == nil {
  80162. c.header_ = make(http.Header)
  80163. }
  80164. return c.header_
  80165. }
  80166. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  80167. reqHeaders := make(http.Header)
  80168. for k, v := range c.header_ {
  80169. reqHeaders[k] = v
  80170. }
  80171. reqHeaders.Set("User-Agent", c.s.userAgent())
  80172. if c.ifNoneMatch_ != "" {
  80173. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80174. }
  80175. var body io.Reader = nil
  80176. c.urlParams_.Set("alt", alt)
  80177. c.urlParams_.Set("prettyPrint", "false")
  80178. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  80179. urls += "?" + c.urlParams_.Encode()
  80180. req, err := http.NewRequest("GET", urls, body)
  80181. if err != nil {
  80182. return nil, err
  80183. }
  80184. req.Header = reqHeaders
  80185. googleapi.Expand(req.URL, map[string]string{
  80186. "project": c.project,
  80187. "zone": c.zone,
  80188. "networkEndpointGroup": c.networkEndpointGroup,
  80189. })
  80190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80191. }
  80192. // Do executes the "compute.networkEndpointGroups.get" call.
  80193. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  80194. // non-2xx status code is an error. Response headers are in either
  80195. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  80196. // returned at all) in error.(*googleapi.Error).Header. Use
  80197. // googleapi.IsNotModified to check whether the returned error was
  80198. // because http.StatusNotModified was returned.
  80199. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  80200. gensupport.SetOptions(c.urlParams_, opts...)
  80201. res, err := c.doRequest("json")
  80202. if res != nil && res.StatusCode == http.StatusNotModified {
  80203. if res.Body != nil {
  80204. res.Body.Close()
  80205. }
  80206. return nil, &googleapi.Error{
  80207. Code: res.StatusCode,
  80208. Header: res.Header,
  80209. }
  80210. }
  80211. if err != nil {
  80212. return nil, err
  80213. }
  80214. defer googleapi.CloseBody(res)
  80215. if err := googleapi.CheckResponse(res); err != nil {
  80216. return nil, err
  80217. }
  80218. ret := &NetworkEndpointGroup{
  80219. ServerResponse: googleapi.ServerResponse{
  80220. Header: res.Header,
  80221. HTTPStatusCode: res.StatusCode,
  80222. },
  80223. }
  80224. target := &ret
  80225. if err := gensupport.DecodeResponse(target, res); err != nil {
  80226. return nil, err
  80227. }
  80228. return ret, nil
  80229. // {
  80230. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  80231. // "httpMethod": "GET",
  80232. // "id": "compute.networkEndpointGroups.get",
  80233. // "parameterOrder": [
  80234. // "project",
  80235. // "zone",
  80236. // "networkEndpointGroup"
  80237. // ],
  80238. // "parameters": {
  80239. // "networkEndpointGroup": {
  80240. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  80241. // "location": "path",
  80242. // "required": true,
  80243. // "type": "string"
  80244. // },
  80245. // "project": {
  80246. // "description": "Project ID for this request.",
  80247. // "location": "path",
  80248. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80249. // "required": true,
  80250. // "type": "string"
  80251. // },
  80252. // "zone": {
  80253. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  80254. // "location": "path",
  80255. // "required": true,
  80256. // "type": "string"
  80257. // }
  80258. // },
  80259. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  80260. // "response": {
  80261. // "$ref": "NetworkEndpointGroup"
  80262. // },
  80263. // "scopes": [
  80264. // "https://www.googleapis.com/auth/cloud-platform",
  80265. // "https://www.googleapis.com/auth/compute",
  80266. // "https://www.googleapis.com/auth/compute.readonly"
  80267. // ]
  80268. // }
  80269. }
  80270. // method id "compute.networkEndpointGroups.insert":
  80271. type NetworkEndpointGroupsInsertCall struct {
  80272. s *Service
  80273. project string
  80274. zone string
  80275. networkendpointgroup *NetworkEndpointGroup
  80276. urlParams_ gensupport.URLParams
  80277. ctx_ context.Context
  80278. header_ http.Header
  80279. }
  80280. // Insert: Creates a network endpoint group in the specified project
  80281. // using the parameters that are included in the request.
  80282. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  80283. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80284. c.project = project
  80285. c.zone = zone
  80286. c.networkendpointgroup = networkendpointgroup
  80287. return c
  80288. }
  80289. // RequestId sets the optional parameter "requestId": An optional
  80290. // request ID to identify requests. Specify a unique request ID so that
  80291. // if you must retry your request, the server will know to ignore the
  80292. // request if it has already been completed.
  80293. //
  80294. // For example, consider a situation where you make an initial request
  80295. // and the request times out. If you make the request again with the
  80296. // same request ID, the server can check if original operation with the
  80297. // same request ID was received, and if so, will ignore the second
  80298. // request. This prevents clients from accidentally creating duplicate
  80299. // commitments.
  80300. //
  80301. // The request ID must be a valid UUID with the exception that zero UUID
  80302. // is not supported (00000000-0000-0000-0000-000000000000).
  80303. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  80304. c.urlParams_.Set("requestId", requestId)
  80305. return c
  80306. }
  80307. // Fields allows partial responses to be retrieved. See
  80308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80309. // for more information.
  80310. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  80311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80312. return c
  80313. }
  80314. // Context sets the context to be used in this call's Do method. Any
  80315. // pending HTTP request will be aborted if the provided context is
  80316. // canceled.
  80317. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  80318. c.ctx_ = ctx
  80319. return c
  80320. }
  80321. // Header returns an http.Header that can be modified by the caller to
  80322. // add HTTP headers to the request.
  80323. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  80324. if c.header_ == nil {
  80325. c.header_ = make(http.Header)
  80326. }
  80327. return c.header_
  80328. }
  80329. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  80330. reqHeaders := make(http.Header)
  80331. for k, v := range c.header_ {
  80332. reqHeaders[k] = v
  80333. }
  80334. reqHeaders.Set("User-Agent", c.s.userAgent())
  80335. var body io.Reader = nil
  80336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  80337. if err != nil {
  80338. return nil, err
  80339. }
  80340. reqHeaders.Set("Content-Type", "application/json")
  80341. c.urlParams_.Set("alt", alt)
  80342. c.urlParams_.Set("prettyPrint", "false")
  80343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  80344. urls += "?" + c.urlParams_.Encode()
  80345. req, err := http.NewRequest("POST", urls, body)
  80346. if err != nil {
  80347. return nil, err
  80348. }
  80349. req.Header = reqHeaders
  80350. googleapi.Expand(req.URL, map[string]string{
  80351. "project": c.project,
  80352. "zone": c.zone,
  80353. })
  80354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80355. }
  80356. // Do executes the "compute.networkEndpointGroups.insert" call.
  80357. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80358. // status code is an error. Response headers are in either
  80359. // *Operation.ServerResponse.Header or (if a response was returned at
  80360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80361. // to check whether the returned error was because
  80362. // http.StatusNotModified was returned.
  80363. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80364. gensupport.SetOptions(c.urlParams_, opts...)
  80365. res, err := c.doRequest("json")
  80366. if res != nil && res.StatusCode == http.StatusNotModified {
  80367. if res.Body != nil {
  80368. res.Body.Close()
  80369. }
  80370. return nil, &googleapi.Error{
  80371. Code: res.StatusCode,
  80372. Header: res.Header,
  80373. }
  80374. }
  80375. if err != nil {
  80376. return nil, err
  80377. }
  80378. defer googleapi.CloseBody(res)
  80379. if err := googleapi.CheckResponse(res); err != nil {
  80380. return nil, err
  80381. }
  80382. ret := &Operation{
  80383. ServerResponse: googleapi.ServerResponse{
  80384. Header: res.Header,
  80385. HTTPStatusCode: res.StatusCode,
  80386. },
  80387. }
  80388. target := &ret
  80389. if err := gensupport.DecodeResponse(target, res); err != nil {
  80390. return nil, err
  80391. }
  80392. return ret, nil
  80393. // {
  80394. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  80395. // "httpMethod": "POST",
  80396. // "id": "compute.networkEndpointGroups.insert",
  80397. // "parameterOrder": [
  80398. // "project",
  80399. // "zone"
  80400. // ],
  80401. // "parameters": {
  80402. // "project": {
  80403. // "description": "Project ID for this request.",
  80404. // "location": "path",
  80405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80406. // "required": true,
  80407. // "type": "string"
  80408. // },
  80409. // "requestId": {
  80410. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80411. // "location": "query",
  80412. // "type": "string"
  80413. // },
  80414. // "zone": {
  80415. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  80416. // "location": "path",
  80417. // "required": true,
  80418. // "type": "string"
  80419. // }
  80420. // },
  80421. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  80422. // "request": {
  80423. // "$ref": "NetworkEndpointGroup"
  80424. // },
  80425. // "response": {
  80426. // "$ref": "Operation"
  80427. // },
  80428. // "scopes": [
  80429. // "https://www.googleapis.com/auth/cloud-platform",
  80430. // "https://www.googleapis.com/auth/compute"
  80431. // ]
  80432. // }
  80433. }
  80434. // method id "compute.networkEndpointGroups.list":
  80435. type NetworkEndpointGroupsListCall struct {
  80436. s *Service
  80437. project string
  80438. zone string
  80439. urlParams_ gensupport.URLParams
  80440. ifNoneMatch_ string
  80441. ctx_ context.Context
  80442. header_ http.Header
  80443. }
  80444. // List: Retrieves the list of network endpoint groups that are located
  80445. // in the specified project and zone.
  80446. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  80447. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80448. c.project = project
  80449. c.zone = zone
  80450. return c
  80451. }
  80452. // Filter sets the optional parameter "filter": A filter expression that
  80453. // filters resources listed in the response. The expression must specify
  80454. // the field name, a comparison operator, and the value that you want to
  80455. // use for filtering. The value must be a string, a number, or a
  80456. // boolean. The comparison operator must be either =, !=, >, or <.
  80457. //
  80458. // For example, if you are filtering Compute Engine instances, you can
  80459. // exclude instances named example-instance by specifying name !=
  80460. // example-instance.
  80461. //
  80462. // You can also filter nested fields. For example, you could specify
  80463. // scheduling.automaticRestart = false to include instances only if they
  80464. // are not scheduled for automatic restarts. You can use filtering on
  80465. // nested fields to filter based on resource labels.
  80466. //
  80467. // To filter on multiple expressions, provide each separate expression
  80468. // within parentheses. For example, (scheduling.automaticRestart = true)
  80469. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80470. // AND expression. However, you can include AND and OR expressions
  80471. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80472. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80473. // true).
  80474. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  80475. c.urlParams_.Set("filter", filter)
  80476. return c
  80477. }
  80478. // MaxResults sets the optional parameter "maxResults": The maximum
  80479. // number of results per page that should be returned. If the number of
  80480. // available results is larger than maxResults, Compute Engine returns a
  80481. // nextPageToken that can be used to get the next page of results in
  80482. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80483. // (Default: 500)
  80484. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  80485. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80486. return c
  80487. }
  80488. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80489. // a certain order. By default, results are returned in alphanumerical
  80490. // order based on the resource name.
  80491. //
  80492. // You can also sort results in descending order based on the creation
  80493. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80494. // based on the creationTimestamp field in reverse chronological order
  80495. // (newest result first). Use this to sort resources like operations so
  80496. // that the newest operation is returned first.
  80497. //
  80498. // Currently, only sorting by name or creationTimestamp desc is
  80499. // supported.
  80500. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  80501. c.urlParams_.Set("orderBy", orderBy)
  80502. return c
  80503. }
  80504. // PageToken sets the optional parameter "pageToken": Specifies a page
  80505. // token to use. Set pageToken to the nextPageToken returned by a
  80506. // previous list request to get the next page of results.
  80507. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  80508. c.urlParams_.Set("pageToken", pageToken)
  80509. return c
  80510. }
  80511. // Fields allows partial responses to be retrieved. See
  80512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80513. // for more information.
  80514. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  80515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80516. return c
  80517. }
  80518. // IfNoneMatch sets the optional parameter which makes the operation
  80519. // fail if the object's ETag matches the given value. This is useful for
  80520. // getting updates only after the object has changed since the last
  80521. // request. Use googleapi.IsNotModified to check whether the response
  80522. // error from Do is the result of In-None-Match.
  80523. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  80524. c.ifNoneMatch_ = entityTag
  80525. return c
  80526. }
  80527. // Context sets the context to be used in this call's Do method. Any
  80528. // pending HTTP request will be aborted if the provided context is
  80529. // canceled.
  80530. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  80531. c.ctx_ = ctx
  80532. return c
  80533. }
  80534. // Header returns an http.Header that can be modified by the caller to
  80535. // add HTTP headers to the request.
  80536. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  80537. if c.header_ == nil {
  80538. c.header_ = make(http.Header)
  80539. }
  80540. return c.header_
  80541. }
  80542. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  80543. reqHeaders := make(http.Header)
  80544. for k, v := range c.header_ {
  80545. reqHeaders[k] = v
  80546. }
  80547. reqHeaders.Set("User-Agent", c.s.userAgent())
  80548. if c.ifNoneMatch_ != "" {
  80549. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80550. }
  80551. var body io.Reader = nil
  80552. c.urlParams_.Set("alt", alt)
  80553. c.urlParams_.Set("prettyPrint", "false")
  80554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  80555. urls += "?" + c.urlParams_.Encode()
  80556. req, err := http.NewRequest("GET", urls, body)
  80557. if err != nil {
  80558. return nil, err
  80559. }
  80560. req.Header = reqHeaders
  80561. googleapi.Expand(req.URL, map[string]string{
  80562. "project": c.project,
  80563. "zone": c.zone,
  80564. })
  80565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80566. }
  80567. // Do executes the "compute.networkEndpointGroups.list" call.
  80568. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  80569. // Any non-2xx status code is an error. Response headers are in either
  80570. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  80571. // returned at all) in error.(*googleapi.Error).Header. Use
  80572. // googleapi.IsNotModified to check whether the returned error was
  80573. // because http.StatusNotModified was returned.
  80574. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  80575. gensupport.SetOptions(c.urlParams_, opts...)
  80576. res, err := c.doRequest("json")
  80577. if res != nil && res.StatusCode == http.StatusNotModified {
  80578. if res.Body != nil {
  80579. res.Body.Close()
  80580. }
  80581. return nil, &googleapi.Error{
  80582. Code: res.StatusCode,
  80583. Header: res.Header,
  80584. }
  80585. }
  80586. if err != nil {
  80587. return nil, err
  80588. }
  80589. defer googleapi.CloseBody(res)
  80590. if err := googleapi.CheckResponse(res); err != nil {
  80591. return nil, err
  80592. }
  80593. ret := &NetworkEndpointGroupList{
  80594. ServerResponse: googleapi.ServerResponse{
  80595. Header: res.Header,
  80596. HTTPStatusCode: res.StatusCode,
  80597. },
  80598. }
  80599. target := &ret
  80600. if err := gensupport.DecodeResponse(target, res); err != nil {
  80601. return nil, err
  80602. }
  80603. return ret, nil
  80604. // {
  80605. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  80606. // "httpMethod": "GET",
  80607. // "id": "compute.networkEndpointGroups.list",
  80608. // "parameterOrder": [
  80609. // "project",
  80610. // "zone"
  80611. // ],
  80612. // "parameters": {
  80613. // "filter": {
  80614. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80615. // "location": "query",
  80616. // "type": "string"
  80617. // },
  80618. // "maxResults": {
  80619. // "default": "500",
  80620. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80621. // "format": "uint32",
  80622. // "location": "query",
  80623. // "minimum": "0",
  80624. // "type": "integer"
  80625. // },
  80626. // "orderBy": {
  80627. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80628. // "location": "query",
  80629. // "type": "string"
  80630. // },
  80631. // "pageToken": {
  80632. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80633. // "location": "query",
  80634. // "type": "string"
  80635. // },
  80636. // "project": {
  80637. // "description": "Project ID for this request.",
  80638. // "location": "path",
  80639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80640. // "required": true,
  80641. // "type": "string"
  80642. // },
  80643. // "zone": {
  80644. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  80645. // "location": "path",
  80646. // "required": true,
  80647. // "type": "string"
  80648. // }
  80649. // },
  80650. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  80651. // "response": {
  80652. // "$ref": "NetworkEndpointGroupList"
  80653. // },
  80654. // "scopes": [
  80655. // "https://www.googleapis.com/auth/cloud-platform",
  80656. // "https://www.googleapis.com/auth/compute",
  80657. // "https://www.googleapis.com/auth/compute.readonly"
  80658. // ]
  80659. // }
  80660. }
  80661. // Pages invokes f for each page of results.
  80662. // A non-nil error returned from f will halt the iteration.
  80663. // The provided context supersedes any context provided to the Context method.
  80664. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  80665. c.ctx_ = ctx
  80666. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80667. for {
  80668. x, err := c.Do()
  80669. if err != nil {
  80670. return err
  80671. }
  80672. if err := f(x); err != nil {
  80673. return err
  80674. }
  80675. if x.NextPageToken == "" {
  80676. return nil
  80677. }
  80678. c.PageToken(x.NextPageToken)
  80679. }
  80680. }
  80681. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  80682. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  80683. s *Service
  80684. project string
  80685. zone string
  80686. networkEndpointGroup string
  80687. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  80688. urlParams_ gensupport.URLParams
  80689. ctx_ context.Context
  80690. header_ http.Header
  80691. }
  80692. // ListNetworkEndpoints: Lists the network endpoints in the specified
  80693. // network endpoint group.
  80694. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80695. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80696. c.project = project
  80697. c.zone = zone
  80698. c.networkEndpointGroup = networkEndpointGroup
  80699. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  80700. return c
  80701. }
  80702. // Filter sets the optional parameter "filter": A filter expression that
  80703. // filters resources listed in the response. The expression must specify
  80704. // the field name, a comparison operator, and the value that you want to
  80705. // use for filtering. The value must be a string, a number, or a
  80706. // boolean. The comparison operator must be either =, !=, >, or <.
  80707. //
  80708. // For example, if you are filtering Compute Engine instances, you can
  80709. // exclude instances named example-instance by specifying name !=
  80710. // example-instance.
  80711. //
  80712. // You can also filter nested fields. For example, you could specify
  80713. // scheduling.automaticRestart = false to include instances only if they
  80714. // are not scheduled for automatic restarts. You can use filtering on
  80715. // nested fields to filter based on resource labels.
  80716. //
  80717. // To filter on multiple expressions, provide each separate expression
  80718. // within parentheses. For example, (scheduling.automaticRestart = true)
  80719. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80720. // AND expression. However, you can include AND and OR expressions
  80721. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80722. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80723. // true).
  80724. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80725. c.urlParams_.Set("filter", filter)
  80726. return c
  80727. }
  80728. // MaxResults sets the optional parameter "maxResults": The maximum
  80729. // number of results per page that should be returned. If the number of
  80730. // available results is larger than maxResults, Compute Engine returns a
  80731. // nextPageToken that can be used to get the next page of results in
  80732. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80733. // (Default: 500)
  80734. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80735. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80736. return c
  80737. }
  80738. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80739. // a certain order. By default, results are returned in alphanumerical
  80740. // order based on the resource name.
  80741. //
  80742. // You can also sort results in descending order based on the creation
  80743. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80744. // based on the creationTimestamp field in reverse chronological order
  80745. // (newest result first). Use this to sort resources like operations so
  80746. // that the newest operation is returned first.
  80747. //
  80748. // Currently, only sorting by name or creationTimestamp desc is
  80749. // supported.
  80750. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80751. c.urlParams_.Set("orderBy", orderBy)
  80752. return c
  80753. }
  80754. // PageToken sets the optional parameter "pageToken": Specifies a page
  80755. // token to use. Set pageToken to the nextPageToken returned by a
  80756. // previous list request to get the next page of results.
  80757. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80758. c.urlParams_.Set("pageToken", pageToken)
  80759. return c
  80760. }
  80761. // Fields allows partial responses to be retrieved. See
  80762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80763. // for more information.
  80764. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80766. return c
  80767. }
  80768. // Context sets the context to be used in this call's Do method. Any
  80769. // pending HTTP request will be aborted if the provided context is
  80770. // canceled.
  80771. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  80772. c.ctx_ = ctx
  80773. return c
  80774. }
  80775. // Header returns an http.Header that can be modified by the caller to
  80776. // add HTTP headers to the request.
  80777. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  80778. if c.header_ == nil {
  80779. c.header_ = make(http.Header)
  80780. }
  80781. return c.header_
  80782. }
  80783. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  80784. reqHeaders := make(http.Header)
  80785. for k, v := range c.header_ {
  80786. reqHeaders[k] = v
  80787. }
  80788. reqHeaders.Set("User-Agent", c.s.userAgent())
  80789. var body io.Reader = nil
  80790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  80791. if err != nil {
  80792. return nil, err
  80793. }
  80794. reqHeaders.Set("Content-Type", "application/json")
  80795. c.urlParams_.Set("alt", alt)
  80796. c.urlParams_.Set("prettyPrint", "false")
  80797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  80798. urls += "?" + c.urlParams_.Encode()
  80799. req, err := http.NewRequest("POST", urls, body)
  80800. if err != nil {
  80801. return nil, err
  80802. }
  80803. req.Header = reqHeaders
  80804. googleapi.Expand(req.URL, map[string]string{
  80805. "project": c.project,
  80806. "zone": c.zone,
  80807. "networkEndpointGroup": c.networkEndpointGroup,
  80808. })
  80809. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80810. }
  80811. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  80812. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  80813. // will be non-nil. Any non-2xx status code is an error. Response
  80814. // headers are in either
  80815. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  80816. // (if a response was returned at all) in
  80817. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  80818. // whether the returned error was because http.StatusNotModified was
  80819. // returned.
  80820. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  80821. gensupport.SetOptions(c.urlParams_, opts...)
  80822. res, err := c.doRequest("json")
  80823. if res != nil && res.StatusCode == http.StatusNotModified {
  80824. if res.Body != nil {
  80825. res.Body.Close()
  80826. }
  80827. return nil, &googleapi.Error{
  80828. Code: res.StatusCode,
  80829. Header: res.Header,
  80830. }
  80831. }
  80832. if err != nil {
  80833. return nil, err
  80834. }
  80835. defer googleapi.CloseBody(res)
  80836. if err := googleapi.CheckResponse(res); err != nil {
  80837. return nil, err
  80838. }
  80839. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  80840. ServerResponse: googleapi.ServerResponse{
  80841. Header: res.Header,
  80842. HTTPStatusCode: res.StatusCode,
  80843. },
  80844. }
  80845. target := &ret
  80846. if err := gensupport.DecodeResponse(target, res); err != nil {
  80847. return nil, err
  80848. }
  80849. return ret, nil
  80850. // {
  80851. // "description": "Lists the network endpoints in the specified network endpoint group.",
  80852. // "httpMethod": "POST",
  80853. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  80854. // "parameterOrder": [
  80855. // "project",
  80856. // "zone",
  80857. // "networkEndpointGroup"
  80858. // ],
  80859. // "parameters": {
  80860. // "filter": {
  80861. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80862. // "location": "query",
  80863. // "type": "string"
  80864. // },
  80865. // "maxResults": {
  80866. // "default": "500",
  80867. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80868. // "format": "uint32",
  80869. // "location": "query",
  80870. // "minimum": "0",
  80871. // "type": "integer"
  80872. // },
  80873. // "networkEndpointGroup": {
  80874. // "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.",
  80875. // "location": "path",
  80876. // "required": true,
  80877. // "type": "string"
  80878. // },
  80879. // "orderBy": {
  80880. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80881. // "location": "query",
  80882. // "type": "string"
  80883. // },
  80884. // "pageToken": {
  80885. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80886. // "location": "query",
  80887. // "type": "string"
  80888. // },
  80889. // "project": {
  80890. // "description": "Project ID for this request.",
  80891. // "location": "path",
  80892. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80893. // "required": true,
  80894. // "type": "string"
  80895. // },
  80896. // "zone": {
  80897. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  80898. // "location": "path",
  80899. // "required": true,
  80900. // "type": "string"
  80901. // }
  80902. // },
  80903. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  80904. // "request": {
  80905. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  80906. // },
  80907. // "response": {
  80908. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  80909. // },
  80910. // "scopes": [
  80911. // "https://www.googleapis.com/auth/cloud-platform",
  80912. // "https://www.googleapis.com/auth/compute",
  80913. // "https://www.googleapis.com/auth/compute.readonly"
  80914. // ]
  80915. // }
  80916. }
  80917. // Pages invokes f for each page of results.
  80918. // A non-nil error returned from f will halt the iteration.
  80919. // The provided context supersedes any context provided to the Context method.
  80920. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  80921. c.ctx_ = ctx
  80922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80923. for {
  80924. x, err := c.Do()
  80925. if err != nil {
  80926. return err
  80927. }
  80928. if err := f(x); err != nil {
  80929. return err
  80930. }
  80931. if x.NextPageToken == "" {
  80932. return nil
  80933. }
  80934. c.PageToken(x.NextPageToken)
  80935. }
  80936. }
  80937. // method id "compute.networkEndpointGroups.testIamPermissions":
  80938. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  80939. s *Service
  80940. project string
  80941. zone string
  80942. resource string
  80943. testpermissionsrequest *TestPermissionsRequest
  80944. urlParams_ gensupport.URLParams
  80945. ctx_ context.Context
  80946. header_ http.Header
  80947. }
  80948. // TestIamPermissions: Returns permissions that a caller has on the
  80949. // specified resource.
  80950. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  80951. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80952. c.project = project
  80953. c.zone = zone
  80954. c.resource = resource
  80955. c.testpermissionsrequest = testpermissionsrequest
  80956. return c
  80957. }
  80958. // Fields allows partial responses to be retrieved. See
  80959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80960. // for more information.
  80961. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  80962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80963. return c
  80964. }
  80965. // Context sets the context to be used in this call's Do method. Any
  80966. // pending HTTP request will be aborted if the provided context is
  80967. // canceled.
  80968. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  80969. c.ctx_ = ctx
  80970. return c
  80971. }
  80972. // Header returns an http.Header that can be modified by the caller to
  80973. // add HTTP headers to the request.
  80974. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  80975. if c.header_ == nil {
  80976. c.header_ = make(http.Header)
  80977. }
  80978. return c.header_
  80979. }
  80980. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  80981. reqHeaders := make(http.Header)
  80982. for k, v := range c.header_ {
  80983. reqHeaders[k] = v
  80984. }
  80985. reqHeaders.Set("User-Agent", c.s.userAgent())
  80986. var body io.Reader = nil
  80987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  80988. if err != nil {
  80989. return nil, err
  80990. }
  80991. reqHeaders.Set("Content-Type", "application/json")
  80992. c.urlParams_.Set("alt", alt)
  80993. c.urlParams_.Set("prettyPrint", "false")
  80994. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  80995. urls += "?" + c.urlParams_.Encode()
  80996. req, err := http.NewRequest("POST", urls, body)
  80997. if err != nil {
  80998. return nil, err
  80999. }
  81000. req.Header = reqHeaders
  81001. googleapi.Expand(req.URL, map[string]string{
  81002. "project": c.project,
  81003. "zone": c.zone,
  81004. "resource": c.resource,
  81005. })
  81006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81007. }
  81008. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  81009. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81010. // non-2xx status code is an error. Response headers are in either
  81011. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81012. // returned at all) in error.(*googleapi.Error).Header. Use
  81013. // googleapi.IsNotModified to check whether the returned error was
  81014. // because http.StatusNotModified was returned.
  81015. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81016. gensupport.SetOptions(c.urlParams_, opts...)
  81017. res, err := c.doRequest("json")
  81018. if res != nil && res.StatusCode == http.StatusNotModified {
  81019. if res.Body != nil {
  81020. res.Body.Close()
  81021. }
  81022. return nil, &googleapi.Error{
  81023. Code: res.StatusCode,
  81024. Header: res.Header,
  81025. }
  81026. }
  81027. if err != nil {
  81028. return nil, err
  81029. }
  81030. defer googleapi.CloseBody(res)
  81031. if err := googleapi.CheckResponse(res); err != nil {
  81032. return nil, err
  81033. }
  81034. ret := &TestPermissionsResponse{
  81035. ServerResponse: googleapi.ServerResponse{
  81036. Header: res.Header,
  81037. HTTPStatusCode: res.StatusCode,
  81038. },
  81039. }
  81040. target := &ret
  81041. if err := gensupport.DecodeResponse(target, res); err != nil {
  81042. return nil, err
  81043. }
  81044. return ret, nil
  81045. // {
  81046. // "description": "Returns permissions that a caller has on the specified resource.",
  81047. // "httpMethod": "POST",
  81048. // "id": "compute.networkEndpointGroups.testIamPermissions",
  81049. // "parameterOrder": [
  81050. // "project",
  81051. // "zone",
  81052. // "resource"
  81053. // ],
  81054. // "parameters": {
  81055. // "project": {
  81056. // "description": "Project ID for this request.",
  81057. // "location": "path",
  81058. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81059. // "required": true,
  81060. // "type": "string"
  81061. // },
  81062. // "resource": {
  81063. // "description": "Name or id of the resource for this request.",
  81064. // "location": "path",
  81065. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81066. // "required": true,
  81067. // "type": "string"
  81068. // },
  81069. // "zone": {
  81070. // "description": "The name of the zone for this request.",
  81071. // "location": "path",
  81072. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81073. // "required": true,
  81074. // "type": "string"
  81075. // }
  81076. // },
  81077. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  81078. // "request": {
  81079. // "$ref": "TestPermissionsRequest"
  81080. // },
  81081. // "response": {
  81082. // "$ref": "TestPermissionsResponse"
  81083. // },
  81084. // "scopes": [
  81085. // "https://www.googleapis.com/auth/cloud-platform",
  81086. // "https://www.googleapis.com/auth/compute",
  81087. // "https://www.googleapis.com/auth/compute.readonly"
  81088. // ]
  81089. // }
  81090. }
  81091. // method id "compute.networks.addPeering":
  81092. type NetworksAddPeeringCall struct {
  81093. s *Service
  81094. project string
  81095. network string
  81096. networksaddpeeringrequest *NetworksAddPeeringRequest
  81097. urlParams_ gensupport.URLParams
  81098. ctx_ context.Context
  81099. header_ http.Header
  81100. }
  81101. // AddPeering: Adds a peering to the specified network.
  81102. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  81103. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81104. c.project = project
  81105. c.network = network
  81106. c.networksaddpeeringrequest = networksaddpeeringrequest
  81107. return c
  81108. }
  81109. // RequestId sets the optional parameter "requestId": An optional
  81110. // request ID to identify requests. Specify a unique request ID so that
  81111. // if you must retry your request, the server will know to ignore the
  81112. // request if it has already been completed.
  81113. //
  81114. // For example, consider a situation where you make an initial request
  81115. // and the request times out. If you make the request again with the
  81116. // same request ID, the server can check if original operation with the
  81117. // same request ID was received, and if so, will ignore the second
  81118. // request. This prevents clients from accidentally creating duplicate
  81119. // commitments.
  81120. //
  81121. // The request ID must be a valid UUID with the exception that zero UUID
  81122. // is not supported (00000000-0000-0000-0000-000000000000).
  81123. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  81124. c.urlParams_.Set("requestId", requestId)
  81125. return c
  81126. }
  81127. // Fields allows partial responses to be retrieved. See
  81128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81129. // for more information.
  81130. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  81131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81132. return c
  81133. }
  81134. // Context sets the context to be used in this call's Do method. Any
  81135. // pending HTTP request will be aborted if the provided context is
  81136. // canceled.
  81137. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  81138. c.ctx_ = ctx
  81139. return c
  81140. }
  81141. // Header returns an http.Header that can be modified by the caller to
  81142. // add HTTP headers to the request.
  81143. func (c *NetworksAddPeeringCall) Header() http.Header {
  81144. if c.header_ == nil {
  81145. c.header_ = make(http.Header)
  81146. }
  81147. return c.header_
  81148. }
  81149. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  81150. reqHeaders := make(http.Header)
  81151. for k, v := range c.header_ {
  81152. reqHeaders[k] = v
  81153. }
  81154. reqHeaders.Set("User-Agent", c.s.userAgent())
  81155. var body io.Reader = nil
  81156. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  81157. if err != nil {
  81158. return nil, err
  81159. }
  81160. reqHeaders.Set("Content-Type", "application/json")
  81161. c.urlParams_.Set("alt", alt)
  81162. c.urlParams_.Set("prettyPrint", "false")
  81163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  81164. urls += "?" + c.urlParams_.Encode()
  81165. req, err := http.NewRequest("POST", urls, body)
  81166. if err != nil {
  81167. return nil, err
  81168. }
  81169. req.Header = reqHeaders
  81170. googleapi.Expand(req.URL, map[string]string{
  81171. "project": c.project,
  81172. "network": c.network,
  81173. })
  81174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81175. }
  81176. // Do executes the "compute.networks.addPeering" call.
  81177. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81178. // status code is an error. Response headers are in either
  81179. // *Operation.ServerResponse.Header or (if a response was returned at
  81180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81181. // to check whether the returned error was because
  81182. // http.StatusNotModified was returned.
  81183. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81184. gensupport.SetOptions(c.urlParams_, opts...)
  81185. res, err := c.doRequest("json")
  81186. if res != nil && res.StatusCode == http.StatusNotModified {
  81187. if res.Body != nil {
  81188. res.Body.Close()
  81189. }
  81190. return nil, &googleapi.Error{
  81191. Code: res.StatusCode,
  81192. Header: res.Header,
  81193. }
  81194. }
  81195. if err != nil {
  81196. return nil, err
  81197. }
  81198. defer googleapi.CloseBody(res)
  81199. if err := googleapi.CheckResponse(res); err != nil {
  81200. return nil, err
  81201. }
  81202. ret := &Operation{
  81203. ServerResponse: googleapi.ServerResponse{
  81204. Header: res.Header,
  81205. HTTPStatusCode: res.StatusCode,
  81206. },
  81207. }
  81208. target := &ret
  81209. if err := gensupport.DecodeResponse(target, res); err != nil {
  81210. return nil, err
  81211. }
  81212. return ret, nil
  81213. // {
  81214. // "description": "Adds a peering to the specified network.",
  81215. // "httpMethod": "POST",
  81216. // "id": "compute.networks.addPeering",
  81217. // "parameterOrder": [
  81218. // "project",
  81219. // "network"
  81220. // ],
  81221. // "parameters": {
  81222. // "network": {
  81223. // "description": "Name of the network resource to add peering to.",
  81224. // "location": "path",
  81225. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81226. // "required": true,
  81227. // "type": "string"
  81228. // },
  81229. // "project": {
  81230. // "description": "Project ID for this request.",
  81231. // "location": "path",
  81232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81233. // "required": true,
  81234. // "type": "string"
  81235. // },
  81236. // "requestId": {
  81237. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81238. // "location": "query",
  81239. // "type": "string"
  81240. // }
  81241. // },
  81242. // "path": "{project}/global/networks/{network}/addPeering",
  81243. // "request": {
  81244. // "$ref": "NetworksAddPeeringRequest"
  81245. // },
  81246. // "response": {
  81247. // "$ref": "Operation"
  81248. // },
  81249. // "scopes": [
  81250. // "https://www.googleapis.com/auth/cloud-platform",
  81251. // "https://www.googleapis.com/auth/compute"
  81252. // ]
  81253. // }
  81254. }
  81255. // method id "compute.networks.delete":
  81256. type NetworksDeleteCall struct {
  81257. s *Service
  81258. project string
  81259. network string
  81260. urlParams_ gensupport.URLParams
  81261. ctx_ context.Context
  81262. header_ http.Header
  81263. }
  81264. // Delete: Deletes the specified network.
  81265. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  81266. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  81267. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81268. c.project = project
  81269. c.network = network
  81270. return c
  81271. }
  81272. // RequestId sets the optional parameter "requestId": An optional
  81273. // request ID to identify requests. Specify a unique request ID so that
  81274. // if you must retry your request, the server will know to ignore the
  81275. // request if it has already been completed.
  81276. //
  81277. // For example, consider a situation where you make an initial request
  81278. // and the request times out. If you make the request again with the
  81279. // same request ID, the server can check if original operation with the
  81280. // same request ID was received, and if so, will ignore the second
  81281. // request. This prevents clients from accidentally creating duplicate
  81282. // commitments.
  81283. //
  81284. // The request ID must be a valid UUID with the exception that zero UUID
  81285. // is not supported (00000000-0000-0000-0000-000000000000).
  81286. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  81287. c.urlParams_.Set("requestId", requestId)
  81288. return c
  81289. }
  81290. // Fields allows partial responses to be retrieved. See
  81291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81292. // for more information.
  81293. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  81294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81295. return c
  81296. }
  81297. // Context sets the context to be used in this call's Do method. Any
  81298. // pending HTTP request will be aborted if the provided context is
  81299. // canceled.
  81300. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  81301. c.ctx_ = ctx
  81302. return c
  81303. }
  81304. // Header returns an http.Header that can be modified by the caller to
  81305. // add HTTP headers to the request.
  81306. func (c *NetworksDeleteCall) Header() http.Header {
  81307. if c.header_ == nil {
  81308. c.header_ = make(http.Header)
  81309. }
  81310. return c.header_
  81311. }
  81312. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  81313. reqHeaders := make(http.Header)
  81314. for k, v := range c.header_ {
  81315. reqHeaders[k] = v
  81316. }
  81317. reqHeaders.Set("User-Agent", c.s.userAgent())
  81318. var body io.Reader = nil
  81319. c.urlParams_.Set("alt", alt)
  81320. c.urlParams_.Set("prettyPrint", "false")
  81321. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  81322. urls += "?" + c.urlParams_.Encode()
  81323. req, err := http.NewRequest("DELETE", urls, body)
  81324. if err != nil {
  81325. return nil, err
  81326. }
  81327. req.Header = reqHeaders
  81328. googleapi.Expand(req.URL, map[string]string{
  81329. "project": c.project,
  81330. "network": c.network,
  81331. })
  81332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81333. }
  81334. // Do executes the "compute.networks.delete" call.
  81335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81336. // status code is an error. Response headers are in either
  81337. // *Operation.ServerResponse.Header or (if a response was returned at
  81338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81339. // to check whether the returned error was because
  81340. // http.StatusNotModified was returned.
  81341. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81342. gensupport.SetOptions(c.urlParams_, opts...)
  81343. res, err := c.doRequest("json")
  81344. if res != nil && res.StatusCode == http.StatusNotModified {
  81345. if res.Body != nil {
  81346. res.Body.Close()
  81347. }
  81348. return nil, &googleapi.Error{
  81349. Code: res.StatusCode,
  81350. Header: res.Header,
  81351. }
  81352. }
  81353. if err != nil {
  81354. return nil, err
  81355. }
  81356. defer googleapi.CloseBody(res)
  81357. if err := googleapi.CheckResponse(res); err != nil {
  81358. return nil, err
  81359. }
  81360. ret := &Operation{
  81361. ServerResponse: googleapi.ServerResponse{
  81362. Header: res.Header,
  81363. HTTPStatusCode: res.StatusCode,
  81364. },
  81365. }
  81366. target := &ret
  81367. if err := gensupport.DecodeResponse(target, res); err != nil {
  81368. return nil, err
  81369. }
  81370. return ret, nil
  81371. // {
  81372. // "description": "Deletes the specified network.",
  81373. // "httpMethod": "DELETE",
  81374. // "id": "compute.networks.delete",
  81375. // "parameterOrder": [
  81376. // "project",
  81377. // "network"
  81378. // ],
  81379. // "parameters": {
  81380. // "network": {
  81381. // "description": "Name of the network to delete.",
  81382. // "location": "path",
  81383. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81384. // "required": true,
  81385. // "type": "string"
  81386. // },
  81387. // "project": {
  81388. // "description": "Project ID for this request.",
  81389. // "location": "path",
  81390. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81391. // "required": true,
  81392. // "type": "string"
  81393. // },
  81394. // "requestId": {
  81395. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81396. // "location": "query",
  81397. // "type": "string"
  81398. // }
  81399. // },
  81400. // "path": "{project}/global/networks/{network}",
  81401. // "response": {
  81402. // "$ref": "Operation"
  81403. // },
  81404. // "scopes": [
  81405. // "https://www.googleapis.com/auth/cloud-platform",
  81406. // "https://www.googleapis.com/auth/compute"
  81407. // ]
  81408. // }
  81409. }
  81410. // method id "compute.networks.get":
  81411. type NetworksGetCall struct {
  81412. s *Service
  81413. project string
  81414. network string
  81415. urlParams_ gensupport.URLParams
  81416. ifNoneMatch_ string
  81417. ctx_ context.Context
  81418. header_ http.Header
  81419. }
  81420. // Get: Returns the specified network. Gets a list of available networks
  81421. // by making a list() request.
  81422. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  81423. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  81424. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81425. c.project = project
  81426. c.network = network
  81427. return c
  81428. }
  81429. // Fields allows partial responses to be retrieved. See
  81430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81431. // for more information.
  81432. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  81433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81434. return c
  81435. }
  81436. // IfNoneMatch sets the optional parameter which makes the operation
  81437. // fail if the object's ETag matches the given value. This is useful for
  81438. // getting updates only after the object has changed since the last
  81439. // request. Use googleapi.IsNotModified to check whether the response
  81440. // error from Do is the result of In-None-Match.
  81441. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  81442. c.ifNoneMatch_ = entityTag
  81443. return c
  81444. }
  81445. // Context sets the context to be used in this call's Do method. Any
  81446. // pending HTTP request will be aborted if the provided context is
  81447. // canceled.
  81448. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  81449. c.ctx_ = ctx
  81450. return c
  81451. }
  81452. // Header returns an http.Header that can be modified by the caller to
  81453. // add HTTP headers to the request.
  81454. func (c *NetworksGetCall) Header() http.Header {
  81455. if c.header_ == nil {
  81456. c.header_ = make(http.Header)
  81457. }
  81458. return c.header_
  81459. }
  81460. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  81461. reqHeaders := make(http.Header)
  81462. for k, v := range c.header_ {
  81463. reqHeaders[k] = v
  81464. }
  81465. reqHeaders.Set("User-Agent", c.s.userAgent())
  81466. if c.ifNoneMatch_ != "" {
  81467. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81468. }
  81469. var body io.Reader = nil
  81470. c.urlParams_.Set("alt", alt)
  81471. c.urlParams_.Set("prettyPrint", "false")
  81472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  81473. urls += "?" + c.urlParams_.Encode()
  81474. req, err := http.NewRequest("GET", urls, body)
  81475. if err != nil {
  81476. return nil, err
  81477. }
  81478. req.Header = reqHeaders
  81479. googleapi.Expand(req.URL, map[string]string{
  81480. "project": c.project,
  81481. "network": c.network,
  81482. })
  81483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81484. }
  81485. // Do executes the "compute.networks.get" call.
  81486. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  81487. // code is an error. Response headers are in either
  81488. // *Network.ServerResponse.Header or (if a response was returned at all)
  81489. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81490. // check whether the returned error was because http.StatusNotModified
  81491. // was returned.
  81492. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  81493. gensupport.SetOptions(c.urlParams_, opts...)
  81494. res, err := c.doRequest("json")
  81495. if res != nil && res.StatusCode == http.StatusNotModified {
  81496. if res.Body != nil {
  81497. res.Body.Close()
  81498. }
  81499. return nil, &googleapi.Error{
  81500. Code: res.StatusCode,
  81501. Header: res.Header,
  81502. }
  81503. }
  81504. if err != nil {
  81505. return nil, err
  81506. }
  81507. defer googleapi.CloseBody(res)
  81508. if err := googleapi.CheckResponse(res); err != nil {
  81509. return nil, err
  81510. }
  81511. ret := &Network{
  81512. ServerResponse: googleapi.ServerResponse{
  81513. Header: res.Header,
  81514. HTTPStatusCode: res.StatusCode,
  81515. },
  81516. }
  81517. target := &ret
  81518. if err := gensupport.DecodeResponse(target, res); err != nil {
  81519. return nil, err
  81520. }
  81521. return ret, nil
  81522. // {
  81523. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  81524. // "httpMethod": "GET",
  81525. // "id": "compute.networks.get",
  81526. // "parameterOrder": [
  81527. // "project",
  81528. // "network"
  81529. // ],
  81530. // "parameters": {
  81531. // "network": {
  81532. // "description": "Name of the network to return.",
  81533. // "location": "path",
  81534. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81535. // "required": true,
  81536. // "type": "string"
  81537. // },
  81538. // "project": {
  81539. // "description": "Project ID for this request.",
  81540. // "location": "path",
  81541. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81542. // "required": true,
  81543. // "type": "string"
  81544. // }
  81545. // },
  81546. // "path": "{project}/global/networks/{network}",
  81547. // "response": {
  81548. // "$ref": "Network"
  81549. // },
  81550. // "scopes": [
  81551. // "https://www.googleapis.com/auth/cloud-platform",
  81552. // "https://www.googleapis.com/auth/compute",
  81553. // "https://www.googleapis.com/auth/compute.readonly"
  81554. // ]
  81555. // }
  81556. }
  81557. // method id "compute.networks.insert":
  81558. type NetworksInsertCall struct {
  81559. s *Service
  81560. project string
  81561. network *Network
  81562. urlParams_ gensupport.URLParams
  81563. ctx_ context.Context
  81564. header_ http.Header
  81565. }
  81566. // Insert: Creates a network in the specified project using the data
  81567. // included in the request.
  81568. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  81569. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  81570. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81571. c.project = project
  81572. c.network = network
  81573. return c
  81574. }
  81575. // RequestId sets the optional parameter "requestId": An optional
  81576. // request ID to identify requests. Specify a unique request ID so that
  81577. // if you must retry your request, the server will know to ignore the
  81578. // request if it has already been completed.
  81579. //
  81580. // For example, consider a situation where you make an initial request
  81581. // and the request times out. If you make the request again with the
  81582. // same request ID, the server can check if original operation with the
  81583. // same request ID was received, and if so, will ignore the second
  81584. // request. This prevents clients from accidentally creating duplicate
  81585. // commitments.
  81586. //
  81587. // The request ID must be a valid UUID with the exception that zero UUID
  81588. // is not supported (00000000-0000-0000-0000-000000000000).
  81589. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  81590. c.urlParams_.Set("requestId", requestId)
  81591. return c
  81592. }
  81593. // Fields allows partial responses to be retrieved. See
  81594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81595. // for more information.
  81596. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  81597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81598. return c
  81599. }
  81600. // Context sets the context to be used in this call's Do method. Any
  81601. // pending HTTP request will be aborted if the provided context is
  81602. // canceled.
  81603. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  81604. c.ctx_ = ctx
  81605. return c
  81606. }
  81607. // Header returns an http.Header that can be modified by the caller to
  81608. // add HTTP headers to the request.
  81609. func (c *NetworksInsertCall) Header() http.Header {
  81610. if c.header_ == nil {
  81611. c.header_ = make(http.Header)
  81612. }
  81613. return c.header_
  81614. }
  81615. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  81616. reqHeaders := make(http.Header)
  81617. for k, v := range c.header_ {
  81618. reqHeaders[k] = v
  81619. }
  81620. reqHeaders.Set("User-Agent", c.s.userAgent())
  81621. var body io.Reader = nil
  81622. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  81623. if err != nil {
  81624. return nil, err
  81625. }
  81626. reqHeaders.Set("Content-Type", "application/json")
  81627. c.urlParams_.Set("alt", alt)
  81628. c.urlParams_.Set("prettyPrint", "false")
  81629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  81630. urls += "?" + c.urlParams_.Encode()
  81631. req, err := http.NewRequest("POST", urls, body)
  81632. if err != nil {
  81633. return nil, err
  81634. }
  81635. req.Header = reqHeaders
  81636. googleapi.Expand(req.URL, map[string]string{
  81637. "project": c.project,
  81638. })
  81639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81640. }
  81641. // Do executes the "compute.networks.insert" call.
  81642. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81643. // status code is an error. Response headers are in either
  81644. // *Operation.ServerResponse.Header or (if a response was returned at
  81645. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81646. // to check whether the returned error was because
  81647. // http.StatusNotModified was returned.
  81648. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81649. gensupport.SetOptions(c.urlParams_, opts...)
  81650. res, err := c.doRequest("json")
  81651. if res != nil && res.StatusCode == http.StatusNotModified {
  81652. if res.Body != nil {
  81653. res.Body.Close()
  81654. }
  81655. return nil, &googleapi.Error{
  81656. Code: res.StatusCode,
  81657. Header: res.Header,
  81658. }
  81659. }
  81660. if err != nil {
  81661. return nil, err
  81662. }
  81663. defer googleapi.CloseBody(res)
  81664. if err := googleapi.CheckResponse(res); err != nil {
  81665. return nil, err
  81666. }
  81667. ret := &Operation{
  81668. ServerResponse: googleapi.ServerResponse{
  81669. Header: res.Header,
  81670. HTTPStatusCode: res.StatusCode,
  81671. },
  81672. }
  81673. target := &ret
  81674. if err := gensupport.DecodeResponse(target, res); err != nil {
  81675. return nil, err
  81676. }
  81677. return ret, nil
  81678. // {
  81679. // "description": "Creates a network in the specified project using the data included in the request.",
  81680. // "httpMethod": "POST",
  81681. // "id": "compute.networks.insert",
  81682. // "parameterOrder": [
  81683. // "project"
  81684. // ],
  81685. // "parameters": {
  81686. // "project": {
  81687. // "description": "Project ID for this request.",
  81688. // "location": "path",
  81689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81690. // "required": true,
  81691. // "type": "string"
  81692. // },
  81693. // "requestId": {
  81694. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81695. // "location": "query",
  81696. // "type": "string"
  81697. // }
  81698. // },
  81699. // "path": "{project}/global/networks",
  81700. // "request": {
  81701. // "$ref": "Network"
  81702. // },
  81703. // "response": {
  81704. // "$ref": "Operation"
  81705. // },
  81706. // "scopes": [
  81707. // "https://www.googleapis.com/auth/cloud-platform",
  81708. // "https://www.googleapis.com/auth/compute"
  81709. // ]
  81710. // }
  81711. }
  81712. // method id "compute.networks.list":
  81713. type NetworksListCall struct {
  81714. s *Service
  81715. project string
  81716. urlParams_ gensupport.URLParams
  81717. ifNoneMatch_ string
  81718. ctx_ context.Context
  81719. header_ http.Header
  81720. }
  81721. // List: Retrieves the list of networks available to the specified
  81722. // project.
  81723. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  81724. func (r *NetworksService) List(project string) *NetworksListCall {
  81725. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81726. c.project = project
  81727. return c
  81728. }
  81729. // Filter sets the optional parameter "filter": A filter expression that
  81730. // filters resources listed in the response. The expression must specify
  81731. // the field name, a comparison operator, and the value that you want to
  81732. // use for filtering. The value must be a string, a number, or a
  81733. // boolean. The comparison operator must be either =, !=, >, or <.
  81734. //
  81735. // For example, if you are filtering Compute Engine instances, you can
  81736. // exclude instances named example-instance by specifying name !=
  81737. // example-instance.
  81738. //
  81739. // You can also filter nested fields. For example, you could specify
  81740. // scheduling.automaticRestart = false to include instances only if they
  81741. // are not scheduled for automatic restarts. You can use filtering on
  81742. // nested fields to filter based on resource labels.
  81743. //
  81744. // To filter on multiple expressions, provide each separate expression
  81745. // within parentheses. For example, (scheduling.automaticRestart = true)
  81746. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81747. // AND expression. However, you can include AND and OR expressions
  81748. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81749. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81750. // true).
  81751. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  81752. c.urlParams_.Set("filter", filter)
  81753. return c
  81754. }
  81755. // MaxResults sets the optional parameter "maxResults": The maximum
  81756. // number of results per page that should be returned. If the number of
  81757. // available results is larger than maxResults, Compute Engine returns a
  81758. // nextPageToken that can be used to get the next page of results in
  81759. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81760. // (Default: 500)
  81761. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  81762. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81763. return c
  81764. }
  81765. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81766. // a certain order. By default, results are returned in alphanumerical
  81767. // order based on the resource name.
  81768. //
  81769. // You can also sort results in descending order based on the creation
  81770. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81771. // based on the creationTimestamp field in reverse chronological order
  81772. // (newest result first). Use this to sort resources like operations so
  81773. // that the newest operation is returned first.
  81774. //
  81775. // Currently, only sorting by name or creationTimestamp desc is
  81776. // supported.
  81777. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  81778. c.urlParams_.Set("orderBy", orderBy)
  81779. return c
  81780. }
  81781. // PageToken sets the optional parameter "pageToken": Specifies a page
  81782. // token to use. Set pageToken to the nextPageToken returned by a
  81783. // previous list request to get the next page of results.
  81784. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  81785. c.urlParams_.Set("pageToken", pageToken)
  81786. return c
  81787. }
  81788. // Fields allows partial responses to be retrieved. See
  81789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81790. // for more information.
  81791. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  81792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81793. return c
  81794. }
  81795. // IfNoneMatch sets the optional parameter which makes the operation
  81796. // fail if the object's ETag matches the given value. This is useful for
  81797. // getting updates only after the object has changed since the last
  81798. // request. Use googleapi.IsNotModified to check whether the response
  81799. // error from Do is the result of In-None-Match.
  81800. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  81801. c.ifNoneMatch_ = entityTag
  81802. return c
  81803. }
  81804. // Context sets the context to be used in this call's Do method. Any
  81805. // pending HTTP request will be aborted if the provided context is
  81806. // canceled.
  81807. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  81808. c.ctx_ = ctx
  81809. return c
  81810. }
  81811. // Header returns an http.Header that can be modified by the caller to
  81812. // add HTTP headers to the request.
  81813. func (c *NetworksListCall) Header() http.Header {
  81814. if c.header_ == nil {
  81815. c.header_ = make(http.Header)
  81816. }
  81817. return c.header_
  81818. }
  81819. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  81820. reqHeaders := make(http.Header)
  81821. for k, v := range c.header_ {
  81822. reqHeaders[k] = v
  81823. }
  81824. reqHeaders.Set("User-Agent", c.s.userAgent())
  81825. if c.ifNoneMatch_ != "" {
  81826. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81827. }
  81828. var body io.Reader = nil
  81829. c.urlParams_.Set("alt", alt)
  81830. c.urlParams_.Set("prettyPrint", "false")
  81831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  81832. urls += "?" + c.urlParams_.Encode()
  81833. req, err := http.NewRequest("GET", urls, body)
  81834. if err != nil {
  81835. return nil, err
  81836. }
  81837. req.Header = reqHeaders
  81838. googleapi.Expand(req.URL, map[string]string{
  81839. "project": c.project,
  81840. })
  81841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81842. }
  81843. // Do executes the "compute.networks.list" call.
  81844. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  81845. // status code is an error. Response headers are in either
  81846. // *NetworkList.ServerResponse.Header or (if a response was returned at
  81847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81848. // to check whether the returned error was because
  81849. // http.StatusNotModified was returned.
  81850. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  81851. gensupport.SetOptions(c.urlParams_, opts...)
  81852. res, err := c.doRequest("json")
  81853. if res != nil && res.StatusCode == http.StatusNotModified {
  81854. if res.Body != nil {
  81855. res.Body.Close()
  81856. }
  81857. return nil, &googleapi.Error{
  81858. Code: res.StatusCode,
  81859. Header: res.Header,
  81860. }
  81861. }
  81862. if err != nil {
  81863. return nil, err
  81864. }
  81865. defer googleapi.CloseBody(res)
  81866. if err := googleapi.CheckResponse(res); err != nil {
  81867. return nil, err
  81868. }
  81869. ret := &NetworkList{
  81870. ServerResponse: googleapi.ServerResponse{
  81871. Header: res.Header,
  81872. HTTPStatusCode: res.StatusCode,
  81873. },
  81874. }
  81875. target := &ret
  81876. if err := gensupport.DecodeResponse(target, res); err != nil {
  81877. return nil, err
  81878. }
  81879. return ret, nil
  81880. // {
  81881. // "description": "Retrieves the list of networks available to the specified project.",
  81882. // "httpMethod": "GET",
  81883. // "id": "compute.networks.list",
  81884. // "parameterOrder": [
  81885. // "project"
  81886. // ],
  81887. // "parameters": {
  81888. // "filter": {
  81889. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  81890. // "location": "query",
  81891. // "type": "string"
  81892. // },
  81893. // "maxResults": {
  81894. // "default": "500",
  81895. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  81896. // "format": "uint32",
  81897. // "location": "query",
  81898. // "minimum": "0",
  81899. // "type": "integer"
  81900. // },
  81901. // "orderBy": {
  81902. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  81903. // "location": "query",
  81904. // "type": "string"
  81905. // },
  81906. // "pageToken": {
  81907. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  81908. // "location": "query",
  81909. // "type": "string"
  81910. // },
  81911. // "project": {
  81912. // "description": "Project ID for this request.",
  81913. // "location": "path",
  81914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81915. // "required": true,
  81916. // "type": "string"
  81917. // }
  81918. // },
  81919. // "path": "{project}/global/networks",
  81920. // "response": {
  81921. // "$ref": "NetworkList"
  81922. // },
  81923. // "scopes": [
  81924. // "https://www.googleapis.com/auth/cloud-platform",
  81925. // "https://www.googleapis.com/auth/compute",
  81926. // "https://www.googleapis.com/auth/compute.readonly"
  81927. // ]
  81928. // }
  81929. }
  81930. // Pages invokes f for each page of results.
  81931. // A non-nil error returned from f will halt the iteration.
  81932. // The provided context supersedes any context provided to the Context method.
  81933. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  81934. c.ctx_ = ctx
  81935. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81936. for {
  81937. x, err := c.Do()
  81938. if err != nil {
  81939. return err
  81940. }
  81941. if err := f(x); err != nil {
  81942. return err
  81943. }
  81944. if x.NextPageToken == "" {
  81945. return nil
  81946. }
  81947. c.PageToken(x.NextPageToken)
  81948. }
  81949. }
  81950. // method id "compute.networks.listIpAddresses":
  81951. type NetworksListIpAddressesCall struct {
  81952. s *Service
  81953. project string
  81954. network string
  81955. urlParams_ gensupport.URLParams
  81956. ifNoneMatch_ string
  81957. ctx_ context.Context
  81958. header_ http.Header
  81959. }
  81960. // ListIpAddresses: Lists the internal IP addresses in the specified
  81961. // network.
  81962. func (r *NetworksService) ListIpAddresses(project string, network string) *NetworksListIpAddressesCall {
  81963. c := &NetworksListIpAddressesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81964. c.project = project
  81965. c.network = network
  81966. return c
  81967. }
  81968. // Filter sets the optional parameter "filter": A filter expression that
  81969. // filters resources listed in the response. The expression must specify
  81970. // the field name, a comparison operator, and the value that you want to
  81971. // use for filtering. The value must be a string, a number, or a
  81972. // boolean. The comparison operator must be either =, !=, >, or <.
  81973. //
  81974. // For example, if you are filtering Compute Engine instances, you can
  81975. // exclude instances named example-instance by specifying name !=
  81976. // example-instance.
  81977. //
  81978. // You can also filter nested fields. For example, you could specify
  81979. // scheduling.automaticRestart = false to include instances only if they
  81980. // are not scheduled for automatic restarts. You can use filtering on
  81981. // nested fields to filter based on resource labels.
  81982. //
  81983. // To filter on multiple expressions, provide each separate expression
  81984. // within parentheses. For example, (scheduling.automaticRestart = true)
  81985. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81986. // AND expression. However, you can include AND and OR expressions
  81987. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81988. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81989. // true).
  81990. func (c *NetworksListIpAddressesCall) Filter(filter string) *NetworksListIpAddressesCall {
  81991. c.urlParams_.Set("filter", filter)
  81992. return c
  81993. }
  81994. // MaxResults sets the optional parameter "maxResults": The maximum
  81995. // number of results per page that should be returned. If the number of
  81996. // available results is larger than maxResults, Compute Engine returns a
  81997. // nextPageToken that can be used to get the next page of results in
  81998. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81999. // (Default: 500)
  82000. func (c *NetworksListIpAddressesCall) MaxResults(maxResults int64) *NetworksListIpAddressesCall {
  82001. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82002. return c
  82003. }
  82004. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82005. // a certain order. By default, results are returned in alphanumerical
  82006. // order based on the resource name.
  82007. //
  82008. // You can also sort results in descending order based on the creation
  82009. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82010. // based on the creationTimestamp field in reverse chronological order
  82011. // (newest result first). Use this to sort resources like operations so
  82012. // that the newest operation is returned first.
  82013. //
  82014. // Currently, only sorting by name or creationTimestamp desc is
  82015. // supported.
  82016. func (c *NetworksListIpAddressesCall) OrderBy(orderBy string) *NetworksListIpAddressesCall {
  82017. c.urlParams_.Set("orderBy", orderBy)
  82018. return c
  82019. }
  82020. // PageToken sets the optional parameter "pageToken": Specifies a page
  82021. // token to use. Set pageToken to the nextPageToken returned by a
  82022. // previous list request to get the next page of results.
  82023. func (c *NetworksListIpAddressesCall) PageToken(pageToken string) *NetworksListIpAddressesCall {
  82024. c.urlParams_.Set("pageToken", pageToken)
  82025. return c
  82026. }
  82027. // Types sets the optional parameter "types": (Optional) types filter
  82028. // separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED,
  82029. // PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.
  82030. func (c *NetworksListIpAddressesCall) Types(types string) *NetworksListIpAddressesCall {
  82031. c.urlParams_.Set("types", types)
  82032. return c
  82033. }
  82034. // Fields allows partial responses to be retrieved. See
  82035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82036. // for more information.
  82037. func (c *NetworksListIpAddressesCall) Fields(s ...googleapi.Field) *NetworksListIpAddressesCall {
  82038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82039. return c
  82040. }
  82041. // IfNoneMatch sets the optional parameter which makes the operation
  82042. // fail if the object's ETag matches the given value. This is useful for
  82043. // getting updates only after the object has changed since the last
  82044. // request. Use googleapi.IsNotModified to check whether the response
  82045. // error from Do is the result of In-None-Match.
  82046. func (c *NetworksListIpAddressesCall) IfNoneMatch(entityTag string) *NetworksListIpAddressesCall {
  82047. c.ifNoneMatch_ = entityTag
  82048. return c
  82049. }
  82050. // Context sets the context to be used in this call's Do method. Any
  82051. // pending HTTP request will be aborted if the provided context is
  82052. // canceled.
  82053. func (c *NetworksListIpAddressesCall) Context(ctx context.Context) *NetworksListIpAddressesCall {
  82054. c.ctx_ = ctx
  82055. return c
  82056. }
  82057. // Header returns an http.Header that can be modified by the caller to
  82058. // add HTTP headers to the request.
  82059. func (c *NetworksListIpAddressesCall) Header() http.Header {
  82060. if c.header_ == nil {
  82061. c.header_ = make(http.Header)
  82062. }
  82063. return c.header_
  82064. }
  82065. func (c *NetworksListIpAddressesCall) doRequest(alt string) (*http.Response, error) {
  82066. reqHeaders := make(http.Header)
  82067. for k, v := range c.header_ {
  82068. reqHeaders[k] = v
  82069. }
  82070. reqHeaders.Set("User-Agent", c.s.userAgent())
  82071. if c.ifNoneMatch_ != "" {
  82072. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82073. }
  82074. var body io.Reader = nil
  82075. c.urlParams_.Set("alt", alt)
  82076. c.urlParams_.Set("prettyPrint", "false")
  82077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpAddresses")
  82078. urls += "?" + c.urlParams_.Encode()
  82079. req, err := http.NewRequest("GET", urls, body)
  82080. if err != nil {
  82081. return nil, err
  82082. }
  82083. req.Header = reqHeaders
  82084. googleapi.Expand(req.URL, map[string]string{
  82085. "project": c.project,
  82086. "network": c.network,
  82087. })
  82088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82089. }
  82090. // Do executes the "compute.networks.listIpAddresses" call.
  82091. // Exactly one of *IpAddressesList or error will be non-nil. Any non-2xx
  82092. // status code is an error. Response headers are in either
  82093. // *IpAddressesList.ServerResponse.Header or (if a response was returned
  82094. // at all) in error.(*googleapi.Error).Header. Use
  82095. // googleapi.IsNotModified to check whether the returned error was
  82096. // because http.StatusNotModified was returned.
  82097. func (c *NetworksListIpAddressesCall) Do(opts ...googleapi.CallOption) (*IpAddressesList, error) {
  82098. gensupport.SetOptions(c.urlParams_, opts...)
  82099. res, err := c.doRequest("json")
  82100. if res != nil && res.StatusCode == http.StatusNotModified {
  82101. if res.Body != nil {
  82102. res.Body.Close()
  82103. }
  82104. return nil, &googleapi.Error{
  82105. Code: res.StatusCode,
  82106. Header: res.Header,
  82107. }
  82108. }
  82109. if err != nil {
  82110. return nil, err
  82111. }
  82112. defer googleapi.CloseBody(res)
  82113. if err := googleapi.CheckResponse(res); err != nil {
  82114. return nil, err
  82115. }
  82116. ret := &IpAddressesList{
  82117. ServerResponse: googleapi.ServerResponse{
  82118. Header: res.Header,
  82119. HTTPStatusCode: res.StatusCode,
  82120. },
  82121. }
  82122. target := &ret
  82123. if err := gensupport.DecodeResponse(target, res); err != nil {
  82124. return nil, err
  82125. }
  82126. return ret, nil
  82127. // {
  82128. // "description": "Lists the internal IP addresses in the specified network.",
  82129. // "httpMethod": "GET",
  82130. // "id": "compute.networks.listIpAddresses",
  82131. // "parameterOrder": [
  82132. // "project",
  82133. // "network"
  82134. // ],
  82135. // "parameters": {
  82136. // "filter": {
  82137. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82138. // "location": "query",
  82139. // "type": "string"
  82140. // },
  82141. // "maxResults": {
  82142. // "default": "500",
  82143. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82144. // "format": "uint32",
  82145. // "location": "query",
  82146. // "minimum": "0",
  82147. // "type": "integer"
  82148. // },
  82149. // "network": {
  82150. // "description": "Name of the network for this request.",
  82151. // "location": "path",
  82152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82153. // "required": true,
  82154. // "type": "string"
  82155. // },
  82156. // "orderBy": {
  82157. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82158. // "location": "query",
  82159. // "type": "string"
  82160. // },
  82161. // "pageToken": {
  82162. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82163. // "location": "query",
  82164. // "type": "string"
  82165. // },
  82166. // "project": {
  82167. // "description": "Project ID for this request.",
  82168. // "location": "path",
  82169. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82170. // "required": true,
  82171. // "type": "string"
  82172. // },
  82173. // "types": {
  82174. // "description": "(Optional) types filter separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED, PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.",
  82175. // "location": "query",
  82176. // "type": "string"
  82177. // }
  82178. // },
  82179. // "path": "{project}/global/networks/{network}/listIpAddresses",
  82180. // "response": {
  82181. // "$ref": "IpAddressesList"
  82182. // },
  82183. // "scopes": [
  82184. // "https://www.googleapis.com/auth/cloud-platform",
  82185. // "https://www.googleapis.com/auth/compute",
  82186. // "https://www.googleapis.com/auth/compute.readonly"
  82187. // ]
  82188. // }
  82189. }
  82190. // Pages invokes f for each page of results.
  82191. // A non-nil error returned from f will halt the iteration.
  82192. // The provided context supersedes any context provided to the Context method.
  82193. func (c *NetworksListIpAddressesCall) Pages(ctx context.Context, f func(*IpAddressesList) error) error {
  82194. c.ctx_ = ctx
  82195. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82196. for {
  82197. x, err := c.Do()
  82198. if err != nil {
  82199. return err
  82200. }
  82201. if err := f(x); err != nil {
  82202. return err
  82203. }
  82204. if x.NextPageToken == "" {
  82205. return nil
  82206. }
  82207. c.PageToken(x.NextPageToken)
  82208. }
  82209. }
  82210. // method id "compute.networks.listIpOwners":
  82211. type NetworksListIpOwnersCall struct {
  82212. s *Service
  82213. project string
  82214. network string
  82215. urlParams_ gensupport.URLParams
  82216. ifNoneMatch_ string
  82217. ctx_ context.Context
  82218. header_ http.Header
  82219. }
  82220. // ListIpOwners: Lists the internal IP owners in the specified network.
  82221. func (r *NetworksService) ListIpOwners(project string, network string) *NetworksListIpOwnersCall {
  82222. c := &NetworksListIpOwnersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82223. c.project = project
  82224. c.network = network
  82225. return c
  82226. }
  82227. // Filter sets the optional parameter "filter": A filter expression that
  82228. // filters resources listed in the response. The expression must specify
  82229. // the field name, a comparison operator, and the value that you want to
  82230. // use for filtering. The value must be a string, a number, or a
  82231. // boolean. The comparison operator must be either =, !=, >, or <.
  82232. //
  82233. // For example, if you are filtering Compute Engine instances, you can
  82234. // exclude instances named example-instance by specifying name !=
  82235. // example-instance.
  82236. //
  82237. // You can also filter nested fields. For example, you could specify
  82238. // scheduling.automaticRestart = false to include instances only if they
  82239. // are not scheduled for automatic restarts. You can use filtering on
  82240. // nested fields to filter based on resource labels.
  82241. //
  82242. // To filter on multiple expressions, provide each separate expression
  82243. // within parentheses. For example, (scheduling.automaticRestart = true)
  82244. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82245. // AND expression. However, you can include AND and OR expressions
  82246. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82247. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82248. // true).
  82249. func (c *NetworksListIpOwnersCall) Filter(filter string) *NetworksListIpOwnersCall {
  82250. c.urlParams_.Set("filter", filter)
  82251. return c
  82252. }
  82253. // IpCidrRange sets the optional parameter "ipCidrRange": (Optional) IP
  82254. // CIDR range filter, example: "10.128.10.0/30".
  82255. func (c *NetworksListIpOwnersCall) IpCidrRange(ipCidrRange string) *NetworksListIpOwnersCall {
  82256. c.urlParams_.Set("ipCidrRange", ipCidrRange)
  82257. return c
  82258. }
  82259. // MaxResults sets the optional parameter "maxResults": The maximum
  82260. // number of results per page that should be returned. If the number of
  82261. // available results is larger than maxResults, Compute Engine returns a
  82262. // nextPageToken that can be used to get the next page of results in
  82263. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82264. // (Default: 500)
  82265. func (c *NetworksListIpOwnersCall) MaxResults(maxResults int64) *NetworksListIpOwnersCall {
  82266. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82267. return c
  82268. }
  82269. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82270. // a certain order. By default, results are returned in alphanumerical
  82271. // order based on the resource name.
  82272. //
  82273. // You can also sort results in descending order based on the creation
  82274. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82275. // based on the creationTimestamp field in reverse chronological order
  82276. // (newest result first). Use this to sort resources like operations so
  82277. // that the newest operation is returned first.
  82278. //
  82279. // Currently, only sorting by name or creationTimestamp desc is
  82280. // supported.
  82281. func (c *NetworksListIpOwnersCall) OrderBy(orderBy string) *NetworksListIpOwnersCall {
  82282. c.urlParams_.Set("orderBy", orderBy)
  82283. return c
  82284. }
  82285. // OwnerProjects sets the optional parameter "ownerProjects": (Optional)
  82286. // Project IDs filter, example: "project-1,project-2".
  82287. func (c *NetworksListIpOwnersCall) OwnerProjects(ownerProjects string) *NetworksListIpOwnersCall {
  82288. c.urlParams_.Set("ownerProjects", ownerProjects)
  82289. return c
  82290. }
  82291. // OwnerTypes sets the optional parameter "ownerTypes": (Optional) Owner
  82292. // types filter, example: "instance,forwardingRule".
  82293. func (c *NetworksListIpOwnersCall) OwnerTypes(ownerTypes string) *NetworksListIpOwnersCall {
  82294. c.urlParams_.Set("ownerTypes", ownerTypes)
  82295. return c
  82296. }
  82297. // PageToken sets the optional parameter "pageToken": Specifies a page
  82298. // token to use. Set pageToken to the nextPageToken returned by a
  82299. // previous list request to get the next page of results.
  82300. func (c *NetworksListIpOwnersCall) PageToken(pageToken string) *NetworksListIpOwnersCall {
  82301. c.urlParams_.Set("pageToken", pageToken)
  82302. return c
  82303. }
  82304. // SubnetName sets the optional parameter "subnetName": (Optional)
  82305. // Subnetwork name filter.
  82306. func (c *NetworksListIpOwnersCall) SubnetName(subnetName string) *NetworksListIpOwnersCall {
  82307. c.urlParams_.Set("subnetName", subnetName)
  82308. return c
  82309. }
  82310. // SubnetRegion sets the optional parameter "subnetRegion": (Optional)
  82311. // Subnetwork region filter.
  82312. func (c *NetworksListIpOwnersCall) SubnetRegion(subnetRegion string) *NetworksListIpOwnersCall {
  82313. c.urlParams_.Set("subnetRegion", subnetRegion)
  82314. return c
  82315. }
  82316. // Fields allows partial responses to be retrieved. See
  82317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82318. // for more information.
  82319. func (c *NetworksListIpOwnersCall) Fields(s ...googleapi.Field) *NetworksListIpOwnersCall {
  82320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82321. return c
  82322. }
  82323. // IfNoneMatch sets the optional parameter which makes the operation
  82324. // fail if the object's ETag matches the given value. This is useful for
  82325. // getting updates only after the object has changed since the last
  82326. // request. Use googleapi.IsNotModified to check whether the response
  82327. // error from Do is the result of In-None-Match.
  82328. func (c *NetworksListIpOwnersCall) IfNoneMatch(entityTag string) *NetworksListIpOwnersCall {
  82329. c.ifNoneMatch_ = entityTag
  82330. return c
  82331. }
  82332. // Context sets the context to be used in this call's Do method. Any
  82333. // pending HTTP request will be aborted if the provided context is
  82334. // canceled.
  82335. func (c *NetworksListIpOwnersCall) Context(ctx context.Context) *NetworksListIpOwnersCall {
  82336. c.ctx_ = ctx
  82337. return c
  82338. }
  82339. // Header returns an http.Header that can be modified by the caller to
  82340. // add HTTP headers to the request.
  82341. func (c *NetworksListIpOwnersCall) Header() http.Header {
  82342. if c.header_ == nil {
  82343. c.header_ = make(http.Header)
  82344. }
  82345. return c.header_
  82346. }
  82347. func (c *NetworksListIpOwnersCall) doRequest(alt string) (*http.Response, error) {
  82348. reqHeaders := make(http.Header)
  82349. for k, v := range c.header_ {
  82350. reqHeaders[k] = v
  82351. }
  82352. reqHeaders.Set("User-Agent", c.s.userAgent())
  82353. if c.ifNoneMatch_ != "" {
  82354. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82355. }
  82356. var body io.Reader = nil
  82357. c.urlParams_.Set("alt", alt)
  82358. c.urlParams_.Set("prettyPrint", "false")
  82359. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpOwners")
  82360. urls += "?" + c.urlParams_.Encode()
  82361. req, err := http.NewRequest("GET", urls, body)
  82362. if err != nil {
  82363. return nil, err
  82364. }
  82365. req.Header = reqHeaders
  82366. googleapi.Expand(req.URL, map[string]string{
  82367. "project": c.project,
  82368. "network": c.network,
  82369. })
  82370. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82371. }
  82372. // Do executes the "compute.networks.listIpOwners" call.
  82373. // Exactly one of *IpOwnerList or error will be non-nil. Any non-2xx
  82374. // status code is an error. Response headers are in either
  82375. // *IpOwnerList.ServerResponse.Header or (if a response was returned at
  82376. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82377. // to check whether the returned error was because
  82378. // http.StatusNotModified was returned.
  82379. func (c *NetworksListIpOwnersCall) Do(opts ...googleapi.CallOption) (*IpOwnerList, error) {
  82380. gensupport.SetOptions(c.urlParams_, opts...)
  82381. res, err := c.doRequest("json")
  82382. if res != nil && res.StatusCode == http.StatusNotModified {
  82383. if res.Body != nil {
  82384. res.Body.Close()
  82385. }
  82386. return nil, &googleapi.Error{
  82387. Code: res.StatusCode,
  82388. Header: res.Header,
  82389. }
  82390. }
  82391. if err != nil {
  82392. return nil, err
  82393. }
  82394. defer googleapi.CloseBody(res)
  82395. if err := googleapi.CheckResponse(res); err != nil {
  82396. return nil, err
  82397. }
  82398. ret := &IpOwnerList{
  82399. ServerResponse: googleapi.ServerResponse{
  82400. Header: res.Header,
  82401. HTTPStatusCode: res.StatusCode,
  82402. },
  82403. }
  82404. target := &ret
  82405. if err := gensupport.DecodeResponse(target, res); err != nil {
  82406. return nil, err
  82407. }
  82408. return ret, nil
  82409. // {
  82410. // "description": "Lists the internal IP owners in the specified network.",
  82411. // "httpMethod": "GET",
  82412. // "id": "compute.networks.listIpOwners",
  82413. // "parameterOrder": [
  82414. // "project",
  82415. // "network"
  82416. // ],
  82417. // "parameters": {
  82418. // "filter": {
  82419. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82420. // "location": "query",
  82421. // "type": "string"
  82422. // },
  82423. // "ipCidrRange": {
  82424. // "description": "(Optional) IP CIDR range filter, example: \"10.128.10.0/30\".",
  82425. // "location": "query",
  82426. // "type": "string"
  82427. // },
  82428. // "maxResults": {
  82429. // "default": "500",
  82430. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82431. // "format": "uint32",
  82432. // "location": "query",
  82433. // "minimum": "0",
  82434. // "type": "integer"
  82435. // },
  82436. // "network": {
  82437. // "description": "Name of the network to return.",
  82438. // "location": "path",
  82439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82440. // "required": true,
  82441. // "type": "string"
  82442. // },
  82443. // "orderBy": {
  82444. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82445. // "location": "query",
  82446. // "type": "string"
  82447. // },
  82448. // "ownerProjects": {
  82449. // "description": "(Optional) Project IDs filter, example: \"project-1,project-2\".",
  82450. // "location": "query",
  82451. // "type": "string"
  82452. // },
  82453. // "ownerTypes": {
  82454. // "description": "(Optional) Owner types filter, example: \"instance,forwardingRule\".",
  82455. // "location": "query",
  82456. // "type": "string"
  82457. // },
  82458. // "pageToken": {
  82459. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82460. // "location": "query",
  82461. // "type": "string"
  82462. // },
  82463. // "project": {
  82464. // "description": "Project ID for this request.",
  82465. // "location": "path",
  82466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82467. // "required": true,
  82468. // "type": "string"
  82469. // },
  82470. // "subnetName": {
  82471. // "description": "(Optional) Subnetwork name filter.",
  82472. // "location": "query",
  82473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82474. // "type": "string"
  82475. // },
  82476. // "subnetRegion": {
  82477. // "description": "(Optional) Subnetwork region filter.",
  82478. // "location": "query",
  82479. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82480. // "type": "string"
  82481. // }
  82482. // },
  82483. // "path": "{project}/global/networks/{network}/listIpOwners",
  82484. // "response": {
  82485. // "$ref": "IpOwnerList"
  82486. // },
  82487. // "scopes": [
  82488. // "https://www.googleapis.com/auth/cloud-platform",
  82489. // "https://www.googleapis.com/auth/compute",
  82490. // "https://www.googleapis.com/auth/compute.readonly"
  82491. // ]
  82492. // }
  82493. }
  82494. // Pages invokes f for each page of results.
  82495. // A non-nil error returned from f will halt the iteration.
  82496. // The provided context supersedes any context provided to the Context method.
  82497. func (c *NetworksListIpOwnersCall) Pages(ctx context.Context, f func(*IpOwnerList) error) error {
  82498. c.ctx_ = ctx
  82499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82500. for {
  82501. x, err := c.Do()
  82502. if err != nil {
  82503. return err
  82504. }
  82505. if err := f(x); err != nil {
  82506. return err
  82507. }
  82508. if x.NextPageToken == "" {
  82509. return nil
  82510. }
  82511. c.PageToken(x.NextPageToken)
  82512. }
  82513. }
  82514. // method id "compute.networks.listPeeringRoutes":
  82515. type NetworksListPeeringRoutesCall struct {
  82516. s *Service
  82517. project string
  82518. network string
  82519. urlParams_ gensupport.URLParams
  82520. ifNoneMatch_ string
  82521. ctx_ context.Context
  82522. header_ http.Header
  82523. }
  82524. // ListPeeringRoutes: Lists the peering routes exchanged over peering
  82525. // connection.
  82526. func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
  82527. c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82528. c.project = project
  82529. c.network = network
  82530. return c
  82531. }
  82532. // Direction sets the optional parameter "direction": The direction of
  82533. // the exchanged routes.
  82534. //
  82535. // Possible values:
  82536. // "INCOMING"
  82537. // "OUTGOING"
  82538. func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
  82539. c.urlParams_.Set("direction", direction)
  82540. return c
  82541. }
  82542. // Filter sets the optional parameter "filter": A filter expression that
  82543. // filters resources listed in the response. The expression must specify
  82544. // the field name, a comparison operator, and the value that you want to
  82545. // use for filtering. The value must be a string, a number, or a
  82546. // boolean. The comparison operator must be either =, !=, >, or <.
  82547. //
  82548. // For example, if you are filtering Compute Engine instances, you can
  82549. // exclude instances named example-instance by specifying name !=
  82550. // example-instance.
  82551. //
  82552. // You can also filter nested fields. For example, you could specify
  82553. // scheduling.automaticRestart = false to include instances only if they
  82554. // are not scheduled for automatic restarts. You can use filtering on
  82555. // nested fields to filter based on resource labels.
  82556. //
  82557. // To filter on multiple expressions, provide each separate expression
  82558. // within parentheses. For example, (scheduling.automaticRestart = true)
  82559. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82560. // AND expression. However, you can include AND and OR expressions
  82561. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82562. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82563. // true).
  82564. func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
  82565. c.urlParams_.Set("filter", filter)
  82566. return c
  82567. }
  82568. // MaxResults sets the optional parameter "maxResults": The maximum
  82569. // number of results per page that should be returned. If the number of
  82570. // available results is larger than maxResults, Compute Engine returns a
  82571. // nextPageToken that can be used to get the next page of results in
  82572. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82573. // (Default: 500)
  82574. func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
  82575. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82576. return c
  82577. }
  82578. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82579. // a certain order. By default, results are returned in alphanumerical
  82580. // order based on the resource name.
  82581. //
  82582. // You can also sort results in descending order based on the creation
  82583. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82584. // based on the creationTimestamp field in reverse chronological order
  82585. // (newest result first). Use this to sort resources like operations so
  82586. // that the newest operation is returned first.
  82587. //
  82588. // Currently, only sorting by name or creationTimestamp desc is
  82589. // supported.
  82590. func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
  82591. c.urlParams_.Set("orderBy", orderBy)
  82592. return c
  82593. }
  82594. // PageToken sets the optional parameter "pageToken": Specifies a page
  82595. // token to use. Set pageToken to the nextPageToken returned by a
  82596. // previous list request to get the next page of results.
  82597. func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
  82598. c.urlParams_.Set("pageToken", pageToken)
  82599. return c
  82600. }
  82601. // PeeringName sets the optional parameter "peeringName": The response
  82602. // will show routes exchanged over the given peering connection.
  82603. func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
  82604. c.urlParams_.Set("peeringName", peeringName)
  82605. return c
  82606. }
  82607. // Region sets the optional parameter "region": The region of the
  82608. // request. The response will include all subnet routes, static routes
  82609. // and dynamic routes in the region.
  82610. func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
  82611. c.urlParams_.Set("region", region)
  82612. return c
  82613. }
  82614. // Fields allows partial responses to be retrieved. See
  82615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82616. // for more information.
  82617. func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
  82618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82619. return c
  82620. }
  82621. // IfNoneMatch sets the optional parameter which makes the operation
  82622. // fail if the object's ETag matches the given value. This is useful for
  82623. // getting updates only after the object has changed since the last
  82624. // request. Use googleapi.IsNotModified to check whether the response
  82625. // error from Do is the result of In-None-Match.
  82626. func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
  82627. c.ifNoneMatch_ = entityTag
  82628. return c
  82629. }
  82630. // Context sets the context to be used in this call's Do method. Any
  82631. // pending HTTP request will be aborted if the provided context is
  82632. // canceled.
  82633. func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
  82634. c.ctx_ = ctx
  82635. return c
  82636. }
  82637. // Header returns an http.Header that can be modified by the caller to
  82638. // add HTTP headers to the request.
  82639. func (c *NetworksListPeeringRoutesCall) Header() http.Header {
  82640. if c.header_ == nil {
  82641. c.header_ = make(http.Header)
  82642. }
  82643. return c.header_
  82644. }
  82645. func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
  82646. reqHeaders := make(http.Header)
  82647. for k, v := range c.header_ {
  82648. reqHeaders[k] = v
  82649. }
  82650. reqHeaders.Set("User-Agent", c.s.userAgent())
  82651. if c.ifNoneMatch_ != "" {
  82652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82653. }
  82654. var body io.Reader = nil
  82655. c.urlParams_.Set("alt", alt)
  82656. c.urlParams_.Set("prettyPrint", "false")
  82657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listPeeringRoutes")
  82658. urls += "?" + c.urlParams_.Encode()
  82659. req, err := http.NewRequest("GET", urls, body)
  82660. if err != nil {
  82661. return nil, err
  82662. }
  82663. req.Header = reqHeaders
  82664. googleapi.Expand(req.URL, map[string]string{
  82665. "project": c.project,
  82666. "network": c.network,
  82667. })
  82668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82669. }
  82670. // Do executes the "compute.networks.listPeeringRoutes" call.
  82671. // Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
  82672. // Any non-2xx status code is an error. Response headers are in either
  82673. // *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response
  82674. // was returned at all) in error.(*googleapi.Error).Header. Use
  82675. // googleapi.IsNotModified to check whether the returned error was
  82676. // because http.StatusNotModified was returned.
  82677. func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) {
  82678. gensupport.SetOptions(c.urlParams_, opts...)
  82679. res, err := c.doRequest("json")
  82680. if res != nil && res.StatusCode == http.StatusNotModified {
  82681. if res.Body != nil {
  82682. res.Body.Close()
  82683. }
  82684. return nil, &googleapi.Error{
  82685. Code: res.StatusCode,
  82686. Header: res.Header,
  82687. }
  82688. }
  82689. if err != nil {
  82690. return nil, err
  82691. }
  82692. defer googleapi.CloseBody(res)
  82693. if err := googleapi.CheckResponse(res); err != nil {
  82694. return nil, err
  82695. }
  82696. ret := &ExchangedPeeringRoutesList{
  82697. ServerResponse: googleapi.ServerResponse{
  82698. Header: res.Header,
  82699. HTTPStatusCode: res.StatusCode,
  82700. },
  82701. }
  82702. target := &ret
  82703. if err := gensupport.DecodeResponse(target, res); err != nil {
  82704. return nil, err
  82705. }
  82706. return ret, nil
  82707. // {
  82708. // "description": "Lists the peering routes exchanged over peering connection.",
  82709. // "httpMethod": "GET",
  82710. // "id": "compute.networks.listPeeringRoutes",
  82711. // "parameterOrder": [
  82712. // "project",
  82713. // "network"
  82714. // ],
  82715. // "parameters": {
  82716. // "direction": {
  82717. // "description": "The direction of the exchanged routes.",
  82718. // "enum": [
  82719. // "INCOMING",
  82720. // "OUTGOING"
  82721. // ],
  82722. // "enumDescriptions": [
  82723. // "",
  82724. // ""
  82725. // ],
  82726. // "location": "query",
  82727. // "type": "string"
  82728. // },
  82729. // "filter": {
  82730. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82731. // "location": "query",
  82732. // "type": "string"
  82733. // },
  82734. // "maxResults": {
  82735. // "default": "500",
  82736. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82737. // "format": "uint32",
  82738. // "location": "query",
  82739. // "minimum": "0",
  82740. // "type": "integer"
  82741. // },
  82742. // "network": {
  82743. // "description": "Name of the network for this request.",
  82744. // "location": "path",
  82745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82746. // "required": true,
  82747. // "type": "string"
  82748. // },
  82749. // "orderBy": {
  82750. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82751. // "location": "query",
  82752. // "type": "string"
  82753. // },
  82754. // "pageToken": {
  82755. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82756. // "location": "query",
  82757. // "type": "string"
  82758. // },
  82759. // "peeringName": {
  82760. // "description": "The response will show routes exchanged over the given peering connection.",
  82761. // "location": "query",
  82762. // "type": "string"
  82763. // },
  82764. // "project": {
  82765. // "description": "Project ID for this request.",
  82766. // "location": "path",
  82767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82768. // "required": true,
  82769. // "type": "string"
  82770. // },
  82771. // "region": {
  82772. // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
  82773. // "location": "query",
  82774. // "type": "string"
  82775. // }
  82776. // },
  82777. // "path": "{project}/global/networks/{network}/listPeeringRoutes",
  82778. // "response": {
  82779. // "$ref": "ExchangedPeeringRoutesList"
  82780. // },
  82781. // "scopes": [
  82782. // "https://www.googleapis.com/auth/cloud-platform",
  82783. // "https://www.googleapis.com/auth/compute",
  82784. // "https://www.googleapis.com/auth/compute.readonly"
  82785. // ]
  82786. // }
  82787. }
  82788. // Pages invokes f for each page of results.
  82789. // A non-nil error returned from f will halt the iteration.
  82790. // The provided context supersedes any context provided to the Context method.
  82791. func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error {
  82792. c.ctx_ = ctx
  82793. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82794. for {
  82795. x, err := c.Do()
  82796. if err != nil {
  82797. return err
  82798. }
  82799. if err := f(x); err != nil {
  82800. return err
  82801. }
  82802. if x.NextPageToken == "" {
  82803. return nil
  82804. }
  82805. c.PageToken(x.NextPageToken)
  82806. }
  82807. }
  82808. // method id "compute.networks.patch":
  82809. type NetworksPatchCall struct {
  82810. s *Service
  82811. project string
  82812. network string
  82813. network2 *Network
  82814. urlParams_ gensupport.URLParams
  82815. ctx_ context.Context
  82816. header_ http.Header
  82817. }
  82818. // Patch: Patches the specified network with the data included in the
  82819. // request. Only the following fields can be modified:
  82820. // routingConfig.routingMode.
  82821. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  82822. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82823. c.project = project
  82824. c.network = network
  82825. c.network2 = network2
  82826. return c
  82827. }
  82828. // RequestId sets the optional parameter "requestId": An optional
  82829. // request ID to identify requests. Specify a unique request ID so that
  82830. // if you must retry your request, the server will know to ignore the
  82831. // request if it has already been completed.
  82832. //
  82833. // For example, consider a situation where you make an initial request
  82834. // and the request times out. If you make the request again with the
  82835. // same request ID, the server can check if original operation with the
  82836. // same request ID was received, and if so, will ignore the second
  82837. // request. This prevents clients from accidentally creating duplicate
  82838. // commitments.
  82839. //
  82840. // The request ID must be a valid UUID with the exception that zero UUID
  82841. // is not supported (00000000-0000-0000-0000-000000000000).
  82842. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  82843. c.urlParams_.Set("requestId", requestId)
  82844. return c
  82845. }
  82846. // Fields allows partial responses to be retrieved. See
  82847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82848. // for more information.
  82849. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  82850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82851. return c
  82852. }
  82853. // Context sets the context to be used in this call's Do method. Any
  82854. // pending HTTP request will be aborted if the provided context is
  82855. // canceled.
  82856. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  82857. c.ctx_ = ctx
  82858. return c
  82859. }
  82860. // Header returns an http.Header that can be modified by the caller to
  82861. // add HTTP headers to the request.
  82862. func (c *NetworksPatchCall) Header() http.Header {
  82863. if c.header_ == nil {
  82864. c.header_ = make(http.Header)
  82865. }
  82866. return c.header_
  82867. }
  82868. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  82869. reqHeaders := make(http.Header)
  82870. for k, v := range c.header_ {
  82871. reqHeaders[k] = v
  82872. }
  82873. reqHeaders.Set("User-Agent", c.s.userAgent())
  82874. var body io.Reader = nil
  82875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  82876. if err != nil {
  82877. return nil, err
  82878. }
  82879. reqHeaders.Set("Content-Type", "application/json")
  82880. c.urlParams_.Set("alt", alt)
  82881. c.urlParams_.Set("prettyPrint", "false")
  82882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  82883. urls += "?" + c.urlParams_.Encode()
  82884. req, err := http.NewRequest("PATCH", urls, body)
  82885. if err != nil {
  82886. return nil, err
  82887. }
  82888. req.Header = reqHeaders
  82889. googleapi.Expand(req.URL, map[string]string{
  82890. "project": c.project,
  82891. "network": c.network,
  82892. })
  82893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82894. }
  82895. // Do executes the "compute.networks.patch" call.
  82896. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82897. // status code is an error. Response headers are in either
  82898. // *Operation.ServerResponse.Header or (if a response was returned at
  82899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82900. // to check whether the returned error was because
  82901. // http.StatusNotModified was returned.
  82902. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82903. gensupport.SetOptions(c.urlParams_, opts...)
  82904. res, err := c.doRequest("json")
  82905. if res != nil && res.StatusCode == http.StatusNotModified {
  82906. if res.Body != nil {
  82907. res.Body.Close()
  82908. }
  82909. return nil, &googleapi.Error{
  82910. Code: res.StatusCode,
  82911. Header: res.Header,
  82912. }
  82913. }
  82914. if err != nil {
  82915. return nil, err
  82916. }
  82917. defer googleapi.CloseBody(res)
  82918. if err := googleapi.CheckResponse(res); err != nil {
  82919. return nil, err
  82920. }
  82921. ret := &Operation{
  82922. ServerResponse: googleapi.ServerResponse{
  82923. Header: res.Header,
  82924. HTTPStatusCode: res.StatusCode,
  82925. },
  82926. }
  82927. target := &ret
  82928. if err := gensupport.DecodeResponse(target, res); err != nil {
  82929. return nil, err
  82930. }
  82931. return ret, nil
  82932. // {
  82933. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  82934. // "httpMethod": "PATCH",
  82935. // "id": "compute.networks.patch",
  82936. // "parameterOrder": [
  82937. // "project",
  82938. // "network"
  82939. // ],
  82940. // "parameters": {
  82941. // "network": {
  82942. // "description": "Name of the network to update.",
  82943. // "location": "path",
  82944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82945. // "required": true,
  82946. // "type": "string"
  82947. // },
  82948. // "project": {
  82949. // "description": "Project ID for this request.",
  82950. // "location": "path",
  82951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82952. // "required": true,
  82953. // "type": "string"
  82954. // },
  82955. // "requestId": {
  82956. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82957. // "location": "query",
  82958. // "type": "string"
  82959. // }
  82960. // },
  82961. // "path": "{project}/global/networks/{network}",
  82962. // "request": {
  82963. // "$ref": "Network"
  82964. // },
  82965. // "response": {
  82966. // "$ref": "Operation"
  82967. // },
  82968. // "scopes": [
  82969. // "https://www.googleapis.com/auth/cloud-platform",
  82970. // "https://www.googleapis.com/auth/compute"
  82971. // ]
  82972. // }
  82973. }
  82974. // method id "compute.networks.removePeering":
  82975. type NetworksRemovePeeringCall struct {
  82976. s *Service
  82977. project string
  82978. network string
  82979. networksremovepeeringrequest *NetworksRemovePeeringRequest
  82980. urlParams_ gensupport.URLParams
  82981. ctx_ context.Context
  82982. header_ http.Header
  82983. }
  82984. // RemovePeering: Removes a peering from the specified network.
  82985. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  82986. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82987. c.project = project
  82988. c.network = network
  82989. c.networksremovepeeringrequest = networksremovepeeringrequest
  82990. return c
  82991. }
  82992. // RequestId sets the optional parameter "requestId": An optional
  82993. // request ID to identify requests. Specify a unique request ID so that
  82994. // if you must retry your request, the server will know to ignore the
  82995. // request if it has already been completed.
  82996. //
  82997. // For example, consider a situation where you make an initial request
  82998. // and the request times out. If you make the request again with the
  82999. // same request ID, the server can check if original operation with the
  83000. // same request ID was received, and if so, will ignore the second
  83001. // request. This prevents clients from accidentally creating duplicate
  83002. // commitments.
  83003. //
  83004. // The request ID must be a valid UUID with the exception that zero UUID
  83005. // is not supported (00000000-0000-0000-0000-000000000000).
  83006. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  83007. c.urlParams_.Set("requestId", requestId)
  83008. return c
  83009. }
  83010. // Fields allows partial responses to be retrieved. See
  83011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83012. // for more information.
  83013. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  83014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83015. return c
  83016. }
  83017. // Context sets the context to be used in this call's Do method. Any
  83018. // pending HTTP request will be aborted if the provided context is
  83019. // canceled.
  83020. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  83021. c.ctx_ = ctx
  83022. return c
  83023. }
  83024. // Header returns an http.Header that can be modified by the caller to
  83025. // add HTTP headers to the request.
  83026. func (c *NetworksRemovePeeringCall) Header() http.Header {
  83027. if c.header_ == nil {
  83028. c.header_ = make(http.Header)
  83029. }
  83030. return c.header_
  83031. }
  83032. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  83033. reqHeaders := make(http.Header)
  83034. for k, v := range c.header_ {
  83035. reqHeaders[k] = v
  83036. }
  83037. reqHeaders.Set("User-Agent", c.s.userAgent())
  83038. var body io.Reader = nil
  83039. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  83040. if err != nil {
  83041. return nil, err
  83042. }
  83043. reqHeaders.Set("Content-Type", "application/json")
  83044. c.urlParams_.Set("alt", alt)
  83045. c.urlParams_.Set("prettyPrint", "false")
  83046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  83047. urls += "?" + c.urlParams_.Encode()
  83048. req, err := http.NewRequest("POST", urls, body)
  83049. if err != nil {
  83050. return nil, err
  83051. }
  83052. req.Header = reqHeaders
  83053. googleapi.Expand(req.URL, map[string]string{
  83054. "project": c.project,
  83055. "network": c.network,
  83056. })
  83057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83058. }
  83059. // Do executes the "compute.networks.removePeering" call.
  83060. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83061. // status code is an error. Response headers are in either
  83062. // *Operation.ServerResponse.Header or (if a response was returned at
  83063. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83064. // to check whether the returned error was because
  83065. // http.StatusNotModified was returned.
  83066. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83067. gensupport.SetOptions(c.urlParams_, opts...)
  83068. res, err := c.doRequest("json")
  83069. if res != nil && res.StatusCode == http.StatusNotModified {
  83070. if res.Body != nil {
  83071. res.Body.Close()
  83072. }
  83073. return nil, &googleapi.Error{
  83074. Code: res.StatusCode,
  83075. Header: res.Header,
  83076. }
  83077. }
  83078. if err != nil {
  83079. return nil, err
  83080. }
  83081. defer googleapi.CloseBody(res)
  83082. if err := googleapi.CheckResponse(res); err != nil {
  83083. return nil, err
  83084. }
  83085. ret := &Operation{
  83086. ServerResponse: googleapi.ServerResponse{
  83087. Header: res.Header,
  83088. HTTPStatusCode: res.StatusCode,
  83089. },
  83090. }
  83091. target := &ret
  83092. if err := gensupport.DecodeResponse(target, res); err != nil {
  83093. return nil, err
  83094. }
  83095. return ret, nil
  83096. // {
  83097. // "description": "Removes a peering from the specified network.",
  83098. // "httpMethod": "POST",
  83099. // "id": "compute.networks.removePeering",
  83100. // "parameterOrder": [
  83101. // "project",
  83102. // "network"
  83103. // ],
  83104. // "parameters": {
  83105. // "network": {
  83106. // "description": "Name of the network resource to remove peering from.",
  83107. // "location": "path",
  83108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83109. // "required": true,
  83110. // "type": "string"
  83111. // },
  83112. // "project": {
  83113. // "description": "Project ID for this request.",
  83114. // "location": "path",
  83115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83116. // "required": true,
  83117. // "type": "string"
  83118. // },
  83119. // "requestId": {
  83120. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83121. // "location": "query",
  83122. // "type": "string"
  83123. // }
  83124. // },
  83125. // "path": "{project}/global/networks/{network}/removePeering",
  83126. // "request": {
  83127. // "$ref": "NetworksRemovePeeringRequest"
  83128. // },
  83129. // "response": {
  83130. // "$ref": "Operation"
  83131. // },
  83132. // "scopes": [
  83133. // "https://www.googleapis.com/auth/cloud-platform",
  83134. // "https://www.googleapis.com/auth/compute"
  83135. // ]
  83136. // }
  83137. }
  83138. // method id "compute.networks.switchToCustomMode":
  83139. type NetworksSwitchToCustomModeCall struct {
  83140. s *Service
  83141. project string
  83142. network string
  83143. urlParams_ gensupport.URLParams
  83144. ctx_ context.Context
  83145. header_ http.Header
  83146. }
  83147. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  83148. // to custom subnet mode.
  83149. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  83150. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83151. c.project = project
  83152. c.network = network
  83153. return c
  83154. }
  83155. // RequestId sets the optional parameter "requestId": An optional
  83156. // request ID to identify requests. Specify a unique request ID so that
  83157. // if you must retry your request, the server will know to ignore the
  83158. // request if it has already been completed.
  83159. //
  83160. // For example, consider a situation where you make an initial request
  83161. // and the request times out. If you make the request again with the
  83162. // same request ID, the server can check if original operation with the
  83163. // same request ID was received, and if so, will ignore the second
  83164. // request. This prevents clients from accidentally creating duplicate
  83165. // commitments.
  83166. //
  83167. // The request ID must be a valid UUID with the exception that zero UUID
  83168. // is not supported (00000000-0000-0000-0000-000000000000).
  83169. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  83170. c.urlParams_.Set("requestId", requestId)
  83171. return c
  83172. }
  83173. // Fields allows partial responses to be retrieved. See
  83174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83175. // for more information.
  83176. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  83177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83178. return c
  83179. }
  83180. // Context sets the context to be used in this call's Do method. Any
  83181. // pending HTTP request will be aborted if the provided context is
  83182. // canceled.
  83183. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  83184. c.ctx_ = ctx
  83185. return c
  83186. }
  83187. // Header returns an http.Header that can be modified by the caller to
  83188. // add HTTP headers to the request.
  83189. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  83190. if c.header_ == nil {
  83191. c.header_ = make(http.Header)
  83192. }
  83193. return c.header_
  83194. }
  83195. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  83196. reqHeaders := make(http.Header)
  83197. for k, v := range c.header_ {
  83198. reqHeaders[k] = v
  83199. }
  83200. reqHeaders.Set("User-Agent", c.s.userAgent())
  83201. var body io.Reader = nil
  83202. c.urlParams_.Set("alt", alt)
  83203. c.urlParams_.Set("prettyPrint", "false")
  83204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  83205. urls += "?" + c.urlParams_.Encode()
  83206. req, err := http.NewRequest("POST", urls, body)
  83207. if err != nil {
  83208. return nil, err
  83209. }
  83210. req.Header = reqHeaders
  83211. googleapi.Expand(req.URL, map[string]string{
  83212. "project": c.project,
  83213. "network": c.network,
  83214. })
  83215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83216. }
  83217. // Do executes the "compute.networks.switchToCustomMode" call.
  83218. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83219. // status code is an error. Response headers are in either
  83220. // *Operation.ServerResponse.Header or (if a response was returned at
  83221. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83222. // to check whether the returned error was because
  83223. // http.StatusNotModified was returned.
  83224. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83225. gensupport.SetOptions(c.urlParams_, opts...)
  83226. res, err := c.doRequest("json")
  83227. if res != nil && res.StatusCode == http.StatusNotModified {
  83228. if res.Body != nil {
  83229. res.Body.Close()
  83230. }
  83231. return nil, &googleapi.Error{
  83232. Code: res.StatusCode,
  83233. Header: res.Header,
  83234. }
  83235. }
  83236. if err != nil {
  83237. return nil, err
  83238. }
  83239. defer googleapi.CloseBody(res)
  83240. if err := googleapi.CheckResponse(res); err != nil {
  83241. return nil, err
  83242. }
  83243. ret := &Operation{
  83244. ServerResponse: googleapi.ServerResponse{
  83245. Header: res.Header,
  83246. HTTPStatusCode: res.StatusCode,
  83247. },
  83248. }
  83249. target := &ret
  83250. if err := gensupport.DecodeResponse(target, res); err != nil {
  83251. return nil, err
  83252. }
  83253. return ret, nil
  83254. // {
  83255. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  83256. // "httpMethod": "POST",
  83257. // "id": "compute.networks.switchToCustomMode",
  83258. // "parameterOrder": [
  83259. // "project",
  83260. // "network"
  83261. // ],
  83262. // "parameters": {
  83263. // "network": {
  83264. // "description": "Name of the network to be updated.",
  83265. // "location": "path",
  83266. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83267. // "required": true,
  83268. // "type": "string"
  83269. // },
  83270. // "project": {
  83271. // "description": "Project ID for this request.",
  83272. // "location": "path",
  83273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83274. // "required": true,
  83275. // "type": "string"
  83276. // },
  83277. // "requestId": {
  83278. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83279. // "location": "query",
  83280. // "type": "string"
  83281. // }
  83282. // },
  83283. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  83284. // "response": {
  83285. // "$ref": "Operation"
  83286. // },
  83287. // "scopes": [
  83288. // "https://www.googleapis.com/auth/cloud-platform",
  83289. // "https://www.googleapis.com/auth/compute"
  83290. // ]
  83291. // }
  83292. }
  83293. // method id "compute.networks.testIamPermissions":
  83294. type NetworksTestIamPermissionsCall struct {
  83295. s *Service
  83296. project string
  83297. resource string
  83298. testpermissionsrequest *TestPermissionsRequest
  83299. urlParams_ gensupport.URLParams
  83300. ctx_ context.Context
  83301. header_ http.Header
  83302. }
  83303. // TestIamPermissions: Returns permissions that a caller has on the
  83304. // specified resource.
  83305. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  83306. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83307. c.project = project
  83308. c.resource = resource
  83309. c.testpermissionsrequest = testpermissionsrequest
  83310. return c
  83311. }
  83312. // Fields allows partial responses to be retrieved. See
  83313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83314. // for more information.
  83315. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  83316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83317. return c
  83318. }
  83319. // Context sets the context to be used in this call's Do method. Any
  83320. // pending HTTP request will be aborted if the provided context is
  83321. // canceled.
  83322. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  83323. c.ctx_ = ctx
  83324. return c
  83325. }
  83326. // Header returns an http.Header that can be modified by the caller to
  83327. // add HTTP headers to the request.
  83328. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  83329. if c.header_ == nil {
  83330. c.header_ = make(http.Header)
  83331. }
  83332. return c.header_
  83333. }
  83334. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  83335. reqHeaders := make(http.Header)
  83336. for k, v := range c.header_ {
  83337. reqHeaders[k] = v
  83338. }
  83339. reqHeaders.Set("User-Agent", c.s.userAgent())
  83340. var body io.Reader = nil
  83341. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  83342. if err != nil {
  83343. return nil, err
  83344. }
  83345. reqHeaders.Set("Content-Type", "application/json")
  83346. c.urlParams_.Set("alt", alt)
  83347. c.urlParams_.Set("prettyPrint", "false")
  83348. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  83349. urls += "?" + c.urlParams_.Encode()
  83350. req, err := http.NewRequest("POST", urls, body)
  83351. if err != nil {
  83352. return nil, err
  83353. }
  83354. req.Header = reqHeaders
  83355. googleapi.Expand(req.URL, map[string]string{
  83356. "project": c.project,
  83357. "resource": c.resource,
  83358. })
  83359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83360. }
  83361. // Do executes the "compute.networks.testIamPermissions" call.
  83362. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  83363. // non-2xx status code is an error. Response headers are in either
  83364. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  83365. // returned at all) in error.(*googleapi.Error).Header. Use
  83366. // googleapi.IsNotModified to check whether the returned error was
  83367. // because http.StatusNotModified was returned.
  83368. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  83369. gensupport.SetOptions(c.urlParams_, opts...)
  83370. res, err := c.doRequest("json")
  83371. if res != nil && res.StatusCode == http.StatusNotModified {
  83372. if res.Body != nil {
  83373. res.Body.Close()
  83374. }
  83375. return nil, &googleapi.Error{
  83376. Code: res.StatusCode,
  83377. Header: res.Header,
  83378. }
  83379. }
  83380. if err != nil {
  83381. return nil, err
  83382. }
  83383. defer googleapi.CloseBody(res)
  83384. if err := googleapi.CheckResponse(res); err != nil {
  83385. return nil, err
  83386. }
  83387. ret := &TestPermissionsResponse{
  83388. ServerResponse: googleapi.ServerResponse{
  83389. Header: res.Header,
  83390. HTTPStatusCode: res.StatusCode,
  83391. },
  83392. }
  83393. target := &ret
  83394. if err := gensupport.DecodeResponse(target, res); err != nil {
  83395. return nil, err
  83396. }
  83397. return ret, nil
  83398. // {
  83399. // "description": "Returns permissions that a caller has on the specified resource.",
  83400. // "httpMethod": "POST",
  83401. // "id": "compute.networks.testIamPermissions",
  83402. // "parameterOrder": [
  83403. // "project",
  83404. // "resource"
  83405. // ],
  83406. // "parameters": {
  83407. // "project": {
  83408. // "description": "Project ID for this request.",
  83409. // "location": "path",
  83410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83411. // "required": true,
  83412. // "type": "string"
  83413. // },
  83414. // "resource": {
  83415. // "description": "Name or id of the resource for this request.",
  83416. // "location": "path",
  83417. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83418. // "required": true,
  83419. // "type": "string"
  83420. // }
  83421. // },
  83422. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  83423. // "request": {
  83424. // "$ref": "TestPermissionsRequest"
  83425. // },
  83426. // "response": {
  83427. // "$ref": "TestPermissionsResponse"
  83428. // },
  83429. // "scopes": [
  83430. // "https://www.googleapis.com/auth/cloud-platform",
  83431. // "https://www.googleapis.com/auth/compute",
  83432. // "https://www.googleapis.com/auth/compute.readonly"
  83433. // ]
  83434. // }
  83435. }
  83436. // method id "compute.networks.updatePeering":
  83437. type NetworksUpdatePeeringCall struct {
  83438. s *Service
  83439. project string
  83440. network string
  83441. networksupdatepeeringrequest *NetworksUpdatePeeringRequest
  83442. urlParams_ gensupport.URLParams
  83443. ctx_ context.Context
  83444. header_ http.Header
  83445. }
  83446. // UpdatePeering: Updates the specified network peering with the data
  83447. // included in the request Only the following fields can be modified:
  83448. // NetworkPeering.export_custom_routes, and
  83449. // NetworkPeering.import_custom_routes
  83450. func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
  83451. c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83452. c.project = project
  83453. c.network = network
  83454. c.networksupdatepeeringrequest = networksupdatepeeringrequest
  83455. return c
  83456. }
  83457. // RequestId sets the optional parameter "requestId": An optional
  83458. // request ID to identify requests. Specify a unique request ID so that
  83459. // if you must retry your request, the server will know to ignore the
  83460. // request if it has already been completed.
  83461. //
  83462. // For example, consider a situation where you make an initial request
  83463. // and the request times out. If you make the request again with the
  83464. // same request ID, the server can check if original operation with the
  83465. // same request ID was received, and if so, will ignore the second
  83466. // request. This prevents clients from accidentally creating duplicate
  83467. // commitments.
  83468. //
  83469. // The request ID must be a valid UUID with the exception that zero UUID
  83470. // is not supported (00000000-0000-0000-0000-000000000000).
  83471. func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
  83472. c.urlParams_.Set("requestId", requestId)
  83473. return c
  83474. }
  83475. // Fields allows partial responses to be retrieved. See
  83476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83477. // for more information.
  83478. func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
  83479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83480. return c
  83481. }
  83482. // Context sets the context to be used in this call's Do method. Any
  83483. // pending HTTP request will be aborted if the provided context is
  83484. // canceled.
  83485. func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
  83486. c.ctx_ = ctx
  83487. return c
  83488. }
  83489. // Header returns an http.Header that can be modified by the caller to
  83490. // add HTTP headers to the request.
  83491. func (c *NetworksUpdatePeeringCall) Header() http.Header {
  83492. if c.header_ == nil {
  83493. c.header_ = make(http.Header)
  83494. }
  83495. return c.header_
  83496. }
  83497. func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
  83498. reqHeaders := make(http.Header)
  83499. for k, v := range c.header_ {
  83500. reqHeaders[k] = v
  83501. }
  83502. reqHeaders.Set("User-Agent", c.s.userAgent())
  83503. var body io.Reader = nil
  83504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
  83505. if err != nil {
  83506. return nil, err
  83507. }
  83508. reqHeaders.Set("Content-Type", "application/json")
  83509. c.urlParams_.Set("alt", alt)
  83510. c.urlParams_.Set("prettyPrint", "false")
  83511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/updatePeering")
  83512. urls += "?" + c.urlParams_.Encode()
  83513. req, err := http.NewRequest("PATCH", urls, body)
  83514. if err != nil {
  83515. return nil, err
  83516. }
  83517. req.Header = reqHeaders
  83518. googleapi.Expand(req.URL, map[string]string{
  83519. "project": c.project,
  83520. "network": c.network,
  83521. })
  83522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83523. }
  83524. // Do executes the "compute.networks.updatePeering" call.
  83525. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83526. // status code is an error. Response headers are in either
  83527. // *Operation.ServerResponse.Header or (if a response was returned at
  83528. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83529. // to check whether the returned error was because
  83530. // http.StatusNotModified was returned.
  83531. func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83532. gensupport.SetOptions(c.urlParams_, opts...)
  83533. res, err := c.doRequest("json")
  83534. if res != nil && res.StatusCode == http.StatusNotModified {
  83535. if res.Body != nil {
  83536. res.Body.Close()
  83537. }
  83538. return nil, &googleapi.Error{
  83539. Code: res.StatusCode,
  83540. Header: res.Header,
  83541. }
  83542. }
  83543. if err != nil {
  83544. return nil, err
  83545. }
  83546. defer googleapi.CloseBody(res)
  83547. if err := googleapi.CheckResponse(res); err != nil {
  83548. return nil, err
  83549. }
  83550. ret := &Operation{
  83551. ServerResponse: googleapi.ServerResponse{
  83552. Header: res.Header,
  83553. HTTPStatusCode: res.StatusCode,
  83554. },
  83555. }
  83556. target := &ret
  83557. if err := gensupport.DecodeResponse(target, res); err != nil {
  83558. return nil, err
  83559. }
  83560. return ret, nil
  83561. // {
  83562. // "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",
  83563. // "httpMethod": "PATCH",
  83564. // "id": "compute.networks.updatePeering",
  83565. // "parameterOrder": [
  83566. // "project",
  83567. // "network"
  83568. // ],
  83569. // "parameters": {
  83570. // "network": {
  83571. // "description": "Name of the network resource which the updated peering is belonging to.",
  83572. // "location": "path",
  83573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83574. // "required": true,
  83575. // "type": "string"
  83576. // },
  83577. // "project": {
  83578. // "description": "Project ID for this request.",
  83579. // "location": "path",
  83580. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83581. // "required": true,
  83582. // "type": "string"
  83583. // },
  83584. // "requestId": {
  83585. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83586. // "location": "query",
  83587. // "type": "string"
  83588. // }
  83589. // },
  83590. // "path": "{project}/global/networks/{network}/updatePeering",
  83591. // "request": {
  83592. // "$ref": "NetworksUpdatePeeringRequest"
  83593. // },
  83594. // "response": {
  83595. // "$ref": "Operation"
  83596. // },
  83597. // "scopes": [
  83598. // "https://www.googleapis.com/auth/cloud-platform",
  83599. // "https://www.googleapis.com/auth/compute"
  83600. // ]
  83601. // }
  83602. }
  83603. // method id "compute.nodeGroups.addNodes":
  83604. type NodeGroupsAddNodesCall struct {
  83605. s *Service
  83606. project string
  83607. zone string
  83608. nodeGroup string
  83609. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  83610. urlParams_ gensupport.URLParams
  83611. ctx_ context.Context
  83612. header_ http.Header
  83613. }
  83614. // AddNodes: Adds specified number of nodes to the node group.
  83615. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  83616. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83617. c.project = project
  83618. c.zone = zone
  83619. c.nodeGroup = nodeGroup
  83620. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  83621. return c
  83622. }
  83623. // RequestId sets the optional parameter "requestId": An optional
  83624. // request ID to identify requests. Specify a unique request ID so that
  83625. // if you must retry your request, the server will know to ignore the
  83626. // request if it has already been completed.
  83627. //
  83628. // For example, consider a situation where you make an initial request
  83629. // and the request times out. If you make the request again with the
  83630. // same request ID, the server can check if original operation with the
  83631. // same request ID was received, and if so, will ignore the second
  83632. // request. This prevents clients from accidentally creating duplicate
  83633. // commitments.
  83634. //
  83635. // The request ID must be a valid UUID with the exception that zero UUID
  83636. // is not supported (00000000-0000-0000-0000-000000000000).
  83637. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  83638. c.urlParams_.Set("requestId", requestId)
  83639. return c
  83640. }
  83641. // Fields allows partial responses to be retrieved. See
  83642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83643. // for more information.
  83644. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  83645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83646. return c
  83647. }
  83648. // Context sets the context to be used in this call's Do method. Any
  83649. // pending HTTP request will be aborted if the provided context is
  83650. // canceled.
  83651. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  83652. c.ctx_ = ctx
  83653. return c
  83654. }
  83655. // Header returns an http.Header that can be modified by the caller to
  83656. // add HTTP headers to the request.
  83657. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  83658. if c.header_ == nil {
  83659. c.header_ = make(http.Header)
  83660. }
  83661. return c.header_
  83662. }
  83663. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  83664. reqHeaders := make(http.Header)
  83665. for k, v := range c.header_ {
  83666. reqHeaders[k] = v
  83667. }
  83668. reqHeaders.Set("User-Agent", c.s.userAgent())
  83669. var body io.Reader = nil
  83670. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  83671. if err != nil {
  83672. return nil, err
  83673. }
  83674. reqHeaders.Set("Content-Type", "application/json")
  83675. c.urlParams_.Set("alt", alt)
  83676. c.urlParams_.Set("prettyPrint", "false")
  83677. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  83678. urls += "?" + c.urlParams_.Encode()
  83679. req, err := http.NewRequest("POST", urls, body)
  83680. if err != nil {
  83681. return nil, err
  83682. }
  83683. req.Header = reqHeaders
  83684. googleapi.Expand(req.URL, map[string]string{
  83685. "project": c.project,
  83686. "zone": c.zone,
  83687. "nodeGroup": c.nodeGroup,
  83688. })
  83689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83690. }
  83691. // Do executes the "compute.nodeGroups.addNodes" call.
  83692. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83693. // status code is an error. Response headers are in either
  83694. // *Operation.ServerResponse.Header or (if a response was returned at
  83695. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83696. // to check whether the returned error was because
  83697. // http.StatusNotModified was returned.
  83698. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83699. gensupport.SetOptions(c.urlParams_, opts...)
  83700. res, err := c.doRequest("json")
  83701. if res != nil && res.StatusCode == http.StatusNotModified {
  83702. if res.Body != nil {
  83703. res.Body.Close()
  83704. }
  83705. return nil, &googleapi.Error{
  83706. Code: res.StatusCode,
  83707. Header: res.Header,
  83708. }
  83709. }
  83710. if err != nil {
  83711. return nil, err
  83712. }
  83713. defer googleapi.CloseBody(res)
  83714. if err := googleapi.CheckResponse(res); err != nil {
  83715. return nil, err
  83716. }
  83717. ret := &Operation{
  83718. ServerResponse: googleapi.ServerResponse{
  83719. Header: res.Header,
  83720. HTTPStatusCode: res.StatusCode,
  83721. },
  83722. }
  83723. target := &ret
  83724. if err := gensupport.DecodeResponse(target, res); err != nil {
  83725. return nil, err
  83726. }
  83727. return ret, nil
  83728. // {
  83729. // "description": "Adds specified number of nodes to the node group.",
  83730. // "httpMethod": "POST",
  83731. // "id": "compute.nodeGroups.addNodes",
  83732. // "parameterOrder": [
  83733. // "project",
  83734. // "zone",
  83735. // "nodeGroup"
  83736. // ],
  83737. // "parameters": {
  83738. // "nodeGroup": {
  83739. // "description": "Name of the NodeGroup resource.",
  83740. // "location": "path",
  83741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83742. // "required": true,
  83743. // "type": "string"
  83744. // },
  83745. // "project": {
  83746. // "description": "Project ID for this request.",
  83747. // "location": "path",
  83748. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83749. // "required": true,
  83750. // "type": "string"
  83751. // },
  83752. // "requestId": {
  83753. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83754. // "location": "query",
  83755. // "type": "string"
  83756. // },
  83757. // "zone": {
  83758. // "description": "The name of the zone for this request.",
  83759. // "location": "path",
  83760. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83761. // "required": true,
  83762. // "type": "string"
  83763. // }
  83764. // },
  83765. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  83766. // "request": {
  83767. // "$ref": "NodeGroupsAddNodesRequest"
  83768. // },
  83769. // "response": {
  83770. // "$ref": "Operation"
  83771. // },
  83772. // "scopes": [
  83773. // "https://www.googleapis.com/auth/cloud-platform",
  83774. // "https://www.googleapis.com/auth/compute"
  83775. // ]
  83776. // }
  83777. }
  83778. // method id "compute.nodeGroups.aggregatedList":
  83779. type NodeGroupsAggregatedListCall struct {
  83780. s *Service
  83781. project string
  83782. urlParams_ gensupport.URLParams
  83783. ifNoneMatch_ string
  83784. ctx_ context.Context
  83785. header_ http.Header
  83786. }
  83787. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  83788. // use nodeGroups.listNodes for more details about each group.
  83789. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  83790. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83791. c.project = project
  83792. return c
  83793. }
  83794. // Filter sets the optional parameter "filter": A filter expression that
  83795. // filters resources listed in the response. The expression must specify
  83796. // the field name, a comparison operator, and the value that you want to
  83797. // use for filtering. The value must be a string, a number, or a
  83798. // boolean. The comparison operator must be either =, !=, >, or <.
  83799. //
  83800. // For example, if you are filtering Compute Engine instances, you can
  83801. // exclude instances named example-instance by specifying name !=
  83802. // example-instance.
  83803. //
  83804. // You can also filter nested fields. For example, you could specify
  83805. // scheduling.automaticRestart = false to include instances only if they
  83806. // are not scheduled for automatic restarts. You can use filtering on
  83807. // nested fields to filter based on resource labels.
  83808. //
  83809. // To filter on multiple expressions, provide each separate expression
  83810. // within parentheses. For example, (scheduling.automaticRestart = true)
  83811. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83812. // AND expression. However, you can include AND and OR expressions
  83813. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83814. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83815. // true).
  83816. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  83817. c.urlParams_.Set("filter", filter)
  83818. return c
  83819. }
  83820. // MaxResults sets the optional parameter "maxResults": The maximum
  83821. // number of results per page that should be returned. If the number of
  83822. // available results is larger than maxResults, Compute Engine returns a
  83823. // nextPageToken that can be used to get the next page of results in
  83824. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83825. // (Default: 500)
  83826. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  83827. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83828. return c
  83829. }
  83830. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83831. // a certain order. By default, results are returned in alphanumerical
  83832. // order based on the resource name.
  83833. //
  83834. // You can also sort results in descending order based on the creation
  83835. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83836. // based on the creationTimestamp field in reverse chronological order
  83837. // (newest result first). Use this to sort resources like operations so
  83838. // that the newest operation is returned first.
  83839. //
  83840. // Currently, only sorting by name or creationTimestamp desc is
  83841. // supported.
  83842. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  83843. c.urlParams_.Set("orderBy", orderBy)
  83844. return c
  83845. }
  83846. // PageToken sets the optional parameter "pageToken": Specifies a page
  83847. // token to use. Set pageToken to the nextPageToken returned by a
  83848. // previous list request to get the next page of results.
  83849. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  83850. c.urlParams_.Set("pageToken", pageToken)
  83851. return c
  83852. }
  83853. // Fields allows partial responses to be retrieved. See
  83854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83855. // for more information.
  83856. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  83857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83858. return c
  83859. }
  83860. // IfNoneMatch sets the optional parameter which makes the operation
  83861. // fail if the object's ETag matches the given value. This is useful for
  83862. // getting updates only after the object has changed since the last
  83863. // request. Use googleapi.IsNotModified to check whether the response
  83864. // error from Do is the result of In-None-Match.
  83865. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  83866. c.ifNoneMatch_ = entityTag
  83867. return c
  83868. }
  83869. // Context sets the context to be used in this call's Do method. Any
  83870. // pending HTTP request will be aborted if the provided context is
  83871. // canceled.
  83872. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  83873. c.ctx_ = ctx
  83874. return c
  83875. }
  83876. // Header returns an http.Header that can be modified by the caller to
  83877. // add HTTP headers to the request.
  83878. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  83879. if c.header_ == nil {
  83880. c.header_ = make(http.Header)
  83881. }
  83882. return c.header_
  83883. }
  83884. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  83885. reqHeaders := make(http.Header)
  83886. for k, v := range c.header_ {
  83887. reqHeaders[k] = v
  83888. }
  83889. reqHeaders.Set("User-Agent", c.s.userAgent())
  83890. if c.ifNoneMatch_ != "" {
  83891. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83892. }
  83893. var body io.Reader = nil
  83894. c.urlParams_.Set("alt", alt)
  83895. c.urlParams_.Set("prettyPrint", "false")
  83896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  83897. urls += "?" + c.urlParams_.Encode()
  83898. req, err := http.NewRequest("GET", urls, body)
  83899. if err != nil {
  83900. return nil, err
  83901. }
  83902. req.Header = reqHeaders
  83903. googleapi.Expand(req.URL, map[string]string{
  83904. "project": c.project,
  83905. })
  83906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83907. }
  83908. // Do executes the "compute.nodeGroups.aggregatedList" call.
  83909. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  83910. // non-2xx status code is an error. Response headers are in either
  83911. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  83912. // returned at all) in error.(*googleapi.Error).Header. Use
  83913. // googleapi.IsNotModified to check whether the returned error was
  83914. // because http.StatusNotModified was returned.
  83915. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  83916. gensupport.SetOptions(c.urlParams_, opts...)
  83917. res, err := c.doRequest("json")
  83918. if res != nil && res.StatusCode == http.StatusNotModified {
  83919. if res.Body != nil {
  83920. res.Body.Close()
  83921. }
  83922. return nil, &googleapi.Error{
  83923. Code: res.StatusCode,
  83924. Header: res.Header,
  83925. }
  83926. }
  83927. if err != nil {
  83928. return nil, err
  83929. }
  83930. defer googleapi.CloseBody(res)
  83931. if err := googleapi.CheckResponse(res); err != nil {
  83932. return nil, err
  83933. }
  83934. ret := &NodeGroupAggregatedList{
  83935. ServerResponse: googleapi.ServerResponse{
  83936. Header: res.Header,
  83937. HTTPStatusCode: res.StatusCode,
  83938. },
  83939. }
  83940. target := &ret
  83941. if err := gensupport.DecodeResponse(target, res); err != nil {
  83942. return nil, err
  83943. }
  83944. return ret, nil
  83945. // {
  83946. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  83947. // "httpMethod": "GET",
  83948. // "id": "compute.nodeGroups.aggregatedList",
  83949. // "parameterOrder": [
  83950. // "project"
  83951. // ],
  83952. // "parameters": {
  83953. // "filter": {
  83954. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83955. // "location": "query",
  83956. // "type": "string"
  83957. // },
  83958. // "maxResults": {
  83959. // "default": "500",
  83960. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83961. // "format": "uint32",
  83962. // "location": "query",
  83963. // "minimum": "0",
  83964. // "type": "integer"
  83965. // },
  83966. // "orderBy": {
  83967. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83968. // "location": "query",
  83969. // "type": "string"
  83970. // },
  83971. // "pageToken": {
  83972. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83973. // "location": "query",
  83974. // "type": "string"
  83975. // },
  83976. // "project": {
  83977. // "description": "Project ID for this request.",
  83978. // "location": "path",
  83979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83980. // "required": true,
  83981. // "type": "string"
  83982. // }
  83983. // },
  83984. // "path": "{project}/aggregated/nodeGroups",
  83985. // "response": {
  83986. // "$ref": "NodeGroupAggregatedList"
  83987. // },
  83988. // "scopes": [
  83989. // "https://www.googleapis.com/auth/cloud-platform",
  83990. // "https://www.googleapis.com/auth/compute",
  83991. // "https://www.googleapis.com/auth/compute.readonly"
  83992. // ]
  83993. // }
  83994. }
  83995. // Pages invokes f for each page of results.
  83996. // A non-nil error returned from f will halt the iteration.
  83997. // The provided context supersedes any context provided to the Context method.
  83998. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  83999. c.ctx_ = ctx
  84000. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84001. for {
  84002. x, err := c.Do()
  84003. if err != nil {
  84004. return err
  84005. }
  84006. if err := f(x); err != nil {
  84007. return err
  84008. }
  84009. if x.NextPageToken == "" {
  84010. return nil
  84011. }
  84012. c.PageToken(x.NextPageToken)
  84013. }
  84014. }
  84015. // method id "compute.nodeGroups.delete":
  84016. type NodeGroupsDeleteCall struct {
  84017. s *Service
  84018. project string
  84019. zone string
  84020. nodeGroup string
  84021. urlParams_ gensupport.URLParams
  84022. ctx_ context.Context
  84023. header_ http.Header
  84024. }
  84025. // Delete: Deletes the specified NodeGroup resource.
  84026. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  84027. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84028. c.project = project
  84029. c.zone = zone
  84030. c.nodeGroup = nodeGroup
  84031. return c
  84032. }
  84033. // RequestId sets the optional parameter "requestId": An optional
  84034. // request ID to identify requests. Specify a unique request ID so that
  84035. // if you must retry your request, the server will know to ignore the
  84036. // request if it has already been completed.
  84037. //
  84038. // For example, consider a situation where you make an initial request
  84039. // and the request times out. If you make the request again with the
  84040. // same request ID, the server can check if original operation with the
  84041. // same request ID was received, and if so, will ignore the second
  84042. // request. This prevents clients from accidentally creating duplicate
  84043. // commitments.
  84044. //
  84045. // The request ID must be a valid UUID with the exception that zero UUID
  84046. // is not supported (00000000-0000-0000-0000-000000000000).
  84047. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  84048. c.urlParams_.Set("requestId", requestId)
  84049. return c
  84050. }
  84051. // Fields allows partial responses to be retrieved. See
  84052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84053. // for more information.
  84054. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  84055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84056. return c
  84057. }
  84058. // Context sets the context to be used in this call's Do method. Any
  84059. // pending HTTP request will be aborted if the provided context is
  84060. // canceled.
  84061. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  84062. c.ctx_ = ctx
  84063. return c
  84064. }
  84065. // Header returns an http.Header that can be modified by the caller to
  84066. // add HTTP headers to the request.
  84067. func (c *NodeGroupsDeleteCall) Header() http.Header {
  84068. if c.header_ == nil {
  84069. c.header_ = make(http.Header)
  84070. }
  84071. return c.header_
  84072. }
  84073. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  84074. reqHeaders := make(http.Header)
  84075. for k, v := range c.header_ {
  84076. reqHeaders[k] = v
  84077. }
  84078. reqHeaders.Set("User-Agent", c.s.userAgent())
  84079. var body io.Reader = nil
  84080. c.urlParams_.Set("alt", alt)
  84081. c.urlParams_.Set("prettyPrint", "false")
  84082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  84083. urls += "?" + c.urlParams_.Encode()
  84084. req, err := http.NewRequest("DELETE", urls, body)
  84085. if err != nil {
  84086. return nil, err
  84087. }
  84088. req.Header = reqHeaders
  84089. googleapi.Expand(req.URL, map[string]string{
  84090. "project": c.project,
  84091. "zone": c.zone,
  84092. "nodeGroup": c.nodeGroup,
  84093. })
  84094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84095. }
  84096. // Do executes the "compute.nodeGroups.delete" call.
  84097. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84098. // status code is an error. Response headers are in either
  84099. // *Operation.ServerResponse.Header or (if a response was returned at
  84100. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84101. // to check whether the returned error was because
  84102. // http.StatusNotModified was returned.
  84103. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84104. gensupport.SetOptions(c.urlParams_, opts...)
  84105. res, err := c.doRequest("json")
  84106. if res != nil && res.StatusCode == http.StatusNotModified {
  84107. if res.Body != nil {
  84108. res.Body.Close()
  84109. }
  84110. return nil, &googleapi.Error{
  84111. Code: res.StatusCode,
  84112. Header: res.Header,
  84113. }
  84114. }
  84115. if err != nil {
  84116. return nil, err
  84117. }
  84118. defer googleapi.CloseBody(res)
  84119. if err := googleapi.CheckResponse(res); err != nil {
  84120. return nil, err
  84121. }
  84122. ret := &Operation{
  84123. ServerResponse: googleapi.ServerResponse{
  84124. Header: res.Header,
  84125. HTTPStatusCode: res.StatusCode,
  84126. },
  84127. }
  84128. target := &ret
  84129. if err := gensupport.DecodeResponse(target, res); err != nil {
  84130. return nil, err
  84131. }
  84132. return ret, nil
  84133. // {
  84134. // "description": "Deletes the specified NodeGroup resource.",
  84135. // "httpMethod": "DELETE",
  84136. // "id": "compute.nodeGroups.delete",
  84137. // "parameterOrder": [
  84138. // "project",
  84139. // "zone",
  84140. // "nodeGroup"
  84141. // ],
  84142. // "parameters": {
  84143. // "nodeGroup": {
  84144. // "description": "Name of the NodeGroup resource to delete.",
  84145. // "location": "path",
  84146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84147. // "required": true,
  84148. // "type": "string"
  84149. // },
  84150. // "project": {
  84151. // "description": "Project ID for this request.",
  84152. // "location": "path",
  84153. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84154. // "required": true,
  84155. // "type": "string"
  84156. // },
  84157. // "requestId": {
  84158. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84159. // "location": "query",
  84160. // "type": "string"
  84161. // },
  84162. // "zone": {
  84163. // "description": "The name of the zone for this request.",
  84164. // "location": "path",
  84165. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84166. // "required": true,
  84167. // "type": "string"
  84168. // }
  84169. // },
  84170. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  84171. // "response": {
  84172. // "$ref": "Operation"
  84173. // },
  84174. // "scopes": [
  84175. // "https://www.googleapis.com/auth/cloud-platform",
  84176. // "https://www.googleapis.com/auth/compute"
  84177. // ]
  84178. // }
  84179. }
  84180. // method id "compute.nodeGroups.deleteNodes":
  84181. type NodeGroupsDeleteNodesCall struct {
  84182. s *Service
  84183. project string
  84184. zone string
  84185. nodeGroup string
  84186. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  84187. urlParams_ gensupport.URLParams
  84188. ctx_ context.Context
  84189. header_ http.Header
  84190. }
  84191. // DeleteNodes: Deletes specified nodes from the node group.
  84192. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  84193. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84194. c.project = project
  84195. c.zone = zone
  84196. c.nodeGroup = nodeGroup
  84197. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  84198. return c
  84199. }
  84200. // RequestId sets the optional parameter "requestId": An optional
  84201. // request ID to identify requests. Specify a unique request ID so that
  84202. // if you must retry your request, the server will know to ignore the
  84203. // request if it has already been completed.
  84204. //
  84205. // For example, consider a situation where you make an initial request
  84206. // and the request times out. If you make the request again with the
  84207. // same request ID, the server can check if original operation with the
  84208. // same request ID was received, and if so, will ignore the second
  84209. // request. This prevents clients from accidentally creating duplicate
  84210. // commitments.
  84211. //
  84212. // The request ID must be a valid UUID with the exception that zero UUID
  84213. // is not supported (00000000-0000-0000-0000-000000000000).
  84214. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  84215. c.urlParams_.Set("requestId", requestId)
  84216. return c
  84217. }
  84218. // Fields allows partial responses to be retrieved. See
  84219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84220. // for more information.
  84221. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  84222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84223. return c
  84224. }
  84225. // Context sets the context to be used in this call's Do method. Any
  84226. // pending HTTP request will be aborted if the provided context is
  84227. // canceled.
  84228. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  84229. c.ctx_ = ctx
  84230. return c
  84231. }
  84232. // Header returns an http.Header that can be modified by the caller to
  84233. // add HTTP headers to the request.
  84234. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  84235. if c.header_ == nil {
  84236. c.header_ = make(http.Header)
  84237. }
  84238. return c.header_
  84239. }
  84240. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  84241. reqHeaders := make(http.Header)
  84242. for k, v := range c.header_ {
  84243. reqHeaders[k] = v
  84244. }
  84245. reqHeaders.Set("User-Agent", c.s.userAgent())
  84246. var body io.Reader = nil
  84247. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  84248. if err != nil {
  84249. return nil, err
  84250. }
  84251. reqHeaders.Set("Content-Type", "application/json")
  84252. c.urlParams_.Set("alt", alt)
  84253. c.urlParams_.Set("prettyPrint", "false")
  84254. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  84255. urls += "?" + c.urlParams_.Encode()
  84256. req, err := http.NewRequest("POST", urls, body)
  84257. if err != nil {
  84258. return nil, err
  84259. }
  84260. req.Header = reqHeaders
  84261. googleapi.Expand(req.URL, map[string]string{
  84262. "project": c.project,
  84263. "zone": c.zone,
  84264. "nodeGroup": c.nodeGroup,
  84265. })
  84266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84267. }
  84268. // Do executes the "compute.nodeGroups.deleteNodes" call.
  84269. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84270. // status code is an error. Response headers are in either
  84271. // *Operation.ServerResponse.Header or (if a response was returned at
  84272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84273. // to check whether the returned error was because
  84274. // http.StatusNotModified was returned.
  84275. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84276. gensupport.SetOptions(c.urlParams_, opts...)
  84277. res, err := c.doRequest("json")
  84278. if res != nil && res.StatusCode == http.StatusNotModified {
  84279. if res.Body != nil {
  84280. res.Body.Close()
  84281. }
  84282. return nil, &googleapi.Error{
  84283. Code: res.StatusCode,
  84284. Header: res.Header,
  84285. }
  84286. }
  84287. if err != nil {
  84288. return nil, err
  84289. }
  84290. defer googleapi.CloseBody(res)
  84291. if err := googleapi.CheckResponse(res); err != nil {
  84292. return nil, err
  84293. }
  84294. ret := &Operation{
  84295. ServerResponse: googleapi.ServerResponse{
  84296. Header: res.Header,
  84297. HTTPStatusCode: res.StatusCode,
  84298. },
  84299. }
  84300. target := &ret
  84301. if err := gensupport.DecodeResponse(target, res); err != nil {
  84302. return nil, err
  84303. }
  84304. return ret, nil
  84305. // {
  84306. // "description": "Deletes specified nodes from the node group.",
  84307. // "httpMethod": "POST",
  84308. // "id": "compute.nodeGroups.deleteNodes",
  84309. // "parameterOrder": [
  84310. // "project",
  84311. // "zone",
  84312. // "nodeGroup"
  84313. // ],
  84314. // "parameters": {
  84315. // "nodeGroup": {
  84316. // "description": "Name of the NodeGroup resource to delete.",
  84317. // "location": "path",
  84318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84319. // "required": true,
  84320. // "type": "string"
  84321. // },
  84322. // "project": {
  84323. // "description": "Project ID for this request.",
  84324. // "location": "path",
  84325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84326. // "required": true,
  84327. // "type": "string"
  84328. // },
  84329. // "requestId": {
  84330. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84331. // "location": "query",
  84332. // "type": "string"
  84333. // },
  84334. // "zone": {
  84335. // "description": "The name of the zone for this request.",
  84336. // "location": "path",
  84337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84338. // "required": true,
  84339. // "type": "string"
  84340. // }
  84341. // },
  84342. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  84343. // "request": {
  84344. // "$ref": "NodeGroupsDeleteNodesRequest"
  84345. // },
  84346. // "response": {
  84347. // "$ref": "Operation"
  84348. // },
  84349. // "scopes": [
  84350. // "https://www.googleapis.com/auth/cloud-platform",
  84351. // "https://www.googleapis.com/auth/compute"
  84352. // ]
  84353. // }
  84354. }
  84355. // method id "compute.nodeGroups.get":
  84356. type NodeGroupsGetCall struct {
  84357. s *Service
  84358. project string
  84359. zone string
  84360. nodeGroup string
  84361. urlParams_ gensupport.URLParams
  84362. ifNoneMatch_ string
  84363. ctx_ context.Context
  84364. header_ http.Header
  84365. }
  84366. // Get: Returns the specified NodeGroup. Get a list of available
  84367. // NodeGroups by making a list() request. Note: the "nodes" field should
  84368. // not be used. Use nodeGroups.listNodes instead.
  84369. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  84370. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84371. c.project = project
  84372. c.zone = zone
  84373. c.nodeGroup = nodeGroup
  84374. return c
  84375. }
  84376. // Fields allows partial responses to be retrieved. See
  84377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84378. // for more information.
  84379. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  84380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84381. return c
  84382. }
  84383. // IfNoneMatch sets the optional parameter which makes the operation
  84384. // fail if the object's ETag matches the given value. This is useful for
  84385. // getting updates only after the object has changed since the last
  84386. // request. Use googleapi.IsNotModified to check whether the response
  84387. // error from Do is the result of In-None-Match.
  84388. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  84389. c.ifNoneMatch_ = entityTag
  84390. return c
  84391. }
  84392. // Context sets the context to be used in this call's Do method. Any
  84393. // pending HTTP request will be aborted if the provided context is
  84394. // canceled.
  84395. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  84396. c.ctx_ = ctx
  84397. return c
  84398. }
  84399. // Header returns an http.Header that can be modified by the caller to
  84400. // add HTTP headers to the request.
  84401. func (c *NodeGroupsGetCall) Header() http.Header {
  84402. if c.header_ == nil {
  84403. c.header_ = make(http.Header)
  84404. }
  84405. return c.header_
  84406. }
  84407. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  84408. reqHeaders := make(http.Header)
  84409. for k, v := range c.header_ {
  84410. reqHeaders[k] = v
  84411. }
  84412. reqHeaders.Set("User-Agent", c.s.userAgent())
  84413. if c.ifNoneMatch_ != "" {
  84414. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84415. }
  84416. var body io.Reader = nil
  84417. c.urlParams_.Set("alt", alt)
  84418. c.urlParams_.Set("prettyPrint", "false")
  84419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  84420. urls += "?" + c.urlParams_.Encode()
  84421. req, err := http.NewRequest("GET", urls, body)
  84422. if err != nil {
  84423. return nil, err
  84424. }
  84425. req.Header = reqHeaders
  84426. googleapi.Expand(req.URL, map[string]string{
  84427. "project": c.project,
  84428. "zone": c.zone,
  84429. "nodeGroup": c.nodeGroup,
  84430. })
  84431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84432. }
  84433. // Do executes the "compute.nodeGroups.get" call.
  84434. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  84435. // status code is an error. Response headers are in either
  84436. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  84437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84438. // to check whether the returned error was because
  84439. // http.StatusNotModified was returned.
  84440. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  84441. gensupport.SetOptions(c.urlParams_, opts...)
  84442. res, err := c.doRequest("json")
  84443. if res != nil && res.StatusCode == http.StatusNotModified {
  84444. if res.Body != nil {
  84445. res.Body.Close()
  84446. }
  84447. return nil, &googleapi.Error{
  84448. Code: res.StatusCode,
  84449. Header: res.Header,
  84450. }
  84451. }
  84452. if err != nil {
  84453. return nil, err
  84454. }
  84455. defer googleapi.CloseBody(res)
  84456. if err := googleapi.CheckResponse(res); err != nil {
  84457. return nil, err
  84458. }
  84459. ret := &NodeGroup{
  84460. ServerResponse: googleapi.ServerResponse{
  84461. Header: res.Header,
  84462. HTTPStatusCode: res.StatusCode,
  84463. },
  84464. }
  84465. target := &ret
  84466. if err := gensupport.DecodeResponse(target, res); err != nil {
  84467. return nil, err
  84468. }
  84469. return ret, nil
  84470. // {
  84471. // "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.",
  84472. // "httpMethod": "GET",
  84473. // "id": "compute.nodeGroups.get",
  84474. // "parameterOrder": [
  84475. // "project",
  84476. // "zone",
  84477. // "nodeGroup"
  84478. // ],
  84479. // "parameters": {
  84480. // "nodeGroup": {
  84481. // "description": "Name of the node group to return.",
  84482. // "location": "path",
  84483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84484. // "required": true,
  84485. // "type": "string"
  84486. // },
  84487. // "project": {
  84488. // "description": "Project ID for this request.",
  84489. // "location": "path",
  84490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84491. // "required": true,
  84492. // "type": "string"
  84493. // },
  84494. // "zone": {
  84495. // "description": "The name of the zone for this request.",
  84496. // "location": "path",
  84497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84498. // "required": true,
  84499. // "type": "string"
  84500. // }
  84501. // },
  84502. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  84503. // "response": {
  84504. // "$ref": "NodeGroup"
  84505. // },
  84506. // "scopes": [
  84507. // "https://www.googleapis.com/auth/cloud-platform",
  84508. // "https://www.googleapis.com/auth/compute",
  84509. // "https://www.googleapis.com/auth/compute.readonly"
  84510. // ]
  84511. // }
  84512. }
  84513. // method id "compute.nodeGroups.getIamPolicy":
  84514. type NodeGroupsGetIamPolicyCall struct {
  84515. s *Service
  84516. project string
  84517. zone string
  84518. resource string
  84519. urlParams_ gensupport.URLParams
  84520. ifNoneMatch_ string
  84521. ctx_ context.Context
  84522. header_ http.Header
  84523. }
  84524. // GetIamPolicy: Gets the access control policy for a resource. May be
  84525. // empty if no such policy or resource exists.
  84526. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  84527. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84528. c.project = project
  84529. c.zone = zone
  84530. c.resource = resource
  84531. return c
  84532. }
  84533. // Fields allows partial responses to be retrieved. See
  84534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84535. // for more information.
  84536. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  84537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84538. return c
  84539. }
  84540. // IfNoneMatch sets the optional parameter which makes the operation
  84541. // fail if the object's ETag matches the given value. This is useful for
  84542. // getting updates only after the object has changed since the last
  84543. // request. Use googleapi.IsNotModified to check whether the response
  84544. // error from Do is the result of In-None-Match.
  84545. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  84546. c.ifNoneMatch_ = entityTag
  84547. return c
  84548. }
  84549. // Context sets the context to be used in this call's Do method. Any
  84550. // pending HTTP request will be aborted if the provided context is
  84551. // canceled.
  84552. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  84553. c.ctx_ = ctx
  84554. return c
  84555. }
  84556. // Header returns an http.Header that can be modified by the caller to
  84557. // add HTTP headers to the request.
  84558. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  84559. if c.header_ == nil {
  84560. c.header_ = make(http.Header)
  84561. }
  84562. return c.header_
  84563. }
  84564. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84565. reqHeaders := make(http.Header)
  84566. for k, v := range c.header_ {
  84567. reqHeaders[k] = v
  84568. }
  84569. reqHeaders.Set("User-Agent", c.s.userAgent())
  84570. if c.ifNoneMatch_ != "" {
  84571. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84572. }
  84573. var body io.Reader = nil
  84574. c.urlParams_.Set("alt", alt)
  84575. c.urlParams_.Set("prettyPrint", "false")
  84576. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  84577. urls += "?" + c.urlParams_.Encode()
  84578. req, err := http.NewRequest("GET", urls, body)
  84579. if err != nil {
  84580. return nil, err
  84581. }
  84582. req.Header = reqHeaders
  84583. googleapi.Expand(req.URL, map[string]string{
  84584. "project": c.project,
  84585. "zone": c.zone,
  84586. "resource": c.resource,
  84587. })
  84588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84589. }
  84590. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  84591. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84592. // code is an error. Response headers are in either
  84593. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84594. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84595. // check whether the returned error was because http.StatusNotModified
  84596. // was returned.
  84597. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84598. gensupport.SetOptions(c.urlParams_, opts...)
  84599. res, err := c.doRequest("json")
  84600. if res != nil && res.StatusCode == http.StatusNotModified {
  84601. if res.Body != nil {
  84602. res.Body.Close()
  84603. }
  84604. return nil, &googleapi.Error{
  84605. Code: res.StatusCode,
  84606. Header: res.Header,
  84607. }
  84608. }
  84609. if err != nil {
  84610. return nil, err
  84611. }
  84612. defer googleapi.CloseBody(res)
  84613. if err := googleapi.CheckResponse(res); err != nil {
  84614. return nil, err
  84615. }
  84616. ret := &Policy{
  84617. ServerResponse: googleapi.ServerResponse{
  84618. Header: res.Header,
  84619. HTTPStatusCode: res.StatusCode,
  84620. },
  84621. }
  84622. target := &ret
  84623. if err := gensupport.DecodeResponse(target, res); err != nil {
  84624. return nil, err
  84625. }
  84626. return ret, nil
  84627. // {
  84628. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  84629. // "httpMethod": "GET",
  84630. // "id": "compute.nodeGroups.getIamPolicy",
  84631. // "parameterOrder": [
  84632. // "project",
  84633. // "zone",
  84634. // "resource"
  84635. // ],
  84636. // "parameters": {
  84637. // "project": {
  84638. // "description": "Project ID for this request.",
  84639. // "location": "path",
  84640. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84641. // "required": true,
  84642. // "type": "string"
  84643. // },
  84644. // "resource": {
  84645. // "description": "Name or id of the resource for this request.",
  84646. // "location": "path",
  84647. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84648. // "required": true,
  84649. // "type": "string"
  84650. // },
  84651. // "zone": {
  84652. // "description": "The name of the zone for this request.",
  84653. // "location": "path",
  84654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84655. // "required": true,
  84656. // "type": "string"
  84657. // }
  84658. // },
  84659. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  84660. // "response": {
  84661. // "$ref": "Policy"
  84662. // },
  84663. // "scopes": [
  84664. // "https://www.googleapis.com/auth/cloud-platform",
  84665. // "https://www.googleapis.com/auth/compute",
  84666. // "https://www.googleapis.com/auth/compute.readonly"
  84667. // ]
  84668. // }
  84669. }
  84670. // method id "compute.nodeGroups.insert":
  84671. type NodeGroupsInsertCall struct {
  84672. s *Service
  84673. project string
  84674. zone string
  84675. nodegroup *NodeGroup
  84676. urlParams_ gensupport.URLParams
  84677. ctx_ context.Context
  84678. header_ http.Header
  84679. }
  84680. // Insert: Creates a NodeGroup resource in the specified project using
  84681. // the data included in the request.
  84682. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  84683. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84684. c.project = project
  84685. c.zone = zone
  84686. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  84687. c.nodegroup = nodegroup
  84688. return c
  84689. }
  84690. // RequestId sets the optional parameter "requestId": An optional
  84691. // request ID to identify requests. Specify a unique request ID so that
  84692. // if you must retry your request, the server will know to ignore the
  84693. // request if it has already been completed.
  84694. //
  84695. // For example, consider a situation where you make an initial request
  84696. // and the request times out. If you make the request again with the
  84697. // same request ID, the server can check if original operation with the
  84698. // same request ID was received, and if so, will ignore the second
  84699. // request. This prevents clients from accidentally creating duplicate
  84700. // commitments.
  84701. //
  84702. // The request ID must be a valid UUID with the exception that zero UUID
  84703. // is not supported (00000000-0000-0000-0000-000000000000).
  84704. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  84705. c.urlParams_.Set("requestId", requestId)
  84706. return c
  84707. }
  84708. // Fields allows partial responses to be retrieved. See
  84709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84710. // for more information.
  84711. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  84712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84713. return c
  84714. }
  84715. // Context sets the context to be used in this call's Do method. Any
  84716. // pending HTTP request will be aborted if the provided context is
  84717. // canceled.
  84718. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  84719. c.ctx_ = ctx
  84720. return c
  84721. }
  84722. // Header returns an http.Header that can be modified by the caller to
  84723. // add HTTP headers to the request.
  84724. func (c *NodeGroupsInsertCall) Header() http.Header {
  84725. if c.header_ == nil {
  84726. c.header_ = make(http.Header)
  84727. }
  84728. return c.header_
  84729. }
  84730. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  84731. reqHeaders := make(http.Header)
  84732. for k, v := range c.header_ {
  84733. reqHeaders[k] = v
  84734. }
  84735. reqHeaders.Set("User-Agent", c.s.userAgent())
  84736. var body io.Reader = nil
  84737. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  84738. if err != nil {
  84739. return nil, err
  84740. }
  84741. reqHeaders.Set("Content-Type", "application/json")
  84742. c.urlParams_.Set("alt", alt)
  84743. c.urlParams_.Set("prettyPrint", "false")
  84744. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  84745. urls += "?" + c.urlParams_.Encode()
  84746. req, err := http.NewRequest("POST", urls, body)
  84747. if err != nil {
  84748. return nil, err
  84749. }
  84750. req.Header = reqHeaders
  84751. googleapi.Expand(req.URL, map[string]string{
  84752. "project": c.project,
  84753. "zone": c.zone,
  84754. })
  84755. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84756. }
  84757. // Do executes the "compute.nodeGroups.insert" call.
  84758. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84759. // status code is an error. Response headers are in either
  84760. // *Operation.ServerResponse.Header or (if a response was returned at
  84761. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84762. // to check whether the returned error was because
  84763. // http.StatusNotModified was returned.
  84764. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84765. gensupport.SetOptions(c.urlParams_, opts...)
  84766. res, err := c.doRequest("json")
  84767. if res != nil && res.StatusCode == http.StatusNotModified {
  84768. if res.Body != nil {
  84769. res.Body.Close()
  84770. }
  84771. return nil, &googleapi.Error{
  84772. Code: res.StatusCode,
  84773. Header: res.Header,
  84774. }
  84775. }
  84776. if err != nil {
  84777. return nil, err
  84778. }
  84779. defer googleapi.CloseBody(res)
  84780. if err := googleapi.CheckResponse(res); err != nil {
  84781. return nil, err
  84782. }
  84783. ret := &Operation{
  84784. ServerResponse: googleapi.ServerResponse{
  84785. Header: res.Header,
  84786. HTTPStatusCode: res.StatusCode,
  84787. },
  84788. }
  84789. target := &ret
  84790. if err := gensupport.DecodeResponse(target, res); err != nil {
  84791. return nil, err
  84792. }
  84793. return ret, nil
  84794. // {
  84795. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  84796. // "httpMethod": "POST",
  84797. // "id": "compute.nodeGroups.insert",
  84798. // "parameterOrder": [
  84799. // "project",
  84800. // "zone",
  84801. // "initialNodeCount"
  84802. // ],
  84803. // "parameters": {
  84804. // "initialNodeCount": {
  84805. // "description": "Initial count of nodes in the node group.",
  84806. // "format": "int32",
  84807. // "location": "query",
  84808. // "required": true,
  84809. // "type": "integer"
  84810. // },
  84811. // "project": {
  84812. // "description": "Project ID for this request.",
  84813. // "location": "path",
  84814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84815. // "required": true,
  84816. // "type": "string"
  84817. // },
  84818. // "requestId": {
  84819. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84820. // "location": "query",
  84821. // "type": "string"
  84822. // },
  84823. // "zone": {
  84824. // "description": "The name of the zone for this request.",
  84825. // "location": "path",
  84826. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84827. // "required": true,
  84828. // "type": "string"
  84829. // }
  84830. // },
  84831. // "path": "{project}/zones/{zone}/nodeGroups",
  84832. // "request": {
  84833. // "$ref": "NodeGroup"
  84834. // },
  84835. // "response": {
  84836. // "$ref": "Operation"
  84837. // },
  84838. // "scopes": [
  84839. // "https://www.googleapis.com/auth/cloud-platform",
  84840. // "https://www.googleapis.com/auth/compute"
  84841. // ]
  84842. // }
  84843. }
  84844. // method id "compute.nodeGroups.list":
  84845. type NodeGroupsListCall struct {
  84846. s *Service
  84847. project string
  84848. zone string
  84849. urlParams_ gensupport.URLParams
  84850. ifNoneMatch_ string
  84851. ctx_ context.Context
  84852. header_ http.Header
  84853. }
  84854. // List: Retrieves a list of node groups available to the specified
  84855. // project. Note: use nodeGroups.listNodes for more details about each
  84856. // group.
  84857. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  84858. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84859. c.project = project
  84860. c.zone = zone
  84861. return c
  84862. }
  84863. // Filter sets the optional parameter "filter": A filter expression that
  84864. // filters resources listed in the response. The expression must specify
  84865. // the field name, a comparison operator, and the value that you want to
  84866. // use for filtering. The value must be a string, a number, or a
  84867. // boolean. The comparison operator must be either =, !=, >, or <.
  84868. //
  84869. // For example, if you are filtering Compute Engine instances, you can
  84870. // exclude instances named example-instance by specifying name !=
  84871. // example-instance.
  84872. //
  84873. // You can also filter nested fields. For example, you could specify
  84874. // scheduling.automaticRestart = false to include instances only if they
  84875. // are not scheduled for automatic restarts. You can use filtering on
  84876. // nested fields to filter based on resource labels.
  84877. //
  84878. // To filter on multiple expressions, provide each separate expression
  84879. // within parentheses. For example, (scheduling.automaticRestart = true)
  84880. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84881. // AND expression. However, you can include AND and OR expressions
  84882. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84883. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84884. // true).
  84885. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  84886. c.urlParams_.Set("filter", filter)
  84887. return c
  84888. }
  84889. // MaxResults sets the optional parameter "maxResults": The maximum
  84890. // number of results per page that should be returned. If the number of
  84891. // available results is larger than maxResults, Compute Engine returns a
  84892. // nextPageToken that can be used to get the next page of results in
  84893. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84894. // (Default: 500)
  84895. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  84896. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84897. return c
  84898. }
  84899. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84900. // a certain order. By default, results are returned in alphanumerical
  84901. // order based on the resource name.
  84902. //
  84903. // You can also sort results in descending order based on the creation
  84904. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84905. // based on the creationTimestamp field in reverse chronological order
  84906. // (newest result first). Use this to sort resources like operations so
  84907. // that the newest operation is returned first.
  84908. //
  84909. // Currently, only sorting by name or creationTimestamp desc is
  84910. // supported.
  84911. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  84912. c.urlParams_.Set("orderBy", orderBy)
  84913. return c
  84914. }
  84915. // PageToken sets the optional parameter "pageToken": Specifies a page
  84916. // token to use. Set pageToken to the nextPageToken returned by a
  84917. // previous list request to get the next page of results.
  84918. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  84919. c.urlParams_.Set("pageToken", pageToken)
  84920. return c
  84921. }
  84922. // Fields allows partial responses to be retrieved. See
  84923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84924. // for more information.
  84925. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  84926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84927. return c
  84928. }
  84929. // IfNoneMatch sets the optional parameter which makes the operation
  84930. // fail if the object's ETag matches the given value. This is useful for
  84931. // getting updates only after the object has changed since the last
  84932. // request. Use googleapi.IsNotModified to check whether the response
  84933. // error from Do is the result of In-None-Match.
  84934. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  84935. c.ifNoneMatch_ = entityTag
  84936. return c
  84937. }
  84938. // Context sets the context to be used in this call's Do method. Any
  84939. // pending HTTP request will be aborted if the provided context is
  84940. // canceled.
  84941. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  84942. c.ctx_ = ctx
  84943. return c
  84944. }
  84945. // Header returns an http.Header that can be modified by the caller to
  84946. // add HTTP headers to the request.
  84947. func (c *NodeGroupsListCall) Header() http.Header {
  84948. if c.header_ == nil {
  84949. c.header_ = make(http.Header)
  84950. }
  84951. return c.header_
  84952. }
  84953. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  84954. reqHeaders := make(http.Header)
  84955. for k, v := range c.header_ {
  84956. reqHeaders[k] = v
  84957. }
  84958. reqHeaders.Set("User-Agent", c.s.userAgent())
  84959. if c.ifNoneMatch_ != "" {
  84960. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84961. }
  84962. var body io.Reader = nil
  84963. c.urlParams_.Set("alt", alt)
  84964. c.urlParams_.Set("prettyPrint", "false")
  84965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  84966. urls += "?" + c.urlParams_.Encode()
  84967. req, err := http.NewRequest("GET", urls, body)
  84968. if err != nil {
  84969. return nil, err
  84970. }
  84971. req.Header = reqHeaders
  84972. googleapi.Expand(req.URL, map[string]string{
  84973. "project": c.project,
  84974. "zone": c.zone,
  84975. })
  84976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84977. }
  84978. // Do executes the "compute.nodeGroups.list" call.
  84979. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  84980. // status code is an error. Response headers are in either
  84981. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  84982. // at all) in error.(*googleapi.Error).Header. Use
  84983. // googleapi.IsNotModified to check whether the returned error was
  84984. // because http.StatusNotModified was returned.
  84985. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  84986. gensupport.SetOptions(c.urlParams_, opts...)
  84987. res, err := c.doRequest("json")
  84988. if res != nil && res.StatusCode == http.StatusNotModified {
  84989. if res.Body != nil {
  84990. res.Body.Close()
  84991. }
  84992. return nil, &googleapi.Error{
  84993. Code: res.StatusCode,
  84994. Header: res.Header,
  84995. }
  84996. }
  84997. if err != nil {
  84998. return nil, err
  84999. }
  85000. defer googleapi.CloseBody(res)
  85001. if err := googleapi.CheckResponse(res); err != nil {
  85002. return nil, err
  85003. }
  85004. ret := &NodeGroupList{
  85005. ServerResponse: googleapi.ServerResponse{
  85006. Header: res.Header,
  85007. HTTPStatusCode: res.StatusCode,
  85008. },
  85009. }
  85010. target := &ret
  85011. if err := gensupport.DecodeResponse(target, res); err != nil {
  85012. return nil, err
  85013. }
  85014. return ret, nil
  85015. // {
  85016. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  85017. // "httpMethod": "GET",
  85018. // "id": "compute.nodeGroups.list",
  85019. // "parameterOrder": [
  85020. // "project",
  85021. // "zone"
  85022. // ],
  85023. // "parameters": {
  85024. // "filter": {
  85025. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85026. // "location": "query",
  85027. // "type": "string"
  85028. // },
  85029. // "maxResults": {
  85030. // "default": "500",
  85031. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85032. // "format": "uint32",
  85033. // "location": "query",
  85034. // "minimum": "0",
  85035. // "type": "integer"
  85036. // },
  85037. // "orderBy": {
  85038. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85039. // "location": "query",
  85040. // "type": "string"
  85041. // },
  85042. // "pageToken": {
  85043. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85044. // "location": "query",
  85045. // "type": "string"
  85046. // },
  85047. // "project": {
  85048. // "description": "Project ID for this request.",
  85049. // "location": "path",
  85050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85051. // "required": true,
  85052. // "type": "string"
  85053. // },
  85054. // "zone": {
  85055. // "description": "The name of the zone for this request.",
  85056. // "location": "path",
  85057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85058. // "required": true,
  85059. // "type": "string"
  85060. // }
  85061. // },
  85062. // "path": "{project}/zones/{zone}/nodeGroups",
  85063. // "response": {
  85064. // "$ref": "NodeGroupList"
  85065. // },
  85066. // "scopes": [
  85067. // "https://www.googleapis.com/auth/cloud-platform",
  85068. // "https://www.googleapis.com/auth/compute",
  85069. // "https://www.googleapis.com/auth/compute.readonly"
  85070. // ]
  85071. // }
  85072. }
  85073. // Pages invokes f for each page of results.
  85074. // A non-nil error returned from f will halt the iteration.
  85075. // The provided context supersedes any context provided to the Context method.
  85076. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  85077. c.ctx_ = ctx
  85078. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85079. for {
  85080. x, err := c.Do()
  85081. if err != nil {
  85082. return err
  85083. }
  85084. if err := f(x); err != nil {
  85085. return err
  85086. }
  85087. if x.NextPageToken == "" {
  85088. return nil
  85089. }
  85090. c.PageToken(x.NextPageToken)
  85091. }
  85092. }
  85093. // method id "compute.nodeGroups.listNodes":
  85094. type NodeGroupsListNodesCall struct {
  85095. s *Service
  85096. project string
  85097. zone string
  85098. nodeGroup string
  85099. urlParams_ gensupport.URLParams
  85100. ctx_ context.Context
  85101. header_ http.Header
  85102. }
  85103. // ListNodes: Lists nodes in the node group.
  85104. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  85105. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85106. c.project = project
  85107. c.zone = zone
  85108. c.nodeGroup = nodeGroup
  85109. return c
  85110. }
  85111. // Filter sets the optional parameter "filter": A filter expression that
  85112. // filters resources listed in the response. The expression must specify
  85113. // the field name, a comparison operator, and the value that you want to
  85114. // use for filtering. The value must be a string, a number, or a
  85115. // boolean. The comparison operator must be either =, !=, >, or <.
  85116. //
  85117. // For example, if you are filtering Compute Engine instances, you can
  85118. // exclude instances named example-instance by specifying name !=
  85119. // example-instance.
  85120. //
  85121. // You can also filter nested fields. For example, you could specify
  85122. // scheduling.automaticRestart = false to include instances only if they
  85123. // are not scheduled for automatic restarts. You can use filtering on
  85124. // nested fields to filter based on resource labels.
  85125. //
  85126. // To filter on multiple expressions, provide each separate expression
  85127. // within parentheses. For example, (scheduling.automaticRestart = true)
  85128. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85129. // AND expression. However, you can include AND and OR expressions
  85130. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85131. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85132. // true).
  85133. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  85134. c.urlParams_.Set("filter", filter)
  85135. return c
  85136. }
  85137. // MaxResults sets the optional parameter "maxResults": The maximum
  85138. // number of results per page that should be returned. If the number of
  85139. // available results is larger than maxResults, Compute Engine returns a
  85140. // nextPageToken that can be used to get the next page of results in
  85141. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85142. // (Default: 500)
  85143. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  85144. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85145. return c
  85146. }
  85147. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85148. // a certain order. By default, results are returned in alphanumerical
  85149. // order based on the resource name.
  85150. //
  85151. // You can also sort results in descending order based on the creation
  85152. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85153. // based on the creationTimestamp field in reverse chronological order
  85154. // (newest result first). Use this to sort resources like operations so
  85155. // that the newest operation is returned first.
  85156. //
  85157. // Currently, only sorting by name or creationTimestamp desc is
  85158. // supported.
  85159. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  85160. c.urlParams_.Set("orderBy", orderBy)
  85161. return c
  85162. }
  85163. // PageToken sets the optional parameter "pageToken": Specifies a page
  85164. // token to use. Set pageToken to the nextPageToken returned by a
  85165. // previous list request to get the next page of results.
  85166. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  85167. c.urlParams_.Set("pageToken", pageToken)
  85168. return c
  85169. }
  85170. // Fields allows partial responses to be retrieved. See
  85171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85172. // for more information.
  85173. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  85174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85175. return c
  85176. }
  85177. // Context sets the context to be used in this call's Do method. Any
  85178. // pending HTTP request will be aborted if the provided context is
  85179. // canceled.
  85180. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  85181. c.ctx_ = ctx
  85182. return c
  85183. }
  85184. // Header returns an http.Header that can be modified by the caller to
  85185. // add HTTP headers to the request.
  85186. func (c *NodeGroupsListNodesCall) Header() http.Header {
  85187. if c.header_ == nil {
  85188. c.header_ = make(http.Header)
  85189. }
  85190. return c.header_
  85191. }
  85192. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  85193. reqHeaders := make(http.Header)
  85194. for k, v := range c.header_ {
  85195. reqHeaders[k] = v
  85196. }
  85197. reqHeaders.Set("User-Agent", c.s.userAgent())
  85198. var body io.Reader = nil
  85199. c.urlParams_.Set("alt", alt)
  85200. c.urlParams_.Set("prettyPrint", "false")
  85201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  85202. urls += "?" + c.urlParams_.Encode()
  85203. req, err := http.NewRequest("POST", urls, body)
  85204. if err != nil {
  85205. return nil, err
  85206. }
  85207. req.Header = reqHeaders
  85208. googleapi.Expand(req.URL, map[string]string{
  85209. "project": c.project,
  85210. "zone": c.zone,
  85211. "nodeGroup": c.nodeGroup,
  85212. })
  85213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85214. }
  85215. // Do executes the "compute.nodeGroups.listNodes" call.
  85216. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  85217. // non-2xx status code is an error. Response headers are in either
  85218. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  85219. // returned at all) in error.(*googleapi.Error).Header. Use
  85220. // googleapi.IsNotModified to check whether the returned error was
  85221. // because http.StatusNotModified was returned.
  85222. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  85223. gensupport.SetOptions(c.urlParams_, opts...)
  85224. res, err := c.doRequest("json")
  85225. if res != nil && res.StatusCode == http.StatusNotModified {
  85226. if res.Body != nil {
  85227. res.Body.Close()
  85228. }
  85229. return nil, &googleapi.Error{
  85230. Code: res.StatusCode,
  85231. Header: res.Header,
  85232. }
  85233. }
  85234. if err != nil {
  85235. return nil, err
  85236. }
  85237. defer googleapi.CloseBody(res)
  85238. if err := googleapi.CheckResponse(res); err != nil {
  85239. return nil, err
  85240. }
  85241. ret := &NodeGroupsListNodes{
  85242. ServerResponse: googleapi.ServerResponse{
  85243. Header: res.Header,
  85244. HTTPStatusCode: res.StatusCode,
  85245. },
  85246. }
  85247. target := &ret
  85248. if err := gensupport.DecodeResponse(target, res); err != nil {
  85249. return nil, err
  85250. }
  85251. return ret, nil
  85252. // {
  85253. // "description": "Lists nodes in the node group.",
  85254. // "httpMethod": "POST",
  85255. // "id": "compute.nodeGroups.listNodes",
  85256. // "parameterOrder": [
  85257. // "project",
  85258. // "zone",
  85259. // "nodeGroup"
  85260. // ],
  85261. // "parameters": {
  85262. // "filter": {
  85263. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85264. // "location": "query",
  85265. // "type": "string"
  85266. // },
  85267. // "maxResults": {
  85268. // "default": "500",
  85269. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85270. // "format": "uint32",
  85271. // "location": "query",
  85272. // "minimum": "0",
  85273. // "type": "integer"
  85274. // },
  85275. // "nodeGroup": {
  85276. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  85277. // "location": "path",
  85278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85279. // "required": true,
  85280. // "type": "string"
  85281. // },
  85282. // "orderBy": {
  85283. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85284. // "location": "query",
  85285. // "type": "string"
  85286. // },
  85287. // "pageToken": {
  85288. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85289. // "location": "query",
  85290. // "type": "string"
  85291. // },
  85292. // "project": {
  85293. // "description": "Project ID for this request.",
  85294. // "location": "path",
  85295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85296. // "required": true,
  85297. // "type": "string"
  85298. // },
  85299. // "zone": {
  85300. // "description": "The name of the zone for this request.",
  85301. // "location": "path",
  85302. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85303. // "required": true,
  85304. // "type": "string"
  85305. // }
  85306. // },
  85307. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  85308. // "response": {
  85309. // "$ref": "NodeGroupsListNodes"
  85310. // },
  85311. // "scopes": [
  85312. // "https://www.googleapis.com/auth/cloud-platform",
  85313. // "https://www.googleapis.com/auth/compute",
  85314. // "https://www.googleapis.com/auth/compute.readonly"
  85315. // ]
  85316. // }
  85317. }
  85318. // Pages invokes f for each page of results.
  85319. // A non-nil error returned from f will halt the iteration.
  85320. // The provided context supersedes any context provided to the Context method.
  85321. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  85322. c.ctx_ = ctx
  85323. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85324. for {
  85325. x, err := c.Do()
  85326. if err != nil {
  85327. return err
  85328. }
  85329. if err := f(x); err != nil {
  85330. return err
  85331. }
  85332. if x.NextPageToken == "" {
  85333. return nil
  85334. }
  85335. c.PageToken(x.NextPageToken)
  85336. }
  85337. }
  85338. // method id "compute.nodeGroups.setIamPolicy":
  85339. type NodeGroupsSetIamPolicyCall struct {
  85340. s *Service
  85341. project string
  85342. zone string
  85343. resource string
  85344. zonesetpolicyrequest *ZoneSetPolicyRequest
  85345. urlParams_ gensupport.URLParams
  85346. ctx_ context.Context
  85347. header_ http.Header
  85348. }
  85349. // SetIamPolicy: Sets the access control policy on the specified
  85350. // resource. Replaces any existing policy.
  85351. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  85352. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85353. c.project = project
  85354. c.zone = zone
  85355. c.resource = resource
  85356. c.zonesetpolicyrequest = zonesetpolicyrequest
  85357. return c
  85358. }
  85359. // Fields allows partial responses to be retrieved. See
  85360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85361. // for more information.
  85362. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  85363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85364. return c
  85365. }
  85366. // Context sets the context to be used in this call's Do method. Any
  85367. // pending HTTP request will be aborted if the provided context is
  85368. // canceled.
  85369. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  85370. c.ctx_ = ctx
  85371. return c
  85372. }
  85373. // Header returns an http.Header that can be modified by the caller to
  85374. // add HTTP headers to the request.
  85375. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  85376. if c.header_ == nil {
  85377. c.header_ = make(http.Header)
  85378. }
  85379. return c.header_
  85380. }
  85381. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  85382. reqHeaders := make(http.Header)
  85383. for k, v := range c.header_ {
  85384. reqHeaders[k] = v
  85385. }
  85386. reqHeaders.Set("User-Agent", c.s.userAgent())
  85387. var body io.Reader = nil
  85388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  85389. if err != nil {
  85390. return nil, err
  85391. }
  85392. reqHeaders.Set("Content-Type", "application/json")
  85393. c.urlParams_.Set("alt", alt)
  85394. c.urlParams_.Set("prettyPrint", "false")
  85395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  85396. urls += "?" + c.urlParams_.Encode()
  85397. req, err := http.NewRequest("POST", urls, body)
  85398. if err != nil {
  85399. return nil, err
  85400. }
  85401. req.Header = reqHeaders
  85402. googleapi.Expand(req.URL, map[string]string{
  85403. "project": c.project,
  85404. "zone": c.zone,
  85405. "resource": c.resource,
  85406. })
  85407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85408. }
  85409. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  85410. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  85411. // code is an error. Response headers are in either
  85412. // *Policy.ServerResponse.Header or (if a response was returned at all)
  85413. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  85414. // check whether the returned error was because http.StatusNotModified
  85415. // was returned.
  85416. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  85417. gensupport.SetOptions(c.urlParams_, opts...)
  85418. res, err := c.doRequest("json")
  85419. if res != nil && res.StatusCode == http.StatusNotModified {
  85420. if res.Body != nil {
  85421. res.Body.Close()
  85422. }
  85423. return nil, &googleapi.Error{
  85424. Code: res.StatusCode,
  85425. Header: res.Header,
  85426. }
  85427. }
  85428. if err != nil {
  85429. return nil, err
  85430. }
  85431. defer googleapi.CloseBody(res)
  85432. if err := googleapi.CheckResponse(res); err != nil {
  85433. return nil, err
  85434. }
  85435. ret := &Policy{
  85436. ServerResponse: googleapi.ServerResponse{
  85437. Header: res.Header,
  85438. HTTPStatusCode: res.StatusCode,
  85439. },
  85440. }
  85441. target := &ret
  85442. if err := gensupport.DecodeResponse(target, res); err != nil {
  85443. return nil, err
  85444. }
  85445. return ret, nil
  85446. // {
  85447. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  85448. // "httpMethod": "POST",
  85449. // "id": "compute.nodeGroups.setIamPolicy",
  85450. // "parameterOrder": [
  85451. // "project",
  85452. // "zone",
  85453. // "resource"
  85454. // ],
  85455. // "parameters": {
  85456. // "project": {
  85457. // "description": "Project ID for this request.",
  85458. // "location": "path",
  85459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85460. // "required": true,
  85461. // "type": "string"
  85462. // },
  85463. // "resource": {
  85464. // "description": "Name or id of the resource for this request.",
  85465. // "location": "path",
  85466. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85467. // "required": true,
  85468. // "type": "string"
  85469. // },
  85470. // "zone": {
  85471. // "description": "The name of the zone for this request.",
  85472. // "location": "path",
  85473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85474. // "required": true,
  85475. // "type": "string"
  85476. // }
  85477. // },
  85478. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  85479. // "request": {
  85480. // "$ref": "ZoneSetPolicyRequest"
  85481. // },
  85482. // "response": {
  85483. // "$ref": "Policy"
  85484. // },
  85485. // "scopes": [
  85486. // "https://www.googleapis.com/auth/cloud-platform",
  85487. // "https://www.googleapis.com/auth/compute"
  85488. // ]
  85489. // }
  85490. }
  85491. // method id "compute.nodeGroups.setNodeTemplate":
  85492. type NodeGroupsSetNodeTemplateCall struct {
  85493. s *Service
  85494. project string
  85495. zone string
  85496. nodeGroup string
  85497. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  85498. urlParams_ gensupport.URLParams
  85499. ctx_ context.Context
  85500. header_ http.Header
  85501. }
  85502. // SetNodeTemplate: Updates the node template of the node group.
  85503. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  85504. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85505. c.project = project
  85506. c.zone = zone
  85507. c.nodeGroup = nodeGroup
  85508. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  85509. return c
  85510. }
  85511. // RequestId sets the optional parameter "requestId": An optional
  85512. // request ID to identify requests. Specify a unique request ID so that
  85513. // if you must retry your request, the server will know to ignore the
  85514. // request if it has already been completed.
  85515. //
  85516. // For example, consider a situation where you make an initial request
  85517. // and the request times out. If you make the request again with the
  85518. // same request ID, the server can check if original operation with the
  85519. // same request ID was received, and if so, will ignore the second
  85520. // request. This prevents clients from accidentally creating duplicate
  85521. // commitments.
  85522. //
  85523. // The request ID must be a valid UUID with the exception that zero UUID
  85524. // is not supported (00000000-0000-0000-0000-000000000000).
  85525. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  85526. c.urlParams_.Set("requestId", requestId)
  85527. return c
  85528. }
  85529. // Fields allows partial responses to be retrieved. See
  85530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85531. // for more information.
  85532. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  85533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85534. return c
  85535. }
  85536. // Context sets the context to be used in this call's Do method. Any
  85537. // pending HTTP request will be aborted if the provided context is
  85538. // canceled.
  85539. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  85540. c.ctx_ = ctx
  85541. return c
  85542. }
  85543. // Header returns an http.Header that can be modified by the caller to
  85544. // add HTTP headers to the request.
  85545. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  85546. if c.header_ == nil {
  85547. c.header_ = make(http.Header)
  85548. }
  85549. return c.header_
  85550. }
  85551. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  85552. reqHeaders := make(http.Header)
  85553. for k, v := range c.header_ {
  85554. reqHeaders[k] = v
  85555. }
  85556. reqHeaders.Set("User-Agent", c.s.userAgent())
  85557. var body io.Reader = nil
  85558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  85559. if err != nil {
  85560. return nil, err
  85561. }
  85562. reqHeaders.Set("Content-Type", "application/json")
  85563. c.urlParams_.Set("alt", alt)
  85564. c.urlParams_.Set("prettyPrint", "false")
  85565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  85566. urls += "?" + c.urlParams_.Encode()
  85567. req, err := http.NewRequest("POST", urls, body)
  85568. if err != nil {
  85569. return nil, err
  85570. }
  85571. req.Header = reqHeaders
  85572. googleapi.Expand(req.URL, map[string]string{
  85573. "project": c.project,
  85574. "zone": c.zone,
  85575. "nodeGroup": c.nodeGroup,
  85576. })
  85577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85578. }
  85579. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  85580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85581. // status code is an error. Response headers are in either
  85582. // *Operation.ServerResponse.Header or (if a response was returned at
  85583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85584. // to check whether the returned error was because
  85585. // http.StatusNotModified was returned.
  85586. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85587. gensupport.SetOptions(c.urlParams_, opts...)
  85588. res, err := c.doRequest("json")
  85589. if res != nil && res.StatusCode == http.StatusNotModified {
  85590. if res.Body != nil {
  85591. res.Body.Close()
  85592. }
  85593. return nil, &googleapi.Error{
  85594. Code: res.StatusCode,
  85595. Header: res.Header,
  85596. }
  85597. }
  85598. if err != nil {
  85599. return nil, err
  85600. }
  85601. defer googleapi.CloseBody(res)
  85602. if err := googleapi.CheckResponse(res); err != nil {
  85603. return nil, err
  85604. }
  85605. ret := &Operation{
  85606. ServerResponse: googleapi.ServerResponse{
  85607. Header: res.Header,
  85608. HTTPStatusCode: res.StatusCode,
  85609. },
  85610. }
  85611. target := &ret
  85612. if err := gensupport.DecodeResponse(target, res); err != nil {
  85613. return nil, err
  85614. }
  85615. return ret, nil
  85616. // {
  85617. // "description": "Updates the node template of the node group.",
  85618. // "httpMethod": "POST",
  85619. // "id": "compute.nodeGroups.setNodeTemplate",
  85620. // "parameterOrder": [
  85621. // "project",
  85622. // "zone",
  85623. // "nodeGroup"
  85624. // ],
  85625. // "parameters": {
  85626. // "nodeGroup": {
  85627. // "description": "Name of the NodeGroup resource to delete.",
  85628. // "location": "path",
  85629. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85630. // "required": true,
  85631. // "type": "string"
  85632. // },
  85633. // "project": {
  85634. // "description": "Project ID for this request.",
  85635. // "location": "path",
  85636. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85637. // "required": true,
  85638. // "type": "string"
  85639. // },
  85640. // "requestId": {
  85641. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85642. // "location": "query",
  85643. // "type": "string"
  85644. // },
  85645. // "zone": {
  85646. // "description": "The name of the zone for this request.",
  85647. // "location": "path",
  85648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85649. // "required": true,
  85650. // "type": "string"
  85651. // }
  85652. // },
  85653. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  85654. // "request": {
  85655. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  85656. // },
  85657. // "response": {
  85658. // "$ref": "Operation"
  85659. // },
  85660. // "scopes": [
  85661. // "https://www.googleapis.com/auth/cloud-platform",
  85662. // "https://www.googleapis.com/auth/compute"
  85663. // ]
  85664. // }
  85665. }
  85666. // method id "compute.nodeGroups.testIamPermissions":
  85667. type NodeGroupsTestIamPermissionsCall struct {
  85668. s *Service
  85669. project string
  85670. zone string
  85671. resource string
  85672. testpermissionsrequest *TestPermissionsRequest
  85673. urlParams_ gensupport.URLParams
  85674. ctx_ context.Context
  85675. header_ http.Header
  85676. }
  85677. // TestIamPermissions: Returns permissions that a caller has on the
  85678. // specified resource.
  85679. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  85680. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85681. c.project = project
  85682. c.zone = zone
  85683. c.resource = resource
  85684. c.testpermissionsrequest = testpermissionsrequest
  85685. return c
  85686. }
  85687. // Fields allows partial responses to be retrieved. See
  85688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85689. // for more information.
  85690. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  85691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85692. return c
  85693. }
  85694. // Context sets the context to be used in this call's Do method. Any
  85695. // pending HTTP request will be aborted if the provided context is
  85696. // canceled.
  85697. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  85698. c.ctx_ = ctx
  85699. return c
  85700. }
  85701. // Header returns an http.Header that can be modified by the caller to
  85702. // add HTTP headers to the request.
  85703. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  85704. if c.header_ == nil {
  85705. c.header_ = make(http.Header)
  85706. }
  85707. return c.header_
  85708. }
  85709. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  85710. reqHeaders := make(http.Header)
  85711. for k, v := range c.header_ {
  85712. reqHeaders[k] = v
  85713. }
  85714. reqHeaders.Set("User-Agent", c.s.userAgent())
  85715. var body io.Reader = nil
  85716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  85717. if err != nil {
  85718. return nil, err
  85719. }
  85720. reqHeaders.Set("Content-Type", "application/json")
  85721. c.urlParams_.Set("alt", alt)
  85722. c.urlParams_.Set("prettyPrint", "false")
  85723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  85724. urls += "?" + c.urlParams_.Encode()
  85725. req, err := http.NewRequest("POST", urls, body)
  85726. if err != nil {
  85727. return nil, err
  85728. }
  85729. req.Header = reqHeaders
  85730. googleapi.Expand(req.URL, map[string]string{
  85731. "project": c.project,
  85732. "zone": c.zone,
  85733. "resource": c.resource,
  85734. })
  85735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85736. }
  85737. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  85738. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  85739. // non-2xx status code is an error. Response headers are in either
  85740. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  85741. // returned at all) in error.(*googleapi.Error).Header. Use
  85742. // googleapi.IsNotModified to check whether the returned error was
  85743. // because http.StatusNotModified was returned.
  85744. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  85745. gensupport.SetOptions(c.urlParams_, opts...)
  85746. res, err := c.doRequest("json")
  85747. if res != nil && res.StatusCode == http.StatusNotModified {
  85748. if res.Body != nil {
  85749. res.Body.Close()
  85750. }
  85751. return nil, &googleapi.Error{
  85752. Code: res.StatusCode,
  85753. Header: res.Header,
  85754. }
  85755. }
  85756. if err != nil {
  85757. return nil, err
  85758. }
  85759. defer googleapi.CloseBody(res)
  85760. if err := googleapi.CheckResponse(res); err != nil {
  85761. return nil, err
  85762. }
  85763. ret := &TestPermissionsResponse{
  85764. ServerResponse: googleapi.ServerResponse{
  85765. Header: res.Header,
  85766. HTTPStatusCode: res.StatusCode,
  85767. },
  85768. }
  85769. target := &ret
  85770. if err := gensupport.DecodeResponse(target, res); err != nil {
  85771. return nil, err
  85772. }
  85773. return ret, nil
  85774. // {
  85775. // "description": "Returns permissions that a caller has on the specified resource.",
  85776. // "httpMethod": "POST",
  85777. // "id": "compute.nodeGroups.testIamPermissions",
  85778. // "parameterOrder": [
  85779. // "project",
  85780. // "zone",
  85781. // "resource"
  85782. // ],
  85783. // "parameters": {
  85784. // "project": {
  85785. // "description": "Project ID for this request.",
  85786. // "location": "path",
  85787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85788. // "required": true,
  85789. // "type": "string"
  85790. // },
  85791. // "resource": {
  85792. // "description": "Name or id of the resource for this request.",
  85793. // "location": "path",
  85794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85795. // "required": true,
  85796. // "type": "string"
  85797. // },
  85798. // "zone": {
  85799. // "description": "The name of the zone for this request.",
  85800. // "location": "path",
  85801. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85802. // "required": true,
  85803. // "type": "string"
  85804. // }
  85805. // },
  85806. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  85807. // "request": {
  85808. // "$ref": "TestPermissionsRequest"
  85809. // },
  85810. // "response": {
  85811. // "$ref": "TestPermissionsResponse"
  85812. // },
  85813. // "scopes": [
  85814. // "https://www.googleapis.com/auth/cloud-platform",
  85815. // "https://www.googleapis.com/auth/compute",
  85816. // "https://www.googleapis.com/auth/compute.readonly"
  85817. // ]
  85818. // }
  85819. }
  85820. // method id "compute.nodeTemplates.aggregatedList":
  85821. type NodeTemplatesAggregatedListCall struct {
  85822. s *Service
  85823. project string
  85824. urlParams_ gensupport.URLParams
  85825. ifNoneMatch_ string
  85826. ctx_ context.Context
  85827. header_ http.Header
  85828. }
  85829. // AggregatedList: Retrieves an aggregated list of node templates.
  85830. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  85831. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85832. c.project = project
  85833. return c
  85834. }
  85835. // Filter sets the optional parameter "filter": A filter expression that
  85836. // filters resources listed in the response. The expression must specify
  85837. // the field name, a comparison operator, and the value that you want to
  85838. // use for filtering. The value must be a string, a number, or a
  85839. // boolean. The comparison operator must be either =, !=, >, or <.
  85840. //
  85841. // For example, if you are filtering Compute Engine instances, you can
  85842. // exclude instances named example-instance by specifying name !=
  85843. // example-instance.
  85844. //
  85845. // You can also filter nested fields. For example, you could specify
  85846. // scheduling.automaticRestart = false to include instances only if they
  85847. // are not scheduled for automatic restarts. You can use filtering on
  85848. // nested fields to filter based on resource labels.
  85849. //
  85850. // To filter on multiple expressions, provide each separate expression
  85851. // within parentheses. For example, (scheduling.automaticRestart = true)
  85852. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85853. // AND expression. However, you can include AND and OR expressions
  85854. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85855. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85856. // true).
  85857. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  85858. c.urlParams_.Set("filter", filter)
  85859. return c
  85860. }
  85861. // MaxResults sets the optional parameter "maxResults": The maximum
  85862. // number of results per page that should be returned. If the number of
  85863. // available results is larger than maxResults, Compute Engine returns a
  85864. // nextPageToken that can be used to get the next page of results in
  85865. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85866. // (Default: 500)
  85867. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  85868. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85869. return c
  85870. }
  85871. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85872. // a certain order. By default, results are returned in alphanumerical
  85873. // order based on the resource name.
  85874. //
  85875. // You can also sort results in descending order based on the creation
  85876. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85877. // based on the creationTimestamp field in reverse chronological order
  85878. // (newest result first). Use this to sort resources like operations so
  85879. // that the newest operation is returned first.
  85880. //
  85881. // Currently, only sorting by name or creationTimestamp desc is
  85882. // supported.
  85883. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  85884. c.urlParams_.Set("orderBy", orderBy)
  85885. return c
  85886. }
  85887. // PageToken sets the optional parameter "pageToken": Specifies a page
  85888. // token to use. Set pageToken to the nextPageToken returned by a
  85889. // previous list request to get the next page of results.
  85890. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  85891. c.urlParams_.Set("pageToken", pageToken)
  85892. return c
  85893. }
  85894. // Fields allows partial responses to be retrieved. See
  85895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85896. // for more information.
  85897. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  85898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85899. return c
  85900. }
  85901. // IfNoneMatch sets the optional parameter which makes the operation
  85902. // fail if the object's ETag matches the given value. This is useful for
  85903. // getting updates only after the object has changed since the last
  85904. // request. Use googleapi.IsNotModified to check whether the response
  85905. // error from Do is the result of In-None-Match.
  85906. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  85907. c.ifNoneMatch_ = entityTag
  85908. return c
  85909. }
  85910. // Context sets the context to be used in this call's Do method. Any
  85911. // pending HTTP request will be aborted if the provided context is
  85912. // canceled.
  85913. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  85914. c.ctx_ = ctx
  85915. return c
  85916. }
  85917. // Header returns an http.Header that can be modified by the caller to
  85918. // add HTTP headers to the request.
  85919. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  85920. if c.header_ == nil {
  85921. c.header_ = make(http.Header)
  85922. }
  85923. return c.header_
  85924. }
  85925. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  85926. reqHeaders := make(http.Header)
  85927. for k, v := range c.header_ {
  85928. reqHeaders[k] = v
  85929. }
  85930. reqHeaders.Set("User-Agent", c.s.userAgent())
  85931. if c.ifNoneMatch_ != "" {
  85932. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85933. }
  85934. var body io.Reader = nil
  85935. c.urlParams_.Set("alt", alt)
  85936. c.urlParams_.Set("prettyPrint", "false")
  85937. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  85938. urls += "?" + c.urlParams_.Encode()
  85939. req, err := http.NewRequest("GET", urls, body)
  85940. if err != nil {
  85941. return nil, err
  85942. }
  85943. req.Header = reqHeaders
  85944. googleapi.Expand(req.URL, map[string]string{
  85945. "project": c.project,
  85946. })
  85947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85948. }
  85949. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  85950. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  85951. // Any non-2xx status code is an error. Response headers are in either
  85952. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  85953. // was returned at all) in error.(*googleapi.Error).Header. Use
  85954. // googleapi.IsNotModified to check whether the returned error was
  85955. // because http.StatusNotModified was returned.
  85956. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  85957. gensupport.SetOptions(c.urlParams_, opts...)
  85958. res, err := c.doRequest("json")
  85959. if res != nil && res.StatusCode == http.StatusNotModified {
  85960. if res.Body != nil {
  85961. res.Body.Close()
  85962. }
  85963. return nil, &googleapi.Error{
  85964. Code: res.StatusCode,
  85965. Header: res.Header,
  85966. }
  85967. }
  85968. if err != nil {
  85969. return nil, err
  85970. }
  85971. defer googleapi.CloseBody(res)
  85972. if err := googleapi.CheckResponse(res); err != nil {
  85973. return nil, err
  85974. }
  85975. ret := &NodeTemplateAggregatedList{
  85976. ServerResponse: googleapi.ServerResponse{
  85977. Header: res.Header,
  85978. HTTPStatusCode: res.StatusCode,
  85979. },
  85980. }
  85981. target := &ret
  85982. if err := gensupport.DecodeResponse(target, res); err != nil {
  85983. return nil, err
  85984. }
  85985. return ret, nil
  85986. // {
  85987. // "description": "Retrieves an aggregated list of node templates.",
  85988. // "httpMethod": "GET",
  85989. // "id": "compute.nodeTemplates.aggregatedList",
  85990. // "parameterOrder": [
  85991. // "project"
  85992. // ],
  85993. // "parameters": {
  85994. // "filter": {
  85995. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85996. // "location": "query",
  85997. // "type": "string"
  85998. // },
  85999. // "maxResults": {
  86000. // "default": "500",
  86001. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86002. // "format": "uint32",
  86003. // "location": "query",
  86004. // "minimum": "0",
  86005. // "type": "integer"
  86006. // },
  86007. // "orderBy": {
  86008. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86009. // "location": "query",
  86010. // "type": "string"
  86011. // },
  86012. // "pageToken": {
  86013. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86014. // "location": "query",
  86015. // "type": "string"
  86016. // },
  86017. // "project": {
  86018. // "description": "Project ID for this request.",
  86019. // "location": "path",
  86020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86021. // "required": true,
  86022. // "type": "string"
  86023. // }
  86024. // },
  86025. // "path": "{project}/aggregated/nodeTemplates",
  86026. // "response": {
  86027. // "$ref": "NodeTemplateAggregatedList"
  86028. // },
  86029. // "scopes": [
  86030. // "https://www.googleapis.com/auth/cloud-platform",
  86031. // "https://www.googleapis.com/auth/compute",
  86032. // "https://www.googleapis.com/auth/compute.readonly"
  86033. // ]
  86034. // }
  86035. }
  86036. // Pages invokes f for each page of results.
  86037. // A non-nil error returned from f will halt the iteration.
  86038. // The provided context supersedes any context provided to the Context method.
  86039. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  86040. c.ctx_ = ctx
  86041. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86042. for {
  86043. x, err := c.Do()
  86044. if err != nil {
  86045. return err
  86046. }
  86047. if err := f(x); err != nil {
  86048. return err
  86049. }
  86050. if x.NextPageToken == "" {
  86051. return nil
  86052. }
  86053. c.PageToken(x.NextPageToken)
  86054. }
  86055. }
  86056. // method id "compute.nodeTemplates.delete":
  86057. type NodeTemplatesDeleteCall struct {
  86058. s *Service
  86059. project string
  86060. region string
  86061. nodeTemplate string
  86062. urlParams_ gensupport.URLParams
  86063. ctx_ context.Context
  86064. header_ http.Header
  86065. }
  86066. // Delete: Deletes the specified NodeTemplate resource.
  86067. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  86068. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86069. c.project = project
  86070. c.region = region
  86071. c.nodeTemplate = nodeTemplate
  86072. return c
  86073. }
  86074. // RequestId sets the optional parameter "requestId": An optional
  86075. // request ID to identify requests. Specify a unique request ID so that
  86076. // if you must retry your request, the server will know to ignore the
  86077. // request if it has already been completed.
  86078. //
  86079. // For example, consider a situation where you make an initial request
  86080. // and the request times out. If you make the request again with the
  86081. // same request ID, the server can check if original operation with the
  86082. // same request ID was received, and if so, will ignore the second
  86083. // request. This prevents clients from accidentally creating duplicate
  86084. // commitments.
  86085. //
  86086. // The request ID must be a valid UUID with the exception that zero UUID
  86087. // is not supported (00000000-0000-0000-0000-000000000000).
  86088. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  86089. c.urlParams_.Set("requestId", requestId)
  86090. return c
  86091. }
  86092. // Fields allows partial responses to be retrieved. See
  86093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86094. // for more information.
  86095. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  86096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86097. return c
  86098. }
  86099. // Context sets the context to be used in this call's Do method. Any
  86100. // pending HTTP request will be aborted if the provided context is
  86101. // canceled.
  86102. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  86103. c.ctx_ = ctx
  86104. return c
  86105. }
  86106. // Header returns an http.Header that can be modified by the caller to
  86107. // add HTTP headers to the request.
  86108. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  86109. if c.header_ == nil {
  86110. c.header_ = make(http.Header)
  86111. }
  86112. return c.header_
  86113. }
  86114. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  86115. reqHeaders := make(http.Header)
  86116. for k, v := range c.header_ {
  86117. reqHeaders[k] = v
  86118. }
  86119. reqHeaders.Set("User-Agent", c.s.userAgent())
  86120. var body io.Reader = nil
  86121. c.urlParams_.Set("alt", alt)
  86122. c.urlParams_.Set("prettyPrint", "false")
  86123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  86124. urls += "?" + c.urlParams_.Encode()
  86125. req, err := http.NewRequest("DELETE", urls, body)
  86126. if err != nil {
  86127. return nil, err
  86128. }
  86129. req.Header = reqHeaders
  86130. googleapi.Expand(req.URL, map[string]string{
  86131. "project": c.project,
  86132. "region": c.region,
  86133. "nodeTemplate": c.nodeTemplate,
  86134. })
  86135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86136. }
  86137. // Do executes the "compute.nodeTemplates.delete" call.
  86138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86139. // status code is an error. Response headers are in either
  86140. // *Operation.ServerResponse.Header or (if a response was returned at
  86141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86142. // to check whether the returned error was because
  86143. // http.StatusNotModified was returned.
  86144. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86145. gensupport.SetOptions(c.urlParams_, opts...)
  86146. res, err := c.doRequest("json")
  86147. if res != nil && res.StatusCode == http.StatusNotModified {
  86148. if res.Body != nil {
  86149. res.Body.Close()
  86150. }
  86151. return nil, &googleapi.Error{
  86152. Code: res.StatusCode,
  86153. Header: res.Header,
  86154. }
  86155. }
  86156. if err != nil {
  86157. return nil, err
  86158. }
  86159. defer googleapi.CloseBody(res)
  86160. if err := googleapi.CheckResponse(res); err != nil {
  86161. return nil, err
  86162. }
  86163. ret := &Operation{
  86164. ServerResponse: googleapi.ServerResponse{
  86165. Header: res.Header,
  86166. HTTPStatusCode: res.StatusCode,
  86167. },
  86168. }
  86169. target := &ret
  86170. if err := gensupport.DecodeResponse(target, res); err != nil {
  86171. return nil, err
  86172. }
  86173. return ret, nil
  86174. // {
  86175. // "description": "Deletes the specified NodeTemplate resource.",
  86176. // "httpMethod": "DELETE",
  86177. // "id": "compute.nodeTemplates.delete",
  86178. // "parameterOrder": [
  86179. // "project",
  86180. // "region",
  86181. // "nodeTemplate"
  86182. // ],
  86183. // "parameters": {
  86184. // "nodeTemplate": {
  86185. // "description": "Name of the NodeTemplate resource to delete.",
  86186. // "location": "path",
  86187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86188. // "required": true,
  86189. // "type": "string"
  86190. // },
  86191. // "project": {
  86192. // "description": "Project ID for this request.",
  86193. // "location": "path",
  86194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86195. // "required": true,
  86196. // "type": "string"
  86197. // },
  86198. // "region": {
  86199. // "description": "The name of the region for this request.",
  86200. // "location": "path",
  86201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86202. // "required": true,
  86203. // "type": "string"
  86204. // },
  86205. // "requestId": {
  86206. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86207. // "location": "query",
  86208. // "type": "string"
  86209. // }
  86210. // },
  86211. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  86212. // "response": {
  86213. // "$ref": "Operation"
  86214. // },
  86215. // "scopes": [
  86216. // "https://www.googleapis.com/auth/cloud-platform",
  86217. // "https://www.googleapis.com/auth/compute"
  86218. // ]
  86219. // }
  86220. }
  86221. // method id "compute.nodeTemplates.get":
  86222. type NodeTemplatesGetCall struct {
  86223. s *Service
  86224. project string
  86225. region string
  86226. nodeTemplate string
  86227. urlParams_ gensupport.URLParams
  86228. ifNoneMatch_ string
  86229. ctx_ context.Context
  86230. header_ http.Header
  86231. }
  86232. // Get: Returns the specified node template. Gets a list of available
  86233. // node templates by making a list() request.
  86234. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  86235. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86236. c.project = project
  86237. c.region = region
  86238. c.nodeTemplate = nodeTemplate
  86239. return c
  86240. }
  86241. // Fields allows partial responses to be retrieved. See
  86242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86243. // for more information.
  86244. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  86245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86246. return c
  86247. }
  86248. // IfNoneMatch sets the optional parameter which makes the operation
  86249. // fail if the object's ETag matches the given value. This is useful for
  86250. // getting updates only after the object has changed since the last
  86251. // request. Use googleapi.IsNotModified to check whether the response
  86252. // error from Do is the result of In-None-Match.
  86253. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  86254. c.ifNoneMatch_ = entityTag
  86255. return c
  86256. }
  86257. // Context sets the context to be used in this call's Do method. Any
  86258. // pending HTTP request will be aborted if the provided context is
  86259. // canceled.
  86260. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  86261. c.ctx_ = ctx
  86262. return c
  86263. }
  86264. // Header returns an http.Header that can be modified by the caller to
  86265. // add HTTP headers to the request.
  86266. func (c *NodeTemplatesGetCall) Header() http.Header {
  86267. if c.header_ == nil {
  86268. c.header_ = make(http.Header)
  86269. }
  86270. return c.header_
  86271. }
  86272. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  86273. reqHeaders := make(http.Header)
  86274. for k, v := range c.header_ {
  86275. reqHeaders[k] = v
  86276. }
  86277. reqHeaders.Set("User-Agent", c.s.userAgent())
  86278. if c.ifNoneMatch_ != "" {
  86279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86280. }
  86281. var body io.Reader = nil
  86282. c.urlParams_.Set("alt", alt)
  86283. c.urlParams_.Set("prettyPrint", "false")
  86284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  86285. urls += "?" + c.urlParams_.Encode()
  86286. req, err := http.NewRequest("GET", urls, body)
  86287. if err != nil {
  86288. return nil, err
  86289. }
  86290. req.Header = reqHeaders
  86291. googleapi.Expand(req.URL, map[string]string{
  86292. "project": c.project,
  86293. "region": c.region,
  86294. "nodeTemplate": c.nodeTemplate,
  86295. })
  86296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86297. }
  86298. // Do executes the "compute.nodeTemplates.get" call.
  86299. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  86300. // status code is an error. Response headers are in either
  86301. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  86302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86303. // to check whether the returned error was because
  86304. // http.StatusNotModified was returned.
  86305. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  86306. gensupport.SetOptions(c.urlParams_, opts...)
  86307. res, err := c.doRequest("json")
  86308. if res != nil && res.StatusCode == http.StatusNotModified {
  86309. if res.Body != nil {
  86310. res.Body.Close()
  86311. }
  86312. return nil, &googleapi.Error{
  86313. Code: res.StatusCode,
  86314. Header: res.Header,
  86315. }
  86316. }
  86317. if err != nil {
  86318. return nil, err
  86319. }
  86320. defer googleapi.CloseBody(res)
  86321. if err := googleapi.CheckResponse(res); err != nil {
  86322. return nil, err
  86323. }
  86324. ret := &NodeTemplate{
  86325. ServerResponse: googleapi.ServerResponse{
  86326. Header: res.Header,
  86327. HTTPStatusCode: res.StatusCode,
  86328. },
  86329. }
  86330. target := &ret
  86331. if err := gensupport.DecodeResponse(target, res); err != nil {
  86332. return nil, err
  86333. }
  86334. return ret, nil
  86335. // {
  86336. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  86337. // "httpMethod": "GET",
  86338. // "id": "compute.nodeTemplates.get",
  86339. // "parameterOrder": [
  86340. // "project",
  86341. // "region",
  86342. // "nodeTemplate"
  86343. // ],
  86344. // "parameters": {
  86345. // "nodeTemplate": {
  86346. // "description": "Name of the node template to return.",
  86347. // "location": "path",
  86348. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86349. // "required": true,
  86350. // "type": "string"
  86351. // },
  86352. // "project": {
  86353. // "description": "Project ID for this request.",
  86354. // "location": "path",
  86355. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86356. // "required": true,
  86357. // "type": "string"
  86358. // },
  86359. // "region": {
  86360. // "description": "The name of the region for this request.",
  86361. // "location": "path",
  86362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86363. // "required": true,
  86364. // "type": "string"
  86365. // }
  86366. // },
  86367. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  86368. // "response": {
  86369. // "$ref": "NodeTemplate"
  86370. // },
  86371. // "scopes": [
  86372. // "https://www.googleapis.com/auth/cloud-platform",
  86373. // "https://www.googleapis.com/auth/compute",
  86374. // "https://www.googleapis.com/auth/compute.readonly"
  86375. // ]
  86376. // }
  86377. }
  86378. // method id "compute.nodeTemplates.getIamPolicy":
  86379. type NodeTemplatesGetIamPolicyCall struct {
  86380. s *Service
  86381. project string
  86382. region string
  86383. resource string
  86384. urlParams_ gensupport.URLParams
  86385. ifNoneMatch_ string
  86386. ctx_ context.Context
  86387. header_ http.Header
  86388. }
  86389. // GetIamPolicy: Gets the access control policy for a resource. May be
  86390. // empty if no such policy or resource exists.
  86391. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  86392. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86393. c.project = project
  86394. c.region = region
  86395. c.resource = resource
  86396. return c
  86397. }
  86398. // Fields allows partial responses to be retrieved. See
  86399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86400. // for more information.
  86401. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  86402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86403. return c
  86404. }
  86405. // IfNoneMatch sets the optional parameter which makes the operation
  86406. // fail if the object's ETag matches the given value. This is useful for
  86407. // getting updates only after the object has changed since the last
  86408. // request. Use googleapi.IsNotModified to check whether the response
  86409. // error from Do is the result of In-None-Match.
  86410. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  86411. c.ifNoneMatch_ = entityTag
  86412. return c
  86413. }
  86414. // Context sets the context to be used in this call's Do method. Any
  86415. // pending HTTP request will be aborted if the provided context is
  86416. // canceled.
  86417. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  86418. c.ctx_ = ctx
  86419. return c
  86420. }
  86421. // Header returns an http.Header that can be modified by the caller to
  86422. // add HTTP headers to the request.
  86423. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  86424. if c.header_ == nil {
  86425. c.header_ = make(http.Header)
  86426. }
  86427. return c.header_
  86428. }
  86429. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  86430. reqHeaders := make(http.Header)
  86431. for k, v := range c.header_ {
  86432. reqHeaders[k] = v
  86433. }
  86434. reqHeaders.Set("User-Agent", c.s.userAgent())
  86435. if c.ifNoneMatch_ != "" {
  86436. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86437. }
  86438. var body io.Reader = nil
  86439. c.urlParams_.Set("alt", alt)
  86440. c.urlParams_.Set("prettyPrint", "false")
  86441. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  86442. urls += "?" + c.urlParams_.Encode()
  86443. req, err := http.NewRequest("GET", urls, body)
  86444. if err != nil {
  86445. return nil, err
  86446. }
  86447. req.Header = reqHeaders
  86448. googleapi.Expand(req.URL, map[string]string{
  86449. "project": c.project,
  86450. "region": c.region,
  86451. "resource": c.resource,
  86452. })
  86453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86454. }
  86455. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  86456. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  86457. // code is an error. Response headers are in either
  86458. // *Policy.ServerResponse.Header or (if a response was returned at all)
  86459. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  86460. // check whether the returned error was because http.StatusNotModified
  86461. // was returned.
  86462. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  86463. gensupport.SetOptions(c.urlParams_, opts...)
  86464. res, err := c.doRequest("json")
  86465. if res != nil && res.StatusCode == http.StatusNotModified {
  86466. if res.Body != nil {
  86467. res.Body.Close()
  86468. }
  86469. return nil, &googleapi.Error{
  86470. Code: res.StatusCode,
  86471. Header: res.Header,
  86472. }
  86473. }
  86474. if err != nil {
  86475. return nil, err
  86476. }
  86477. defer googleapi.CloseBody(res)
  86478. if err := googleapi.CheckResponse(res); err != nil {
  86479. return nil, err
  86480. }
  86481. ret := &Policy{
  86482. ServerResponse: googleapi.ServerResponse{
  86483. Header: res.Header,
  86484. HTTPStatusCode: res.StatusCode,
  86485. },
  86486. }
  86487. target := &ret
  86488. if err := gensupport.DecodeResponse(target, res); err != nil {
  86489. return nil, err
  86490. }
  86491. return ret, nil
  86492. // {
  86493. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  86494. // "httpMethod": "GET",
  86495. // "id": "compute.nodeTemplates.getIamPolicy",
  86496. // "parameterOrder": [
  86497. // "project",
  86498. // "region",
  86499. // "resource"
  86500. // ],
  86501. // "parameters": {
  86502. // "project": {
  86503. // "description": "Project ID for this request.",
  86504. // "location": "path",
  86505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86506. // "required": true,
  86507. // "type": "string"
  86508. // },
  86509. // "region": {
  86510. // "description": "The name of the region for this request.",
  86511. // "location": "path",
  86512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86513. // "required": true,
  86514. // "type": "string"
  86515. // },
  86516. // "resource": {
  86517. // "description": "Name or id of the resource for this request.",
  86518. // "location": "path",
  86519. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86520. // "required": true,
  86521. // "type": "string"
  86522. // }
  86523. // },
  86524. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  86525. // "response": {
  86526. // "$ref": "Policy"
  86527. // },
  86528. // "scopes": [
  86529. // "https://www.googleapis.com/auth/cloud-platform",
  86530. // "https://www.googleapis.com/auth/compute",
  86531. // "https://www.googleapis.com/auth/compute.readonly"
  86532. // ]
  86533. // }
  86534. }
  86535. // method id "compute.nodeTemplates.insert":
  86536. type NodeTemplatesInsertCall struct {
  86537. s *Service
  86538. project string
  86539. region string
  86540. nodetemplate *NodeTemplate
  86541. urlParams_ gensupport.URLParams
  86542. ctx_ context.Context
  86543. header_ http.Header
  86544. }
  86545. // Insert: Creates a NodeTemplate resource in the specified project
  86546. // using the data included in the request.
  86547. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  86548. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86549. c.project = project
  86550. c.region = region
  86551. c.nodetemplate = nodetemplate
  86552. return c
  86553. }
  86554. // RequestId sets the optional parameter "requestId": An optional
  86555. // request ID to identify requests. Specify a unique request ID so that
  86556. // if you must retry your request, the server will know to ignore the
  86557. // request if it has already been completed.
  86558. //
  86559. // For example, consider a situation where you make an initial request
  86560. // and the request times out. If you make the request again with the
  86561. // same request ID, the server can check if original operation with the
  86562. // same request ID was received, and if so, will ignore the second
  86563. // request. This prevents clients from accidentally creating duplicate
  86564. // commitments.
  86565. //
  86566. // The request ID must be a valid UUID with the exception that zero UUID
  86567. // is not supported (00000000-0000-0000-0000-000000000000).
  86568. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  86569. c.urlParams_.Set("requestId", requestId)
  86570. return c
  86571. }
  86572. // Fields allows partial responses to be retrieved. See
  86573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86574. // for more information.
  86575. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  86576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86577. return c
  86578. }
  86579. // Context sets the context to be used in this call's Do method. Any
  86580. // pending HTTP request will be aborted if the provided context is
  86581. // canceled.
  86582. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  86583. c.ctx_ = ctx
  86584. return c
  86585. }
  86586. // Header returns an http.Header that can be modified by the caller to
  86587. // add HTTP headers to the request.
  86588. func (c *NodeTemplatesInsertCall) Header() http.Header {
  86589. if c.header_ == nil {
  86590. c.header_ = make(http.Header)
  86591. }
  86592. return c.header_
  86593. }
  86594. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  86595. reqHeaders := make(http.Header)
  86596. for k, v := range c.header_ {
  86597. reqHeaders[k] = v
  86598. }
  86599. reqHeaders.Set("User-Agent", c.s.userAgent())
  86600. var body io.Reader = nil
  86601. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  86602. if err != nil {
  86603. return nil, err
  86604. }
  86605. reqHeaders.Set("Content-Type", "application/json")
  86606. c.urlParams_.Set("alt", alt)
  86607. c.urlParams_.Set("prettyPrint", "false")
  86608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  86609. urls += "?" + c.urlParams_.Encode()
  86610. req, err := http.NewRequest("POST", urls, body)
  86611. if err != nil {
  86612. return nil, err
  86613. }
  86614. req.Header = reqHeaders
  86615. googleapi.Expand(req.URL, map[string]string{
  86616. "project": c.project,
  86617. "region": c.region,
  86618. })
  86619. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86620. }
  86621. // Do executes the "compute.nodeTemplates.insert" call.
  86622. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86623. // status code is an error. Response headers are in either
  86624. // *Operation.ServerResponse.Header or (if a response was returned at
  86625. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86626. // to check whether the returned error was because
  86627. // http.StatusNotModified was returned.
  86628. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86629. gensupport.SetOptions(c.urlParams_, opts...)
  86630. res, err := c.doRequest("json")
  86631. if res != nil && res.StatusCode == http.StatusNotModified {
  86632. if res.Body != nil {
  86633. res.Body.Close()
  86634. }
  86635. return nil, &googleapi.Error{
  86636. Code: res.StatusCode,
  86637. Header: res.Header,
  86638. }
  86639. }
  86640. if err != nil {
  86641. return nil, err
  86642. }
  86643. defer googleapi.CloseBody(res)
  86644. if err := googleapi.CheckResponse(res); err != nil {
  86645. return nil, err
  86646. }
  86647. ret := &Operation{
  86648. ServerResponse: googleapi.ServerResponse{
  86649. Header: res.Header,
  86650. HTTPStatusCode: res.StatusCode,
  86651. },
  86652. }
  86653. target := &ret
  86654. if err := gensupport.DecodeResponse(target, res); err != nil {
  86655. return nil, err
  86656. }
  86657. return ret, nil
  86658. // {
  86659. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  86660. // "httpMethod": "POST",
  86661. // "id": "compute.nodeTemplates.insert",
  86662. // "parameterOrder": [
  86663. // "project",
  86664. // "region"
  86665. // ],
  86666. // "parameters": {
  86667. // "project": {
  86668. // "description": "Project ID for this request.",
  86669. // "location": "path",
  86670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86671. // "required": true,
  86672. // "type": "string"
  86673. // },
  86674. // "region": {
  86675. // "description": "The name of the region for this request.",
  86676. // "location": "path",
  86677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86678. // "required": true,
  86679. // "type": "string"
  86680. // },
  86681. // "requestId": {
  86682. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86683. // "location": "query",
  86684. // "type": "string"
  86685. // }
  86686. // },
  86687. // "path": "{project}/regions/{region}/nodeTemplates",
  86688. // "request": {
  86689. // "$ref": "NodeTemplate"
  86690. // },
  86691. // "response": {
  86692. // "$ref": "Operation"
  86693. // },
  86694. // "scopes": [
  86695. // "https://www.googleapis.com/auth/cloud-platform",
  86696. // "https://www.googleapis.com/auth/compute"
  86697. // ]
  86698. // }
  86699. }
  86700. // method id "compute.nodeTemplates.list":
  86701. type NodeTemplatesListCall struct {
  86702. s *Service
  86703. project string
  86704. region string
  86705. urlParams_ gensupport.URLParams
  86706. ifNoneMatch_ string
  86707. ctx_ context.Context
  86708. header_ http.Header
  86709. }
  86710. // List: Retrieves a list of node templates available to the specified
  86711. // project.
  86712. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  86713. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86714. c.project = project
  86715. c.region = region
  86716. return c
  86717. }
  86718. // Filter sets the optional parameter "filter": A filter expression that
  86719. // filters resources listed in the response. The expression must specify
  86720. // the field name, a comparison operator, and the value that you want to
  86721. // use for filtering. The value must be a string, a number, or a
  86722. // boolean. The comparison operator must be either =, !=, >, or <.
  86723. //
  86724. // For example, if you are filtering Compute Engine instances, you can
  86725. // exclude instances named example-instance by specifying name !=
  86726. // example-instance.
  86727. //
  86728. // You can also filter nested fields. For example, you could specify
  86729. // scheduling.automaticRestart = false to include instances only if they
  86730. // are not scheduled for automatic restarts. You can use filtering on
  86731. // nested fields to filter based on resource labels.
  86732. //
  86733. // To filter on multiple expressions, provide each separate expression
  86734. // within parentheses. For example, (scheduling.automaticRestart = true)
  86735. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86736. // AND expression. However, you can include AND and OR expressions
  86737. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86738. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86739. // true).
  86740. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  86741. c.urlParams_.Set("filter", filter)
  86742. return c
  86743. }
  86744. // MaxResults sets the optional parameter "maxResults": The maximum
  86745. // number of results per page that should be returned. If the number of
  86746. // available results is larger than maxResults, Compute Engine returns a
  86747. // nextPageToken that can be used to get the next page of results in
  86748. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86749. // (Default: 500)
  86750. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  86751. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86752. return c
  86753. }
  86754. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86755. // a certain order. By default, results are returned in alphanumerical
  86756. // order based on the resource name.
  86757. //
  86758. // You can also sort results in descending order based on the creation
  86759. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86760. // based on the creationTimestamp field in reverse chronological order
  86761. // (newest result first). Use this to sort resources like operations so
  86762. // that the newest operation is returned first.
  86763. //
  86764. // Currently, only sorting by name or creationTimestamp desc is
  86765. // supported.
  86766. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  86767. c.urlParams_.Set("orderBy", orderBy)
  86768. return c
  86769. }
  86770. // PageToken sets the optional parameter "pageToken": Specifies a page
  86771. // token to use. Set pageToken to the nextPageToken returned by a
  86772. // previous list request to get the next page of results.
  86773. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  86774. c.urlParams_.Set("pageToken", pageToken)
  86775. return c
  86776. }
  86777. // Fields allows partial responses to be retrieved. See
  86778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86779. // for more information.
  86780. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  86781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86782. return c
  86783. }
  86784. // IfNoneMatch sets the optional parameter which makes the operation
  86785. // fail if the object's ETag matches the given value. This is useful for
  86786. // getting updates only after the object has changed since the last
  86787. // request. Use googleapi.IsNotModified to check whether the response
  86788. // error from Do is the result of In-None-Match.
  86789. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  86790. c.ifNoneMatch_ = entityTag
  86791. return c
  86792. }
  86793. // Context sets the context to be used in this call's Do method. Any
  86794. // pending HTTP request will be aborted if the provided context is
  86795. // canceled.
  86796. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  86797. c.ctx_ = ctx
  86798. return c
  86799. }
  86800. // Header returns an http.Header that can be modified by the caller to
  86801. // add HTTP headers to the request.
  86802. func (c *NodeTemplatesListCall) Header() http.Header {
  86803. if c.header_ == nil {
  86804. c.header_ = make(http.Header)
  86805. }
  86806. return c.header_
  86807. }
  86808. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  86809. reqHeaders := make(http.Header)
  86810. for k, v := range c.header_ {
  86811. reqHeaders[k] = v
  86812. }
  86813. reqHeaders.Set("User-Agent", c.s.userAgent())
  86814. if c.ifNoneMatch_ != "" {
  86815. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86816. }
  86817. var body io.Reader = nil
  86818. c.urlParams_.Set("alt", alt)
  86819. c.urlParams_.Set("prettyPrint", "false")
  86820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  86821. urls += "?" + c.urlParams_.Encode()
  86822. req, err := http.NewRequest("GET", urls, body)
  86823. if err != nil {
  86824. return nil, err
  86825. }
  86826. req.Header = reqHeaders
  86827. googleapi.Expand(req.URL, map[string]string{
  86828. "project": c.project,
  86829. "region": c.region,
  86830. })
  86831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86832. }
  86833. // Do executes the "compute.nodeTemplates.list" call.
  86834. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  86835. // non-2xx status code is an error. Response headers are in either
  86836. // *NodeTemplateList.ServerResponse.Header or (if a response was
  86837. // returned at all) in error.(*googleapi.Error).Header. Use
  86838. // googleapi.IsNotModified to check whether the returned error was
  86839. // because http.StatusNotModified was returned.
  86840. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  86841. gensupport.SetOptions(c.urlParams_, opts...)
  86842. res, err := c.doRequest("json")
  86843. if res != nil && res.StatusCode == http.StatusNotModified {
  86844. if res.Body != nil {
  86845. res.Body.Close()
  86846. }
  86847. return nil, &googleapi.Error{
  86848. Code: res.StatusCode,
  86849. Header: res.Header,
  86850. }
  86851. }
  86852. if err != nil {
  86853. return nil, err
  86854. }
  86855. defer googleapi.CloseBody(res)
  86856. if err := googleapi.CheckResponse(res); err != nil {
  86857. return nil, err
  86858. }
  86859. ret := &NodeTemplateList{
  86860. ServerResponse: googleapi.ServerResponse{
  86861. Header: res.Header,
  86862. HTTPStatusCode: res.StatusCode,
  86863. },
  86864. }
  86865. target := &ret
  86866. if err := gensupport.DecodeResponse(target, res); err != nil {
  86867. return nil, err
  86868. }
  86869. return ret, nil
  86870. // {
  86871. // "description": "Retrieves a list of node templates available to the specified project.",
  86872. // "httpMethod": "GET",
  86873. // "id": "compute.nodeTemplates.list",
  86874. // "parameterOrder": [
  86875. // "project",
  86876. // "region"
  86877. // ],
  86878. // "parameters": {
  86879. // "filter": {
  86880. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86881. // "location": "query",
  86882. // "type": "string"
  86883. // },
  86884. // "maxResults": {
  86885. // "default": "500",
  86886. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86887. // "format": "uint32",
  86888. // "location": "query",
  86889. // "minimum": "0",
  86890. // "type": "integer"
  86891. // },
  86892. // "orderBy": {
  86893. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86894. // "location": "query",
  86895. // "type": "string"
  86896. // },
  86897. // "pageToken": {
  86898. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86899. // "location": "query",
  86900. // "type": "string"
  86901. // },
  86902. // "project": {
  86903. // "description": "Project ID for this request.",
  86904. // "location": "path",
  86905. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86906. // "required": true,
  86907. // "type": "string"
  86908. // },
  86909. // "region": {
  86910. // "description": "The name of the region for this request.",
  86911. // "location": "path",
  86912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86913. // "required": true,
  86914. // "type": "string"
  86915. // }
  86916. // },
  86917. // "path": "{project}/regions/{region}/nodeTemplates",
  86918. // "response": {
  86919. // "$ref": "NodeTemplateList"
  86920. // },
  86921. // "scopes": [
  86922. // "https://www.googleapis.com/auth/cloud-platform",
  86923. // "https://www.googleapis.com/auth/compute",
  86924. // "https://www.googleapis.com/auth/compute.readonly"
  86925. // ]
  86926. // }
  86927. }
  86928. // Pages invokes f for each page of results.
  86929. // A non-nil error returned from f will halt the iteration.
  86930. // The provided context supersedes any context provided to the Context method.
  86931. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  86932. c.ctx_ = ctx
  86933. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86934. for {
  86935. x, err := c.Do()
  86936. if err != nil {
  86937. return err
  86938. }
  86939. if err := f(x); err != nil {
  86940. return err
  86941. }
  86942. if x.NextPageToken == "" {
  86943. return nil
  86944. }
  86945. c.PageToken(x.NextPageToken)
  86946. }
  86947. }
  86948. // method id "compute.nodeTemplates.setIamPolicy":
  86949. type NodeTemplatesSetIamPolicyCall struct {
  86950. s *Service
  86951. project string
  86952. region string
  86953. resource string
  86954. regionsetpolicyrequest *RegionSetPolicyRequest
  86955. urlParams_ gensupport.URLParams
  86956. ctx_ context.Context
  86957. header_ http.Header
  86958. }
  86959. // SetIamPolicy: Sets the access control policy on the specified
  86960. // resource. Replaces any existing policy.
  86961. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  86962. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86963. c.project = project
  86964. c.region = region
  86965. c.resource = resource
  86966. c.regionsetpolicyrequest = regionsetpolicyrequest
  86967. return c
  86968. }
  86969. // Fields allows partial responses to be retrieved. See
  86970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86971. // for more information.
  86972. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  86973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86974. return c
  86975. }
  86976. // Context sets the context to be used in this call's Do method. Any
  86977. // pending HTTP request will be aborted if the provided context is
  86978. // canceled.
  86979. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  86980. c.ctx_ = ctx
  86981. return c
  86982. }
  86983. // Header returns an http.Header that can be modified by the caller to
  86984. // add HTTP headers to the request.
  86985. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  86986. if c.header_ == nil {
  86987. c.header_ = make(http.Header)
  86988. }
  86989. return c.header_
  86990. }
  86991. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  86992. reqHeaders := make(http.Header)
  86993. for k, v := range c.header_ {
  86994. reqHeaders[k] = v
  86995. }
  86996. reqHeaders.Set("User-Agent", c.s.userAgent())
  86997. var body io.Reader = nil
  86998. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  86999. if err != nil {
  87000. return nil, err
  87001. }
  87002. reqHeaders.Set("Content-Type", "application/json")
  87003. c.urlParams_.Set("alt", alt)
  87004. c.urlParams_.Set("prettyPrint", "false")
  87005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  87006. urls += "?" + c.urlParams_.Encode()
  87007. req, err := http.NewRequest("POST", urls, body)
  87008. if err != nil {
  87009. return nil, err
  87010. }
  87011. req.Header = reqHeaders
  87012. googleapi.Expand(req.URL, map[string]string{
  87013. "project": c.project,
  87014. "region": c.region,
  87015. "resource": c.resource,
  87016. })
  87017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87018. }
  87019. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  87020. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  87021. // code is an error. Response headers are in either
  87022. // *Policy.ServerResponse.Header or (if a response was returned at all)
  87023. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  87024. // check whether the returned error was because http.StatusNotModified
  87025. // was returned.
  87026. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  87027. gensupport.SetOptions(c.urlParams_, opts...)
  87028. res, err := c.doRequest("json")
  87029. if res != nil && res.StatusCode == http.StatusNotModified {
  87030. if res.Body != nil {
  87031. res.Body.Close()
  87032. }
  87033. return nil, &googleapi.Error{
  87034. Code: res.StatusCode,
  87035. Header: res.Header,
  87036. }
  87037. }
  87038. if err != nil {
  87039. return nil, err
  87040. }
  87041. defer googleapi.CloseBody(res)
  87042. if err := googleapi.CheckResponse(res); err != nil {
  87043. return nil, err
  87044. }
  87045. ret := &Policy{
  87046. ServerResponse: googleapi.ServerResponse{
  87047. Header: res.Header,
  87048. HTTPStatusCode: res.StatusCode,
  87049. },
  87050. }
  87051. target := &ret
  87052. if err := gensupport.DecodeResponse(target, res); err != nil {
  87053. return nil, err
  87054. }
  87055. return ret, nil
  87056. // {
  87057. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  87058. // "httpMethod": "POST",
  87059. // "id": "compute.nodeTemplates.setIamPolicy",
  87060. // "parameterOrder": [
  87061. // "project",
  87062. // "region",
  87063. // "resource"
  87064. // ],
  87065. // "parameters": {
  87066. // "project": {
  87067. // "description": "Project ID for this request.",
  87068. // "location": "path",
  87069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87070. // "required": true,
  87071. // "type": "string"
  87072. // },
  87073. // "region": {
  87074. // "description": "The name of the region for this request.",
  87075. // "location": "path",
  87076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87077. // "required": true,
  87078. // "type": "string"
  87079. // },
  87080. // "resource": {
  87081. // "description": "Name or id of the resource for this request.",
  87082. // "location": "path",
  87083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87084. // "required": true,
  87085. // "type": "string"
  87086. // }
  87087. // },
  87088. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  87089. // "request": {
  87090. // "$ref": "RegionSetPolicyRequest"
  87091. // },
  87092. // "response": {
  87093. // "$ref": "Policy"
  87094. // },
  87095. // "scopes": [
  87096. // "https://www.googleapis.com/auth/cloud-platform",
  87097. // "https://www.googleapis.com/auth/compute"
  87098. // ]
  87099. // }
  87100. }
  87101. // method id "compute.nodeTemplates.testIamPermissions":
  87102. type NodeTemplatesTestIamPermissionsCall struct {
  87103. s *Service
  87104. project string
  87105. region string
  87106. resource string
  87107. testpermissionsrequest *TestPermissionsRequest
  87108. urlParams_ gensupport.URLParams
  87109. ctx_ context.Context
  87110. header_ http.Header
  87111. }
  87112. // TestIamPermissions: Returns permissions that a caller has on the
  87113. // specified resource.
  87114. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  87115. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87116. c.project = project
  87117. c.region = region
  87118. c.resource = resource
  87119. c.testpermissionsrequest = testpermissionsrequest
  87120. return c
  87121. }
  87122. // Fields allows partial responses to be retrieved. See
  87123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87124. // for more information.
  87125. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  87126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87127. return c
  87128. }
  87129. // Context sets the context to be used in this call's Do method. Any
  87130. // pending HTTP request will be aborted if the provided context is
  87131. // canceled.
  87132. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  87133. c.ctx_ = ctx
  87134. return c
  87135. }
  87136. // Header returns an http.Header that can be modified by the caller to
  87137. // add HTTP headers to the request.
  87138. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  87139. if c.header_ == nil {
  87140. c.header_ = make(http.Header)
  87141. }
  87142. return c.header_
  87143. }
  87144. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  87145. reqHeaders := make(http.Header)
  87146. for k, v := range c.header_ {
  87147. reqHeaders[k] = v
  87148. }
  87149. reqHeaders.Set("User-Agent", c.s.userAgent())
  87150. var body io.Reader = nil
  87151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  87152. if err != nil {
  87153. return nil, err
  87154. }
  87155. reqHeaders.Set("Content-Type", "application/json")
  87156. c.urlParams_.Set("alt", alt)
  87157. c.urlParams_.Set("prettyPrint", "false")
  87158. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  87159. urls += "?" + c.urlParams_.Encode()
  87160. req, err := http.NewRequest("POST", urls, body)
  87161. if err != nil {
  87162. return nil, err
  87163. }
  87164. req.Header = reqHeaders
  87165. googleapi.Expand(req.URL, map[string]string{
  87166. "project": c.project,
  87167. "region": c.region,
  87168. "resource": c.resource,
  87169. })
  87170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87171. }
  87172. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  87173. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  87174. // non-2xx status code is an error. Response headers are in either
  87175. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  87176. // returned at all) in error.(*googleapi.Error).Header. Use
  87177. // googleapi.IsNotModified to check whether the returned error was
  87178. // because http.StatusNotModified was returned.
  87179. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  87180. gensupport.SetOptions(c.urlParams_, opts...)
  87181. res, err := c.doRequest("json")
  87182. if res != nil && res.StatusCode == http.StatusNotModified {
  87183. if res.Body != nil {
  87184. res.Body.Close()
  87185. }
  87186. return nil, &googleapi.Error{
  87187. Code: res.StatusCode,
  87188. Header: res.Header,
  87189. }
  87190. }
  87191. if err != nil {
  87192. return nil, err
  87193. }
  87194. defer googleapi.CloseBody(res)
  87195. if err := googleapi.CheckResponse(res); err != nil {
  87196. return nil, err
  87197. }
  87198. ret := &TestPermissionsResponse{
  87199. ServerResponse: googleapi.ServerResponse{
  87200. Header: res.Header,
  87201. HTTPStatusCode: res.StatusCode,
  87202. },
  87203. }
  87204. target := &ret
  87205. if err := gensupport.DecodeResponse(target, res); err != nil {
  87206. return nil, err
  87207. }
  87208. return ret, nil
  87209. // {
  87210. // "description": "Returns permissions that a caller has on the specified resource.",
  87211. // "httpMethod": "POST",
  87212. // "id": "compute.nodeTemplates.testIamPermissions",
  87213. // "parameterOrder": [
  87214. // "project",
  87215. // "region",
  87216. // "resource"
  87217. // ],
  87218. // "parameters": {
  87219. // "project": {
  87220. // "description": "Project ID for this request.",
  87221. // "location": "path",
  87222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87223. // "required": true,
  87224. // "type": "string"
  87225. // },
  87226. // "region": {
  87227. // "description": "The name of the region for this request.",
  87228. // "location": "path",
  87229. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87230. // "required": true,
  87231. // "type": "string"
  87232. // },
  87233. // "resource": {
  87234. // "description": "Name or id of the resource for this request.",
  87235. // "location": "path",
  87236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87237. // "required": true,
  87238. // "type": "string"
  87239. // }
  87240. // },
  87241. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  87242. // "request": {
  87243. // "$ref": "TestPermissionsRequest"
  87244. // },
  87245. // "response": {
  87246. // "$ref": "TestPermissionsResponse"
  87247. // },
  87248. // "scopes": [
  87249. // "https://www.googleapis.com/auth/cloud-platform",
  87250. // "https://www.googleapis.com/auth/compute",
  87251. // "https://www.googleapis.com/auth/compute.readonly"
  87252. // ]
  87253. // }
  87254. }
  87255. // method id "compute.nodeTypes.aggregatedList":
  87256. type NodeTypesAggregatedListCall struct {
  87257. s *Service
  87258. project string
  87259. urlParams_ gensupport.URLParams
  87260. ifNoneMatch_ string
  87261. ctx_ context.Context
  87262. header_ http.Header
  87263. }
  87264. // AggregatedList: Retrieves an aggregated list of node types.
  87265. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  87266. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87267. c.project = project
  87268. return c
  87269. }
  87270. // Filter sets the optional parameter "filter": A filter expression that
  87271. // filters resources listed in the response. The expression must specify
  87272. // the field name, a comparison operator, and the value that you want to
  87273. // use for filtering. The value must be a string, a number, or a
  87274. // boolean. The comparison operator must be either =, !=, >, or <.
  87275. //
  87276. // For example, if you are filtering Compute Engine instances, you can
  87277. // exclude instances named example-instance by specifying name !=
  87278. // example-instance.
  87279. //
  87280. // You can also filter nested fields. For example, you could specify
  87281. // scheduling.automaticRestart = false to include instances only if they
  87282. // are not scheduled for automatic restarts. You can use filtering on
  87283. // nested fields to filter based on resource labels.
  87284. //
  87285. // To filter on multiple expressions, provide each separate expression
  87286. // within parentheses. For example, (scheduling.automaticRestart = true)
  87287. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87288. // AND expression. However, you can include AND and OR expressions
  87289. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87290. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87291. // true).
  87292. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  87293. c.urlParams_.Set("filter", filter)
  87294. return c
  87295. }
  87296. // MaxResults sets the optional parameter "maxResults": The maximum
  87297. // number of results per page that should be returned. If the number of
  87298. // available results is larger than maxResults, Compute Engine returns a
  87299. // nextPageToken that can be used to get the next page of results in
  87300. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87301. // (Default: 500)
  87302. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  87303. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87304. return c
  87305. }
  87306. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87307. // a certain order. By default, results are returned in alphanumerical
  87308. // order based on the resource name.
  87309. //
  87310. // You can also sort results in descending order based on the creation
  87311. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87312. // based on the creationTimestamp field in reverse chronological order
  87313. // (newest result first). Use this to sort resources like operations so
  87314. // that the newest operation is returned first.
  87315. //
  87316. // Currently, only sorting by name or creationTimestamp desc is
  87317. // supported.
  87318. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  87319. c.urlParams_.Set("orderBy", orderBy)
  87320. return c
  87321. }
  87322. // PageToken sets the optional parameter "pageToken": Specifies a page
  87323. // token to use. Set pageToken to the nextPageToken returned by a
  87324. // previous list request to get the next page of results.
  87325. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  87326. c.urlParams_.Set("pageToken", pageToken)
  87327. return c
  87328. }
  87329. // Fields allows partial responses to be retrieved. See
  87330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87331. // for more information.
  87332. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  87333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87334. return c
  87335. }
  87336. // IfNoneMatch sets the optional parameter which makes the operation
  87337. // fail if the object's ETag matches the given value. This is useful for
  87338. // getting updates only after the object has changed since the last
  87339. // request. Use googleapi.IsNotModified to check whether the response
  87340. // error from Do is the result of In-None-Match.
  87341. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  87342. c.ifNoneMatch_ = entityTag
  87343. return c
  87344. }
  87345. // Context sets the context to be used in this call's Do method. Any
  87346. // pending HTTP request will be aborted if the provided context is
  87347. // canceled.
  87348. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  87349. c.ctx_ = ctx
  87350. return c
  87351. }
  87352. // Header returns an http.Header that can be modified by the caller to
  87353. // add HTTP headers to the request.
  87354. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  87355. if c.header_ == nil {
  87356. c.header_ = make(http.Header)
  87357. }
  87358. return c.header_
  87359. }
  87360. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  87361. reqHeaders := make(http.Header)
  87362. for k, v := range c.header_ {
  87363. reqHeaders[k] = v
  87364. }
  87365. reqHeaders.Set("User-Agent", c.s.userAgent())
  87366. if c.ifNoneMatch_ != "" {
  87367. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87368. }
  87369. var body io.Reader = nil
  87370. c.urlParams_.Set("alt", alt)
  87371. c.urlParams_.Set("prettyPrint", "false")
  87372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  87373. urls += "?" + c.urlParams_.Encode()
  87374. req, err := http.NewRequest("GET", urls, body)
  87375. if err != nil {
  87376. return nil, err
  87377. }
  87378. req.Header = reqHeaders
  87379. googleapi.Expand(req.URL, map[string]string{
  87380. "project": c.project,
  87381. })
  87382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87383. }
  87384. // Do executes the "compute.nodeTypes.aggregatedList" call.
  87385. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  87386. // non-2xx status code is an error. Response headers are in either
  87387. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  87388. // returned at all) in error.(*googleapi.Error).Header. Use
  87389. // googleapi.IsNotModified to check whether the returned error was
  87390. // because http.StatusNotModified was returned.
  87391. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  87392. gensupport.SetOptions(c.urlParams_, opts...)
  87393. res, err := c.doRequest("json")
  87394. if res != nil && res.StatusCode == http.StatusNotModified {
  87395. if res.Body != nil {
  87396. res.Body.Close()
  87397. }
  87398. return nil, &googleapi.Error{
  87399. Code: res.StatusCode,
  87400. Header: res.Header,
  87401. }
  87402. }
  87403. if err != nil {
  87404. return nil, err
  87405. }
  87406. defer googleapi.CloseBody(res)
  87407. if err := googleapi.CheckResponse(res); err != nil {
  87408. return nil, err
  87409. }
  87410. ret := &NodeTypeAggregatedList{
  87411. ServerResponse: googleapi.ServerResponse{
  87412. Header: res.Header,
  87413. HTTPStatusCode: res.StatusCode,
  87414. },
  87415. }
  87416. target := &ret
  87417. if err := gensupport.DecodeResponse(target, res); err != nil {
  87418. return nil, err
  87419. }
  87420. return ret, nil
  87421. // {
  87422. // "description": "Retrieves an aggregated list of node types.",
  87423. // "httpMethod": "GET",
  87424. // "id": "compute.nodeTypes.aggregatedList",
  87425. // "parameterOrder": [
  87426. // "project"
  87427. // ],
  87428. // "parameters": {
  87429. // "filter": {
  87430. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87431. // "location": "query",
  87432. // "type": "string"
  87433. // },
  87434. // "maxResults": {
  87435. // "default": "500",
  87436. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87437. // "format": "uint32",
  87438. // "location": "query",
  87439. // "minimum": "0",
  87440. // "type": "integer"
  87441. // },
  87442. // "orderBy": {
  87443. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87444. // "location": "query",
  87445. // "type": "string"
  87446. // },
  87447. // "pageToken": {
  87448. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87449. // "location": "query",
  87450. // "type": "string"
  87451. // },
  87452. // "project": {
  87453. // "description": "Project ID for this request.",
  87454. // "location": "path",
  87455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87456. // "required": true,
  87457. // "type": "string"
  87458. // }
  87459. // },
  87460. // "path": "{project}/aggregated/nodeTypes",
  87461. // "response": {
  87462. // "$ref": "NodeTypeAggregatedList"
  87463. // },
  87464. // "scopes": [
  87465. // "https://www.googleapis.com/auth/cloud-platform",
  87466. // "https://www.googleapis.com/auth/compute",
  87467. // "https://www.googleapis.com/auth/compute.readonly"
  87468. // ]
  87469. // }
  87470. }
  87471. // Pages invokes f for each page of results.
  87472. // A non-nil error returned from f will halt the iteration.
  87473. // The provided context supersedes any context provided to the Context method.
  87474. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  87475. c.ctx_ = ctx
  87476. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87477. for {
  87478. x, err := c.Do()
  87479. if err != nil {
  87480. return err
  87481. }
  87482. if err := f(x); err != nil {
  87483. return err
  87484. }
  87485. if x.NextPageToken == "" {
  87486. return nil
  87487. }
  87488. c.PageToken(x.NextPageToken)
  87489. }
  87490. }
  87491. // method id "compute.nodeTypes.get":
  87492. type NodeTypesGetCall struct {
  87493. s *Service
  87494. project string
  87495. zone string
  87496. nodeType string
  87497. urlParams_ gensupport.URLParams
  87498. ifNoneMatch_ string
  87499. ctx_ context.Context
  87500. header_ http.Header
  87501. }
  87502. // Get: Returns the specified node type. Gets a list of available node
  87503. // types by making a list() request.
  87504. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  87505. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87506. c.project = project
  87507. c.zone = zone
  87508. c.nodeType = nodeType
  87509. return c
  87510. }
  87511. // Fields allows partial responses to be retrieved. See
  87512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87513. // for more information.
  87514. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  87515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87516. return c
  87517. }
  87518. // IfNoneMatch sets the optional parameter which makes the operation
  87519. // fail if the object's ETag matches the given value. This is useful for
  87520. // getting updates only after the object has changed since the last
  87521. // request. Use googleapi.IsNotModified to check whether the response
  87522. // error from Do is the result of In-None-Match.
  87523. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  87524. c.ifNoneMatch_ = entityTag
  87525. return c
  87526. }
  87527. // Context sets the context to be used in this call's Do method. Any
  87528. // pending HTTP request will be aborted if the provided context is
  87529. // canceled.
  87530. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  87531. c.ctx_ = ctx
  87532. return c
  87533. }
  87534. // Header returns an http.Header that can be modified by the caller to
  87535. // add HTTP headers to the request.
  87536. func (c *NodeTypesGetCall) Header() http.Header {
  87537. if c.header_ == nil {
  87538. c.header_ = make(http.Header)
  87539. }
  87540. return c.header_
  87541. }
  87542. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  87543. reqHeaders := make(http.Header)
  87544. for k, v := range c.header_ {
  87545. reqHeaders[k] = v
  87546. }
  87547. reqHeaders.Set("User-Agent", c.s.userAgent())
  87548. if c.ifNoneMatch_ != "" {
  87549. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87550. }
  87551. var body io.Reader = nil
  87552. c.urlParams_.Set("alt", alt)
  87553. c.urlParams_.Set("prettyPrint", "false")
  87554. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  87555. urls += "?" + c.urlParams_.Encode()
  87556. req, err := http.NewRequest("GET", urls, body)
  87557. if err != nil {
  87558. return nil, err
  87559. }
  87560. req.Header = reqHeaders
  87561. googleapi.Expand(req.URL, map[string]string{
  87562. "project": c.project,
  87563. "zone": c.zone,
  87564. "nodeType": c.nodeType,
  87565. })
  87566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87567. }
  87568. // Do executes the "compute.nodeTypes.get" call.
  87569. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  87570. // code is an error. Response headers are in either
  87571. // *NodeType.ServerResponse.Header or (if a response was returned at
  87572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87573. // to check whether the returned error was because
  87574. // http.StatusNotModified was returned.
  87575. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  87576. gensupport.SetOptions(c.urlParams_, opts...)
  87577. res, err := c.doRequest("json")
  87578. if res != nil && res.StatusCode == http.StatusNotModified {
  87579. if res.Body != nil {
  87580. res.Body.Close()
  87581. }
  87582. return nil, &googleapi.Error{
  87583. Code: res.StatusCode,
  87584. Header: res.Header,
  87585. }
  87586. }
  87587. if err != nil {
  87588. return nil, err
  87589. }
  87590. defer googleapi.CloseBody(res)
  87591. if err := googleapi.CheckResponse(res); err != nil {
  87592. return nil, err
  87593. }
  87594. ret := &NodeType{
  87595. ServerResponse: googleapi.ServerResponse{
  87596. Header: res.Header,
  87597. HTTPStatusCode: res.StatusCode,
  87598. },
  87599. }
  87600. target := &ret
  87601. if err := gensupport.DecodeResponse(target, res); err != nil {
  87602. return nil, err
  87603. }
  87604. return ret, nil
  87605. // {
  87606. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  87607. // "httpMethod": "GET",
  87608. // "id": "compute.nodeTypes.get",
  87609. // "parameterOrder": [
  87610. // "project",
  87611. // "zone",
  87612. // "nodeType"
  87613. // ],
  87614. // "parameters": {
  87615. // "nodeType": {
  87616. // "description": "Name of the node type to return.",
  87617. // "location": "path",
  87618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87619. // "required": true,
  87620. // "type": "string"
  87621. // },
  87622. // "project": {
  87623. // "description": "Project ID for this request.",
  87624. // "location": "path",
  87625. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87626. // "required": true,
  87627. // "type": "string"
  87628. // },
  87629. // "zone": {
  87630. // "description": "The name of the zone for this request.",
  87631. // "location": "path",
  87632. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87633. // "required": true,
  87634. // "type": "string"
  87635. // }
  87636. // },
  87637. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  87638. // "response": {
  87639. // "$ref": "NodeType"
  87640. // },
  87641. // "scopes": [
  87642. // "https://www.googleapis.com/auth/cloud-platform",
  87643. // "https://www.googleapis.com/auth/compute",
  87644. // "https://www.googleapis.com/auth/compute.readonly"
  87645. // ]
  87646. // }
  87647. }
  87648. // method id "compute.nodeTypes.list":
  87649. type NodeTypesListCall struct {
  87650. s *Service
  87651. project string
  87652. zone string
  87653. urlParams_ gensupport.URLParams
  87654. ifNoneMatch_ string
  87655. ctx_ context.Context
  87656. header_ http.Header
  87657. }
  87658. // List: Retrieves a list of node types available to the specified
  87659. // project.
  87660. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  87661. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87662. c.project = project
  87663. c.zone = zone
  87664. return c
  87665. }
  87666. // Filter sets the optional parameter "filter": A filter expression that
  87667. // filters resources listed in the response. The expression must specify
  87668. // the field name, a comparison operator, and the value that you want to
  87669. // use for filtering. The value must be a string, a number, or a
  87670. // boolean. The comparison operator must be either =, !=, >, or <.
  87671. //
  87672. // For example, if you are filtering Compute Engine instances, you can
  87673. // exclude instances named example-instance by specifying name !=
  87674. // example-instance.
  87675. //
  87676. // You can also filter nested fields. For example, you could specify
  87677. // scheduling.automaticRestart = false to include instances only if they
  87678. // are not scheduled for automatic restarts. You can use filtering on
  87679. // nested fields to filter based on resource labels.
  87680. //
  87681. // To filter on multiple expressions, provide each separate expression
  87682. // within parentheses. For example, (scheduling.automaticRestart = true)
  87683. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87684. // AND expression. However, you can include AND and OR expressions
  87685. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87686. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87687. // true).
  87688. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  87689. c.urlParams_.Set("filter", filter)
  87690. return c
  87691. }
  87692. // MaxResults sets the optional parameter "maxResults": The maximum
  87693. // number of results per page that should be returned. If the number of
  87694. // available results is larger than maxResults, Compute Engine returns a
  87695. // nextPageToken that can be used to get the next page of results in
  87696. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87697. // (Default: 500)
  87698. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  87699. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87700. return c
  87701. }
  87702. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87703. // a certain order. By default, results are returned in alphanumerical
  87704. // order based on the resource name.
  87705. //
  87706. // You can also sort results in descending order based on the creation
  87707. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87708. // based on the creationTimestamp field in reverse chronological order
  87709. // (newest result first). Use this to sort resources like operations so
  87710. // that the newest operation is returned first.
  87711. //
  87712. // Currently, only sorting by name or creationTimestamp desc is
  87713. // supported.
  87714. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  87715. c.urlParams_.Set("orderBy", orderBy)
  87716. return c
  87717. }
  87718. // PageToken sets the optional parameter "pageToken": Specifies a page
  87719. // token to use. Set pageToken to the nextPageToken returned by a
  87720. // previous list request to get the next page of results.
  87721. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  87722. c.urlParams_.Set("pageToken", pageToken)
  87723. return c
  87724. }
  87725. // Fields allows partial responses to be retrieved. See
  87726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87727. // for more information.
  87728. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  87729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87730. return c
  87731. }
  87732. // IfNoneMatch sets the optional parameter which makes the operation
  87733. // fail if the object's ETag matches the given value. This is useful for
  87734. // getting updates only after the object has changed since the last
  87735. // request. Use googleapi.IsNotModified to check whether the response
  87736. // error from Do is the result of In-None-Match.
  87737. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  87738. c.ifNoneMatch_ = entityTag
  87739. return c
  87740. }
  87741. // Context sets the context to be used in this call's Do method. Any
  87742. // pending HTTP request will be aborted if the provided context is
  87743. // canceled.
  87744. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  87745. c.ctx_ = ctx
  87746. return c
  87747. }
  87748. // Header returns an http.Header that can be modified by the caller to
  87749. // add HTTP headers to the request.
  87750. func (c *NodeTypesListCall) Header() http.Header {
  87751. if c.header_ == nil {
  87752. c.header_ = make(http.Header)
  87753. }
  87754. return c.header_
  87755. }
  87756. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  87757. reqHeaders := make(http.Header)
  87758. for k, v := range c.header_ {
  87759. reqHeaders[k] = v
  87760. }
  87761. reqHeaders.Set("User-Agent", c.s.userAgent())
  87762. if c.ifNoneMatch_ != "" {
  87763. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87764. }
  87765. var body io.Reader = nil
  87766. c.urlParams_.Set("alt", alt)
  87767. c.urlParams_.Set("prettyPrint", "false")
  87768. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  87769. urls += "?" + c.urlParams_.Encode()
  87770. req, err := http.NewRequest("GET", urls, body)
  87771. if err != nil {
  87772. return nil, err
  87773. }
  87774. req.Header = reqHeaders
  87775. googleapi.Expand(req.URL, map[string]string{
  87776. "project": c.project,
  87777. "zone": c.zone,
  87778. })
  87779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87780. }
  87781. // Do executes the "compute.nodeTypes.list" call.
  87782. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  87783. // status code is an error. Response headers are in either
  87784. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  87785. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87786. // to check whether the returned error was because
  87787. // http.StatusNotModified was returned.
  87788. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  87789. gensupport.SetOptions(c.urlParams_, opts...)
  87790. res, err := c.doRequest("json")
  87791. if res != nil && res.StatusCode == http.StatusNotModified {
  87792. if res.Body != nil {
  87793. res.Body.Close()
  87794. }
  87795. return nil, &googleapi.Error{
  87796. Code: res.StatusCode,
  87797. Header: res.Header,
  87798. }
  87799. }
  87800. if err != nil {
  87801. return nil, err
  87802. }
  87803. defer googleapi.CloseBody(res)
  87804. if err := googleapi.CheckResponse(res); err != nil {
  87805. return nil, err
  87806. }
  87807. ret := &NodeTypeList{
  87808. ServerResponse: googleapi.ServerResponse{
  87809. Header: res.Header,
  87810. HTTPStatusCode: res.StatusCode,
  87811. },
  87812. }
  87813. target := &ret
  87814. if err := gensupport.DecodeResponse(target, res); err != nil {
  87815. return nil, err
  87816. }
  87817. return ret, nil
  87818. // {
  87819. // "description": "Retrieves a list of node types available to the specified project.",
  87820. // "httpMethod": "GET",
  87821. // "id": "compute.nodeTypes.list",
  87822. // "parameterOrder": [
  87823. // "project",
  87824. // "zone"
  87825. // ],
  87826. // "parameters": {
  87827. // "filter": {
  87828. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87829. // "location": "query",
  87830. // "type": "string"
  87831. // },
  87832. // "maxResults": {
  87833. // "default": "500",
  87834. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87835. // "format": "uint32",
  87836. // "location": "query",
  87837. // "minimum": "0",
  87838. // "type": "integer"
  87839. // },
  87840. // "orderBy": {
  87841. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87842. // "location": "query",
  87843. // "type": "string"
  87844. // },
  87845. // "pageToken": {
  87846. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87847. // "location": "query",
  87848. // "type": "string"
  87849. // },
  87850. // "project": {
  87851. // "description": "Project ID for this request.",
  87852. // "location": "path",
  87853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87854. // "required": true,
  87855. // "type": "string"
  87856. // },
  87857. // "zone": {
  87858. // "description": "The name of the zone for this request.",
  87859. // "location": "path",
  87860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87861. // "required": true,
  87862. // "type": "string"
  87863. // }
  87864. // },
  87865. // "path": "{project}/zones/{zone}/nodeTypes",
  87866. // "response": {
  87867. // "$ref": "NodeTypeList"
  87868. // },
  87869. // "scopes": [
  87870. // "https://www.googleapis.com/auth/cloud-platform",
  87871. // "https://www.googleapis.com/auth/compute",
  87872. // "https://www.googleapis.com/auth/compute.readonly"
  87873. // ]
  87874. // }
  87875. }
  87876. // Pages invokes f for each page of results.
  87877. // A non-nil error returned from f will halt the iteration.
  87878. // The provided context supersedes any context provided to the Context method.
  87879. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  87880. c.ctx_ = ctx
  87881. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87882. for {
  87883. x, err := c.Do()
  87884. if err != nil {
  87885. return err
  87886. }
  87887. if err := f(x); err != nil {
  87888. return err
  87889. }
  87890. if x.NextPageToken == "" {
  87891. return nil
  87892. }
  87893. c.PageToken(x.NextPageToken)
  87894. }
  87895. }
  87896. // method id "compute.organizationSecurityPolicies.addAssociation":
  87897. type OrganizationSecurityPoliciesAddAssociationCall struct {
  87898. s *Service
  87899. securityPolicy string
  87900. securitypolicyassociation *SecurityPolicyAssociation
  87901. urlParams_ gensupport.URLParams
  87902. ctx_ context.Context
  87903. header_ http.Header
  87904. }
  87905. // AddAssociation: Inserts an association for the specified security
  87906. // policy.
  87907. func (r *OrganizationSecurityPoliciesService) AddAssociation(securityPolicy string, securitypolicyassociation *SecurityPolicyAssociation) *OrganizationSecurityPoliciesAddAssociationCall {
  87908. c := &OrganizationSecurityPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87909. c.securityPolicy = securityPolicy
  87910. c.securitypolicyassociation = securitypolicyassociation
  87911. return c
  87912. }
  87913. // RequestId sets the optional parameter "requestId": An optional
  87914. // request ID to identify requests. Specify a unique request ID so that
  87915. // if you must retry your request, the server will know to ignore the
  87916. // request if it has already been completed.
  87917. //
  87918. // For example, consider a situation where you make an initial request
  87919. // and the request times out. If you make the request again with the
  87920. // same request ID, the server can check if original operation with the
  87921. // same request ID was received, and if so, will ignore the second
  87922. // request. This prevents clients from accidentally creating duplicate
  87923. // commitments.
  87924. //
  87925. // The request ID must be a valid UUID with the exception that zero UUID
  87926. // is not supported (00000000-0000-0000-0000-000000000000).
  87927. func (c *OrganizationSecurityPoliciesAddAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddAssociationCall {
  87928. c.urlParams_.Set("requestId", requestId)
  87929. return c
  87930. }
  87931. // Fields allows partial responses to be retrieved. See
  87932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87933. // for more information.
  87934. func (c *OrganizationSecurityPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddAssociationCall {
  87935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87936. return c
  87937. }
  87938. // Context sets the context to be used in this call's Do method. Any
  87939. // pending HTTP request will be aborted if the provided context is
  87940. // canceled.
  87941. func (c *OrganizationSecurityPoliciesAddAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddAssociationCall {
  87942. c.ctx_ = ctx
  87943. return c
  87944. }
  87945. // Header returns an http.Header that can be modified by the caller to
  87946. // add HTTP headers to the request.
  87947. func (c *OrganizationSecurityPoliciesAddAssociationCall) Header() http.Header {
  87948. if c.header_ == nil {
  87949. c.header_ = make(http.Header)
  87950. }
  87951. return c.header_
  87952. }
  87953. func (c *OrganizationSecurityPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
  87954. reqHeaders := make(http.Header)
  87955. for k, v := range c.header_ {
  87956. reqHeaders[k] = v
  87957. }
  87958. reqHeaders.Set("User-Agent", c.s.userAgent())
  87959. var body io.Reader = nil
  87960. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyassociation)
  87961. if err != nil {
  87962. return nil, err
  87963. }
  87964. reqHeaders.Set("Content-Type", "application/json")
  87965. c.urlParams_.Set("alt", alt)
  87966. c.urlParams_.Set("prettyPrint", "false")
  87967. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addAssociation")
  87968. urls += "?" + c.urlParams_.Encode()
  87969. req, err := http.NewRequest("POST", urls, body)
  87970. if err != nil {
  87971. return nil, err
  87972. }
  87973. req.Header = reqHeaders
  87974. googleapi.Expand(req.URL, map[string]string{
  87975. "securityPolicy": c.securityPolicy,
  87976. })
  87977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87978. }
  87979. // Do executes the "compute.organizationSecurityPolicies.addAssociation" call.
  87980. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87981. // status code is an error. Response headers are in either
  87982. // *Operation.ServerResponse.Header or (if a response was returned at
  87983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87984. // to check whether the returned error was because
  87985. // http.StatusNotModified was returned.
  87986. func (c *OrganizationSecurityPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87987. gensupport.SetOptions(c.urlParams_, opts...)
  87988. res, err := c.doRequest("json")
  87989. if res != nil && res.StatusCode == http.StatusNotModified {
  87990. if res.Body != nil {
  87991. res.Body.Close()
  87992. }
  87993. return nil, &googleapi.Error{
  87994. Code: res.StatusCode,
  87995. Header: res.Header,
  87996. }
  87997. }
  87998. if err != nil {
  87999. return nil, err
  88000. }
  88001. defer googleapi.CloseBody(res)
  88002. if err := googleapi.CheckResponse(res); err != nil {
  88003. return nil, err
  88004. }
  88005. ret := &Operation{
  88006. ServerResponse: googleapi.ServerResponse{
  88007. Header: res.Header,
  88008. HTTPStatusCode: res.StatusCode,
  88009. },
  88010. }
  88011. target := &ret
  88012. if err := gensupport.DecodeResponse(target, res); err != nil {
  88013. return nil, err
  88014. }
  88015. return ret, nil
  88016. // {
  88017. // "description": "Inserts an association for the specified security policy.",
  88018. // "httpMethod": "POST",
  88019. // "id": "compute.organizationSecurityPolicies.addAssociation",
  88020. // "parameterOrder": [
  88021. // "securityPolicy"
  88022. // ],
  88023. // "parameters": {
  88024. // "requestId": {
  88025. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88026. // "location": "query",
  88027. // "type": "string"
  88028. // },
  88029. // "securityPolicy": {
  88030. // "description": "Name of the security policy to update.",
  88031. // "location": "path",
  88032. // "pattern": "[0-9]{0,20}",
  88033. // "required": true,
  88034. // "type": "string"
  88035. // }
  88036. // },
  88037. // "path": "locations/global/securityPolicies/{securityPolicy}/addAssociation",
  88038. // "request": {
  88039. // "$ref": "SecurityPolicyAssociation"
  88040. // },
  88041. // "response": {
  88042. // "$ref": "Operation"
  88043. // },
  88044. // "scopes": [
  88045. // "https://www.googleapis.com/auth/cloud-platform",
  88046. // "https://www.googleapis.com/auth/compute"
  88047. // ]
  88048. // }
  88049. }
  88050. // method id "compute.organizationSecurityPolicies.addRule":
  88051. type OrganizationSecurityPoliciesAddRuleCall struct {
  88052. s *Service
  88053. securityPolicy string
  88054. securitypolicyrule *SecurityPolicyRule
  88055. urlParams_ gensupport.URLParams
  88056. ctx_ context.Context
  88057. header_ http.Header
  88058. }
  88059. // AddRule: Inserts a rule into a security policy.
  88060. func (r *OrganizationSecurityPoliciesService) AddRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesAddRuleCall {
  88061. c := &OrganizationSecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88062. c.securityPolicy = securityPolicy
  88063. c.securitypolicyrule = securitypolicyrule
  88064. return c
  88065. }
  88066. // RequestId sets the optional parameter "requestId": An optional
  88067. // request ID to identify requests. Specify a unique request ID so that
  88068. // if you must retry your request, the server will know to ignore the
  88069. // request if it has already been completed.
  88070. //
  88071. // For example, consider a situation where you make an initial request
  88072. // and the request times out. If you make the request again with the
  88073. // same request ID, the server can check if original operation with the
  88074. // same request ID was received, and if so, will ignore the second
  88075. // request. This prevents clients from accidentally creating duplicate
  88076. // commitments.
  88077. //
  88078. // The request ID must be a valid UUID with the exception that zero UUID
  88079. // is not supported (00000000-0000-0000-0000-000000000000).
  88080. func (c *OrganizationSecurityPoliciesAddRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddRuleCall {
  88081. c.urlParams_.Set("requestId", requestId)
  88082. return c
  88083. }
  88084. // Fields allows partial responses to be retrieved. See
  88085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88086. // for more information.
  88087. func (c *OrganizationSecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddRuleCall {
  88088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88089. return c
  88090. }
  88091. // Context sets the context to be used in this call's Do method. Any
  88092. // pending HTTP request will be aborted if the provided context is
  88093. // canceled.
  88094. func (c *OrganizationSecurityPoliciesAddRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddRuleCall {
  88095. c.ctx_ = ctx
  88096. return c
  88097. }
  88098. // Header returns an http.Header that can be modified by the caller to
  88099. // add HTTP headers to the request.
  88100. func (c *OrganizationSecurityPoliciesAddRuleCall) Header() http.Header {
  88101. if c.header_ == nil {
  88102. c.header_ = make(http.Header)
  88103. }
  88104. return c.header_
  88105. }
  88106. func (c *OrganizationSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  88107. reqHeaders := make(http.Header)
  88108. for k, v := range c.header_ {
  88109. reqHeaders[k] = v
  88110. }
  88111. reqHeaders.Set("User-Agent", c.s.userAgent())
  88112. var body io.Reader = nil
  88113. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  88114. if err != nil {
  88115. return nil, err
  88116. }
  88117. reqHeaders.Set("Content-Type", "application/json")
  88118. c.urlParams_.Set("alt", alt)
  88119. c.urlParams_.Set("prettyPrint", "false")
  88120. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addRule")
  88121. urls += "?" + c.urlParams_.Encode()
  88122. req, err := http.NewRequest("POST", urls, body)
  88123. if err != nil {
  88124. return nil, err
  88125. }
  88126. req.Header = reqHeaders
  88127. googleapi.Expand(req.URL, map[string]string{
  88128. "securityPolicy": c.securityPolicy,
  88129. })
  88130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88131. }
  88132. // Do executes the "compute.organizationSecurityPolicies.addRule" call.
  88133. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88134. // status code is an error. Response headers are in either
  88135. // *Operation.ServerResponse.Header or (if a response was returned at
  88136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88137. // to check whether the returned error was because
  88138. // http.StatusNotModified was returned.
  88139. func (c *OrganizationSecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88140. gensupport.SetOptions(c.urlParams_, opts...)
  88141. res, err := c.doRequest("json")
  88142. if res != nil && res.StatusCode == http.StatusNotModified {
  88143. if res.Body != nil {
  88144. res.Body.Close()
  88145. }
  88146. return nil, &googleapi.Error{
  88147. Code: res.StatusCode,
  88148. Header: res.Header,
  88149. }
  88150. }
  88151. if err != nil {
  88152. return nil, err
  88153. }
  88154. defer googleapi.CloseBody(res)
  88155. if err := googleapi.CheckResponse(res); err != nil {
  88156. return nil, err
  88157. }
  88158. ret := &Operation{
  88159. ServerResponse: googleapi.ServerResponse{
  88160. Header: res.Header,
  88161. HTTPStatusCode: res.StatusCode,
  88162. },
  88163. }
  88164. target := &ret
  88165. if err := gensupport.DecodeResponse(target, res); err != nil {
  88166. return nil, err
  88167. }
  88168. return ret, nil
  88169. // {
  88170. // "description": "Inserts a rule into a security policy.",
  88171. // "httpMethod": "POST",
  88172. // "id": "compute.organizationSecurityPolicies.addRule",
  88173. // "parameterOrder": [
  88174. // "securityPolicy"
  88175. // ],
  88176. // "parameters": {
  88177. // "requestId": {
  88178. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88179. // "location": "query",
  88180. // "type": "string"
  88181. // },
  88182. // "securityPolicy": {
  88183. // "description": "Name of the security policy to update.",
  88184. // "location": "path",
  88185. // "pattern": "[0-9]{0,20}",
  88186. // "required": true,
  88187. // "type": "string"
  88188. // }
  88189. // },
  88190. // "path": "locations/global/securityPolicies/{securityPolicy}/addRule",
  88191. // "request": {
  88192. // "$ref": "SecurityPolicyRule"
  88193. // },
  88194. // "response": {
  88195. // "$ref": "Operation"
  88196. // },
  88197. // "scopes": [
  88198. // "https://www.googleapis.com/auth/cloud-platform",
  88199. // "https://www.googleapis.com/auth/compute"
  88200. // ]
  88201. // }
  88202. }
  88203. // method id "compute.organizationSecurityPolicies.delete":
  88204. type OrganizationSecurityPoliciesDeleteCall struct {
  88205. s *Service
  88206. securityPolicy string
  88207. urlParams_ gensupport.URLParams
  88208. ctx_ context.Context
  88209. header_ http.Header
  88210. }
  88211. // Delete: Deletes the specified policy.
  88212. func (r *OrganizationSecurityPoliciesService) Delete(securityPolicy string) *OrganizationSecurityPoliciesDeleteCall {
  88213. c := &OrganizationSecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88214. c.securityPolicy = securityPolicy
  88215. return c
  88216. }
  88217. // RequestId sets the optional parameter "requestId": An optional
  88218. // request ID to identify requests. Specify a unique request ID so that
  88219. // if you must retry your request, the server will know to ignore the
  88220. // request if it has already been completed.
  88221. //
  88222. // For example, consider a situation where you make an initial request
  88223. // and the request times out. If you make the request again with the
  88224. // same request ID, the server can check if original operation with the
  88225. // same request ID was received, and if so, will ignore the second
  88226. // request. This prevents clients from accidentally creating duplicate
  88227. // commitments.
  88228. //
  88229. // The request ID must be a valid UUID with the exception that zero UUID
  88230. // is not supported (00000000-0000-0000-0000-000000000000).
  88231. func (c *OrganizationSecurityPoliciesDeleteCall) RequestId(requestId string) *OrganizationSecurityPoliciesDeleteCall {
  88232. c.urlParams_.Set("requestId", requestId)
  88233. return c
  88234. }
  88235. // Fields allows partial responses to be retrieved. See
  88236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88237. // for more information.
  88238. func (c *OrganizationSecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesDeleteCall {
  88239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88240. return c
  88241. }
  88242. // Context sets the context to be used in this call's Do method. Any
  88243. // pending HTTP request will be aborted if the provided context is
  88244. // canceled.
  88245. func (c *OrganizationSecurityPoliciesDeleteCall) Context(ctx context.Context) *OrganizationSecurityPoliciesDeleteCall {
  88246. c.ctx_ = ctx
  88247. return c
  88248. }
  88249. // Header returns an http.Header that can be modified by the caller to
  88250. // add HTTP headers to the request.
  88251. func (c *OrganizationSecurityPoliciesDeleteCall) Header() http.Header {
  88252. if c.header_ == nil {
  88253. c.header_ = make(http.Header)
  88254. }
  88255. return c.header_
  88256. }
  88257. func (c *OrganizationSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  88258. reqHeaders := make(http.Header)
  88259. for k, v := range c.header_ {
  88260. reqHeaders[k] = v
  88261. }
  88262. reqHeaders.Set("User-Agent", c.s.userAgent())
  88263. var body io.Reader = nil
  88264. c.urlParams_.Set("alt", alt)
  88265. c.urlParams_.Set("prettyPrint", "false")
  88266. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  88267. urls += "?" + c.urlParams_.Encode()
  88268. req, err := http.NewRequest("DELETE", urls, body)
  88269. if err != nil {
  88270. return nil, err
  88271. }
  88272. req.Header = reqHeaders
  88273. googleapi.Expand(req.URL, map[string]string{
  88274. "securityPolicy": c.securityPolicy,
  88275. })
  88276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88277. }
  88278. // Do executes the "compute.organizationSecurityPolicies.delete" call.
  88279. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88280. // status code is an error. Response headers are in either
  88281. // *Operation.ServerResponse.Header or (if a response was returned at
  88282. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88283. // to check whether the returned error was because
  88284. // http.StatusNotModified was returned.
  88285. func (c *OrganizationSecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88286. gensupport.SetOptions(c.urlParams_, opts...)
  88287. res, err := c.doRequest("json")
  88288. if res != nil && res.StatusCode == http.StatusNotModified {
  88289. if res.Body != nil {
  88290. res.Body.Close()
  88291. }
  88292. return nil, &googleapi.Error{
  88293. Code: res.StatusCode,
  88294. Header: res.Header,
  88295. }
  88296. }
  88297. if err != nil {
  88298. return nil, err
  88299. }
  88300. defer googleapi.CloseBody(res)
  88301. if err := googleapi.CheckResponse(res); err != nil {
  88302. return nil, err
  88303. }
  88304. ret := &Operation{
  88305. ServerResponse: googleapi.ServerResponse{
  88306. Header: res.Header,
  88307. HTTPStatusCode: res.StatusCode,
  88308. },
  88309. }
  88310. target := &ret
  88311. if err := gensupport.DecodeResponse(target, res); err != nil {
  88312. return nil, err
  88313. }
  88314. return ret, nil
  88315. // {
  88316. // "description": "Deletes the specified policy.",
  88317. // "httpMethod": "DELETE",
  88318. // "id": "compute.organizationSecurityPolicies.delete",
  88319. // "parameterOrder": [
  88320. // "securityPolicy"
  88321. // ],
  88322. // "parameters": {
  88323. // "requestId": {
  88324. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88325. // "location": "query",
  88326. // "type": "string"
  88327. // },
  88328. // "securityPolicy": {
  88329. // "description": "Name of the security policy to delete.",
  88330. // "location": "path",
  88331. // "pattern": "[0-9]{0,20}",
  88332. // "required": true,
  88333. // "type": "string"
  88334. // }
  88335. // },
  88336. // "path": "locations/global/securityPolicies/{securityPolicy}",
  88337. // "response": {
  88338. // "$ref": "Operation"
  88339. // },
  88340. // "scopes": [
  88341. // "https://www.googleapis.com/auth/cloud-platform",
  88342. // "https://www.googleapis.com/auth/compute"
  88343. // ]
  88344. // }
  88345. }
  88346. // method id "compute.organizationSecurityPolicies.get":
  88347. type OrganizationSecurityPoliciesGetCall struct {
  88348. s *Service
  88349. securityPolicy string
  88350. urlParams_ gensupport.URLParams
  88351. ifNoneMatch_ string
  88352. ctx_ context.Context
  88353. header_ http.Header
  88354. }
  88355. // Get: List all of the ordered rules present in a single specified
  88356. // policy.
  88357. func (r *OrganizationSecurityPoliciesService) Get(securityPolicy string) *OrganizationSecurityPoliciesGetCall {
  88358. c := &OrganizationSecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88359. c.securityPolicy = securityPolicy
  88360. return c
  88361. }
  88362. // Fields allows partial responses to be retrieved. See
  88363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88364. // for more information.
  88365. func (c *OrganizationSecurityPoliciesGetCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetCall {
  88366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88367. return c
  88368. }
  88369. // IfNoneMatch sets the optional parameter which makes the operation
  88370. // fail if the object's ETag matches the given value. This is useful for
  88371. // getting updates only after the object has changed since the last
  88372. // request. Use googleapi.IsNotModified to check whether the response
  88373. // error from Do is the result of In-None-Match.
  88374. func (c *OrganizationSecurityPoliciesGetCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetCall {
  88375. c.ifNoneMatch_ = entityTag
  88376. return c
  88377. }
  88378. // Context sets the context to be used in this call's Do method. Any
  88379. // pending HTTP request will be aborted if the provided context is
  88380. // canceled.
  88381. func (c *OrganizationSecurityPoliciesGetCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetCall {
  88382. c.ctx_ = ctx
  88383. return c
  88384. }
  88385. // Header returns an http.Header that can be modified by the caller to
  88386. // add HTTP headers to the request.
  88387. func (c *OrganizationSecurityPoliciesGetCall) Header() http.Header {
  88388. if c.header_ == nil {
  88389. c.header_ = make(http.Header)
  88390. }
  88391. return c.header_
  88392. }
  88393. func (c *OrganizationSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  88394. reqHeaders := make(http.Header)
  88395. for k, v := range c.header_ {
  88396. reqHeaders[k] = v
  88397. }
  88398. reqHeaders.Set("User-Agent", c.s.userAgent())
  88399. if c.ifNoneMatch_ != "" {
  88400. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88401. }
  88402. var body io.Reader = nil
  88403. c.urlParams_.Set("alt", alt)
  88404. c.urlParams_.Set("prettyPrint", "false")
  88405. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  88406. urls += "?" + c.urlParams_.Encode()
  88407. req, err := http.NewRequest("GET", urls, body)
  88408. if err != nil {
  88409. return nil, err
  88410. }
  88411. req.Header = reqHeaders
  88412. googleapi.Expand(req.URL, map[string]string{
  88413. "securityPolicy": c.securityPolicy,
  88414. })
  88415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88416. }
  88417. // Do executes the "compute.organizationSecurityPolicies.get" call.
  88418. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  88419. // status code is an error. Response headers are in either
  88420. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  88421. // at all) in error.(*googleapi.Error).Header. Use
  88422. // googleapi.IsNotModified to check whether the returned error was
  88423. // because http.StatusNotModified was returned.
  88424. func (c *OrganizationSecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  88425. gensupport.SetOptions(c.urlParams_, opts...)
  88426. res, err := c.doRequest("json")
  88427. if res != nil && res.StatusCode == http.StatusNotModified {
  88428. if res.Body != nil {
  88429. res.Body.Close()
  88430. }
  88431. return nil, &googleapi.Error{
  88432. Code: res.StatusCode,
  88433. Header: res.Header,
  88434. }
  88435. }
  88436. if err != nil {
  88437. return nil, err
  88438. }
  88439. defer googleapi.CloseBody(res)
  88440. if err := googleapi.CheckResponse(res); err != nil {
  88441. return nil, err
  88442. }
  88443. ret := &SecurityPolicy{
  88444. ServerResponse: googleapi.ServerResponse{
  88445. Header: res.Header,
  88446. HTTPStatusCode: res.StatusCode,
  88447. },
  88448. }
  88449. target := &ret
  88450. if err := gensupport.DecodeResponse(target, res); err != nil {
  88451. return nil, err
  88452. }
  88453. return ret, nil
  88454. // {
  88455. // "description": "List all of the ordered rules present in a single specified policy.",
  88456. // "httpMethod": "GET",
  88457. // "id": "compute.organizationSecurityPolicies.get",
  88458. // "parameterOrder": [
  88459. // "securityPolicy"
  88460. // ],
  88461. // "parameters": {
  88462. // "securityPolicy": {
  88463. // "description": "Name of the security policy to get.",
  88464. // "location": "path",
  88465. // "pattern": "[0-9]{0,20}",
  88466. // "required": true,
  88467. // "type": "string"
  88468. // }
  88469. // },
  88470. // "path": "locations/global/securityPolicies/{securityPolicy}",
  88471. // "response": {
  88472. // "$ref": "SecurityPolicy"
  88473. // },
  88474. // "scopes": [
  88475. // "https://www.googleapis.com/auth/cloud-platform",
  88476. // "https://www.googleapis.com/auth/compute",
  88477. // "https://www.googleapis.com/auth/compute.readonly"
  88478. // ]
  88479. // }
  88480. }
  88481. // method id "compute.organizationSecurityPolicies.getAssociation":
  88482. type OrganizationSecurityPoliciesGetAssociationCall struct {
  88483. s *Service
  88484. securityPolicy string
  88485. urlParams_ gensupport.URLParams
  88486. ifNoneMatch_ string
  88487. ctx_ context.Context
  88488. header_ http.Header
  88489. }
  88490. // GetAssociation: Gets an association with the specified name.
  88491. func (r *OrganizationSecurityPoliciesService) GetAssociation(securityPolicy string) *OrganizationSecurityPoliciesGetAssociationCall {
  88492. c := &OrganizationSecurityPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88493. c.securityPolicy = securityPolicy
  88494. return c
  88495. }
  88496. // Name sets the optional parameter "name": The name of the association
  88497. // to get from the security policy.
  88498. func (c *OrganizationSecurityPoliciesGetAssociationCall) Name(name string) *OrganizationSecurityPoliciesGetAssociationCall {
  88499. c.urlParams_.Set("name", name)
  88500. return c
  88501. }
  88502. // Fields allows partial responses to be retrieved. See
  88503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88504. // for more information.
  88505. func (c *OrganizationSecurityPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetAssociationCall {
  88506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88507. return c
  88508. }
  88509. // IfNoneMatch sets the optional parameter which makes the operation
  88510. // fail if the object's ETag matches the given value. This is useful for
  88511. // getting updates only after the object has changed since the last
  88512. // request. Use googleapi.IsNotModified to check whether the response
  88513. // error from Do is the result of In-None-Match.
  88514. func (c *OrganizationSecurityPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetAssociationCall {
  88515. c.ifNoneMatch_ = entityTag
  88516. return c
  88517. }
  88518. // Context sets the context to be used in this call's Do method. Any
  88519. // pending HTTP request will be aborted if the provided context is
  88520. // canceled.
  88521. func (c *OrganizationSecurityPoliciesGetAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetAssociationCall {
  88522. c.ctx_ = ctx
  88523. return c
  88524. }
  88525. // Header returns an http.Header that can be modified by the caller to
  88526. // add HTTP headers to the request.
  88527. func (c *OrganizationSecurityPoliciesGetAssociationCall) Header() http.Header {
  88528. if c.header_ == nil {
  88529. c.header_ = make(http.Header)
  88530. }
  88531. return c.header_
  88532. }
  88533. func (c *OrganizationSecurityPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
  88534. reqHeaders := make(http.Header)
  88535. for k, v := range c.header_ {
  88536. reqHeaders[k] = v
  88537. }
  88538. reqHeaders.Set("User-Agent", c.s.userAgent())
  88539. if c.ifNoneMatch_ != "" {
  88540. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88541. }
  88542. var body io.Reader = nil
  88543. c.urlParams_.Set("alt", alt)
  88544. c.urlParams_.Set("prettyPrint", "false")
  88545. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getAssociation")
  88546. urls += "?" + c.urlParams_.Encode()
  88547. req, err := http.NewRequest("GET", urls, body)
  88548. if err != nil {
  88549. return nil, err
  88550. }
  88551. req.Header = reqHeaders
  88552. googleapi.Expand(req.URL, map[string]string{
  88553. "securityPolicy": c.securityPolicy,
  88554. })
  88555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88556. }
  88557. // Do executes the "compute.organizationSecurityPolicies.getAssociation" call.
  88558. // Exactly one of *SecurityPolicyAssociation or error will be non-nil.
  88559. // Any non-2xx status code is an error. Response headers are in either
  88560. // *SecurityPolicyAssociation.ServerResponse.Header or (if a response
  88561. // was returned at all) in error.(*googleapi.Error).Header. Use
  88562. // googleapi.IsNotModified to check whether the returned error was
  88563. // because http.StatusNotModified was returned.
  88564. func (c *OrganizationSecurityPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyAssociation, error) {
  88565. gensupport.SetOptions(c.urlParams_, opts...)
  88566. res, err := c.doRequest("json")
  88567. if res != nil && res.StatusCode == http.StatusNotModified {
  88568. if res.Body != nil {
  88569. res.Body.Close()
  88570. }
  88571. return nil, &googleapi.Error{
  88572. Code: res.StatusCode,
  88573. Header: res.Header,
  88574. }
  88575. }
  88576. if err != nil {
  88577. return nil, err
  88578. }
  88579. defer googleapi.CloseBody(res)
  88580. if err := googleapi.CheckResponse(res); err != nil {
  88581. return nil, err
  88582. }
  88583. ret := &SecurityPolicyAssociation{
  88584. ServerResponse: googleapi.ServerResponse{
  88585. Header: res.Header,
  88586. HTTPStatusCode: res.StatusCode,
  88587. },
  88588. }
  88589. target := &ret
  88590. if err := gensupport.DecodeResponse(target, res); err != nil {
  88591. return nil, err
  88592. }
  88593. return ret, nil
  88594. // {
  88595. // "description": "Gets an association with the specified name.",
  88596. // "httpMethod": "GET",
  88597. // "id": "compute.organizationSecurityPolicies.getAssociation",
  88598. // "parameterOrder": [
  88599. // "securityPolicy"
  88600. // ],
  88601. // "parameters": {
  88602. // "name": {
  88603. // "description": "The name of the association to get from the security policy.",
  88604. // "location": "query",
  88605. // "type": "string"
  88606. // },
  88607. // "securityPolicy": {
  88608. // "description": "Name of the security policy to which the queried rule belongs.",
  88609. // "location": "path",
  88610. // "pattern": "[0-9]{0,20}",
  88611. // "required": true,
  88612. // "type": "string"
  88613. // }
  88614. // },
  88615. // "path": "locations/global/securityPolicies/{securityPolicy}/getAssociation",
  88616. // "response": {
  88617. // "$ref": "SecurityPolicyAssociation"
  88618. // },
  88619. // "scopes": [
  88620. // "https://www.googleapis.com/auth/cloud-platform",
  88621. // "https://www.googleapis.com/auth/compute",
  88622. // "https://www.googleapis.com/auth/compute.readonly"
  88623. // ]
  88624. // }
  88625. }
  88626. // method id "compute.organizationSecurityPolicies.getRule":
  88627. type OrganizationSecurityPoliciesGetRuleCall struct {
  88628. s *Service
  88629. securityPolicy string
  88630. urlParams_ gensupport.URLParams
  88631. ifNoneMatch_ string
  88632. ctx_ context.Context
  88633. header_ http.Header
  88634. }
  88635. // GetRule: Gets a rule at the specified priority.
  88636. func (r *OrganizationSecurityPoliciesService) GetRule(securityPolicy string) *OrganizationSecurityPoliciesGetRuleCall {
  88637. c := &OrganizationSecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88638. c.securityPolicy = securityPolicy
  88639. return c
  88640. }
  88641. // Priority sets the optional parameter "priority": The priority of the
  88642. // rule to get from the security policy.
  88643. func (c *OrganizationSecurityPoliciesGetRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesGetRuleCall {
  88644. c.urlParams_.Set("priority", fmt.Sprint(priority))
  88645. return c
  88646. }
  88647. // Fields allows partial responses to be retrieved. See
  88648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88649. // for more information.
  88650. func (c *OrganizationSecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetRuleCall {
  88651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88652. return c
  88653. }
  88654. // IfNoneMatch sets the optional parameter which makes the operation
  88655. // fail if the object's ETag matches the given value. This is useful for
  88656. // getting updates only after the object has changed since the last
  88657. // request. Use googleapi.IsNotModified to check whether the response
  88658. // error from Do is the result of In-None-Match.
  88659. func (c *OrganizationSecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetRuleCall {
  88660. c.ifNoneMatch_ = entityTag
  88661. return c
  88662. }
  88663. // Context sets the context to be used in this call's Do method. Any
  88664. // pending HTTP request will be aborted if the provided context is
  88665. // canceled.
  88666. func (c *OrganizationSecurityPoliciesGetRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetRuleCall {
  88667. c.ctx_ = ctx
  88668. return c
  88669. }
  88670. // Header returns an http.Header that can be modified by the caller to
  88671. // add HTTP headers to the request.
  88672. func (c *OrganizationSecurityPoliciesGetRuleCall) Header() http.Header {
  88673. if c.header_ == nil {
  88674. c.header_ = make(http.Header)
  88675. }
  88676. return c.header_
  88677. }
  88678. func (c *OrganizationSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  88679. reqHeaders := make(http.Header)
  88680. for k, v := range c.header_ {
  88681. reqHeaders[k] = v
  88682. }
  88683. reqHeaders.Set("User-Agent", c.s.userAgent())
  88684. if c.ifNoneMatch_ != "" {
  88685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88686. }
  88687. var body io.Reader = nil
  88688. c.urlParams_.Set("alt", alt)
  88689. c.urlParams_.Set("prettyPrint", "false")
  88690. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getRule")
  88691. urls += "?" + c.urlParams_.Encode()
  88692. req, err := http.NewRequest("GET", urls, body)
  88693. if err != nil {
  88694. return nil, err
  88695. }
  88696. req.Header = reqHeaders
  88697. googleapi.Expand(req.URL, map[string]string{
  88698. "securityPolicy": c.securityPolicy,
  88699. })
  88700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88701. }
  88702. // Do executes the "compute.organizationSecurityPolicies.getRule" call.
  88703. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  88704. // non-2xx status code is an error. Response headers are in either
  88705. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  88706. // returned at all) in error.(*googleapi.Error).Header. Use
  88707. // googleapi.IsNotModified to check whether the returned error was
  88708. // because http.StatusNotModified was returned.
  88709. func (c *OrganizationSecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  88710. gensupport.SetOptions(c.urlParams_, opts...)
  88711. res, err := c.doRequest("json")
  88712. if res != nil && res.StatusCode == http.StatusNotModified {
  88713. if res.Body != nil {
  88714. res.Body.Close()
  88715. }
  88716. return nil, &googleapi.Error{
  88717. Code: res.StatusCode,
  88718. Header: res.Header,
  88719. }
  88720. }
  88721. if err != nil {
  88722. return nil, err
  88723. }
  88724. defer googleapi.CloseBody(res)
  88725. if err := googleapi.CheckResponse(res); err != nil {
  88726. return nil, err
  88727. }
  88728. ret := &SecurityPolicyRule{
  88729. ServerResponse: googleapi.ServerResponse{
  88730. Header: res.Header,
  88731. HTTPStatusCode: res.StatusCode,
  88732. },
  88733. }
  88734. target := &ret
  88735. if err := gensupport.DecodeResponse(target, res); err != nil {
  88736. return nil, err
  88737. }
  88738. return ret, nil
  88739. // {
  88740. // "description": "Gets a rule at the specified priority.",
  88741. // "httpMethod": "GET",
  88742. // "id": "compute.organizationSecurityPolicies.getRule",
  88743. // "parameterOrder": [
  88744. // "securityPolicy"
  88745. // ],
  88746. // "parameters": {
  88747. // "priority": {
  88748. // "description": "The priority of the rule to get from the security policy.",
  88749. // "format": "int32",
  88750. // "location": "query",
  88751. // "type": "integer"
  88752. // },
  88753. // "securityPolicy": {
  88754. // "description": "Name of the security policy to which the queried rule belongs.",
  88755. // "location": "path",
  88756. // "pattern": "[0-9]{0,20}",
  88757. // "required": true,
  88758. // "type": "string"
  88759. // }
  88760. // },
  88761. // "path": "locations/global/securityPolicies/{securityPolicy}/getRule",
  88762. // "response": {
  88763. // "$ref": "SecurityPolicyRule"
  88764. // },
  88765. // "scopes": [
  88766. // "https://www.googleapis.com/auth/cloud-platform",
  88767. // "https://www.googleapis.com/auth/compute",
  88768. // "https://www.googleapis.com/auth/compute.readonly"
  88769. // ]
  88770. // }
  88771. }
  88772. // method id "compute.organizationSecurityPolicies.insert":
  88773. type OrganizationSecurityPoliciesInsertCall struct {
  88774. s *Service
  88775. securitypolicy *SecurityPolicy
  88776. urlParams_ gensupport.URLParams
  88777. ctx_ context.Context
  88778. header_ http.Header
  88779. }
  88780. // Insert: Creates a new policy in the specified project using the data
  88781. // included in the request.
  88782. func (r *OrganizationSecurityPoliciesService) Insert(securitypolicy *SecurityPolicy) *OrganizationSecurityPoliciesInsertCall {
  88783. c := &OrganizationSecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88784. c.securitypolicy = securitypolicy
  88785. return c
  88786. }
  88787. // ParentId sets the optional parameter "parentId": Parent ID for this
  88788. // request.
  88789. func (c *OrganizationSecurityPoliciesInsertCall) ParentId(parentId string) *OrganizationSecurityPoliciesInsertCall {
  88790. c.urlParams_.Set("parentId", parentId)
  88791. return c
  88792. }
  88793. // RequestId sets the optional parameter "requestId": An optional
  88794. // request ID to identify requests. Specify a unique request ID so that
  88795. // if you must retry your request, the server will know to ignore the
  88796. // request if it has already been completed.
  88797. //
  88798. // For example, consider a situation where you make an initial request
  88799. // and the request times out. If you make the request again with the
  88800. // same request ID, the server can check if original operation with the
  88801. // same request ID was received, and if so, will ignore the second
  88802. // request. This prevents clients from accidentally creating duplicate
  88803. // commitments.
  88804. //
  88805. // The request ID must be a valid UUID with the exception that zero UUID
  88806. // is not supported (00000000-0000-0000-0000-000000000000).
  88807. func (c *OrganizationSecurityPoliciesInsertCall) RequestId(requestId string) *OrganizationSecurityPoliciesInsertCall {
  88808. c.urlParams_.Set("requestId", requestId)
  88809. return c
  88810. }
  88811. // Fields allows partial responses to be retrieved. See
  88812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88813. // for more information.
  88814. func (c *OrganizationSecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesInsertCall {
  88815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88816. return c
  88817. }
  88818. // Context sets the context to be used in this call's Do method. Any
  88819. // pending HTTP request will be aborted if the provided context is
  88820. // canceled.
  88821. func (c *OrganizationSecurityPoliciesInsertCall) Context(ctx context.Context) *OrganizationSecurityPoliciesInsertCall {
  88822. c.ctx_ = ctx
  88823. return c
  88824. }
  88825. // Header returns an http.Header that can be modified by the caller to
  88826. // add HTTP headers to the request.
  88827. func (c *OrganizationSecurityPoliciesInsertCall) Header() http.Header {
  88828. if c.header_ == nil {
  88829. c.header_ = make(http.Header)
  88830. }
  88831. return c.header_
  88832. }
  88833. func (c *OrganizationSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  88834. reqHeaders := make(http.Header)
  88835. for k, v := range c.header_ {
  88836. reqHeaders[k] = v
  88837. }
  88838. reqHeaders.Set("User-Agent", c.s.userAgent())
  88839. var body io.Reader = nil
  88840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  88841. if err != nil {
  88842. return nil, err
  88843. }
  88844. reqHeaders.Set("Content-Type", "application/json")
  88845. c.urlParams_.Set("alt", alt)
  88846. c.urlParams_.Set("prettyPrint", "false")
  88847. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  88848. urls += "?" + c.urlParams_.Encode()
  88849. req, err := http.NewRequest("POST", urls, body)
  88850. if err != nil {
  88851. return nil, err
  88852. }
  88853. req.Header = reqHeaders
  88854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88855. }
  88856. // Do executes the "compute.organizationSecurityPolicies.insert" call.
  88857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88858. // status code is an error. Response headers are in either
  88859. // *Operation.ServerResponse.Header or (if a response was returned at
  88860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88861. // to check whether the returned error was because
  88862. // http.StatusNotModified was returned.
  88863. func (c *OrganizationSecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88864. gensupport.SetOptions(c.urlParams_, opts...)
  88865. res, err := c.doRequest("json")
  88866. if res != nil && res.StatusCode == http.StatusNotModified {
  88867. if res.Body != nil {
  88868. res.Body.Close()
  88869. }
  88870. return nil, &googleapi.Error{
  88871. Code: res.StatusCode,
  88872. Header: res.Header,
  88873. }
  88874. }
  88875. if err != nil {
  88876. return nil, err
  88877. }
  88878. defer googleapi.CloseBody(res)
  88879. if err := googleapi.CheckResponse(res); err != nil {
  88880. return nil, err
  88881. }
  88882. ret := &Operation{
  88883. ServerResponse: googleapi.ServerResponse{
  88884. Header: res.Header,
  88885. HTTPStatusCode: res.StatusCode,
  88886. },
  88887. }
  88888. target := &ret
  88889. if err := gensupport.DecodeResponse(target, res); err != nil {
  88890. return nil, err
  88891. }
  88892. return ret, nil
  88893. // {
  88894. // "description": "Creates a new policy in the specified project using the data included in the request.",
  88895. // "httpMethod": "POST",
  88896. // "id": "compute.organizationSecurityPolicies.insert",
  88897. // "parameters": {
  88898. // "parentId": {
  88899. // "description": "Parent ID for this request.",
  88900. // "location": "query",
  88901. // "type": "string"
  88902. // },
  88903. // "requestId": {
  88904. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88905. // "location": "query",
  88906. // "type": "string"
  88907. // }
  88908. // },
  88909. // "path": "locations/global/securityPolicies",
  88910. // "request": {
  88911. // "$ref": "SecurityPolicy"
  88912. // },
  88913. // "response": {
  88914. // "$ref": "Operation"
  88915. // },
  88916. // "scopes": [
  88917. // "https://www.googleapis.com/auth/cloud-platform",
  88918. // "https://www.googleapis.com/auth/compute"
  88919. // ]
  88920. // }
  88921. }
  88922. // method id "compute.organizationSecurityPolicies.list":
  88923. type OrganizationSecurityPoliciesListCall struct {
  88924. s *Service
  88925. urlParams_ gensupport.URLParams
  88926. ifNoneMatch_ string
  88927. ctx_ context.Context
  88928. header_ http.Header
  88929. }
  88930. // List: List all the policies that have been configured for the
  88931. // specified project.
  88932. func (r *OrganizationSecurityPoliciesService) List() *OrganizationSecurityPoliciesListCall {
  88933. c := &OrganizationSecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88934. return c
  88935. }
  88936. // Filter sets the optional parameter "filter": A filter expression that
  88937. // filters resources listed in the response. The expression must specify
  88938. // the field name, a comparison operator, and the value that you want to
  88939. // use for filtering. The value must be a string, a number, or a
  88940. // boolean. The comparison operator must be either =, !=, >, or <.
  88941. //
  88942. // For example, if you are filtering Compute Engine instances, you can
  88943. // exclude instances named example-instance by specifying name !=
  88944. // example-instance.
  88945. //
  88946. // You can also filter nested fields. For example, you could specify
  88947. // scheduling.automaticRestart = false to include instances only if they
  88948. // are not scheduled for automatic restarts. You can use filtering on
  88949. // nested fields to filter based on resource labels.
  88950. //
  88951. // To filter on multiple expressions, provide each separate expression
  88952. // within parentheses. For example, (scheduling.automaticRestart = true)
  88953. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88954. // AND expression. However, you can include AND and OR expressions
  88955. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88956. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88957. // true).
  88958. func (c *OrganizationSecurityPoliciesListCall) Filter(filter string) *OrganizationSecurityPoliciesListCall {
  88959. c.urlParams_.Set("filter", filter)
  88960. return c
  88961. }
  88962. // MaxResults sets the optional parameter "maxResults": The maximum
  88963. // number of results per page that should be returned. If the number of
  88964. // available results is larger than maxResults, Compute Engine returns a
  88965. // nextPageToken that can be used to get the next page of results in
  88966. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88967. // (Default: 500)
  88968. func (c *OrganizationSecurityPoliciesListCall) MaxResults(maxResults int64) *OrganizationSecurityPoliciesListCall {
  88969. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88970. return c
  88971. }
  88972. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88973. // a certain order. By default, results are returned in alphanumerical
  88974. // order based on the resource name.
  88975. //
  88976. // You can also sort results in descending order based on the creation
  88977. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88978. // based on the creationTimestamp field in reverse chronological order
  88979. // (newest result first). Use this to sort resources like operations so
  88980. // that the newest operation is returned first.
  88981. //
  88982. // Currently, only sorting by name or creationTimestamp desc is
  88983. // supported.
  88984. func (c *OrganizationSecurityPoliciesListCall) OrderBy(orderBy string) *OrganizationSecurityPoliciesListCall {
  88985. c.urlParams_.Set("orderBy", orderBy)
  88986. return c
  88987. }
  88988. // PageToken sets the optional parameter "pageToken": Specifies a page
  88989. // token to use. Set pageToken to the nextPageToken returned by a
  88990. // previous list request to get the next page of results.
  88991. func (c *OrganizationSecurityPoliciesListCall) PageToken(pageToken string) *OrganizationSecurityPoliciesListCall {
  88992. c.urlParams_.Set("pageToken", pageToken)
  88993. return c
  88994. }
  88995. // ParentId sets the optional parameter "parentId": Parent ID for this
  88996. // request.
  88997. func (c *OrganizationSecurityPoliciesListCall) ParentId(parentId string) *OrganizationSecurityPoliciesListCall {
  88998. c.urlParams_.Set("parentId", parentId)
  88999. return c
  89000. }
  89001. // Fields allows partial responses to be retrieved. See
  89002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89003. // for more information.
  89004. func (c *OrganizationSecurityPoliciesListCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesListCall {
  89005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89006. return c
  89007. }
  89008. // IfNoneMatch sets the optional parameter which makes the operation
  89009. // fail if the object's ETag matches the given value. This is useful for
  89010. // getting updates only after the object has changed since the last
  89011. // request. Use googleapi.IsNotModified to check whether the response
  89012. // error from Do is the result of In-None-Match.
  89013. func (c *OrganizationSecurityPoliciesListCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesListCall {
  89014. c.ifNoneMatch_ = entityTag
  89015. return c
  89016. }
  89017. // Context sets the context to be used in this call's Do method. Any
  89018. // pending HTTP request will be aborted if the provided context is
  89019. // canceled.
  89020. func (c *OrganizationSecurityPoliciesListCall) Context(ctx context.Context) *OrganizationSecurityPoliciesListCall {
  89021. c.ctx_ = ctx
  89022. return c
  89023. }
  89024. // Header returns an http.Header that can be modified by the caller to
  89025. // add HTTP headers to the request.
  89026. func (c *OrganizationSecurityPoliciesListCall) Header() http.Header {
  89027. if c.header_ == nil {
  89028. c.header_ = make(http.Header)
  89029. }
  89030. return c.header_
  89031. }
  89032. func (c *OrganizationSecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  89033. reqHeaders := make(http.Header)
  89034. for k, v := range c.header_ {
  89035. reqHeaders[k] = v
  89036. }
  89037. reqHeaders.Set("User-Agent", c.s.userAgent())
  89038. if c.ifNoneMatch_ != "" {
  89039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89040. }
  89041. var body io.Reader = nil
  89042. c.urlParams_.Set("alt", alt)
  89043. c.urlParams_.Set("prettyPrint", "false")
  89044. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  89045. urls += "?" + c.urlParams_.Encode()
  89046. req, err := http.NewRequest("GET", urls, body)
  89047. if err != nil {
  89048. return nil, err
  89049. }
  89050. req.Header = reqHeaders
  89051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89052. }
  89053. // Do executes the "compute.organizationSecurityPolicies.list" call.
  89054. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  89055. // non-2xx status code is an error. Response headers are in either
  89056. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  89057. // returned at all) in error.(*googleapi.Error).Header. Use
  89058. // googleapi.IsNotModified to check whether the returned error was
  89059. // because http.StatusNotModified was returned.
  89060. func (c *OrganizationSecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  89061. gensupport.SetOptions(c.urlParams_, opts...)
  89062. res, err := c.doRequest("json")
  89063. if res != nil && res.StatusCode == http.StatusNotModified {
  89064. if res.Body != nil {
  89065. res.Body.Close()
  89066. }
  89067. return nil, &googleapi.Error{
  89068. Code: res.StatusCode,
  89069. Header: res.Header,
  89070. }
  89071. }
  89072. if err != nil {
  89073. return nil, err
  89074. }
  89075. defer googleapi.CloseBody(res)
  89076. if err := googleapi.CheckResponse(res); err != nil {
  89077. return nil, err
  89078. }
  89079. ret := &SecurityPolicyList{
  89080. ServerResponse: googleapi.ServerResponse{
  89081. Header: res.Header,
  89082. HTTPStatusCode: res.StatusCode,
  89083. },
  89084. }
  89085. target := &ret
  89086. if err := gensupport.DecodeResponse(target, res); err != nil {
  89087. return nil, err
  89088. }
  89089. return ret, nil
  89090. // {
  89091. // "description": "List all the policies that have been configured for the specified project.",
  89092. // "httpMethod": "GET",
  89093. // "id": "compute.organizationSecurityPolicies.list",
  89094. // "parameters": {
  89095. // "filter": {
  89096. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  89097. // "location": "query",
  89098. // "type": "string"
  89099. // },
  89100. // "maxResults": {
  89101. // "default": "500",
  89102. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  89103. // "format": "uint32",
  89104. // "location": "query",
  89105. // "minimum": "0",
  89106. // "type": "integer"
  89107. // },
  89108. // "orderBy": {
  89109. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  89110. // "location": "query",
  89111. // "type": "string"
  89112. // },
  89113. // "pageToken": {
  89114. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  89115. // "location": "query",
  89116. // "type": "string"
  89117. // },
  89118. // "parentId": {
  89119. // "description": "Parent ID for this request.",
  89120. // "location": "query",
  89121. // "type": "string"
  89122. // }
  89123. // },
  89124. // "path": "locations/global/securityPolicies",
  89125. // "response": {
  89126. // "$ref": "SecurityPolicyList"
  89127. // },
  89128. // "scopes": [
  89129. // "https://www.googleapis.com/auth/cloud-platform",
  89130. // "https://www.googleapis.com/auth/compute",
  89131. // "https://www.googleapis.com/auth/compute.readonly"
  89132. // ]
  89133. // }
  89134. }
  89135. // Pages invokes f for each page of results.
  89136. // A non-nil error returned from f will halt the iteration.
  89137. // The provided context supersedes any context provided to the Context method.
  89138. func (c *OrganizationSecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  89139. c.ctx_ = ctx
  89140. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89141. for {
  89142. x, err := c.Do()
  89143. if err != nil {
  89144. return err
  89145. }
  89146. if err := f(x); err != nil {
  89147. return err
  89148. }
  89149. if x.NextPageToken == "" {
  89150. return nil
  89151. }
  89152. c.PageToken(x.NextPageToken)
  89153. }
  89154. }
  89155. // method id "compute.organizationSecurityPolicies.patchRule":
  89156. type OrganizationSecurityPoliciesPatchRuleCall struct {
  89157. s *Service
  89158. securityPolicy string
  89159. securitypolicyrule *SecurityPolicyRule
  89160. urlParams_ gensupport.URLParams
  89161. ctx_ context.Context
  89162. header_ http.Header
  89163. }
  89164. // PatchRule: Patches a rule at the specified priority.
  89165. func (r *OrganizationSecurityPoliciesService) PatchRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesPatchRuleCall {
  89166. c := &OrganizationSecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89167. c.securityPolicy = securityPolicy
  89168. c.securitypolicyrule = securitypolicyrule
  89169. return c
  89170. }
  89171. // Priority sets the optional parameter "priority": The priority of the
  89172. // rule to patch.
  89173. func (c *OrganizationSecurityPoliciesPatchRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesPatchRuleCall {
  89174. c.urlParams_.Set("priority", fmt.Sprint(priority))
  89175. return c
  89176. }
  89177. // RequestId sets the optional parameter "requestId": An optional
  89178. // request ID to identify requests. Specify a unique request ID so that
  89179. // if you must retry your request, the server will know to ignore the
  89180. // request if it has already been completed.
  89181. //
  89182. // For example, consider a situation where you make an initial request
  89183. // and the request times out. If you make the request again with the
  89184. // same request ID, the server can check if original operation with the
  89185. // same request ID was received, and if so, will ignore the second
  89186. // request. This prevents clients from accidentally creating duplicate
  89187. // commitments.
  89188. //
  89189. // The request ID must be a valid UUID with the exception that zero UUID
  89190. // is not supported (00000000-0000-0000-0000-000000000000).
  89191. func (c *OrganizationSecurityPoliciesPatchRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesPatchRuleCall {
  89192. c.urlParams_.Set("requestId", requestId)
  89193. return c
  89194. }
  89195. // Fields allows partial responses to be retrieved. See
  89196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89197. // for more information.
  89198. func (c *OrganizationSecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesPatchRuleCall {
  89199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89200. return c
  89201. }
  89202. // Context sets the context to be used in this call's Do method. Any
  89203. // pending HTTP request will be aborted if the provided context is
  89204. // canceled.
  89205. func (c *OrganizationSecurityPoliciesPatchRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesPatchRuleCall {
  89206. c.ctx_ = ctx
  89207. return c
  89208. }
  89209. // Header returns an http.Header that can be modified by the caller to
  89210. // add HTTP headers to the request.
  89211. func (c *OrganizationSecurityPoliciesPatchRuleCall) Header() http.Header {
  89212. if c.header_ == nil {
  89213. c.header_ = make(http.Header)
  89214. }
  89215. return c.header_
  89216. }
  89217. func (c *OrganizationSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  89218. reqHeaders := make(http.Header)
  89219. for k, v := range c.header_ {
  89220. reqHeaders[k] = v
  89221. }
  89222. reqHeaders.Set("User-Agent", c.s.userAgent())
  89223. var body io.Reader = nil
  89224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  89225. if err != nil {
  89226. return nil, err
  89227. }
  89228. reqHeaders.Set("Content-Type", "application/json")
  89229. c.urlParams_.Set("alt", alt)
  89230. c.urlParams_.Set("prettyPrint", "false")
  89231. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/patchRule")
  89232. urls += "?" + c.urlParams_.Encode()
  89233. req, err := http.NewRequest("POST", urls, body)
  89234. if err != nil {
  89235. return nil, err
  89236. }
  89237. req.Header = reqHeaders
  89238. googleapi.Expand(req.URL, map[string]string{
  89239. "securityPolicy": c.securityPolicy,
  89240. })
  89241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89242. }
  89243. // Do executes the "compute.organizationSecurityPolicies.patchRule" call.
  89244. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89245. // status code is an error. Response headers are in either
  89246. // *Operation.ServerResponse.Header or (if a response was returned at
  89247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89248. // to check whether the returned error was because
  89249. // http.StatusNotModified was returned.
  89250. func (c *OrganizationSecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89251. gensupport.SetOptions(c.urlParams_, opts...)
  89252. res, err := c.doRequest("json")
  89253. if res != nil && res.StatusCode == http.StatusNotModified {
  89254. if res.Body != nil {
  89255. res.Body.Close()
  89256. }
  89257. return nil, &googleapi.Error{
  89258. Code: res.StatusCode,
  89259. Header: res.Header,
  89260. }
  89261. }
  89262. if err != nil {
  89263. return nil, err
  89264. }
  89265. defer googleapi.CloseBody(res)
  89266. if err := googleapi.CheckResponse(res); err != nil {
  89267. return nil, err
  89268. }
  89269. ret := &Operation{
  89270. ServerResponse: googleapi.ServerResponse{
  89271. Header: res.Header,
  89272. HTTPStatusCode: res.StatusCode,
  89273. },
  89274. }
  89275. target := &ret
  89276. if err := gensupport.DecodeResponse(target, res); err != nil {
  89277. return nil, err
  89278. }
  89279. return ret, nil
  89280. // {
  89281. // "description": "Patches a rule at the specified priority.",
  89282. // "httpMethod": "POST",
  89283. // "id": "compute.organizationSecurityPolicies.patchRule",
  89284. // "parameterOrder": [
  89285. // "securityPolicy"
  89286. // ],
  89287. // "parameters": {
  89288. // "priority": {
  89289. // "description": "The priority of the rule to patch.",
  89290. // "format": "int32",
  89291. // "location": "query",
  89292. // "type": "integer"
  89293. // },
  89294. // "requestId": {
  89295. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89296. // "location": "query",
  89297. // "type": "string"
  89298. // },
  89299. // "securityPolicy": {
  89300. // "description": "Name of the security policy to update.",
  89301. // "location": "path",
  89302. // "pattern": "[0-9]{0,20}",
  89303. // "required": true,
  89304. // "type": "string"
  89305. // }
  89306. // },
  89307. // "path": "locations/global/securityPolicies/{securityPolicy}/patchRule",
  89308. // "request": {
  89309. // "$ref": "SecurityPolicyRule"
  89310. // },
  89311. // "response": {
  89312. // "$ref": "Operation"
  89313. // },
  89314. // "scopes": [
  89315. // "https://www.googleapis.com/auth/cloud-platform",
  89316. // "https://www.googleapis.com/auth/compute"
  89317. // ]
  89318. // }
  89319. }
  89320. // method id "compute.organizationSecurityPolicies.removeAssociation":
  89321. type OrganizationSecurityPoliciesRemoveAssociationCall struct {
  89322. s *Service
  89323. securityPolicy string
  89324. urlParams_ gensupport.URLParams
  89325. ctx_ context.Context
  89326. header_ http.Header
  89327. }
  89328. // RemoveAssociation: Removes an association for the specified security
  89329. // policy.
  89330. func (r *OrganizationSecurityPoliciesService) RemoveAssociation(securityPolicy string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  89331. c := &OrganizationSecurityPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89332. c.securityPolicy = securityPolicy
  89333. return c
  89334. }
  89335. // Name sets the optional parameter "name": Name for the attachment that
  89336. // will be removed.
  89337. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Name(name string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  89338. c.urlParams_.Set("name", name)
  89339. return c
  89340. }
  89341. // RequestId sets the optional parameter "requestId": An optional
  89342. // request ID to identify requests. Specify a unique request ID so that
  89343. // if you must retry your request, the server will know to ignore the
  89344. // request if it has already been completed.
  89345. //
  89346. // For example, consider a situation where you make an initial request
  89347. // and the request times out. If you make the request again with the
  89348. // same request ID, the server can check if original operation with the
  89349. // same request ID was received, and if so, will ignore the second
  89350. // request. This prevents clients from accidentally creating duplicate
  89351. // commitments.
  89352. //
  89353. // The request ID must be a valid UUID with the exception that zero UUID
  89354. // is not supported (00000000-0000-0000-0000-000000000000).
  89355. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  89356. c.urlParams_.Set("requestId", requestId)
  89357. return c
  89358. }
  89359. // Fields allows partial responses to be retrieved. See
  89360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89361. // for more information.
  89362. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveAssociationCall {
  89363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89364. return c
  89365. }
  89366. // Context sets the context to be used in this call's Do method. Any
  89367. // pending HTTP request will be aborted if the provided context is
  89368. // canceled.
  89369. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveAssociationCall {
  89370. c.ctx_ = ctx
  89371. return c
  89372. }
  89373. // Header returns an http.Header that can be modified by the caller to
  89374. // add HTTP headers to the request.
  89375. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Header() http.Header {
  89376. if c.header_ == nil {
  89377. c.header_ = make(http.Header)
  89378. }
  89379. return c.header_
  89380. }
  89381. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
  89382. reqHeaders := make(http.Header)
  89383. for k, v := range c.header_ {
  89384. reqHeaders[k] = v
  89385. }
  89386. reqHeaders.Set("User-Agent", c.s.userAgent())
  89387. var body io.Reader = nil
  89388. c.urlParams_.Set("alt", alt)
  89389. c.urlParams_.Set("prettyPrint", "false")
  89390. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeAssociation")
  89391. urls += "?" + c.urlParams_.Encode()
  89392. req, err := http.NewRequest("POST", urls, body)
  89393. if err != nil {
  89394. return nil, err
  89395. }
  89396. req.Header = reqHeaders
  89397. googleapi.Expand(req.URL, map[string]string{
  89398. "securityPolicy": c.securityPolicy,
  89399. })
  89400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89401. }
  89402. // Do executes the "compute.organizationSecurityPolicies.removeAssociation" call.
  89403. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89404. // status code is an error. Response headers are in either
  89405. // *Operation.ServerResponse.Header or (if a response was returned at
  89406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89407. // to check whether the returned error was because
  89408. // http.StatusNotModified was returned.
  89409. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89410. gensupport.SetOptions(c.urlParams_, opts...)
  89411. res, err := c.doRequest("json")
  89412. if res != nil && res.StatusCode == http.StatusNotModified {
  89413. if res.Body != nil {
  89414. res.Body.Close()
  89415. }
  89416. return nil, &googleapi.Error{
  89417. Code: res.StatusCode,
  89418. Header: res.Header,
  89419. }
  89420. }
  89421. if err != nil {
  89422. return nil, err
  89423. }
  89424. defer googleapi.CloseBody(res)
  89425. if err := googleapi.CheckResponse(res); err != nil {
  89426. return nil, err
  89427. }
  89428. ret := &Operation{
  89429. ServerResponse: googleapi.ServerResponse{
  89430. Header: res.Header,
  89431. HTTPStatusCode: res.StatusCode,
  89432. },
  89433. }
  89434. target := &ret
  89435. if err := gensupport.DecodeResponse(target, res); err != nil {
  89436. return nil, err
  89437. }
  89438. return ret, nil
  89439. // {
  89440. // "description": "Removes an association for the specified security policy.",
  89441. // "httpMethod": "POST",
  89442. // "id": "compute.organizationSecurityPolicies.removeAssociation",
  89443. // "parameterOrder": [
  89444. // "securityPolicy"
  89445. // ],
  89446. // "parameters": {
  89447. // "name": {
  89448. // "description": "Name for the attachment that will be removed.",
  89449. // "location": "query",
  89450. // "type": "string"
  89451. // },
  89452. // "requestId": {
  89453. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89454. // "location": "query",
  89455. // "type": "string"
  89456. // },
  89457. // "securityPolicy": {
  89458. // "description": "Name of the security policy to update.",
  89459. // "location": "path",
  89460. // "pattern": "[0-9]{0,20}",
  89461. // "required": true,
  89462. // "type": "string"
  89463. // }
  89464. // },
  89465. // "path": "locations/global/securityPolicies/{securityPolicy}/removeAssociation",
  89466. // "response": {
  89467. // "$ref": "Operation"
  89468. // },
  89469. // "scopes": [
  89470. // "https://www.googleapis.com/auth/cloud-platform",
  89471. // "https://www.googleapis.com/auth/compute"
  89472. // ]
  89473. // }
  89474. }
  89475. // method id "compute.organizationSecurityPolicies.removeRule":
  89476. type OrganizationSecurityPoliciesRemoveRuleCall struct {
  89477. s *Service
  89478. securityPolicy string
  89479. urlParams_ gensupport.URLParams
  89480. ctx_ context.Context
  89481. header_ http.Header
  89482. }
  89483. // RemoveRule: Deletes a rule at the specified priority.
  89484. func (r *OrganizationSecurityPoliciesService) RemoveRule(securityPolicy string) *OrganizationSecurityPoliciesRemoveRuleCall {
  89485. c := &OrganizationSecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89486. c.securityPolicy = securityPolicy
  89487. return c
  89488. }
  89489. // Priority sets the optional parameter "priority": The priority of the
  89490. // rule to remove from the security policy.
  89491. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesRemoveRuleCall {
  89492. c.urlParams_.Set("priority", fmt.Sprint(priority))
  89493. return c
  89494. }
  89495. // RequestId sets the optional parameter "requestId": An optional
  89496. // request ID to identify requests. Specify a unique request ID so that
  89497. // if you must retry your request, the server will know to ignore the
  89498. // request if it has already been completed.
  89499. //
  89500. // For example, consider a situation where you make an initial request
  89501. // and the request times out. If you make the request again with the
  89502. // same request ID, the server can check if original operation with the
  89503. // same request ID was received, and if so, will ignore the second
  89504. // request. This prevents clients from accidentally creating duplicate
  89505. // commitments.
  89506. //
  89507. // The request ID must be a valid UUID with the exception that zero UUID
  89508. // is not supported (00000000-0000-0000-0000-000000000000).
  89509. func (c *OrganizationSecurityPoliciesRemoveRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveRuleCall {
  89510. c.urlParams_.Set("requestId", requestId)
  89511. return c
  89512. }
  89513. // Fields allows partial responses to be retrieved. See
  89514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89515. // for more information.
  89516. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveRuleCall {
  89517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89518. return c
  89519. }
  89520. // Context sets the context to be used in this call's Do method. Any
  89521. // pending HTTP request will be aborted if the provided context is
  89522. // canceled.
  89523. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveRuleCall {
  89524. c.ctx_ = ctx
  89525. return c
  89526. }
  89527. // Header returns an http.Header that can be modified by the caller to
  89528. // add HTTP headers to the request.
  89529. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Header() http.Header {
  89530. if c.header_ == nil {
  89531. c.header_ = make(http.Header)
  89532. }
  89533. return c.header_
  89534. }
  89535. func (c *OrganizationSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  89536. reqHeaders := make(http.Header)
  89537. for k, v := range c.header_ {
  89538. reqHeaders[k] = v
  89539. }
  89540. reqHeaders.Set("User-Agent", c.s.userAgent())
  89541. var body io.Reader = nil
  89542. c.urlParams_.Set("alt", alt)
  89543. c.urlParams_.Set("prettyPrint", "false")
  89544. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeRule")
  89545. urls += "?" + c.urlParams_.Encode()
  89546. req, err := http.NewRequest("POST", urls, body)
  89547. if err != nil {
  89548. return nil, err
  89549. }
  89550. req.Header = reqHeaders
  89551. googleapi.Expand(req.URL, map[string]string{
  89552. "securityPolicy": c.securityPolicy,
  89553. })
  89554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89555. }
  89556. // Do executes the "compute.organizationSecurityPolicies.removeRule" call.
  89557. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89558. // status code is an error. Response headers are in either
  89559. // *Operation.ServerResponse.Header or (if a response was returned at
  89560. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89561. // to check whether the returned error was because
  89562. // http.StatusNotModified was returned.
  89563. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89564. gensupport.SetOptions(c.urlParams_, opts...)
  89565. res, err := c.doRequest("json")
  89566. if res != nil && res.StatusCode == http.StatusNotModified {
  89567. if res.Body != nil {
  89568. res.Body.Close()
  89569. }
  89570. return nil, &googleapi.Error{
  89571. Code: res.StatusCode,
  89572. Header: res.Header,
  89573. }
  89574. }
  89575. if err != nil {
  89576. return nil, err
  89577. }
  89578. defer googleapi.CloseBody(res)
  89579. if err := googleapi.CheckResponse(res); err != nil {
  89580. return nil, err
  89581. }
  89582. ret := &Operation{
  89583. ServerResponse: googleapi.ServerResponse{
  89584. Header: res.Header,
  89585. HTTPStatusCode: res.StatusCode,
  89586. },
  89587. }
  89588. target := &ret
  89589. if err := gensupport.DecodeResponse(target, res); err != nil {
  89590. return nil, err
  89591. }
  89592. return ret, nil
  89593. // {
  89594. // "description": "Deletes a rule at the specified priority.",
  89595. // "httpMethod": "POST",
  89596. // "id": "compute.organizationSecurityPolicies.removeRule",
  89597. // "parameterOrder": [
  89598. // "securityPolicy"
  89599. // ],
  89600. // "parameters": {
  89601. // "priority": {
  89602. // "description": "The priority of the rule to remove from the security policy.",
  89603. // "format": "int32",
  89604. // "location": "query",
  89605. // "type": "integer"
  89606. // },
  89607. // "requestId": {
  89608. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89609. // "location": "query",
  89610. // "type": "string"
  89611. // },
  89612. // "securityPolicy": {
  89613. // "description": "Name of the security policy to update.",
  89614. // "location": "path",
  89615. // "pattern": "[0-9]{0,20}",
  89616. // "required": true,
  89617. // "type": "string"
  89618. // }
  89619. // },
  89620. // "path": "locations/global/securityPolicies/{securityPolicy}/removeRule",
  89621. // "response": {
  89622. // "$ref": "Operation"
  89623. // },
  89624. // "scopes": [
  89625. // "https://www.googleapis.com/auth/cloud-platform",
  89626. // "https://www.googleapis.com/auth/compute"
  89627. // ]
  89628. // }
  89629. }
  89630. // method id "compute.projects.disableXpnHost":
  89631. type ProjectsDisableXpnHostCall struct {
  89632. s *Service
  89633. project string
  89634. urlParams_ gensupport.URLParams
  89635. ctx_ context.Context
  89636. header_ http.Header
  89637. }
  89638. // DisableXpnHost: Disable this project as a shared VPC host project.
  89639. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  89640. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89641. c.project = project
  89642. return c
  89643. }
  89644. // RequestId sets the optional parameter "requestId": An optional
  89645. // request ID to identify requests. Specify a unique request ID so that
  89646. // if you must retry your request, the server will know to ignore the
  89647. // request if it has already been completed.
  89648. //
  89649. // For example, consider a situation where you make an initial request
  89650. // and the request times out. If you make the request again with the
  89651. // same request ID, the server can check if original operation with the
  89652. // same request ID was received, and if so, will ignore the second
  89653. // request. This prevents clients from accidentally creating duplicate
  89654. // commitments.
  89655. //
  89656. // The request ID must be a valid UUID with the exception that zero UUID
  89657. // is not supported (00000000-0000-0000-0000-000000000000).
  89658. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  89659. c.urlParams_.Set("requestId", requestId)
  89660. return c
  89661. }
  89662. // Fields allows partial responses to be retrieved. See
  89663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89664. // for more information.
  89665. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  89666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89667. return c
  89668. }
  89669. // Context sets the context to be used in this call's Do method. Any
  89670. // pending HTTP request will be aborted if the provided context is
  89671. // canceled.
  89672. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  89673. c.ctx_ = ctx
  89674. return c
  89675. }
  89676. // Header returns an http.Header that can be modified by the caller to
  89677. // add HTTP headers to the request.
  89678. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  89679. if c.header_ == nil {
  89680. c.header_ = make(http.Header)
  89681. }
  89682. return c.header_
  89683. }
  89684. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  89685. reqHeaders := make(http.Header)
  89686. for k, v := range c.header_ {
  89687. reqHeaders[k] = v
  89688. }
  89689. reqHeaders.Set("User-Agent", c.s.userAgent())
  89690. var body io.Reader = nil
  89691. c.urlParams_.Set("alt", alt)
  89692. c.urlParams_.Set("prettyPrint", "false")
  89693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  89694. urls += "?" + c.urlParams_.Encode()
  89695. req, err := http.NewRequest("POST", urls, body)
  89696. if err != nil {
  89697. return nil, err
  89698. }
  89699. req.Header = reqHeaders
  89700. googleapi.Expand(req.URL, map[string]string{
  89701. "project": c.project,
  89702. })
  89703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89704. }
  89705. // Do executes the "compute.projects.disableXpnHost" call.
  89706. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89707. // status code is an error. Response headers are in either
  89708. // *Operation.ServerResponse.Header or (if a response was returned at
  89709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89710. // to check whether the returned error was because
  89711. // http.StatusNotModified was returned.
  89712. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89713. gensupport.SetOptions(c.urlParams_, opts...)
  89714. res, err := c.doRequest("json")
  89715. if res != nil && res.StatusCode == http.StatusNotModified {
  89716. if res.Body != nil {
  89717. res.Body.Close()
  89718. }
  89719. return nil, &googleapi.Error{
  89720. Code: res.StatusCode,
  89721. Header: res.Header,
  89722. }
  89723. }
  89724. if err != nil {
  89725. return nil, err
  89726. }
  89727. defer googleapi.CloseBody(res)
  89728. if err := googleapi.CheckResponse(res); err != nil {
  89729. return nil, err
  89730. }
  89731. ret := &Operation{
  89732. ServerResponse: googleapi.ServerResponse{
  89733. Header: res.Header,
  89734. HTTPStatusCode: res.StatusCode,
  89735. },
  89736. }
  89737. target := &ret
  89738. if err := gensupport.DecodeResponse(target, res); err != nil {
  89739. return nil, err
  89740. }
  89741. return ret, nil
  89742. // {
  89743. // "description": "Disable this project as a shared VPC host project.",
  89744. // "httpMethod": "POST",
  89745. // "id": "compute.projects.disableXpnHost",
  89746. // "parameterOrder": [
  89747. // "project"
  89748. // ],
  89749. // "parameters": {
  89750. // "project": {
  89751. // "description": "Project ID for this request.",
  89752. // "location": "path",
  89753. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89754. // "required": true,
  89755. // "type": "string"
  89756. // },
  89757. // "requestId": {
  89758. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89759. // "location": "query",
  89760. // "type": "string"
  89761. // }
  89762. // },
  89763. // "path": "{project}/disableXpnHost",
  89764. // "response": {
  89765. // "$ref": "Operation"
  89766. // },
  89767. // "scopes": [
  89768. // "https://www.googleapis.com/auth/cloud-platform",
  89769. // "https://www.googleapis.com/auth/compute"
  89770. // ]
  89771. // }
  89772. }
  89773. // method id "compute.projects.disableXpnResource":
  89774. type ProjectsDisableXpnResourceCall struct {
  89775. s *Service
  89776. project string
  89777. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  89778. urlParams_ gensupport.URLParams
  89779. ctx_ context.Context
  89780. header_ http.Header
  89781. }
  89782. // DisableXpnResource: Disable a serivce resource (a.k.a service
  89783. // project) associated with this host project.
  89784. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  89785. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89786. c.project = project
  89787. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  89788. return c
  89789. }
  89790. // RequestId sets the optional parameter "requestId": An optional
  89791. // request ID to identify requests. Specify a unique request ID so that
  89792. // if you must retry your request, the server will know to ignore the
  89793. // request if it has already been completed.
  89794. //
  89795. // For example, consider a situation where you make an initial request
  89796. // and the request times out. If you make the request again with the
  89797. // same request ID, the server can check if original operation with the
  89798. // same request ID was received, and if so, will ignore the second
  89799. // request. This prevents clients from accidentally creating duplicate
  89800. // commitments.
  89801. //
  89802. // The request ID must be a valid UUID with the exception that zero UUID
  89803. // is not supported (00000000-0000-0000-0000-000000000000).
  89804. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  89805. c.urlParams_.Set("requestId", requestId)
  89806. return c
  89807. }
  89808. // Fields allows partial responses to be retrieved. See
  89809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89810. // for more information.
  89811. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  89812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89813. return c
  89814. }
  89815. // Context sets the context to be used in this call's Do method. Any
  89816. // pending HTTP request will be aborted if the provided context is
  89817. // canceled.
  89818. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  89819. c.ctx_ = ctx
  89820. return c
  89821. }
  89822. // Header returns an http.Header that can be modified by the caller to
  89823. // add HTTP headers to the request.
  89824. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  89825. if c.header_ == nil {
  89826. c.header_ = make(http.Header)
  89827. }
  89828. return c.header_
  89829. }
  89830. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  89831. reqHeaders := make(http.Header)
  89832. for k, v := range c.header_ {
  89833. reqHeaders[k] = v
  89834. }
  89835. reqHeaders.Set("User-Agent", c.s.userAgent())
  89836. var body io.Reader = nil
  89837. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  89838. if err != nil {
  89839. return nil, err
  89840. }
  89841. reqHeaders.Set("Content-Type", "application/json")
  89842. c.urlParams_.Set("alt", alt)
  89843. c.urlParams_.Set("prettyPrint", "false")
  89844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  89845. urls += "?" + c.urlParams_.Encode()
  89846. req, err := http.NewRequest("POST", urls, body)
  89847. if err != nil {
  89848. return nil, err
  89849. }
  89850. req.Header = reqHeaders
  89851. googleapi.Expand(req.URL, map[string]string{
  89852. "project": c.project,
  89853. })
  89854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89855. }
  89856. // Do executes the "compute.projects.disableXpnResource" call.
  89857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89858. // status code is an error. Response headers are in either
  89859. // *Operation.ServerResponse.Header or (if a response was returned at
  89860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89861. // to check whether the returned error was because
  89862. // http.StatusNotModified was returned.
  89863. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89864. gensupport.SetOptions(c.urlParams_, opts...)
  89865. res, err := c.doRequest("json")
  89866. if res != nil && res.StatusCode == http.StatusNotModified {
  89867. if res.Body != nil {
  89868. res.Body.Close()
  89869. }
  89870. return nil, &googleapi.Error{
  89871. Code: res.StatusCode,
  89872. Header: res.Header,
  89873. }
  89874. }
  89875. if err != nil {
  89876. return nil, err
  89877. }
  89878. defer googleapi.CloseBody(res)
  89879. if err := googleapi.CheckResponse(res); err != nil {
  89880. return nil, err
  89881. }
  89882. ret := &Operation{
  89883. ServerResponse: googleapi.ServerResponse{
  89884. Header: res.Header,
  89885. HTTPStatusCode: res.StatusCode,
  89886. },
  89887. }
  89888. target := &ret
  89889. if err := gensupport.DecodeResponse(target, res); err != nil {
  89890. return nil, err
  89891. }
  89892. return ret, nil
  89893. // {
  89894. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  89895. // "httpMethod": "POST",
  89896. // "id": "compute.projects.disableXpnResource",
  89897. // "parameterOrder": [
  89898. // "project"
  89899. // ],
  89900. // "parameters": {
  89901. // "project": {
  89902. // "description": "Project ID for this request.",
  89903. // "location": "path",
  89904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89905. // "required": true,
  89906. // "type": "string"
  89907. // },
  89908. // "requestId": {
  89909. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89910. // "location": "query",
  89911. // "type": "string"
  89912. // }
  89913. // },
  89914. // "path": "{project}/disableXpnResource",
  89915. // "request": {
  89916. // "$ref": "ProjectsDisableXpnResourceRequest"
  89917. // },
  89918. // "response": {
  89919. // "$ref": "Operation"
  89920. // },
  89921. // "scopes": [
  89922. // "https://www.googleapis.com/auth/cloud-platform",
  89923. // "https://www.googleapis.com/auth/compute"
  89924. // ]
  89925. // }
  89926. }
  89927. // method id "compute.projects.enableXpnHost":
  89928. type ProjectsEnableXpnHostCall struct {
  89929. s *Service
  89930. project string
  89931. urlParams_ gensupport.URLParams
  89932. ctx_ context.Context
  89933. header_ http.Header
  89934. }
  89935. // EnableXpnHost: Enable this project as a shared VPC host project.
  89936. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  89937. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89938. c.project = project
  89939. return c
  89940. }
  89941. // RequestId sets the optional parameter "requestId": An optional
  89942. // request ID to identify requests. Specify a unique request ID so that
  89943. // if you must retry your request, the server will know to ignore the
  89944. // request if it has already been completed.
  89945. //
  89946. // For example, consider a situation where you make an initial request
  89947. // and the request times out. If you make the request again with the
  89948. // same request ID, the server can check if original operation with the
  89949. // same request ID was received, and if so, will ignore the second
  89950. // request. This prevents clients from accidentally creating duplicate
  89951. // commitments.
  89952. //
  89953. // The request ID must be a valid UUID with the exception that zero UUID
  89954. // is not supported (00000000-0000-0000-0000-000000000000).
  89955. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  89956. c.urlParams_.Set("requestId", requestId)
  89957. return c
  89958. }
  89959. // Fields allows partial responses to be retrieved. See
  89960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89961. // for more information.
  89962. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  89963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89964. return c
  89965. }
  89966. // Context sets the context to be used in this call's Do method. Any
  89967. // pending HTTP request will be aborted if the provided context is
  89968. // canceled.
  89969. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  89970. c.ctx_ = ctx
  89971. return c
  89972. }
  89973. // Header returns an http.Header that can be modified by the caller to
  89974. // add HTTP headers to the request.
  89975. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  89976. if c.header_ == nil {
  89977. c.header_ = make(http.Header)
  89978. }
  89979. return c.header_
  89980. }
  89981. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  89982. reqHeaders := make(http.Header)
  89983. for k, v := range c.header_ {
  89984. reqHeaders[k] = v
  89985. }
  89986. reqHeaders.Set("User-Agent", c.s.userAgent())
  89987. var body io.Reader = nil
  89988. c.urlParams_.Set("alt", alt)
  89989. c.urlParams_.Set("prettyPrint", "false")
  89990. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  89991. urls += "?" + c.urlParams_.Encode()
  89992. req, err := http.NewRequest("POST", urls, body)
  89993. if err != nil {
  89994. return nil, err
  89995. }
  89996. req.Header = reqHeaders
  89997. googleapi.Expand(req.URL, map[string]string{
  89998. "project": c.project,
  89999. })
  90000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90001. }
  90002. // Do executes the "compute.projects.enableXpnHost" call.
  90003. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90004. // status code is an error. Response headers are in either
  90005. // *Operation.ServerResponse.Header or (if a response was returned at
  90006. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90007. // to check whether the returned error was because
  90008. // http.StatusNotModified was returned.
  90009. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90010. gensupport.SetOptions(c.urlParams_, opts...)
  90011. res, err := c.doRequest("json")
  90012. if res != nil && res.StatusCode == http.StatusNotModified {
  90013. if res.Body != nil {
  90014. res.Body.Close()
  90015. }
  90016. return nil, &googleapi.Error{
  90017. Code: res.StatusCode,
  90018. Header: res.Header,
  90019. }
  90020. }
  90021. if err != nil {
  90022. return nil, err
  90023. }
  90024. defer googleapi.CloseBody(res)
  90025. if err := googleapi.CheckResponse(res); err != nil {
  90026. return nil, err
  90027. }
  90028. ret := &Operation{
  90029. ServerResponse: googleapi.ServerResponse{
  90030. Header: res.Header,
  90031. HTTPStatusCode: res.StatusCode,
  90032. },
  90033. }
  90034. target := &ret
  90035. if err := gensupport.DecodeResponse(target, res); err != nil {
  90036. return nil, err
  90037. }
  90038. return ret, nil
  90039. // {
  90040. // "description": "Enable this project as a shared VPC host project.",
  90041. // "httpMethod": "POST",
  90042. // "id": "compute.projects.enableXpnHost",
  90043. // "parameterOrder": [
  90044. // "project"
  90045. // ],
  90046. // "parameters": {
  90047. // "project": {
  90048. // "description": "Project ID for this request.",
  90049. // "location": "path",
  90050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90051. // "required": true,
  90052. // "type": "string"
  90053. // },
  90054. // "requestId": {
  90055. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90056. // "location": "query",
  90057. // "type": "string"
  90058. // }
  90059. // },
  90060. // "path": "{project}/enableXpnHost",
  90061. // "response": {
  90062. // "$ref": "Operation"
  90063. // },
  90064. // "scopes": [
  90065. // "https://www.googleapis.com/auth/cloud-platform",
  90066. // "https://www.googleapis.com/auth/compute"
  90067. // ]
  90068. // }
  90069. }
  90070. // method id "compute.projects.enableXpnResource":
  90071. type ProjectsEnableXpnResourceCall struct {
  90072. s *Service
  90073. project string
  90074. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  90075. urlParams_ gensupport.URLParams
  90076. ctx_ context.Context
  90077. header_ http.Header
  90078. }
  90079. // EnableXpnResource: Enable service resource (a.k.a service project)
  90080. // for a host project, so that subnets in the host project can be used
  90081. // by instances in the service project.
  90082. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  90083. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90084. c.project = project
  90085. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  90086. return c
  90087. }
  90088. // RequestId sets the optional parameter "requestId": An optional
  90089. // request ID to identify requests. Specify a unique request ID so that
  90090. // if you must retry your request, the server will know to ignore the
  90091. // request if it has already been completed.
  90092. //
  90093. // For example, consider a situation where you make an initial request
  90094. // and the request times out. If you make the request again with the
  90095. // same request ID, the server can check if original operation with the
  90096. // same request ID was received, and if so, will ignore the second
  90097. // request. This prevents clients from accidentally creating duplicate
  90098. // commitments.
  90099. //
  90100. // The request ID must be a valid UUID with the exception that zero UUID
  90101. // is not supported (00000000-0000-0000-0000-000000000000).
  90102. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  90103. c.urlParams_.Set("requestId", requestId)
  90104. return c
  90105. }
  90106. // Fields allows partial responses to be retrieved. See
  90107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90108. // for more information.
  90109. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  90110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90111. return c
  90112. }
  90113. // Context sets the context to be used in this call's Do method. Any
  90114. // pending HTTP request will be aborted if the provided context is
  90115. // canceled.
  90116. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  90117. c.ctx_ = ctx
  90118. return c
  90119. }
  90120. // Header returns an http.Header that can be modified by the caller to
  90121. // add HTTP headers to the request.
  90122. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  90123. if c.header_ == nil {
  90124. c.header_ = make(http.Header)
  90125. }
  90126. return c.header_
  90127. }
  90128. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  90129. reqHeaders := make(http.Header)
  90130. for k, v := range c.header_ {
  90131. reqHeaders[k] = v
  90132. }
  90133. reqHeaders.Set("User-Agent", c.s.userAgent())
  90134. var body io.Reader = nil
  90135. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  90136. if err != nil {
  90137. return nil, err
  90138. }
  90139. reqHeaders.Set("Content-Type", "application/json")
  90140. c.urlParams_.Set("alt", alt)
  90141. c.urlParams_.Set("prettyPrint", "false")
  90142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  90143. urls += "?" + c.urlParams_.Encode()
  90144. req, err := http.NewRequest("POST", urls, body)
  90145. if err != nil {
  90146. return nil, err
  90147. }
  90148. req.Header = reqHeaders
  90149. googleapi.Expand(req.URL, map[string]string{
  90150. "project": c.project,
  90151. })
  90152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90153. }
  90154. // Do executes the "compute.projects.enableXpnResource" call.
  90155. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90156. // status code is an error. Response headers are in either
  90157. // *Operation.ServerResponse.Header or (if a response was returned at
  90158. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90159. // to check whether the returned error was because
  90160. // http.StatusNotModified was returned.
  90161. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90162. gensupport.SetOptions(c.urlParams_, opts...)
  90163. res, err := c.doRequest("json")
  90164. if res != nil && res.StatusCode == http.StatusNotModified {
  90165. if res.Body != nil {
  90166. res.Body.Close()
  90167. }
  90168. return nil, &googleapi.Error{
  90169. Code: res.StatusCode,
  90170. Header: res.Header,
  90171. }
  90172. }
  90173. if err != nil {
  90174. return nil, err
  90175. }
  90176. defer googleapi.CloseBody(res)
  90177. if err := googleapi.CheckResponse(res); err != nil {
  90178. return nil, err
  90179. }
  90180. ret := &Operation{
  90181. ServerResponse: googleapi.ServerResponse{
  90182. Header: res.Header,
  90183. HTTPStatusCode: res.StatusCode,
  90184. },
  90185. }
  90186. target := &ret
  90187. if err := gensupport.DecodeResponse(target, res); err != nil {
  90188. return nil, err
  90189. }
  90190. return ret, nil
  90191. // {
  90192. // "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.",
  90193. // "httpMethod": "POST",
  90194. // "id": "compute.projects.enableXpnResource",
  90195. // "parameterOrder": [
  90196. // "project"
  90197. // ],
  90198. // "parameters": {
  90199. // "project": {
  90200. // "description": "Project ID for this request.",
  90201. // "location": "path",
  90202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90203. // "required": true,
  90204. // "type": "string"
  90205. // },
  90206. // "requestId": {
  90207. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90208. // "location": "query",
  90209. // "type": "string"
  90210. // }
  90211. // },
  90212. // "path": "{project}/enableXpnResource",
  90213. // "request": {
  90214. // "$ref": "ProjectsEnableXpnResourceRequest"
  90215. // },
  90216. // "response": {
  90217. // "$ref": "Operation"
  90218. // },
  90219. // "scopes": [
  90220. // "https://www.googleapis.com/auth/cloud-platform",
  90221. // "https://www.googleapis.com/auth/compute"
  90222. // ]
  90223. // }
  90224. }
  90225. // method id "compute.projects.get":
  90226. type ProjectsGetCall struct {
  90227. s *Service
  90228. project string
  90229. urlParams_ gensupport.URLParams
  90230. ifNoneMatch_ string
  90231. ctx_ context.Context
  90232. header_ http.Header
  90233. }
  90234. // Get: Returns the specified Project resource.
  90235. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  90236. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  90237. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90238. c.project = project
  90239. return c
  90240. }
  90241. // Fields allows partial responses to be retrieved. See
  90242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90243. // for more information.
  90244. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  90245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90246. return c
  90247. }
  90248. // IfNoneMatch sets the optional parameter which makes the operation
  90249. // fail if the object's ETag matches the given value. This is useful for
  90250. // getting updates only after the object has changed since the last
  90251. // request. Use googleapi.IsNotModified to check whether the response
  90252. // error from Do is the result of In-None-Match.
  90253. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  90254. c.ifNoneMatch_ = entityTag
  90255. return c
  90256. }
  90257. // Context sets the context to be used in this call's Do method. Any
  90258. // pending HTTP request will be aborted if the provided context is
  90259. // canceled.
  90260. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  90261. c.ctx_ = ctx
  90262. return c
  90263. }
  90264. // Header returns an http.Header that can be modified by the caller to
  90265. // add HTTP headers to the request.
  90266. func (c *ProjectsGetCall) Header() http.Header {
  90267. if c.header_ == nil {
  90268. c.header_ = make(http.Header)
  90269. }
  90270. return c.header_
  90271. }
  90272. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  90273. reqHeaders := make(http.Header)
  90274. for k, v := range c.header_ {
  90275. reqHeaders[k] = v
  90276. }
  90277. reqHeaders.Set("User-Agent", c.s.userAgent())
  90278. if c.ifNoneMatch_ != "" {
  90279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90280. }
  90281. var body io.Reader = nil
  90282. c.urlParams_.Set("alt", alt)
  90283. c.urlParams_.Set("prettyPrint", "false")
  90284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  90285. urls += "?" + c.urlParams_.Encode()
  90286. req, err := http.NewRequest("GET", urls, body)
  90287. if err != nil {
  90288. return nil, err
  90289. }
  90290. req.Header = reqHeaders
  90291. googleapi.Expand(req.URL, map[string]string{
  90292. "project": c.project,
  90293. })
  90294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90295. }
  90296. // Do executes the "compute.projects.get" call.
  90297. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  90298. // code is an error. Response headers are in either
  90299. // *Project.ServerResponse.Header or (if a response was returned at all)
  90300. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  90301. // check whether the returned error was because http.StatusNotModified
  90302. // was returned.
  90303. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  90304. gensupport.SetOptions(c.urlParams_, opts...)
  90305. res, err := c.doRequest("json")
  90306. if res != nil && res.StatusCode == http.StatusNotModified {
  90307. if res.Body != nil {
  90308. res.Body.Close()
  90309. }
  90310. return nil, &googleapi.Error{
  90311. Code: res.StatusCode,
  90312. Header: res.Header,
  90313. }
  90314. }
  90315. if err != nil {
  90316. return nil, err
  90317. }
  90318. defer googleapi.CloseBody(res)
  90319. if err := googleapi.CheckResponse(res); err != nil {
  90320. return nil, err
  90321. }
  90322. ret := &Project{
  90323. ServerResponse: googleapi.ServerResponse{
  90324. Header: res.Header,
  90325. HTTPStatusCode: res.StatusCode,
  90326. },
  90327. }
  90328. target := &ret
  90329. if err := gensupport.DecodeResponse(target, res); err != nil {
  90330. return nil, err
  90331. }
  90332. return ret, nil
  90333. // {
  90334. // "description": "Returns the specified Project resource.",
  90335. // "httpMethod": "GET",
  90336. // "id": "compute.projects.get",
  90337. // "parameterOrder": [
  90338. // "project"
  90339. // ],
  90340. // "parameters": {
  90341. // "project": {
  90342. // "description": "Project ID for this request.",
  90343. // "location": "path",
  90344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90345. // "required": true,
  90346. // "type": "string"
  90347. // }
  90348. // },
  90349. // "path": "{project}",
  90350. // "response": {
  90351. // "$ref": "Project"
  90352. // },
  90353. // "scopes": [
  90354. // "https://www.googleapis.com/auth/cloud-platform",
  90355. // "https://www.googleapis.com/auth/compute",
  90356. // "https://www.googleapis.com/auth/compute.readonly"
  90357. // ]
  90358. // }
  90359. }
  90360. // method id "compute.projects.getXpnHost":
  90361. type ProjectsGetXpnHostCall struct {
  90362. s *Service
  90363. project string
  90364. urlParams_ gensupport.URLParams
  90365. ifNoneMatch_ string
  90366. ctx_ context.Context
  90367. header_ http.Header
  90368. }
  90369. // GetXpnHost: Gets the shared VPC host project that this project links
  90370. // to. May be empty if no link exists.
  90371. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  90372. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90373. c.project = project
  90374. return c
  90375. }
  90376. // Fields allows partial responses to be retrieved. See
  90377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90378. // for more information.
  90379. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  90380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90381. return c
  90382. }
  90383. // IfNoneMatch sets the optional parameter which makes the operation
  90384. // fail if the object's ETag matches the given value. This is useful for
  90385. // getting updates only after the object has changed since the last
  90386. // request. Use googleapi.IsNotModified to check whether the response
  90387. // error from Do is the result of In-None-Match.
  90388. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  90389. c.ifNoneMatch_ = entityTag
  90390. return c
  90391. }
  90392. // Context sets the context to be used in this call's Do method. Any
  90393. // pending HTTP request will be aborted if the provided context is
  90394. // canceled.
  90395. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  90396. c.ctx_ = ctx
  90397. return c
  90398. }
  90399. // Header returns an http.Header that can be modified by the caller to
  90400. // add HTTP headers to the request.
  90401. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  90402. if c.header_ == nil {
  90403. c.header_ = make(http.Header)
  90404. }
  90405. return c.header_
  90406. }
  90407. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  90408. reqHeaders := make(http.Header)
  90409. for k, v := range c.header_ {
  90410. reqHeaders[k] = v
  90411. }
  90412. reqHeaders.Set("User-Agent", c.s.userAgent())
  90413. if c.ifNoneMatch_ != "" {
  90414. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90415. }
  90416. var body io.Reader = nil
  90417. c.urlParams_.Set("alt", alt)
  90418. c.urlParams_.Set("prettyPrint", "false")
  90419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  90420. urls += "?" + c.urlParams_.Encode()
  90421. req, err := http.NewRequest("GET", urls, body)
  90422. if err != nil {
  90423. return nil, err
  90424. }
  90425. req.Header = reqHeaders
  90426. googleapi.Expand(req.URL, map[string]string{
  90427. "project": c.project,
  90428. })
  90429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90430. }
  90431. // Do executes the "compute.projects.getXpnHost" call.
  90432. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  90433. // code is an error. Response headers are in either
  90434. // *Project.ServerResponse.Header or (if a response was returned at all)
  90435. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  90436. // check whether the returned error was because http.StatusNotModified
  90437. // was returned.
  90438. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  90439. gensupport.SetOptions(c.urlParams_, opts...)
  90440. res, err := c.doRequest("json")
  90441. if res != nil && res.StatusCode == http.StatusNotModified {
  90442. if res.Body != nil {
  90443. res.Body.Close()
  90444. }
  90445. return nil, &googleapi.Error{
  90446. Code: res.StatusCode,
  90447. Header: res.Header,
  90448. }
  90449. }
  90450. if err != nil {
  90451. return nil, err
  90452. }
  90453. defer googleapi.CloseBody(res)
  90454. if err := googleapi.CheckResponse(res); err != nil {
  90455. return nil, err
  90456. }
  90457. ret := &Project{
  90458. ServerResponse: googleapi.ServerResponse{
  90459. Header: res.Header,
  90460. HTTPStatusCode: res.StatusCode,
  90461. },
  90462. }
  90463. target := &ret
  90464. if err := gensupport.DecodeResponse(target, res); err != nil {
  90465. return nil, err
  90466. }
  90467. return ret, nil
  90468. // {
  90469. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  90470. // "httpMethod": "GET",
  90471. // "id": "compute.projects.getXpnHost",
  90472. // "parameterOrder": [
  90473. // "project"
  90474. // ],
  90475. // "parameters": {
  90476. // "project": {
  90477. // "description": "Project ID for this request.",
  90478. // "location": "path",
  90479. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90480. // "required": true,
  90481. // "type": "string"
  90482. // }
  90483. // },
  90484. // "path": "{project}/getXpnHost",
  90485. // "response": {
  90486. // "$ref": "Project"
  90487. // },
  90488. // "scopes": [
  90489. // "https://www.googleapis.com/auth/cloud-platform",
  90490. // "https://www.googleapis.com/auth/compute"
  90491. // ]
  90492. // }
  90493. }
  90494. // method id "compute.projects.getXpnResources":
  90495. type ProjectsGetXpnResourcesCall struct {
  90496. s *Service
  90497. project string
  90498. urlParams_ gensupport.URLParams
  90499. ifNoneMatch_ string
  90500. ctx_ context.Context
  90501. header_ http.Header
  90502. }
  90503. // GetXpnResources: Gets service resources (a.k.a service project)
  90504. // associated with this host project.
  90505. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  90506. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90507. c.project = project
  90508. return c
  90509. }
  90510. // Filter sets the optional parameter "filter": A filter expression that
  90511. // filters resources listed in the response. The expression must specify
  90512. // the field name, a comparison operator, and the value that you want to
  90513. // use for filtering. The value must be a string, a number, or a
  90514. // boolean. The comparison operator must be either =, !=, >, or <.
  90515. //
  90516. // For example, if you are filtering Compute Engine instances, you can
  90517. // exclude instances named example-instance by specifying name !=
  90518. // example-instance.
  90519. //
  90520. // You can also filter nested fields. For example, you could specify
  90521. // scheduling.automaticRestart = false to include instances only if they
  90522. // are not scheduled for automatic restarts. You can use filtering on
  90523. // nested fields to filter based on resource labels.
  90524. //
  90525. // To filter on multiple expressions, provide each separate expression
  90526. // within parentheses. For example, (scheduling.automaticRestart = true)
  90527. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90528. // AND expression. However, you can include AND and OR expressions
  90529. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90530. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90531. // true).
  90532. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  90533. c.urlParams_.Set("filter", filter)
  90534. return c
  90535. }
  90536. // MaxResults sets the optional parameter "maxResults": The maximum
  90537. // number of results per page that should be returned. If the number of
  90538. // available results is larger than maxResults, Compute Engine returns a
  90539. // nextPageToken that can be used to get the next page of results in
  90540. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90541. // (Default: 500)
  90542. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  90543. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90544. return c
  90545. }
  90546. // OrderBy sets the optional parameter "order_by": Sorts list results by
  90547. // a certain order. By default, results are returned in alphanumerical
  90548. // order based on the resource name.
  90549. //
  90550. // You can also sort results in descending order based on the creation
  90551. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90552. // based on the creationTimestamp field in reverse chronological order
  90553. // (newest result first). Use this to sort resources like operations so
  90554. // that the newest operation is returned first.
  90555. //
  90556. // Currently, only sorting by name or creationTimestamp desc is
  90557. // supported.
  90558. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  90559. c.urlParams_.Set("order_by", orderBy)
  90560. return c
  90561. }
  90562. // PageToken sets the optional parameter "pageToken": Specifies a page
  90563. // token to use. Set pageToken to the nextPageToken returned by a
  90564. // previous list request to get the next page of results.
  90565. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  90566. c.urlParams_.Set("pageToken", pageToken)
  90567. return c
  90568. }
  90569. // Fields allows partial responses to be retrieved. See
  90570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90571. // for more information.
  90572. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  90573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90574. return c
  90575. }
  90576. // IfNoneMatch sets the optional parameter which makes the operation
  90577. // fail if the object's ETag matches the given value. This is useful for
  90578. // getting updates only after the object has changed since the last
  90579. // request. Use googleapi.IsNotModified to check whether the response
  90580. // error from Do is the result of In-None-Match.
  90581. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  90582. c.ifNoneMatch_ = entityTag
  90583. return c
  90584. }
  90585. // Context sets the context to be used in this call's Do method. Any
  90586. // pending HTTP request will be aborted if the provided context is
  90587. // canceled.
  90588. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  90589. c.ctx_ = ctx
  90590. return c
  90591. }
  90592. // Header returns an http.Header that can be modified by the caller to
  90593. // add HTTP headers to the request.
  90594. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  90595. if c.header_ == nil {
  90596. c.header_ = make(http.Header)
  90597. }
  90598. return c.header_
  90599. }
  90600. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  90601. reqHeaders := make(http.Header)
  90602. for k, v := range c.header_ {
  90603. reqHeaders[k] = v
  90604. }
  90605. reqHeaders.Set("User-Agent", c.s.userAgent())
  90606. if c.ifNoneMatch_ != "" {
  90607. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90608. }
  90609. var body io.Reader = nil
  90610. c.urlParams_.Set("alt", alt)
  90611. c.urlParams_.Set("prettyPrint", "false")
  90612. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  90613. urls += "?" + c.urlParams_.Encode()
  90614. req, err := http.NewRequest("GET", urls, body)
  90615. if err != nil {
  90616. return nil, err
  90617. }
  90618. req.Header = reqHeaders
  90619. googleapi.Expand(req.URL, map[string]string{
  90620. "project": c.project,
  90621. })
  90622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90623. }
  90624. // Do executes the "compute.projects.getXpnResources" call.
  90625. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  90626. // non-2xx status code is an error. Response headers are in either
  90627. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  90628. // returned at all) in error.(*googleapi.Error).Header. Use
  90629. // googleapi.IsNotModified to check whether the returned error was
  90630. // because http.StatusNotModified was returned.
  90631. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  90632. gensupport.SetOptions(c.urlParams_, opts...)
  90633. res, err := c.doRequest("json")
  90634. if res != nil && res.StatusCode == http.StatusNotModified {
  90635. if res.Body != nil {
  90636. res.Body.Close()
  90637. }
  90638. return nil, &googleapi.Error{
  90639. Code: res.StatusCode,
  90640. Header: res.Header,
  90641. }
  90642. }
  90643. if err != nil {
  90644. return nil, err
  90645. }
  90646. defer googleapi.CloseBody(res)
  90647. if err := googleapi.CheckResponse(res); err != nil {
  90648. return nil, err
  90649. }
  90650. ret := &ProjectsGetXpnResources{
  90651. ServerResponse: googleapi.ServerResponse{
  90652. Header: res.Header,
  90653. HTTPStatusCode: res.StatusCode,
  90654. },
  90655. }
  90656. target := &ret
  90657. if err := gensupport.DecodeResponse(target, res); err != nil {
  90658. return nil, err
  90659. }
  90660. return ret, nil
  90661. // {
  90662. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  90663. // "httpMethod": "GET",
  90664. // "id": "compute.projects.getXpnResources",
  90665. // "parameterOrder": [
  90666. // "project"
  90667. // ],
  90668. // "parameters": {
  90669. // "filter": {
  90670. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90671. // "location": "query",
  90672. // "type": "string"
  90673. // },
  90674. // "maxResults": {
  90675. // "default": "500",
  90676. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90677. // "format": "uint32",
  90678. // "location": "query",
  90679. // "minimum": "0",
  90680. // "type": "integer"
  90681. // },
  90682. // "order_by": {
  90683. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90684. // "location": "query",
  90685. // "type": "string"
  90686. // },
  90687. // "pageToken": {
  90688. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90689. // "location": "query",
  90690. // "type": "string"
  90691. // },
  90692. // "project": {
  90693. // "description": "Project ID for this request.",
  90694. // "location": "path",
  90695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90696. // "required": true,
  90697. // "type": "string"
  90698. // }
  90699. // },
  90700. // "path": "{project}/getXpnResources",
  90701. // "response": {
  90702. // "$ref": "ProjectsGetXpnResources"
  90703. // },
  90704. // "scopes": [
  90705. // "https://www.googleapis.com/auth/cloud-platform",
  90706. // "https://www.googleapis.com/auth/compute"
  90707. // ]
  90708. // }
  90709. }
  90710. // Pages invokes f for each page of results.
  90711. // A non-nil error returned from f will halt the iteration.
  90712. // The provided context supersedes any context provided to the Context method.
  90713. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  90714. c.ctx_ = ctx
  90715. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90716. for {
  90717. x, err := c.Do()
  90718. if err != nil {
  90719. return err
  90720. }
  90721. if err := f(x); err != nil {
  90722. return err
  90723. }
  90724. if x.NextPageToken == "" {
  90725. return nil
  90726. }
  90727. c.PageToken(x.NextPageToken)
  90728. }
  90729. }
  90730. // method id "compute.projects.listXpnHosts":
  90731. type ProjectsListXpnHostsCall struct {
  90732. s *Service
  90733. project string
  90734. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  90735. urlParams_ gensupport.URLParams
  90736. ctx_ context.Context
  90737. header_ http.Header
  90738. }
  90739. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  90740. // in an organization.
  90741. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  90742. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90743. c.project = project
  90744. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  90745. return c
  90746. }
  90747. // Filter sets the optional parameter "filter": A filter expression that
  90748. // filters resources listed in the response. The expression must specify
  90749. // the field name, a comparison operator, and the value that you want to
  90750. // use for filtering. The value must be a string, a number, or a
  90751. // boolean. The comparison operator must be either =, !=, >, or <.
  90752. //
  90753. // For example, if you are filtering Compute Engine instances, you can
  90754. // exclude instances named example-instance by specifying name !=
  90755. // example-instance.
  90756. //
  90757. // You can also filter nested fields. For example, you could specify
  90758. // scheduling.automaticRestart = false to include instances only if they
  90759. // are not scheduled for automatic restarts. You can use filtering on
  90760. // nested fields to filter based on resource labels.
  90761. //
  90762. // To filter on multiple expressions, provide each separate expression
  90763. // within parentheses. For example, (scheduling.automaticRestart = true)
  90764. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90765. // AND expression. However, you can include AND and OR expressions
  90766. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90767. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90768. // true).
  90769. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  90770. c.urlParams_.Set("filter", filter)
  90771. return c
  90772. }
  90773. // MaxResults sets the optional parameter "maxResults": The maximum
  90774. // number of results per page that should be returned. If the number of
  90775. // available results is larger than maxResults, Compute Engine returns a
  90776. // nextPageToken that can be used to get the next page of results in
  90777. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90778. // (Default: 500)
  90779. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  90780. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90781. return c
  90782. }
  90783. // OrderBy sets the optional parameter "order_by": Sorts list results by
  90784. // a certain order. By default, results are returned in alphanumerical
  90785. // order based on the resource name.
  90786. //
  90787. // You can also sort results in descending order based on the creation
  90788. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90789. // based on the creationTimestamp field in reverse chronological order
  90790. // (newest result first). Use this to sort resources like operations so
  90791. // that the newest operation is returned first.
  90792. //
  90793. // Currently, only sorting by name or creationTimestamp desc is
  90794. // supported.
  90795. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  90796. c.urlParams_.Set("order_by", orderBy)
  90797. return c
  90798. }
  90799. // PageToken sets the optional parameter "pageToken": Specifies a page
  90800. // token to use. Set pageToken to the nextPageToken returned by a
  90801. // previous list request to get the next page of results.
  90802. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  90803. c.urlParams_.Set("pageToken", pageToken)
  90804. return c
  90805. }
  90806. // Fields allows partial responses to be retrieved. See
  90807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90808. // for more information.
  90809. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  90810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90811. return c
  90812. }
  90813. // Context sets the context to be used in this call's Do method. Any
  90814. // pending HTTP request will be aborted if the provided context is
  90815. // canceled.
  90816. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  90817. c.ctx_ = ctx
  90818. return c
  90819. }
  90820. // Header returns an http.Header that can be modified by the caller to
  90821. // add HTTP headers to the request.
  90822. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  90823. if c.header_ == nil {
  90824. c.header_ = make(http.Header)
  90825. }
  90826. return c.header_
  90827. }
  90828. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  90829. reqHeaders := make(http.Header)
  90830. for k, v := range c.header_ {
  90831. reqHeaders[k] = v
  90832. }
  90833. reqHeaders.Set("User-Agent", c.s.userAgent())
  90834. var body io.Reader = nil
  90835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  90836. if err != nil {
  90837. return nil, err
  90838. }
  90839. reqHeaders.Set("Content-Type", "application/json")
  90840. c.urlParams_.Set("alt", alt)
  90841. c.urlParams_.Set("prettyPrint", "false")
  90842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  90843. urls += "?" + c.urlParams_.Encode()
  90844. req, err := http.NewRequest("POST", urls, body)
  90845. if err != nil {
  90846. return nil, err
  90847. }
  90848. req.Header = reqHeaders
  90849. googleapi.Expand(req.URL, map[string]string{
  90850. "project": c.project,
  90851. })
  90852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90853. }
  90854. // Do executes the "compute.projects.listXpnHosts" call.
  90855. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  90856. // status code is an error. Response headers are in either
  90857. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  90858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90859. // to check whether the returned error was because
  90860. // http.StatusNotModified was returned.
  90861. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  90862. gensupport.SetOptions(c.urlParams_, opts...)
  90863. res, err := c.doRequest("json")
  90864. if res != nil && res.StatusCode == http.StatusNotModified {
  90865. if res.Body != nil {
  90866. res.Body.Close()
  90867. }
  90868. return nil, &googleapi.Error{
  90869. Code: res.StatusCode,
  90870. Header: res.Header,
  90871. }
  90872. }
  90873. if err != nil {
  90874. return nil, err
  90875. }
  90876. defer googleapi.CloseBody(res)
  90877. if err := googleapi.CheckResponse(res); err != nil {
  90878. return nil, err
  90879. }
  90880. ret := &XpnHostList{
  90881. ServerResponse: googleapi.ServerResponse{
  90882. Header: res.Header,
  90883. HTTPStatusCode: res.StatusCode,
  90884. },
  90885. }
  90886. target := &ret
  90887. if err := gensupport.DecodeResponse(target, res); err != nil {
  90888. return nil, err
  90889. }
  90890. return ret, nil
  90891. // {
  90892. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  90893. // "httpMethod": "POST",
  90894. // "id": "compute.projects.listXpnHosts",
  90895. // "parameterOrder": [
  90896. // "project"
  90897. // ],
  90898. // "parameters": {
  90899. // "filter": {
  90900. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90901. // "location": "query",
  90902. // "type": "string"
  90903. // },
  90904. // "maxResults": {
  90905. // "default": "500",
  90906. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90907. // "format": "uint32",
  90908. // "location": "query",
  90909. // "minimum": "0",
  90910. // "type": "integer"
  90911. // },
  90912. // "order_by": {
  90913. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90914. // "location": "query",
  90915. // "type": "string"
  90916. // },
  90917. // "pageToken": {
  90918. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90919. // "location": "query",
  90920. // "type": "string"
  90921. // },
  90922. // "project": {
  90923. // "description": "Project ID for this request.",
  90924. // "location": "path",
  90925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90926. // "required": true,
  90927. // "type": "string"
  90928. // }
  90929. // },
  90930. // "path": "{project}/listXpnHosts",
  90931. // "request": {
  90932. // "$ref": "ProjectsListXpnHostsRequest"
  90933. // },
  90934. // "response": {
  90935. // "$ref": "XpnHostList"
  90936. // },
  90937. // "scopes": [
  90938. // "https://www.googleapis.com/auth/cloud-platform",
  90939. // "https://www.googleapis.com/auth/compute"
  90940. // ]
  90941. // }
  90942. }
  90943. // Pages invokes f for each page of results.
  90944. // A non-nil error returned from f will halt the iteration.
  90945. // The provided context supersedes any context provided to the Context method.
  90946. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  90947. c.ctx_ = ctx
  90948. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90949. for {
  90950. x, err := c.Do()
  90951. if err != nil {
  90952. return err
  90953. }
  90954. if err := f(x); err != nil {
  90955. return err
  90956. }
  90957. if x.NextPageToken == "" {
  90958. return nil
  90959. }
  90960. c.PageToken(x.NextPageToken)
  90961. }
  90962. }
  90963. // method id "compute.projects.moveDisk":
  90964. type ProjectsMoveDiskCall struct {
  90965. s *Service
  90966. project string
  90967. diskmoverequest *DiskMoveRequest
  90968. urlParams_ gensupport.URLParams
  90969. ctx_ context.Context
  90970. header_ http.Header
  90971. }
  90972. // MoveDisk: Moves a persistent disk from one zone to another.
  90973. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  90974. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90975. c.project = project
  90976. c.diskmoverequest = diskmoverequest
  90977. return c
  90978. }
  90979. // RequestId sets the optional parameter "requestId": An optional
  90980. // request ID to identify requests. Specify a unique request ID so that
  90981. // if you must retry your request, the server will know to ignore the
  90982. // request if it has already been completed.
  90983. //
  90984. // For example, consider a situation where you make an initial request
  90985. // and the request times out. If you make the request again with the
  90986. // same request ID, the server can check if original operation with the
  90987. // same request ID was received, and if so, will ignore the second
  90988. // request. This prevents clients from accidentally creating duplicate
  90989. // commitments.
  90990. //
  90991. // The request ID must be a valid UUID with the exception that zero UUID
  90992. // is not supported (00000000-0000-0000-0000-000000000000).
  90993. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  90994. c.urlParams_.Set("requestId", requestId)
  90995. return c
  90996. }
  90997. // Fields allows partial responses to be retrieved. See
  90998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90999. // for more information.
  91000. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  91001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91002. return c
  91003. }
  91004. // Context sets the context to be used in this call's Do method. Any
  91005. // pending HTTP request will be aborted if the provided context is
  91006. // canceled.
  91007. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  91008. c.ctx_ = ctx
  91009. return c
  91010. }
  91011. // Header returns an http.Header that can be modified by the caller to
  91012. // add HTTP headers to the request.
  91013. func (c *ProjectsMoveDiskCall) Header() http.Header {
  91014. if c.header_ == nil {
  91015. c.header_ = make(http.Header)
  91016. }
  91017. return c.header_
  91018. }
  91019. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  91020. reqHeaders := make(http.Header)
  91021. for k, v := range c.header_ {
  91022. reqHeaders[k] = v
  91023. }
  91024. reqHeaders.Set("User-Agent", c.s.userAgent())
  91025. var body io.Reader = nil
  91026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  91027. if err != nil {
  91028. return nil, err
  91029. }
  91030. reqHeaders.Set("Content-Type", "application/json")
  91031. c.urlParams_.Set("alt", alt)
  91032. c.urlParams_.Set("prettyPrint", "false")
  91033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  91034. urls += "?" + c.urlParams_.Encode()
  91035. req, err := http.NewRequest("POST", urls, body)
  91036. if err != nil {
  91037. return nil, err
  91038. }
  91039. req.Header = reqHeaders
  91040. googleapi.Expand(req.URL, map[string]string{
  91041. "project": c.project,
  91042. })
  91043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91044. }
  91045. // Do executes the "compute.projects.moveDisk" call.
  91046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91047. // status code is an error. Response headers are in either
  91048. // *Operation.ServerResponse.Header or (if a response was returned at
  91049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91050. // to check whether the returned error was because
  91051. // http.StatusNotModified was returned.
  91052. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91053. gensupport.SetOptions(c.urlParams_, opts...)
  91054. res, err := c.doRequest("json")
  91055. if res != nil && res.StatusCode == http.StatusNotModified {
  91056. if res.Body != nil {
  91057. res.Body.Close()
  91058. }
  91059. return nil, &googleapi.Error{
  91060. Code: res.StatusCode,
  91061. Header: res.Header,
  91062. }
  91063. }
  91064. if err != nil {
  91065. return nil, err
  91066. }
  91067. defer googleapi.CloseBody(res)
  91068. if err := googleapi.CheckResponse(res); err != nil {
  91069. return nil, err
  91070. }
  91071. ret := &Operation{
  91072. ServerResponse: googleapi.ServerResponse{
  91073. Header: res.Header,
  91074. HTTPStatusCode: res.StatusCode,
  91075. },
  91076. }
  91077. target := &ret
  91078. if err := gensupport.DecodeResponse(target, res); err != nil {
  91079. return nil, err
  91080. }
  91081. return ret, nil
  91082. // {
  91083. // "description": "Moves a persistent disk from one zone to another.",
  91084. // "httpMethod": "POST",
  91085. // "id": "compute.projects.moveDisk",
  91086. // "parameterOrder": [
  91087. // "project"
  91088. // ],
  91089. // "parameters": {
  91090. // "project": {
  91091. // "description": "Project ID for this request.",
  91092. // "location": "path",
  91093. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91094. // "required": true,
  91095. // "type": "string"
  91096. // },
  91097. // "requestId": {
  91098. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91099. // "location": "query",
  91100. // "type": "string"
  91101. // }
  91102. // },
  91103. // "path": "{project}/moveDisk",
  91104. // "request": {
  91105. // "$ref": "DiskMoveRequest"
  91106. // },
  91107. // "response": {
  91108. // "$ref": "Operation"
  91109. // },
  91110. // "scopes": [
  91111. // "https://www.googleapis.com/auth/cloud-platform",
  91112. // "https://www.googleapis.com/auth/compute"
  91113. // ]
  91114. // }
  91115. }
  91116. // method id "compute.projects.moveInstance":
  91117. type ProjectsMoveInstanceCall struct {
  91118. s *Service
  91119. project string
  91120. instancemoverequest *InstanceMoveRequest
  91121. urlParams_ gensupport.URLParams
  91122. ctx_ context.Context
  91123. header_ http.Header
  91124. }
  91125. // MoveInstance: Moves an instance and its attached persistent disks
  91126. // from one zone to another.
  91127. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  91128. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91129. c.project = project
  91130. c.instancemoverequest = instancemoverequest
  91131. return c
  91132. }
  91133. // RequestId sets the optional parameter "requestId": An optional
  91134. // request ID to identify requests. Specify a unique request ID so that
  91135. // if you must retry your request, the server will know to ignore the
  91136. // request if it has already been completed.
  91137. //
  91138. // For example, consider a situation where you make an initial request
  91139. // and the request times out. If you make the request again with the
  91140. // same request ID, the server can check if original operation with the
  91141. // same request ID was received, and if so, will ignore the second
  91142. // request. This prevents clients from accidentally creating duplicate
  91143. // commitments.
  91144. //
  91145. // The request ID must be a valid UUID with the exception that zero UUID
  91146. // is not supported (00000000-0000-0000-0000-000000000000).
  91147. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  91148. c.urlParams_.Set("requestId", requestId)
  91149. return c
  91150. }
  91151. // Fields allows partial responses to be retrieved. See
  91152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91153. // for more information.
  91154. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  91155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91156. return c
  91157. }
  91158. // Context sets the context to be used in this call's Do method. Any
  91159. // pending HTTP request will be aborted if the provided context is
  91160. // canceled.
  91161. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  91162. c.ctx_ = ctx
  91163. return c
  91164. }
  91165. // Header returns an http.Header that can be modified by the caller to
  91166. // add HTTP headers to the request.
  91167. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  91168. if c.header_ == nil {
  91169. c.header_ = make(http.Header)
  91170. }
  91171. return c.header_
  91172. }
  91173. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  91174. reqHeaders := make(http.Header)
  91175. for k, v := range c.header_ {
  91176. reqHeaders[k] = v
  91177. }
  91178. reqHeaders.Set("User-Agent", c.s.userAgent())
  91179. var body io.Reader = nil
  91180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  91181. if err != nil {
  91182. return nil, err
  91183. }
  91184. reqHeaders.Set("Content-Type", "application/json")
  91185. c.urlParams_.Set("alt", alt)
  91186. c.urlParams_.Set("prettyPrint", "false")
  91187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  91188. urls += "?" + c.urlParams_.Encode()
  91189. req, err := http.NewRequest("POST", urls, body)
  91190. if err != nil {
  91191. return nil, err
  91192. }
  91193. req.Header = reqHeaders
  91194. googleapi.Expand(req.URL, map[string]string{
  91195. "project": c.project,
  91196. })
  91197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91198. }
  91199. // Do executes the "compute.projects.moveInstance" call.
  91200. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91201. // status code is an error. Response headers are in either
  91202. // *Operation.ServerResponse.Header or (if a response was returned at
  91203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91204. // to check whether the returned error was because
  91205. // http.StatusNotModified was returned.
  91206. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91207. gensupport.SetOptions(c.urlParams_, opts...)
  91208. res, err := c.doRequest("json")
  91209. if res != nil && res.StatusCode == http.StatusNotModified {
  91210. if res.Body != nil {
  91211. res.Body.Close()
  91212. }
  91213. return nil, &googleapi.Error{
  91214. Code: res.StatusCode,
  91215. Header: res.Header,
  91216. }
  91217. }
  91218. if err != nil {
  91219. return nil, err
  91220. }
  91221. defer googleapi.CloseBody(res)
  91222. if err := googleapi.CheckResponse(res); err != nil {
  91223. return nil, err
  91224. }
  91225. ret := &Operation{
  91226. ServerResponse: googleapi.ServerResponse{
  91227. Header: res.Header,
  91228. HTTPStatusCode: res.StatusCode,
  91229. },
  91230. }
  91231. target := &ret
  91232. if err := gensupport.DecodeResponse(target, res); err != nil {
  91233. return nil, err
  91234. }
  91235. return ret, nil
  91236. // {
  91237. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  91238. // "httpMethod": "POST",
  91239. // "id": "compute.projects.moveInstance",
  91240. // "parameterOrder": [
  91241. // "project"
  91242. // ],
  91243. // "parameters": {
  91244. // "project": {
  91245. // "description": "Project ID for this request.",
  91246. // "location": "path",
  91247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91248. // "required": true,
  91249. // "type": "string"
  91250. // },
  91251. // "requestId": {
  91252. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91253. // "location": "query",
  91254. // "type": "string"
  91255. // }
  91256. // },
  91257. // "path": "{project}/moveInstance",
  91258. // "request": {
  91259. // "$ref": "InstanceMoveRequest"
  91260. // },
  91261. // "response": {
  91262. // "$ref": "Operation"
  91263. // },
  91264. // "scopes": [
  91265. // "https://www.googleapis.com/auth/cloud-platform",
  91266. // "https://www.googleapis.com/auth/compute"
  91267. // ]
  91268. // }
  91269. }
  91270. // method id "compute.projects.setCommonInstanceMetadata":
  91271. type ProjectsSetCommonInstanceMetadataCall struct {
  91272. s *Service
  91273. project string
  91274. metadata *Metadata
  91275. urlParams_ gensupport.URLParams
  91276. ctx_ context.Context
  91277. header_ http.Header
  91278. }
  91279. // SetCommonInstanceMetadata: Sets metadata common to all instances
  91280. // within the specified project using the data included in the request.
  91281. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  91282. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  91283. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91284. c.project = project
  91285. c.metadata = metadata
  91286. return c
  91287. }
  91288. // RequestId sets the optional parameter "requestId": An optional
  91289. // request ID to identify requests. Specify a unique request ID so that
  91290. // if you must retry your request, the server will know to ignore the
  91291. // request if it has already been completed.
  91292. //
  91293. // For example, consider a situation where you make an initial request
  91294. // and the request times out. If you make the request again with the
  91295. // same request ID, the server can check if original operation with the
  91296. // same request ID was received, and if so, will ignore the second
  91297. // request. This prevents clients from accidentally creating duplicate
  91298. // commitments.
  91299. //
  91300. // The request ID must be a valid UUID with the exception that zero UUID
  91301. // is not supported (00000000-0000-0000-0000-000000000000).
  91302. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  91303. c.urlParams_.Set("requestId", requestId)
  91304. return c
  91305. }
  91306. // Fields allows partial responses to be retrieved. See
  91307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91308. // for more information.
  91309. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  91310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91311. return c
  91312. }
  91313. // Context sets the context to be used in this call's Do method. Any
  91314. // pending HTTP request will be aborted if the provided context is
  91315. // canceled.
  91316. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  91317. c.ctx_ = ctx
  91318. return c
  91319. }
  91320. // Header returns an http.Header that can be modified by the caller to
  91321. // add HTTP headers to the request.
  91322. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  91323. if c.header_ == nil {
  91324. c.header_ = make(http.Header)
  91325. }
  91326. return c.header_
  91327. }
  91328. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  91329. reqHeaders := make(http.Header)
  91330. for k, v := range c.header_ {
  91331. reqHeaders[k] = v
  91332. }
  91333. reqHeaders.Set("User-Agent", c.s.userAgent())
  91334. var body io.Reader = nil
  91335. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  91336. if err != nil {
  91337. return nil, err
  91338. }
  91339. reqHeaders.Set("Content-Type", "application/json")
  91340. c.urlParams_.Set("alt", alt)
  91341. c.urlParams_.Set("prettyPrint", "false")
  91342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  91343. urls += "?" + c.urlParams_.Encode()
  91344. req, err := http.NewRequest("POST", urls, body)
  91345. if err != nil {
  91346. return nil, err
  91347. }
  91348. req.Header = reqHeaders
  91349. googleapi.Expand(req.URL, map[string]string{
  91350. "project": c.project,
  91351. })
  91352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91353. }
  91354. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  91355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91356. // status code is an error. Response headers are in either
  91357. // *Operation.ServerResponse.Header or (if a response was returned at
  91358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91359. // to check whether the returned error was because
  91360. // http.StatusNotModified was returned.
  91361. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91362. gensupport.SetOptions(c.urlParams_, opts...)
  91363. res, err := c.doRequest("json")
  91364. if res != nil && res.StatusCode == http.StatusNotModified {
  91365. if res.Body != nil {
  91366. res.Body.Close()
  91367. }
  91368. return nil, &googleapi.Error{
  91369. Code: res.StatusCode,
  91370. Header: res.Header,
  91371. }
  91372. }
  91373. if err != nil {
  91374. return nil, err
  91375. }
  91376. defer googleapi.CloseBody(res)
  91377. if err := googleapi.CheckResponse(res); err != nil {
  91378. return nil, err
  91379. }
  91380. ret := &Operation{
  91381. ServerResponse: googleapi.ServerResponse{
  91382. Header: res.Header,
  91383. HTTPStatusCode: res.StatusCode,
  91384. },
  91385. }
  91386. target := &ret
  91387. if err := gensupport.DecodeResponse(target, res); err != nil {
  91388. return nil, err
  91389. }
  91390. return ret, nil
  91391. // {
  91392. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  91393. // "httpMethod": "POST",
  91394. // "id": "compute.projects.setCommonInstanceMetadata",
  91395. // "parameterOrder": [
  91396. // "project"
  91397. // ],
  91398. // "parameters": {
  91399. // "project": {
  91400. // "description": "Project ID for this request.",
  91401. // "location": "path",
  91402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91403. // "required": true,
  91404. // "type": "string"
  91405. // },
  91406. // "requestId": {
  91407. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91408. // "location": "query",
  91409. // "type": "string"
  91410. // }
  91411. // },
  91412. // "path": "{project}/setCommonInstanceMetadata",
  91413. // "request": {
  91414. // "$ref": "Metadata"
  91415. // },
  91416. // "response": {
  91417. // "$ref": "Operation"
  91418. // },
  91419. // "scopes": [
  91420. // "https://www.googleapis.com/auth/cloud-platform",
  91421. // "https://www.googleapis.com/auth/compute"
  91422. // ]
  91423. // }
  91424. }
  91425. // method id "compute.projects.setDefaultNetworkTier":
  91426. type ProjectsSetDefaultNetworkTierCall struct {
  91427. s *Service
  91428. project string
  91429. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  91430. urlParams_ gensupport.URLParams
  91431. ctx_ context.Context
  91432. header_ http.Header
  91433. }
  91434. // SetDefaultNetworkTier: Sets the default network tier of the project.
  91435. // The default network tier is used when an
  91436. // address/forwardingRule/instance is created without specifying the
  91437. // network tier field.
  91438. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  91439. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91440. c.project = project
  91441. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  91442. return c
  91443. }
  91444. // RequestId sets the optional parameter "requestId": An optional
  91445. // request ID to identify requests. Specify a unique request ID so that
  91446. // if you must retry your request, the server will know to ignore the
  91447. // request if it has already been completed.
  91448. //
  91449. // For example, consider a situation where you make an initial request
  91450. // and the request times out. If you make the request again with the
  91451. // same request ID, the server can check if original operation with the
  91452. // same request ID was received, and if so, will ignore the second
  91453. // request. This prevents clients from accidentally creating duplicate
  91454. // commitments.
  91455. //
  91456. // The request ID must be a valid UUID with the exception that zero UUID
  91457. // is not supported (00000000-0000-0000-0000-000000000000).
  91458. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  91459. c.urlParams_.Set("requestId", requestId)
  91460. return c
  91461. }
  91462. // Fields allows partial responses to be retrieved. See
  91463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91464. // for more information.
  91465. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  91466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91467. return c
  91468. }
  91469. // Context sets the context to be used in this call's Do method. Any
  91470. // pending HTTP request will be aborted if the provided context is
  91471. // canceled.
  91472. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  91473. c.ctx_ = ctx
  91474. return c
  91475. }
  91476. // Header returns an http.Header that can be modified by the caller to
  91477. // add HTTP headers to the request.
  91478. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  91479. if c.header_ == nil {
  91480. c.header_ = make(http.Header)
  91481. }
  91482. return c.header_
  91483. }
  91484. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  91485. reqHeaders := make(http.Header)
  91486. for k, v := range c.header_ {
  91487. reqHeaders[k] = v
  91488. }
  91489. reqHeaders.Set("User-Agent", c.s.userAgent())
  91490. var body io.Reader = nil
  91491. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  91492. if err != nil {
  91493. return nil, err
  91494. }
  91495. reqHeaders.Set("Content-Type", "application/json")
  91496. c.urlParams_.Set("alt", alt)
  91497. c.urlParams_.Set("prettyPrint", "false")
  91498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  91499. urls += "?" + c.urlParams_.Encode()
  91500. req, err := http.NewRequest("POST", urls, body)
  91501. if err != nil {
  91502. return nil, err
  91503. }
  91504. req.Header = reqHeaders
  91505. googleapi.Expand(req.URL, map[string]string{
  91506. "project": c.project,
  91507. })
  91508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91509. }
  91510. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  91511. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91512. // status code is an error. Response headers are in either
  91513. // *Operation.ServerResponse.Header or (if a response was returned at
  91514. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91515. // to check whether the returned error was because
  91516. // http.StatusNotModified was returned.
  91517. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91518. gensupport.SetOptions(c.urlParams_, opts...)
  91519. res, err := c.doRequest("json")
  91520. if res != nil && res.StatusCode == http.StatusNotModified {
  91521. if res.Body != nil {
  91522. res.Body.Close()
  91523. }
  91524. return nil, &googleapi.Error{
  91525. Code: res.StatusCode,
  91526. Header: res.Header,
  91527. }
  91528. }
  91529. if err != nil {
  91530. return nil, err
  91531. }
  91532. defer googleapi.CloseBody(res)
  91533. if err := googleapi.CheckResponse(res); err != nil {
  91534. return nil, err
  91535. }
  91536. ret := &Operation{
  91537. ServerResponse: googleapi.ServerResponse{
  91538. Header: res.Header,
  91539. HTTPStatusCode: res.StatusCode,
  91540. },
  91541. }
  91542. target := &ret
  91543. if err := gensupport.DecodeResponse(target, res); err != nil {
  91544. return nil, err
  91545. }
  91546. return ret, nil
  91547. // {
  91548. // "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.",
  91549. // "httpMethod": "POST",
  91550. // "id": "compute.projects.setDefaultNetworkTier",
  91551. // "parameterOrder": [
  91552. // "project"
  91553. // ],
  91554. // "parameters": {
  91555. // "project": {
  91556. // "description": "Project ID for this request.",
  91557. // "location": "path",
  91558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91559. // "required": true,
  91560. // "type": "string"
  91561. // },
  91562. // "requestId": {
  91563. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91564. // "location": "query",
  91565. // "type": "string"
  91566. // }
  91567. // },
  91568. // "path": "{project}/setDefaultNetworkTier",
  91569. // "request": {
  91570. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  91571. // },
  91572. // "response": {
  91573. // "$ref": "Operation"
  91574. // },
  91575. // "scopes": [
  91576. // "https://www.googleapis.com/auth/cloud-platform",
  91577. // "https://www.googleapis.com/auth/compute"
  91578. // ]
  91579. // }
  91580. }
  91581. // method id "compute.projects.setDefaultServiceAccount":
  91582. type ProjectsSetDefaultServiceAccountCall struct {
  91583. s *Service
  91584. project string
  91585. projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest
  91586. urlParams_ gensupport.URLParams
  91587. ctx_ context.Context
  91588. header_ http.Header
  91589. }
  91590. // SetDefaultServiceAccount: Sets the default service account of the
  91591. // project. The default service account is used when a VM instance is
  91592. // created with the service account email address set to "default".
  91593. func (r *ProjectsService) SetDefaultServiceAccount(project string, projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest) *ProjectsSetDefaultServiceAccountCall {
  91594. c := &ProjectsSetDefaultServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91595. c.project = project
  91596. c.projectssetdefaultserviceaccountrequest = projectssetdefaultserviceaccountrequest
  91597. return c
  91598. }
  91599. // RequestId sets the optional parameter "requestId": An optional
  91600. // request ID to identify requests. Specify a unique request ID so that
  91601. // if you must retry your request, the server will know to ignore the
  91602. // request if it has already been completed.
  91603. //
  91604. // For example, consider a situation where you make an initial request
  91605. // and the request times out. If you make the request again with the
  91606. // same request ID, the server can check if original operation with the
  91607. // same request ID was received, and if so, will ignore the second
  91608. // request. This prevents clients from accidentally creating duplicate
  91609. // commitments.
  91610. //
  91611. // The request ID must be a valid UUID with the exception that zero UUID
  91612. // is not supported (00000000-0000-0000-0000-000000000000).
  91613. func (c *ProjectsSetDefaultServiceAccountCall) RequestId(requestId string) *ProjectsSetDefaultServiceAccountCall {
  91614. c.urlParams_.Set("requestId", requestId)
  91615. return c
  91616. }
  91617. // Fields allows partial responses to be retrieved. See
  91618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91619. // for more information.
  91620. func (c *ProjectsSetDefaultServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultServiceAccountCall {
  91621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91622. return c
  91623. }
  91624. // Context sets the context to be used in this call's Do method. Any
  91625. // pending HTTP request will be aborted if the provided context is
  91626. // canceled.
  91627. func (c *ProjectsSetDefaultServiceAccountCall) Context(ctx context.Context) *ProjectsSetDefaultServiceAccountCall {
  91628. c.ctx_ = ctx
  91629. return c
  91630. }
  91631. // Header returns an http.Header that can be modified by the caller to
  91632. // add HTTP headers to the request.
  91633. func (c *ProjectsSetDefaultServiceAccountCall) Header() http.Header {
  91634. if c.header_ == nil {
  91635. c.header_ = make(http.Header)
  91636. }
  91637. return c.header_
  91638. }
  91639. func (c *ProjectsSetDefaultServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  91640. reqHeaders := make(http.Header)
  91641. for k, v := range c.header_ {
  91642. reqHeaders[k] = v
  91643. }
  91644. reqHeaders.Set("User-Agent", c.s.userAgent())
  91645. var body io.Reader = nil
  91646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultserviceaccountrequest)
  91647. if err != nil {
  91648. return nil, err
  91649. }
  91650. reqHeaders.Set("Content-Type", "application/json")
  91651. c.urlParams_.Set("alt", alt)
  91652. c.urlParams_.Set("prettyPrint", "false")
  91653. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultServiceAccount")
  91654. urls += "?" + c.urlParams_.Encode()
  91655. req, err := http.NewRequest("POST", urls, body)
  91656. if err != nil {
  91657. return nil, err
  91658. }
  91659. req.Header = reqHeaders
  91660. googleapi.Expand(req.URL, map[string]string{
  91661. "project": c.project,
  91662. })
  91663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91664. }
  91665. // Do executes the "compute.projects.setDefaultServiceAccount" call.
  91666. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91667. // status code is an error. Response headers are in either
  91668. // *Operation.ServerResponse.Header or (if a response was returned at
  91669. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91670. // to check whether the returned error was because
  91671. // http.StatusNotModified was returned.
  91672. func (c *ProjectsSetDefaultServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91673. gensupport.SetOptions(c.urlParams_, opts...)
  91674. res, err := c.doRequest("json")
  91675. if res != nil && res.StatusCode == http.StatusNotModified {
  91676. if res.Body != nil {
  91677. res.Body.Close()
  91678. }
  91679. return nil, &googleapi.Error{
  91680. Code: res.StatusCode,
  91681. Header: res.Header,
  91682. }
  91683. }
  91684. if err != nil {
  91685. return nil, err
  91686. }
  91687. defer googleapi.CloseBody(res)
  91688. if err := googleapi.CheckResponse(res); err != nil {
  91689. return nil, err
  91690. }
  91691. ret := &Operation{
  91692. ServerResponse: googleapi.ServerResponse{
  91693. Header: res.Header,
  91694. HTTPStatusCode: res.StatusCode,
  91695. },
  91696. }
  91697. target := &ret
  91698. if err := gensupport.DecodeResponse(target, res); err != nil {
  91699. return nil, err
  91700. }
  91701. return ret, nil
  91702. // {
  91703. // "description": "Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to \"default\".",
  91704. // "httpMethod": "POST",
  91705. // "id": "compute.projects.setDefaultServiceAccount",
  91706. // "parameterOrder": [
  91707. // "project"
  91708. // ],
  91709. // "parameters": {
  91710. // "project": {
  91711. // "description": "Project ID for this request.",
  91712. // "location": "path",
  91713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91714. // "required": true,
  91715. // "type": "string"
  91716. // },
  91717. // "requestId": {
  91718. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91719. // "location": "query",
  91720. // "type": "string"
  91721. // }
  91722. // },
  91723. // "path": "{project}/setDefaultServiceAccount",
  91724. // "request": {
  91725. // "$ref": "ProjectsSetDefaultServiceAccountRequest"
  91726. // },
  91727. // "response": {
  91728. // "$ref": "Operation"
  91729. // },
  91730. // "scopes": [
  91731. // "https://www.googleapis.com/auth/cloud-platform",
  91732. // "https://www.googleapis.com/auth/compute"
  91733. // ]
  91734. // }
  91735. }
  91736. // method id "compute.projects.setUsageExportBucket":
  91737. type ProjectsSetUsageExportBucketCall struct {
  91738. s *Service
  91739. project string
  91740. usageexportlocation *UsageExportLocation
  91741. urlParams_ gensupport.URLParams
  91742. ctx_ context.Context
  91743. header_ http.Header
  91744. }
  91745. // SetUsageExportBucket: Enables the usage export feature and sets the
  91746. // usage export bucket where reports are stored. If you provide an empty
  91747. // request body using this method, the usage export feature will be
  91748. // disabled.
  91749. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  91750. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  91751. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91752. c.project = project
  91753. c.usageexportlocation = usageexportlocation
  91754. return c
  91755. }
  91756. // RequestId sets the optional parameter "requestId": An optional
  91757. // request ID to identify requests. Specify a unique request ID so that
  91758. // if you must retry your request, the server will know to ignore the
  91759. // request if it has already been completed.
  91760. //
  91761. // For example, consider a situation where you make an initial request
  91762. // and the request times out. If you make the request again with the
  91763. // same request ID, the server can check if original operation with the
  91764. // same request ID was received, and if so, will ignore the second
  91765. // request. This prevents clients from accidentally creating duplicate
  91766. // commitments.
  91767. //
  91768. // The request ID must be a valid UUID with the exception that zero UUID
  91769. // is not supported (00000000-0000-0000-0000-000000000000).
  91770. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  91771. c.urlParams_.Set("requestId", requestId)
  91772. return c
  91773. }
  91774. // Fields allows partial responses to be retrieved. See
  91775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91776. // for more information.
  91777. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  91778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91779. return c
  91780. }
  91781. // Context sets the context to be used in this call's Do method. Any
  91782. // pending HTTP request will be aborted if the provided context is
  91783. // canceled.
  91784. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  91785. c.ctx_ = ctx
  91786. return c
  91787. }
  91788. // Header returns an http.Header that can be modified by the caller to
  91789. // add HTTP headers to the request.
  91790. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  91791. if c.header_ == nil {
  91792. c.header_ = make(http.Header)
  91793. }
  91794. return c.header_
  91795. }
  91796. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  91797. reqHeaders := make(http.Header)
  91798. for k, v := range c.header_ {
  91799. reqHeaders[k] = v
  91800. }
  91801. reqHeaders.Set("User-Agent", c.s.userAgent())
  91802. var body io.Reader = nil
  91803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  91804. if err != nil {
  91805. return nil, err
  91806. }
  91807. reqHeaders.Set("Content-Type", "application/json")
  91808. c.urlParams_.Set("alt", alt)
  91809. c.urlParams_.Set("prettyPrint", "false")
  91810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  91811. urls += "?" + c.urlParams_.Encode()
  91812. req, err := http.NewRequest("POST", urls, body)
  91813. if err != nil {
  91814. return nil, err
  91815. }
  91816. req.Header = reqHeaders
  91817. googleapi.Expand(req.URL, map[string]string{
  91818. "project": c.project,
  91819. })
  91820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91821. }
  91822. // Do executes the "compute.projects.setUsageExportBucket" call.
  91823. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91824. // status code is an error. Response headers are in either
  91825. // *Operation.ServerResponse.Header or (if a response was returned at
  91826. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91827. // to check whether the returned error was because
  91828. // http.StatusNotModified was returned.
  91829. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91830. gensupport.SetOptions(c.urlParams_, opts...)
  91831. res, err := c.doRequest("json")
  91832. if res != nil && res.StatusCode == http.StatusNotModified {
  91833. if res.Body != nil {
  91834. res.Body.Close()
  91835. }
  91836. return nil, &googleapi.Error{
  91837. Code: res.StatusCode,
  91838. Header: res.Header,
  91839. }
  91840. }
  91841. if err != nil {
  91842. return nil, err
  91843. }
  91844. defer googleapi.CloseBody(res)
  91845. if err := googleapi.CheckResponse(res); err != nil {
  91846. return nil, err
  91847. }
  91848. ret := &Operation{
  91849. ServerResponse: googleapi.ServerResponse{
  91850. Header: res.Header,
  91851. HTTPStatusCode: res.StatusCode,
  91852. },
  91853. }
  91854. target := &ret
  91855. if err := gensupport.DecodeResponse(target, res); err != nil {
  91856. return nil, err
  91857. }
  91858. return ret, nil
  91859. // {
  91860. // "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.",
  91861. // "httpMethod": "POST",
  91862. // "id": "compute.projects.setUsageExportBucket",
  91863. // "parameterOrder": [
  91864. // "project"
  91865. // ],
  91866. // "parameters": {
  91867. // "project": {
  91868. // "description": "Project ID for this request.",
  91869. // "location": "path",
  91870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91871. // "required": true,
  91872. // "type": "string"
  91873. // },
  91874. // "requestId": {
  91875. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91876. // "location": "query",
  91877. // "type": "string"
  91878. // }
  91879. // },
  91880. // "path": "{project}/setUsageExportBucket",
  91881. // "request": {
  91882. // "$ref": "UsageExportLocation"
  91883. // },
  91884. // "response": {
  91885. // "$ref": "Operation"
  91886. // },
  91887. // "scopes": [
  91888. // "https://www.googleapis.com/auth/cloud-platform",
  91889. // "https://www.googleapis.com/auth/compute",
  91890. // "https://www.googleapis.com/auth/devstorage.full_control",
  91891. // "https://www.googleapis.com/auth/devstorage.read_only",
  91892. // "https://www.googleapis.com/auth/devstorage.read_write"
  91893. // ]
  91894. // }
  91895. }
  91896. // method id "compute.regionAutoscalers.delete":
  91897. type RegionAutoscalersDeleteCall struct {
  91898. s *Service
  91899. project string
  91900. region string
  91901. autoscaler string
  91902. urlParams_ gensupport.URLParams
  91903. ctx_ context.Context
  91904. header_ http.Header
  91905. }
  91906. // Delete: Deletes the specified autoscaler.
  91907. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  91908. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91909. c.project = project
  91910. c.region = region
  91911. c.autoscaler = autoscaler
  91912. return c
  91913. }
  91914. // RequestId sets the optional parameter "requestId": An optional
  91915. // request ID to identify requests. Specify a unique request ID so that
  91916. // if you must retry your request, the server will know to ignore the
  91917. // request if it has already been completed.
  91918. //
  91919. // For example, consider a situation where you make an initial request
  91920. // and the request times out. If you make the request again with the
  91921. // same request ID, the server can check if original operation with the
  91922. // same request ID was received, and if so, will ignore the second
  91923. // request. This prevents clients from accidentally creating duplicate
  91924. // commitments.
  91925. //
  91926. // The request ID must be a valid UUID with the exception that zero UUID
  91927. // is not supported (00000000-0000-0000-0000-000000000000).
  91928. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  91929. c.urlParams_.Set("requestId", requestId)
  91930. return c
  91931. }
  91932. // Fields allows partial responses to be retrieved. See
  91933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91934. // for more information.
  91935. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  91936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91937. return c
  91938. }
  91939. // Context sets the context to be used in this call's Do method. Any
  91940. // pending HTTP request will be aborted if the provided context is
  91941. // canceled.
  91942. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  91943. c.ctx_ = ctx
  91944. return c
  91945. }
  91946. // Header returns an http.Header that can be modified by the caller to
  91947. // add HTTP headers to the request.
  91948. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  91949. if c.header_ == nil {
  91950. c.header_ = make(http.Header)
  91951. }
  91952. return c.header_
  91953. }
  91954. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  91955. reqHeaders := make(http.Header)
  91956. for k, v := range c.header_ {
  91957. reqHeaders[k] = v
  91958. }
  91959. reqHeaders.Set("User-Agent", c.s.userAgent())
  91960. var body io.Reader = nil
  91961. c.urlParams_.Set("alt", alt)
  91962. c.urlParams_.Set("prettyPrint", "false")
  91963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  91964. urls += "?" + c.urlParams_.Encode()
  91965. req, err := http.NewRequest("DELETE", urls, body)
  91966. if err != nil {
  91967. return nil, err
  91968. }
  91969. req.Header = reqHeaders
  91970. googleapi.Expand(req.URL, map[string]string{
  91971. "project": c.project,
  91972. "region": c.region,
  91973. "autoscaler": c.autoscaler,
  91974. })
  91975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91976. }
  91977. // Do executes the "compute.regionAutoscalers.delete" call.
  91978. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91979. // status code is an error. Response headers are in either
  91980. // *Operation.ServerResponse.Header or (if a response was returned at
  91981. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91982. // to check whether the returned error was because
  91983. // http.StatusNotModified was returned.
  91984. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91985. gensupport.SetOptions(c.urlParams_, opts...)
  91986. res, err := c.doRequest("json")
  91987. if res != nil && res.StatusCode == http.StatusNotModified {
  91988. if res.Body != nil {
  91989. res.Body.Close()
  91990. }
  91991. return nil, &googleapi.Error{
  91992. Code: res.StatusCode,
  91993. Header: res.Header,
  91994. }
  91995. }
  91996. if err != nil {
  91997. return nil, err
  91998. }
  91999. defer googleapi.CloseBody(res)
  92000. if err := googleapi.CheckResponse(res); err != nil {
  92001. return nil, err
  92002. }
  92003. ret := &Operation{
  92004. ServerResponse: googleapi.ServerResponse{
  92005. Header: res.Header,
  92006. HTTPStatusCode: res.StatusCode,
  92007. },
  92008. }
  92009. target := &ret
  92010. if err := gensupport.DecodeResponse(target, res); err != nil {
  92011. return nil, err
  92012. }
  92013. return ret, nil
  92014. // {
  92015. // "description": "Deletes the specified autoscaler.",
  92016. // "httpMethod": "DELETE",
  92017. // "id": "compute.regionAutoscalers.delete",
  92018. // "parameterOrder": [
  92019. // "project",
  92020. // "region",
  92021. // "autoscaler"
  92022. // ],
  92023. // "parameters": {
  92024. // "autoscaler": {
  92025. // "description": "Name of the autoscaler to delete.",
  92026. // "location": "path",
  92027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92028. // "required": true,
  92029. // "type": "string"
  92030. // },
  92031. // "project": {
  92032. // "description": "Project ID for this request.",
  92033. // "location": "path",
  92034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92035. // "required": true,
  92036. // "type": "string"
  92037. // },
  92038. // "region": {
  92039. // "description": "Name of the region scoping this request.",
  92040. // "location": "path",
  92041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92042. // "required": true,
  92043. // "type": "string"
  92044. // },
  92045. // "requestId": {
  92046. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92047. // "location": "query",
  92048. // "type": "string"
  92049. // }
  92050. // },
  92051. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  92052. // "response": {
  92053. // "$ref": "Operation"
  92054. // },
  92055. // "scopes": [
  92056. // "https://www.googleapis.com/auth/cloud-platform",
  92057. // "https://www.googleapis.com/auth/compute"
  92058. // ]
  92059. // }
  92060. }
  92061. // method id "compute.regionAutoscalers.get":
  92062. type RegionAutoscalersGetCall struct {
  92063. s *Service
  92064. project string
  92065. region string
  92066. autoscaler string
  92067. urlParams_ gensupport.URLParams
  92068. ifNoneMatch_ string
  92069. ctx_ context.Context
  92070. header_ http.Header
  92071. }
  92072. // Get: Returns the specified autoscaler.
  92073. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  92074. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92075. c.project = project
  92076. c.region = region
  92077. c.autoscaler = autoscaler
  92078. return c
  92079. }
  92080. // Fields allows partial responses to be retrieved. See
  92081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92082. // for more information.
  92083. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  92084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92085. return c
  92086. }
  92087. // IfNoneMatch sets the optional parameter which makes the operation
  92088. // fail if the object's ETag matches the given value. This is useful for
  92089. // getting updates only after the object has changed since the last
  92090. // request. Use googleapi.IsNotModified to check whether the response
  92091. // error from Do is the result of In-None-Match.
  92092. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  92093. c.ifNoneMatch_ = entityTag
  92094. return c
  92095. }
  92096. // Context sets the context to be used in this call's Do method. Any
  92097. // pending HTTP request will be aborted if the provided context is
  92098. // canceled.
  92099. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  92100. c.ctx_ = ctx
  92101. return c
  92102. }
  92103. // Header returns an http.Header that can be modified by the caller to
  92104. // add HTTP headers to the request.
  92105. func (c *RegionAutoscalersGetCall) Header() http.Header {
  92106. if c.header_ == nil {
  92107. c.header_ = make(http.Header)
  92108. }
  92109. return c.header_
  92110. }
  92111. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  92112. reqHeaders := make(http.Header)
  92113. for k, v := range c.header_ {
  92114. reqHeaders[k] = v
  92115. }
  92116. reqHeaders.Set("User-Agent", c.s.userAgent())
  92117. if c.ifNoneMatch_ != "" {
  92118. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92119. }
  92120. var body io.Reader = nil
  92121. c.urlParams_.Set("alt", alt)
  92122. c.urlParams_.Set("prettyPrint", "false")
  92123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  92124. urls += "?" + c.urlParams_.Encode()
  92125. req, err := http.NewRequest("GET", urls, body)
  92126. if err != nil {
  92127. return nil, err
  92128. }
  92129. req.Header = reqHeaders
  92130. googleapi.Expand(req.URL, map[string]string{
  92131. "project": c.project,
  92132. "region": c.region,
  92133. "autoscaler": c.autoscaler,
  92134. })
  92135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92136. }
  92137. // Do executes the "compute.regionAutoscalers.get" call.
  92138. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  92139. // status code is an error. Response headers are in either
  92140. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  92141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92142. // to check whether the returned error was because
  92143. // http.StatusNotModified was returned.
  92144. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  92145. gensupport.SetOptions(c.urlParams_, opts...)
  92146. res, err := c.doRequest("json")
  92147. if res != nil && res.StatusCode == http.StatusNotModified {
  92148. if res.Body != nil {
  92149. res.Body.Close()
  92150. }
  92151. return nil, &googleapi.Error{
  92152. Code: res.StatusCode,
  92153. Header: res.Header,
  92154. }
  92155. }
  92156. if err != nil {
  92157. return nil, err
  92158. }
  92159. defer googleapi.CloseBody(res)
  92160. if err := googleapi.CheckResponse(res); err != nil {
  92161. return nil, err
  92162. }
  92163. ret := &Autoscaler{
  92164. ServerResponse: googleapi.ServerResponse{
  92165. Header: res.Header,
  92166. HTTPStatusCode: res.StatusCode,
  92167. },
  92168. }
  92169. target := &ret
  92170. if err := gensupport.DecodeResponse(target, res); err != nil {
  92171. return nil, err
  92172. }
  92173. return ret, nil
  92174. // {
  92175. // "description": "Returns the specified autoscaler.",
  92176. // "httpMethod": "GET",
  92177. // "id": "compute.regionAutoscalers.get",
  92178. // "parameterOrder": [
  92179. // "project",
  92180. // "region",
  92181. // "autoscaler"
  92182. // ],
  92183. // "parameters": {
  92184. // "autoscaler": {
  92185. // "description": "Name of the autoscaler to return.",
  92186. // "location": "path",
  92187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92188. // "required": true,
  92189. // "type": "string"
  92190. // },
  92191. // "project": {
  92192. // "description": "Project ID for this request.",
  92193. // "location": "path",
  92194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92195. // "required": true,
  92196. // "type": "string"
  92197. // },
  92198. // "region": {
  92199. // "description": "Name of the region scoping this request.",
  92200. // "location": "path",
  92201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92202. // "required": true,
  92203. // "type": "string"
  92204. // }
  92205. // },
  92206. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  92207. // "response": {
  92208. // "$ref": "Autoscaler"
  92209. // },
  92210. // "scopes": [
  92211. // "https://www.googleapis.com/auth/cloud-platform",
  92212. // "https://www.googleapis.com/auth/compute",
  92213. // "https://www.googleapis.com/auth/compute.readonly"
  92214. // ]
  92215. // }
  92216. }
  92217. // method id "compute.regionAutoscalers.insert":
  92218. type RegionAutoscalersInsertCall struct {
  92219. s *Service
  92220. project string
  92221. region string
  92222. autoscaler *Autoscaler
  92223. urlParams_ gensupport.URLParams
  92224. ctx_ context.Context
  92225. header_ http.Header
  92226. }
  92227. // Insert: Creates an autoscaler in the specified project using the data
  92228. // included in the request.
  92229. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  92230. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92231. c.project = project
  92232. c.region = region
  92233. c.autoscaler = autoscaler
  92234. return c
  92235. }
  92236. // RequestId sets the optional parameter "requestId": An optional
  92237. // request ID to identify requests. Specify a unique request ID so that
  92238. // if you must retry your request, the server will know to ignore the
  92239. // request if it has already been completed.
  92240. //
  92241. // For example, consider a situation where you make an initial request
  92242. // and the request times out. If you make the request again with the
  92243. // same request ID, the server can check if original operation with the
  92244. // same request ID was received, and if so, will ignore the second
  92245. // request. This prevents clients from accidentally creating duplicate
  92246. // commitments.
  92247. //
  92248. // The request ID must be a valid UUID with the exception that zero UUID
  92249. // is not supported (00000000-0000-0000-0000-000000000000).
  92250. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  92251. c.urlParams_.Set("requestId", requestId)
  92252. return c
  92253. }
  92254. // Fields allows partial responses to be retrieved. See
  92255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92256. // for more information.
  92257. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  92258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92259. return c
  92260. }
  92261. // Context sets the context to be used in this call's Do method. Any
  92262. // pending HTTP request will be aborted if the provided context is
  92263. // canceled.
  92264. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  92265. c.ctx_ = ctx
  92266. return c
  92267. }
  92268. // Header returns an http.Header that can be modified by the caller to
  92269. // add HTTP headers to the request.
  92270. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  92271. if c.header_ == nil {
  92272. c.header_ = make(http.Header)
  92273. }
  92274. return c.header_
  92275. }
  92276. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  92277. reqHeaders := make(http.Header)
  92278. for k, v := range c.header_ {
  92279. reqHeaders[k] = v
  92280. }
  92281. reqHeaders.Set("User-Agent", c.s.userAgent())
  92282. var body io.Reader = nil
  92283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  92284. if err != nil {
  92285. return nil, err
  92286. }
  92287. reqHeaders.Set("Content-Type", "application/json")
  92288. c.urlParams_.Set("alt", alt)
  92289. c.urlParams_.Set("prettyPrint", "false")
  92290. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  92291. urls += "?" + c.urlParams_.Encode()
  92292. req, err := http.NewRequest("POST", urls, body)
  92293. if err != nil {
  92294. return nil, err
  92295. }
  92296. req.Header = reqHeaders
  92297. googleapi.Expand(req.URL, map[string]string{
  92298. "project": c.project,
  92299. "region": c.region,
  92300. })
  92301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92302. }
  92303. // Do executes the "compute.regionAutoscalers.insert" call.
  92304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92305. // status code is an error. Response headers are in either
  92306. // *Operation.ServerResponse.Header or (if a response was returned at
  92307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92308. // to check whether the returned error was because
  92309. // http.StatusNotModified was returned.
  92310. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92311. gensupport.SetOptions(c.urlParams_, opts...)
  92312. res, err := c.doRequest("json")
  92313. if res != nil && res.StatusCode == http.StatusNotModified {
  92314. if res.Body != nil {
  92315. res.Body.Close()
  92316. }
  92317. return nil, &googleapi.Error{
  92318. Code: res.StatusCode,
  92319. Header: res.Header,
  92320. }
  92321. }
  92322. if err != nil {
  92323. return nil, err
  92324. }
  92325. defer googleapi.CloseBody(res)
  92326. if err := googleapi.CheckResponse(res); err != nil {
  92327. return nil, err
  92328. }
  92329. ret := &Operation{
  92330. ServerResponse: googleapi.ServerResponse{
  92331. Header: res.Header,
  92332. HTTPStatusCode: res.StatusCode,
  92333. },
  92334. }
  92335. target := &ret
  92336. if err := gensupport.DecodeResponse(target, res); err != nil {
  92337. return nil, err
  92338. }
  92339. return ret, nil
  92340. // {
  92341. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  92342. // "httpMethod": "POST",
  92343. // "id": "compute.regionAutoscalers.insert",
  92344. // "parameterOrder": [
  92345. // "project",
  92346. // "region"
  92347. // ],
  92348. // "parameters": {
  92349. // "project": {
  92350. // "description": "Project ID for this request.",
  92351. // "location": "path",
  92352. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92353. // "required": true,
  92354. // "type": "string"
  92355. // },
  92356. // "region": {
  92357. // "description": "Name of the region scoping this request.",
  92358. // "location": "path",
  92359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92360. // "required": true,
  92361. // "type": "string"
  92362. // },
  92363. // "requestId": {
  92364. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92365. // "location": "query",
  92366. // "type": "string"
  92367. // }
  92368. // },
  92369. // "path": "{project}/regions/{region}/autoscalers",
  92370. // "request": {
  92371. // "$ref": "Autoscaler"
  92372. // },
  92373. // "response": {
  92374. // "$ref": "Operation"
  92375. // },
  92376. // "scopes": [
  92377. // "https://www.googleapis.com/auth/cloud-platform",
  92378. // "https://www.googleapis.com/auth/compute"
  92379. // ]
  92380. // }
  92381. }
  92382. // method id "compute.regionAutoscalers.list":
  92383. type RegionAutoscalersListCall struct {
  92384. s *Service
  92385. project string
  92386. region string
  92387. urlParams_ gensupport.URLParams
  92388. ifNoneMatch_ string
  92389. ctx_ context.Context
  92390. header_ http.Header
  92391. }
  92392. // List: Retrieves a list of autoscalers contained within the specified
  92393. // region.
  92394. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  92395. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92396. c.project = project
  92397. c.region = region
  92398. return c
  92399. }
  92400. // Filter sets the optional parameter "filter": A filter expression that
  92401. // filters resources listed in the response. The expression must specify
  92402. // the field name, a comparison operator, and the value that you want to
  92403. // use for filtering. The value must be a string, a number, or a
  92404. // boolean. The comparison operator must be either =, !=, >, or <.
  92405. //
  92406. // For example, if you are filtering Compute Engine instances, you can
  92407. // exclude instances named example-instance by specifying name !=
  92408. // example-instance.
  92409. //
  92410. // You can also filter nested fields. For example, you could specify
  92411. // scheduling.automaticRestart = false to include instances only if they
  92412. // are not scheduled for automatic restarts. You can use filtering on
  92413. // nested fields to filter based on resource labels.
  92414. //
  92415. // To filter on multiple expressions, provide each separate expression
  92416. // within parentheses. For example, (scheduling.automaticRestart = true)
  92417. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92418. // AND expression. However, you can include AND and OR expressions
  92419. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92420. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92421. // true).
  92422. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  92423. c.urlParams_.Set("filter", filter)
  92424. return c
  92425. }
  92426. // MaxResults sets the optional parameter "maxResults": The maximum
  92427. // number of results per page that should be returned. If the number of
  92428. // available results is larger than maxResults, Compute Engine returns a
  92429. // nextPageToken that can be used to get the next page of results in
  92430. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92431. // (Default: 500)
  92432. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  92433. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92434. return c
  92435. }
  92436. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92437. // a certain order. By default, results are returned in alphanumerical
  92438. // order based on the resource name.
  92439. //
  92440. // You can also sort results in descending order based on the creation
  92441. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92442. // based on the creationTimestamp field in reverse chronological order
  92443. // (newest result first). Use this to sort resources like operations so
  92444. // that the newest operation is returned first.
  92445. //
  92446. // Currently, only sorting by name or creationTimestamp desc is
  92447. // supported.
  92448. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  92449. c.urlParams_.Set("orderBy", orderBy)
  92450. return c
  92451. }
  92452. // PageToken sets the optional parameter "pageToken": Specifies a page
  92453. // token to use. Set pageToken to the nextPageToken returned by a
  92454. // previous list request to get the next page of results.
  92455. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  92456. c.urlParams_.Set("pageToken", pageToken)
  92457. return c
  92458. }
  92459. // Fields allows partial responses to be retrieved. See
  92460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92461. // for more information.
  92462. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  92463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92464. return c
  92465. }
  92466. // IfNoneMatch sets the optional parameter which makes the operation
  92467. // fail if the object's ETag matches the given value. This is useful for
  92468. // getting updates only after the object has changed since the last
  92469. // request. Use googleapi.IsNotModified to check whether the response
  92470. // error from Do is the result of In-None-Match.
  92471. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  92472. c.ifNoneMatch_ = entityTag
  92473. return c
  92474. }
  92475. // Context sets the context to be used in this call's Do method. Any
  92476. // pending HTTP request will be aborted if the provided context is
  92477. // canceled.
  92478. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  92479. c.ctx_ = ctx
  92480. return c
  92481. }
  92482. // Header returns an http.Header that can be modified by the caller to
  92483. // add HTTP headers to the request.
  92484. func (c *RegionAutoscalersListCall) Header() http.Header {
  92485. if c.header_ == nil {
  92486. c.header_ = make(http.Header)
  92487. }
  92488. return c.header_
  92489. }
  92490. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  92491. reqHeaders := make(http.Header)
  92492. for k, v := range c.header_ {
  92493. reqHeaders[k] = v
  92494. }
  92495. reqHeaders.Set("User-Agent", c.s.userAgent())
  92496. if c.ifNoneMatch_ != "" {
  92497. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92498. }
  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}/regions/{region}/autoscalers")
  92503. urls += "?" + c.urlParams_.Encode()
  92504. req, err := http.NewRequest("GET", 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. "region": c.region,
  92512. })
  92513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92514. }
  92515. // Do executes the "compute.regionAutoscalers.list" call.
  92516. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  92517. // non-2xx status code is an error. Response headers are in either
  92518. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  92519. // returned at all) in error.(*googleapi.Error).Header. Use
  92520. // googleapi.IsNotModified to check whether the returned error was
  92521. // because http.StatusNotModified was returned.
  92522. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, 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 := &RegionAutoscalerList{
  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": "Retrieves a list of autoscalers contained within the specified region.",
  92554. // "httpMethod": "GET",
  92555. // "id": "compute.regionAutoscalers.list",
  92556. // "parameterOrder": [
  92557. // "project",
  92558. // "region"
  92559. // ],
  92560. // "parameters": {
  92561. // "filter": {
  92562. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92563. // "location": "query",
  92564. // "type": "string"
  92565. // },
  92566. // "maxResults": {
  92567. // "default": "500",
  92568. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92569. // "format": "uint32",
  92570. // "location": "query",
  92571. // "minimum": "0",
  92572. // "type": "integer"
  92573. // },
  92574. // "orderBy": {
  92575. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92576. // "location": "query",
  92577. // "type": "string"
  92578. // },
  92579. // "pageToken": {
  92580. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92581. // "location": "query",
  92582. // "type": "string"
  92583. // },
  92584. // "project": {
  92585. // "description": "Project ID for this request.",
  92586. // "location": "path",
  92587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92588. // "required": true,
  92589. // "type": "string"
  92590. // },
  92591. // "region": {
  92592. // "description": "Name of the region scoping this request.",
  92593. // "location": "path",
  92594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92595. // "required": true,
  92596. // "type": "string"
  92597. // }
  92598. // },
  92599. // "path": "{project}/regions/{region}/autoscalers",
  92600. // "response": {
  92601. // "$ref": "RegionAutoscalerList"
  92602. // },
  92603. // "scopes": [
  92604. // "https://www.googleapis.com/auth/cloud-platform",
  92605. // "https://www.googleapis.com/auth/compute",
  92606. // "https://www.googleapis.com/auth/compute.readonly"
  92607. // ]
  92608. // }
  92609. }
  92610. // Pages invokes f for each page of results.
  92611. // A non-nil error returned from f will halt the iteration.
  92612. // The provided context supersedes any context provided to the Context method.
  92613. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  92614. c.ctx_ = ctx
  92615. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92616. for {
  92617. x, err := c.Do()
  92618. if err != nil {
  92619. return err
  92620. }
  92621. if err := f(x); err != nil {
  92622. return err
  92623. }
  92624. if x.NextPageToken == "" {
  92625. return nil
  92626. }
  92627. c.PageToken(x.NextPageToken)
  92628. }
  92629. }
  92630. // method id "compute.regionAutoscalers.patch":
  92631. type RegionAutoscalersPatchCall struct {
  92632. s *Service
  92633. project string
  92634. region string
  92635. autoscaler *Autoscaler
  92636. urlParams_ gensupport.URLParams
  92637. ctx_ context.Context
  92638. header_ http.Header
  92639. }
  92640. // Patch: Updates an autoscaler in the specified project using the data
  92641. // included in the request. This method supports PATCH semantics and
  92642. // uses the JSON merge patch format and processing rules.
  92643. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  92644. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92645. c.project = project
  92646. c.region = region
  92647. c.autoscaler = autoscaler
  92648. return c
  92649. }
  92650. // Autoscaler sets the optional parameter "autoscaler": Name of the
  92651. // autoscaler to patch.
  92652. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  92653. c.urlParams_.Set("autoscaler", autoscaler)
  92654. return c
  92655. }
  92656. // RequestId sets the optional parameter "requestId": An optional
  92657. // request ID to identify requests. Specify a unique request ID so that
  92658. // if you must retry your request, the server will know to ignore the
  92659. // request if it has already been completed.
  92660. //
  92661. // For example, consider a situation where you make an initial request
  92662. // and the request times out. If you make the request again with the
  92663. // same request ID, the server can check if original operation with the
  92664. // same request ID was received, and if so, will ignore the second
  92665. // request. This prevents clients from accidentally creating duplicate
  92666. // commitments.
  92667. //
  92668. // The request ID must be a valid UUID with the exception that zero UUID
  92669. // is not supported (00000000-0000-0000-0000-000000000000).
  92670. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  92671. c.urlParams_.Set("requestId", requestId)
  92672. return c
  92673. }
  92674. // Fields allows partial responses to be retrieved. See
  92675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92676. // for more information.
  92677. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  92678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92679. return c
  92680. }
  92681. // Context sets the context to be used in this call's Do method. Any
  92682. // pending HTTP request will be aborted if the provided context is
  92683. // canceled.
  92684. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  92685. c.ctx_ = ctx
  92686. return c
  92687. }
  92688. // Header returns an http.Header that can be modified by the caller to
  92689. // add HTTP headers to the request.
  92690. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  92691. if c.header_ == nil {
  92692. c.header_ = make(http.Header)
  92693. }
  92694. return c.header_
  92695. }
  92696. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  92697. reqHeaders := make(http.Header)
  92698. for k, v := range c.header_ {
  92699. reqHeaders[k] = v
  92700. }
  92701. reqHeaders.Set("User-Agent", c.s.userAgent())
  92702. var body io.Reader = nil
  92703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  92704. if err != nil {
  92705. return nil, err
  92706. }
  92707. reqHeaders.Set("Content-Type", "application/json")
  92708. c.urlParams_.Set("alt", alt)
  92709. c.urlParams_.Set("prettyPrint", "false")
  92710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  92711. urls += "?" + c.urlParams_.Encode()
  92712. req, err := http.NewRequest("PATCH", urls, body)
  92713. if err != nil {
  92714. return nil, err
  92715. }
  92716. req.Header = reqHeaders
  92717. googleapi.Expand(req.URL, map[string]string{
  92718. "project": c.project,
  92719. "region": c.region,
  92720. })
  92721. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92722. }
  92723. // Do executes the "compute.regionAutoscalers.patch" call.
  92724. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92725. // status code is an error. Response headers are in either
  92726. // *Operation.ServerResponse.Header or (if a response was returned at
  92727. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92728. // to check whether the returned error was because
  92729. // http.StatusNotModified was returned.
  92730. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92731. gensupport.SetOptions(c.urlParams_, opts...)
  92732. res, err := c.doRequest("json")
  92733. if res != nil && res.StatusCode == http.StatusNotModified {
  92734. if res.Body != nil {
  92735. res.Body.Close()
  92736. }
  92737. return nil, &googleapi.Error{
  92738. Code: res.StatusCode,
  92739. Header: res.Header,
  92740. }
  92741. }
  92742. if err != nil {
  92743. return nil, err
  92744. }
  92745. defer googleapi.CloseBody(res)
  92746. if err := googleapi.CheckResponse(res); err != nil {
  92747. return nil, err
  92748. }
  92749. ret := &Operation{
  92750. ServerResponse: googleapi.ServerResponse{
  92751. Header: res.Header,
  92752. HTTPStatusCode: res.StatusCode,
  92753. },
  92754. }
  92755. target := &ret
  92756. if err := gensupport.DecodeResponse(target, res); err != nil {
  92757. return nil, err
  92758. }
  92759. return ret, nil
  92760. // {
  92761. // "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.",
  92762. // "httpMethod": "PATCH",
  92763. // "id": "compute.regionAutoscalers.patch",
  92764. // "parameterOrder": [
  92765. // "project",
  92766. // "region"
  92767. // ],
  92768. // "parameters": {
  92769. // "autoscaler": {
  92770. // "description": "Name of the autoscaler to patch.",
  92771. // "location": "query",
  92772. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92773. // "type": "string"
  92774. // },
  92775. // "project": {
  92776. // "description": "Project ID for this request.",
  92777. // "location": "path",
  92778. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92779. // "required": true,
  92780. // "type": "string"
  92781. // },
  92782. // "region": {
  92783. // "description": "Name of the region scoping this request.",
  92784. // "location": "path",
  92785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92786. // "required": true,
  92787. // "type": "string"
  92788. // },
  92789. // "requestId": {
  92790. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92791. // "location": "query",
  92792. // "type": "string"
  92793. // }
  92794. // },
  92795. // "path": "{project}/regions/{region}/autoscalers",
  92796. // "request": {
  92797. // "$ref": "Autoscaler"
  92798. // },
  92799. // "response": {
  92800. // "$ref": "Operation"
  92801. // },
  92802. // "scopes": [
  92803. // "https://www.googleapis.com/auth/cloud-platform",
  92804. // "https://www.googleapis.com/auth/compute"
  92805. // ]
  92806. // }
  92807. }
  92808. // method id "compute.regionAutoscalers.testIamPermissions":
  92809. type RegionAutoscalersTestIamPermissionsCall struct {
  92810. s *Service
  92811. project string
  92812. region string
  92813. resource string
  92814. testpermissionsrequest *TestPermissionsRequest
  92815. urlParams_ gensupport.URLParams
  92816. ctx_ context.Context
  92817. header_ http.Header
  92818. }
  92819. // TestIamPermissions: Returns permissions that a caller has on the
  92820. // specified resource.
  92821. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  92822. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92823. c.project = project
  92824. c.region = region
  92825. c.resource = resource
  92826. c.testpermissionsrequest = testpermissionsrequest
  92827. return c
  92828. }
  92829. // Fields allows partial responses to be retrieved. See
  92830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92831. // for more information.
  92832. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  92833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92834. return c
  92835. }
  92836. // Context sets the context to be used in this call's Do method. Any
  92837. // pending HTTP request will be aborted if the provided context is
  92838. // canceled.
  92839. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  92840. c.ctx_ = ctx
  92841. return c
  92842. }
  92843. // Header returns an http.Header that can be modified by the caller to
  92844. // add HTTP headers to the request.
  92845. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  92846. if c.header_ == nil {
  92847. c.header_ = make(http.Header)
  92848. }
  92849. return c.header_
  92850. }
  92851. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92852. reqHeaders := make(http.Header)
  92853. for k, v := range c.header_ {
  92854. reqHeaders[k] = v
  92855. }
  92856. reqHeaders.Set("User-Agent", c.s.userAgent())
  92857. var body io.Reader = nil
  92858. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92859. if err != nil {
  92860. return nil, err
  92861. }
  92862. reqHeaders.Set("Content-Type", "application/json")
  92863. c.urlParams_.Set("alt", alt)
  92864. c.urlParams_.Set("prettyPrint", "false")
  92865. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  92866. urls += "?" + c.urlParams_.Encode()
  92867. req, err := http.NewRequest("POST", urls, body)
  92868. if err != nil {
  92869. return nil, err
  92870. }
  92871. req.Header = reqHeaders
  92872. googleapi.Expand(req.URL, map[string]string{
  92873. "project": c.project,
  92874. "region": c.region,
  92875. "resource": c.resource,
  92876. })
  92877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92878. }
  92879. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  92880. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92881. // non-2xx status code is an error. Response headers are in either
  92882. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92883. // returned at all) in error.(*googleapi.Error).Header. Use
  92884. // googleapi.IsNotModified to check whether the returned error was
  92885. // because http.StatusNotModified was returned.
  92886. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92887. gensupport.SetOptions(c.urlParams_, opts...)
  92888. res, err := c.doRequest("json")
  92889. if res != nil && res.StatusCode == http.StatusNotModified {
  92890. if res.Body != nil {
  92891. res.Body.Close()
  92892. }
  92893. return nil, &googleapi.Error{
  92894. Code: res.StatusCode,
  92895. Header: res.Header,
  92896. }
  92897. }
  92898. if err != nil {
  92899. return nil, err
  92900. }
  92901. defer googleapi.CloseBody(res)
  92902. if err := googleapi.CheckResponse(res); err != nil {
  92903. return nil, err
  92904. }
  92905. ret := &TestPermissionsResponse{
  92906. ServerResponse: googleapi.ServerResponse{
  92907. Header: res.Header,
  92908. HTTPStatusCode: res.StatusCode,
  92909. },
  92910. }
  92911. target := &ret
  92912. if err := gensupport.DecodeResponse(target, res); err != nil {
  92913. return nil, err
  92914. }
  92915. return ret, nil
  92916. // {
  92917. // "description": "Returns permissions that a caller has on the specified resource.",
  92918. // "httpMethod": "POST",
  92919. // "id": "compute.regionAutoscalers.testIamPermissions",
  92920. // "parameterOrder": [
  92921. // "project",
  92922. // "region",
  92923. // "resource"
  92924. // ],
  92925. // "parameters": {
  92926. // "project": {
  92927. // "description": "Project ID for this request.",
  92928. // "location": "path",
  92929. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92930. // "required": true,
  92931. // "type": "string"
  92932. // },
  92933. // "region": {
  92934. // "description": "The name of the region for this request.",
  92935. // "location": "path",
  92936. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92937. // "required": true,
  92938. // "type": "string"
  92939. // },
  92940. // "resource": {
  92941. // "description": "Name or id of the resource for this request.",
  92942. // "location": "path",
  92943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92944. // "required": true,
  92945. // "type": "string"
  92946. // }
  92947. // },
  92948. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  92949. // "request": {
  92950. // "$ref": "TestPermissionsRequest"
  92951. // },
  92952. // "response": {
  92953. // "$ref": "TestPermissionsResponse"
  92954. // },
  92955. // "scopes": [
  92956. // "https://www.googleapis.com/auth/cloud-platform",
  92957. // "https://www.googleapis.com/auth/compute",
  92958. // "https://www.googleapis.com/auth/compute.readonly"
  92959. // ]
  92960. // }
  92961. }
  92962. // method id "compute.regionAutoscalers.update":
  92963. type RegionAutoscalersUpdateCall struct {
  92964. s *Service
  92965. project string
  92966. region string
  92967. autoscaler *Autoscaler
  92968. urlParams_ gensupport.URLParams
  92969. ctx_ context.Context
  92970. header_ http.Header
  92971. }
  92972. // Update: Updates an autoscaler in the specified project using the data
  92973. // included in the request.
  92974. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  92975. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92976. c.project = project
  92977. c.region = region
  92978. c.autoscaler = autoscaler
  92979. return c
  92980. }
  92981. // Autoscaler sets the optional parameter "autoscaler": Name of the
  92982. // autoscaler to update.
  92983. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  92984. c.urlParams_.Set("autoscaler", autoscaler)
  92985. return c
  92986. }
  92987. // RequestId sets the optional parameter "requestId": An optional
  92988. // request ID to identify requests. Specify a unique request ID so that
  92989. // if you must retry your request, the server will know to ignore the
  92990. // request if it has already been completed.
  92991. //
  92992. // For example, consider a situation where you make an initial request
  92993. // and the request times out. If you make the request again with the
  92994. // same request ID, the server can check if original operation with the
  92995. // same request ID was received, and if so, will ignore the second
  92996. // request. This prevents clients from accidentally creating duplicate
  92997. // commitments.
  92998. //
  92999. // The request ID must be a valid UUID with the exception that zero UUID
  93000. // is not supported (00000000-0000-0000-0000-000000000000).
  93001. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  93002. c.urlParams_.Set("requestId", requestId)
  93003. return c
  93004. }
  93005. // Fields allows partial responses to be retrieved. See
  93006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93007. // for more information.
  93008. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  93009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93010. return c
  93011. }
  93012. // Context sets the context to be used in this call's Do method. Any
  93013. // pending HTTP request will be aborted if the provided context is
  93014. // canceled.
  93015. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  93016. c.ctx_ = ctx
  93017. return c
  93018. }
  93019. // Header returns an http.Header that can be modified by the caller to
  93020. // add HTTP headers to the request.
  93021. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  93022. if c.header_ == nil {
  93023. c.header_ = make(http.Header)
  93024. }
  93025. return c.header_
  93026. }
  93027. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  93028. reqHeaders := make(http.Header)
  93029. for k, v := range c.header_ {
  93030. reqHeaders[k] = v
  93031. }
  93032. reqHeaders.Set("User-Agent", c.s.userAgent())
  93033. var body io.Reader = nil
  93034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  93035. if err != nil {
  93036. return nil, err
  93037. }
  93038. reqHeaders.Set("Content-Type", "application/json")
  93039. c.urlParams_.Set("alt", alt)
  93040. c.urlParams_.Set("prettyPrint", "false")
  93041. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  93042. urls += "?" + c.urlParams_.Encode()
  93043. req, err := http.NewRequest("PUT", urls, body)
  93044. if err != nil {
  93045. return nil, err
  93046. }
  93047. req.Header = reqHeaders
  93048. googleapi.Expand(req.URL, map[string]string{
  93049. "project": c.project,
  93050. "region": c.region,
  93051. })
  93052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93053. }
  93054. // Do executes the "compute.regionAutoscalers.update" call.
  93055. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93056. // status code is an error. Response headers are in either
  93057. // *Operation.ServerResponse.Header or (if a response was returned at
  93058. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93059. // to check whether the returned error was because
  93060. // http.StatusNotModified was returned.
  93061. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93062. gensupport.SetOptions(c.urlParams_, opts...)
  93063. res, err := c.doRequest("json")
  93064. if res != nil && res.StatusCode == http.StatusNotModified {
  93065. if res.Body != nil {
  93066. res.Body.Close()
  93067. }
  93068. return nil, &googleapi.Error{
  93069. Code: res.StatusCode,
  93070. Header: res.Header,
  93071. }
  93072. }
  93073. if err != nil {
  93074. return nil, err
  93075. }
  93076. defer googleapi.CloseBody(res)
  93077. if err := googleapi.CheckResponse(res); err != nil {
  93078. return nil, err
  93079. }
  93080. ret := &Operation{
  93081. ServerResponse: googleapi.ServerResponse{
  93082. Header: res.Header,
  93083. HTTPStatusCode: res.StatusCode,
  93084. },
  93085. }
  93086. target := &ret
  93087. if err := gensupport.DecodeResponse(target, res); err != nil {
  93088. return nil, err
  93089. }
  93090. return ret, nil
  93091. // {
  93092. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  93093. // "httpMethod": "PUT",
  93094. // "id": "compute.regionAutoscalers.update",
  93095. // "parameterOrder": [
  93096. // "project",
  93097. // "region"
  93098. // ],
  93099. // "parameters": {
  93100. // "autoscaler": {
  93101. // "description": "Name of the autoscaler to update.",
  93102. // "location": "query",
  93103. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93104. // "type": "string"
  93105. // },
  93106. // "project": {
  93107. // "description": "Project ID for this request.",
  93108. // "location": "path",
  93109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93110. // "required": true,
  93111. // "type": "string"
  93112. // },
  93113. // "region": {
  93114. // "description": "Name of the region scoping this request.",
  93115. // "location": "path",
  93116. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93117. // "required": true,
  93118. // "type": "string"
  93119. // },
  93120. // "requestId": {
  93121. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93122. // "location": "query",
  93123. // "type": "string"
  93124. // }
  93125. // },
  93126. // "path": "{project}/regions/{region}/autoscalers",
  93127. // "request": {
  93128. // "$ref": "Autoscaler"
  93129. // },
  93130. // "response": {
  93131. // "$ref": "Operation"
  93132. // },
  93133. // "scopes": [
  93134. // "https://www.googleapis.com/auth/cloud-platform",
  93135. // "https://www.googleapis.com/auth/compute"
  93136. // ]
  93137. // }
  93138. }
  93139. // method id "compute.regionBackendServices.delete":
  93140. type RegionBackendServicesDeleteCall struct {
  93141. s *Service
  93142. project string
  93143. region string
  93144. backendService string
  93145. urlParams_ gensupport.URLParams
  93146. ctx_ context.Context
  93147. header_ http.Header
  93148. }
  93149. // Delete: Deletes the specified regional BackendService resource.
  93150. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  93151. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93152. c.project = project
  93153. c.region = region
  93154. c.backendService = backendService
  93155. return c
  93156. }
  93157. // RequestId sets the optional parameter "requestId": An optional
  93158. // request ID to identify requests. Specify a unique request ID so that
  93159. // if you must retry your request, the server will know to ignore the
  93160. // request if it has already been completed.
  93161. //
  93162. // For example, consider a situation where you make an initial request
  93163. // and the request times out. If you make the request again with the
  93164. // same request ID, the server can check if original operation with the
  93165. // same request ID was received, and if so, will ignore the second
  93166. // request. This prevents clients from accidentally creating duplicate
  93167. // commitments.
  93168. //
  93169. // The request ID must be a valid UUID with the exception that zero UUID
  93170. // is not supported (00000000-0000-0000-0000-000000000000).
  93171. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  93172. c.urlParams_.Set("requestId", requestId)
  93173. return c
  93174. }
  93175. // Fields allows partial responses to be retrieved. See
  93176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93177. // for more information.
  93178. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  93179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93180. return c
  93181. }
  93182. // Context sets the context to be used in this call's Do method. Any
  93183. // pending HTTP request will be aborted if the provided context is
  93184. // canceled.
  93185. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  93186. c.ctx_ = ctx
  93187. return c
  93188. }
  93189. // Header returns an http.Header that can be modified by the caller to
  93190. // add HTTP headers to the request.
  93191. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  93192. if c.header_ == nil {
  93193. c.header_ = make(http.Header)
  93194. }
  93195. return c.header_
  93196. }
  93197. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  93198. reqHeaders := make(http.Header)
  93199. for k, v := range c.header_ {
  93200. reqHeaders[k] = v
  93201. }
  93202. reqHeaders.Set("User-Agent", c.s.userAgent())
  93203. var body io.Reader = nil
  93204. c.urlParams_.Set("alt", alt)
  93205. c.urlParams_.Set("prettyPrint", "false")
  93206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  93207. urls += "?" + c.urlParams_.Encode()
  93208. req, err := http.NewRequest("DELETE", urls, body)
  93209. if err != nil {
  93210. return nil, err
  93211. }
  93212. req.Header = reqHeaders
  93213. googleapi.Expand(req.URL, map[string]string{
  93214. "project": c.project,
  93215. "region": c.region,
  93216. "backendService": c.backendService,
  93217. })
  93218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93219. }
  93220. // Do executes the "compute.regionBackendServices.delete" call.
  93221. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93222. // status code is an error. Response headers are in either
  93223. // *Operation.ServerResponse.Header or (if a response was returned at
  93224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93225. // to check whether the returned error was because
  93226. // http.StatusNotModified was returned.
  93227. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93228. gensupport.SetOptions(c.urlParams_, opts...)
  93229. res, err := c.doRequest("json")
  93230. if res != nil && res.StatusCode == http.StatusNotModified {
  93231. if res.Body != nil {
  93232. res.Body.Close()
  93233. }
  93234. return nil, &googleapi.Error{
  93235. Code: res.StatusCode,
  93236. Header: res.Header,
  93237. }
  93238. }
  93239. if err != nil {
  93240. return nil, err
  93241. }
  93242. defer googleapi.CloseBody(res)
  93243. if err := googleapi.CheckResponse(res); err != nil {
  93244. return nil, err
  93245. }
  93246. ret := &Operation{
  93247. ServerResponse: googleapi.ServerResponse{
  93248. Header: res.Header,
  93249. HTTPStatusCode: res.StatusCode,
  93250. },
  93251. }
  93252. target := &ret
  93253. if err := gensupport.DecodeResponse(target, res); err != nil {
  93254. return nil, err
  93255. }
  93256. return ret, nil
  93257. // {
  93258. // "description": "Deletes the specified regional BackendService resource.",
  93259. // "httpMethod": "DELETE",
  93260. // "id": "compute.regionBackendServices.delete",
  93261. // "parameterOrder": [
  93262. // "project",
  93263. // "region",
  93264. // "backendService"
  93265. // ],
  93266. // "parameters": {
  93267. // "backendService": {
  93268. // "description": "Name of the BackendService resource to delete.",
  93269. // "location": "path",
  93270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93271. // "required": true,
  93272. // "type": "string"
  93273. // },
  93274. // "project": {
  93275. // "description": "Project ID for this request.",
  93276. // "location": "path",
  93277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93278. // "required": true,
  93279. // "type": "string"
  93280. // },
  93281. // "region": {
  93282. // "description": "Name of the region scoping this request.",
  93283. // "location": "path",
  93284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93285. // "required": true,
  93286. // "type": "string"
  93287. // },
  93288. // "requestId": {
  93289. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93290. // "location": "query",
  93291. // "type": "string"
  93292. // }
  93293. // },
  93294. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  93295. // "response": {
  93296. // "$ref": "Operation"
  93297. // },
  93298. // "scopes": [
  93299. // "https://www.googleapis.com/auth/cloud-platform",
  93300. // "https://www.googleapis.com/auth/compute"
  93301. // ]
  93302. // }
  93303. }
  93304. // method id "compute.regionBackendServices.get":
  93305. type RegionBackendServicesGetCall struct {
  93306. s *Service
  93307. project string
  93308. region string
  93309. backendService string
  93310. urlParams_ gensupport.URLParams
  93311. ifNoneMatch_ string
  93312. ctx_ context.Context
  93313. header_ http.Header
  93314. }
  93315. // Get: Returns the specified regional BackendService resource.
  93316. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  93317. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93318. c.project = project
  93319. c.region = region
  93320. c.backendService = backendService
  93321. return c
  93322. }
  93323. // Fields allows partial responses to be retrieved. See
  93324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93325. // for more information.
  93326. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  93327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93328. return c
  93329. }
  93330. // IfNoneMatch sets the optional parameter which makes the operation
  93331. // fail if the object's ETag matches the given value. This is useful for
  93332. // getting updates only after the object has changed since the last
  93333. // request. Use googleapi.IsNotModified to check whether the response
  93334. // error from Do is the result of In-None-Match.
  93335. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  93336. c.ifNoneMatch_ = entityTag
  93337. return c
  93338. }
  93339. // Context sets the context to be used in this call's Do method. Any
  93340. // pending HTTP request will be aborted if the provided context is
  93341. // canceled.
  93342. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  93343. c.ctx_ = ctx
  93344. return c
  93345. }
  93346. // Header returns an http.Header that can be modified by the caller to
  93347. // add HTTP headers to the request.
  93348. func (c *RegionBackendServicesGetCall) Header() http.Header {
  93349. if c.header_ == nil {
  93350. c.header_ = make(http.Header)
  93351. }
  93352. return c.header_
  93353. }
  93354. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  93355. reqHeaders := make(http.Header)
  93356. for k, v := range c.header_ {
  93357. reqHeaders[k] = v
  93358. }
  93359. reqHeaders.Set("User-Agent", c.s.userAgent())
  93360. if c.ifNoneMatch_ != "" {
  93361. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93362. }
  93363. var body io.Reader = nil
  93364. c.urlParams_.Set("alt", alt)
  93365. c.urlParams_.Set("prettyPrint", "false")
  93366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  93367. urls += "?" + c.urlParams_.Encode()
  93368. req, err := http.NewRequest("GET", urls, body)
  93369. if err != nil {
  93370. return nil, err
  93371. }
  93372. req.Header = reqHeaders
  93373. googleapi.Expand(req.URL, map[string]string{
  93374. "project": c.project,
  93375. "region": c.region,
  93376. "backendService": c.backendService,
  93377. })
  93378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93379. }
  93380. // Do executes the "compute.regionBackendServices.get" call.
  93381. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  93382. // status code is an error. Response headers are in either
  93383. // *BackendService.ServerResponse.Header or (if a response was returned
  93384. // at all) in error.(*googleapi.Error).Header. Use
  93385. // googleapi.IsNotModified to check whether the returned error was
  93386. // because http.StatusNotModified was returned.
  93387. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  93388. gensupport.SetOptions(c.urlParams_, opts...)
  93389. res, err := c.doRequest("json")
  93390. if res != nil && res.StatusCode == http.StatusNotModified {
  93391. if res.Body != nil {
  93392. res.Body.Close()
  93393. }
  93394. return nil, &googleapi.Error{
  93395. Code: res.StatusCode,
  93396. Header: res.Header,
  93397. }
  93398. }
  93399. if err != nil {
  93400. return nil, err
  93401. }
  93402. defer googleapi.CloseBody(res)
  93403. if err := googleapi.CheckResponse(res); err != nil {
  93404. return nil, err
  93405. }
  93406. ret := &BackendService{
  93407. ServerResponse: googleapi.ServerResponse{
  93408. Header: res.Header,
  93409. HTTPStatusCode: res.StatusCode,
  93410. },
  93411. }
  93412. target := &ret
  93413. if err := gensupport.DecodeResponse(target, res); err != nil {
  93414. return nil, err
  93415. }
  93416. return ret, nil
  93417. // {
  93418. // "description": "Returns the specified regional BackendService resource.",
  93419. // "httpMethod": "GET",
  93420. // "id": "compute.regionBackendServices.get",
  93421. // "parameterOrder": [
  93422. // "project",
  93423. // "region",
  93424. // "backendService"
  93425. // ],
  93426. // "parameters": {
  93427. // "backendService": {
  93428. // "description": "Name of the BackendService resource to return.",
  93429. // "location": "path",
  93430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93431. // "required": true,
  93432. // "type": "string"
  93433. // },
  93434. // "project": {
  93435. // "description": "Project ID for this request.",
  93436. // "location": "path",
  93437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93438. // "required": true,
  93439. // "type": "string"
  93440. // },
  93441. // "region": {
  93442. // "description": "Name of the region scoping this request.",
  93443. // "location": "path",
  93444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93445. // "required": true,
  93446. // "type": "string"
  93447. // }
  93448. // },
  93449. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  93450. // "response": {
  93451. // "$ref": "BackendService"
  93452. // },
  93453. // "scopes": [
  93454. // "https://www.googleapis.com/auth/cloud-platform",
  93455. // "https://www.googleapis.com/auth/compute",
  93456. // "https://www.googleapis.com/auth/compute.readonly"
  93457. // ]
  93458. // }
  93459. }
  93460. // method id "compute.regionBackendServices.getHealth":
  93461. type RegionBackendServicesGetHealthCall struct {
  93462. s *Service
  93463. project string
  93464. region string
  93465. backendService string
  93466. resourcegroupreference *ResourceGroupReference
  93467. urlParams_ gensupport.URLParams
  93468. ctx_ context.Context
  93469. header_ http.Header
  93470. }
  93471. // GetHealth: Gets the most recent health check results for this
  93472. // regional BackendService.
  93473. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  93474. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93475. c.project = project
  93476. c.region = region
  93477. c.backendService = backendService
  93478. c.resourcegroupreference = resourcegroupreference
  93479. return c
  93480. }
  93481. // Fields allows partial responses to be retrieved. See
  93482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93483. // for more information.
  93484. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  93485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93486. return c
  93487. }
  93488. // Context sets the context to be used in this call's Do method. Any
  93489. // pending HTTP request will be aborted if the provided context is
  93490. // canceled.
  93491. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  93492. c.ctx_ = ctx
  93493. return c
  93494. }
  93495. // Header returns an http.Header that can be modified by the caller to
  93496. // add HTTP headers to the request.
  93497. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  93498. if c.header_ == nil {
  93499. c.header_ = make(http.Header)
  93500. }
  93501. return c.header_
  93502. }
  93503. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  93504. reqHeaders := make(http.Header)
  93505. for k, v := range c.header_ {
  93506. reqHeaders[k] = v
  93507. }
  93508. reqHeaders.Set("User-Agent", c.s.userAgent())
  93509. var body io.Reader = nil
  93510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  93511. if err != nil {
  93512. return nil, err
  93513. }
  93514. reqHeaders.Set("Content-Type", "application/json")
  93515. c.urlParams_.Set("alt", alt)
  93516. c.urlParams_.Set("prettyPrint", "false")
  93517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  93518. urls += "?" + c.urlParams_.Encode()
  93519. req, err := http.NewRequest("POST", urls, body)
  93520. if err != nil {
  93521. return nil, err
  93522. }
  93523. req.Header = reqHeaders
  93524. googleapi.Expand(req.URL, map[string]string{
  93525. "project": c.project,
  93526. "region": c.region,
  93527. "backendService": c.backendService,
  93528. })
  93529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93530. }
  93531. // Do executes the "compute.regionBackendServices.getHealth" call.
  93532. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  93533. // Any non-2xx status code is an error. Response headers are in either
  93534. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  93535. // was returned at all) in error.(*googleapi.Error).Header. Use
  93536. // googleapi.IsNotModified to check whether the returned error was
  93537. // because http.StatusNotModified was returned.
  93538. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  93539. gensupport.SetOptions(c.urlParams_, opts...)
  93540. res, err := c.doRequest("json")
  93541. if res != nil && res.StatusCode == http.StatusNotModified {
  93542. if res.Body != nil {
  93543. res.Body.Close()
  93544. }
  93545. return nil, &googleapi.Error{
  93546. Code: res.StatusCode,
  93547. Header: res.Header,
  93548. }
  93549. }
  93550. if err != nil {
  93551. return nil, err
  93552. }
  93553. defer googleapi.CloseBody(res)
  93554. if err := googleapi.CheckResponse(res); err != nil {
  93555. return nil, err
  93556. }
  93557. ret := &BackendServiceGroupHealth{
  93558. ServerResponse: googleapi.ServerResponse{
  93559. Header: res.Header,
  93560. HTTPStatusCode: res.StatusCode,
  93561. },
  93562. }
  93563. target := &ret
  93564. if err := gensupport.DecodeResponse(target, res); err != nil {
  93565. return nil, err
  93566. }
  93567. return ret, nil
  93568. // {
  93569. // "description": "Gets the most recent health check results for this regional BackendService.",
  93570. // "httpMethod": "POST",
  93571. // "id": "compute.regionBackendServices.getHealth",
  93572. // "parameterOrder": [
  93573. // "project",
  93574. // "region",
  93575. // "backendService"
  93576. // ],
  93577. // "parameters": {
  93578. // "backendService": {
  93579. // "description": "Name of the BackendService resource for which to get health.",
  93580. // "location": "path",
  93581. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93582. // "required": true,
  93583. // "type": "string"
  93584. // },
  93585. // "project": {
  93586. // "location": "path",
  93587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93588. // "required": true,
  93589. // "type": "string"
  93590. // },
  93591. // "region": {
  93592. // "description": "Name of the region scoping this request.",
  93593. // "location": "path",
  93594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93595. // "required": true,
  93596. // "type": "string"
  93597. // }
  93598. // },
  93599. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  93600. // "request": {
  93601. // "$ref": "ResourceGroupReference"
  93602. // },
  93603. // "response": {
  93604. // "$ref": "BackendServiceGroupHealth"
  93605. // },
  93606. // "scopes": [
  93607. // "https://www.googleapis.com/auth/cloud-platform",
  93608. // "https://www.googleapis.com/auth/compute",
  93609. // "https://www.googleapis.com/auth/compute.readonly"
  93610. // ]
  93611. // }
  93612. }
  93613. // method id "compute.regionBackendServices.insert":
  93614. type RegionBackendServicesInsertCall struct {
  93615. s *Service
  93616. project string
  93617. region string
  93618. backendservice *BackendService
  93619. urlParams_ gensupport.URLParams
  93620. ctx_ context.Context
  93621. header_ http.Header
  93622. }
  93623. // Insert: Creates a regional BackendService resource in the specified
  93624. // project using the data included in the request. There are several
  93625. // restrictions and guidelines to keep in mind when creating a regional
  93626. // backend service. Read Restrictions and Guidelines for more
  93627. // information.
  93628. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  93629. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93630. c.project = project
  93631. c.region = region
  93632. c.backendservice = backendservice
  93633. return c
  93634. }
  93635. // RequestId sets the optional parameter "requestId": An optional
  93636. // request ID to identify requests. Specify a unique request ID so that
  93637. // if you must retry your request, the server will know to ignore the
  93638. // request if it has already been completed.
  93639. //
  93640. // For example, consider a situation where you make an initial request
  93641. // and the request times out. If you make the request again with the
  93642. // same request ID, the server can check if original operation with the
  93643. // same request ID was received, and if so, will ignore the second
  93644. // request. This prevents clients from accidentally creating duplicate
  93645. // commitments.
  93646. //
  93647. // The request ID must be a valid UUID with the exception that zero UUID
  93648. // is not supported (00000000-0000-0000-0000-000000000000).
  93649. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  93650. c.urlParams_.Set("requestId", requestId)
  93651. return c
  93652. }
  93653. // Fields allows partial responses to be retrieved. See
  93654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93655. // for more information.
  93656. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  93657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93658. return c
  93659. }
  93660. // Context sets the context to be used in this call's Do method. Any
  93661. // pending HTTP request will be aborted if the provided context is
  93662. // canceled.
  93663. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  93664. c.ctx_ = ctx
  93665. return c
  93666. }
  93667. // Header returns an http.Header that can be modified by the caller to
  93668. // add HTTP headers to the request.
  93669. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  93670. if c.header_ == nil {
  93671. c.header_ = make(http.Header)
  93672. }
  93673. return c.header_
  93674. }
  93675. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  93676. reqHeaders := make(http.Header)
  93677. for k, v := range c.header_ {
  93678. reqHeaders[k] = v
  93679. }
  93680. reqHeaders.Set("User-Agent", c.s.userAgent())
  93681. var body io.Reader = nil
  93682. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  93683. if err != nil {
  93684. return nil, err
  93685. }
  93686. reqHeaders.Set("Content-Type", "application/json")
  93687. c.urlParams_.Set("alt", alt)
  93688. c.urlParams_.Set("prettyPrint", "false")
  93689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  93690. urls += "?" + c.urlParams_.Encode()
  93691. req, err := http.NewRequest("POST", urls, body)
  93692. if err != nil {
  93693. return nil, err
  93694. }
  93695. req.Header = reqHeaders
  93696. googleapi.Expand(req.URL, map[string]string{
  93697. "project": c.project,
  93698. "region": c.region,
  93699. })
  93700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93701. }
  93702. // Do executes the "compute.regionBackendServices.insert" call.
  93703. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93704. // status code is an error. Response headers are in either
  93705. // *Operation.ServerResponse.Header or (if a response was returned at
  93706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93707. // to check whether the returned error was because
  93708. // http.StatusNotModified was returned.
  93709. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93710. gensupport.SetOptions(c.urlParams_, opts...)
  93711. res, err := c.doRequest("json")
  93712. if res != nil && res.StatusCode == http.StatusNotModified {
  93713. if res.Body != nil {
  93714. res.Body.Close()
  93715. }
  93716. return nil, &googleapi.Error{
  93717. Code: res.StatusCode,
  93718. Header: res.Header,
  93719. }
  93720. }
  93721. if err != nil {
  93722. return nil, err
  93723. }
  93724. defer googleapi.CloseBody(res)
  93725. if err := googleapi.CheckResponse(res); err != nil {
  93726. return nil, err
  93727. }
  93728. ret := &Operation{
  93729. ServerResponse: googleapi.ServerResponse{
  93730. Header: res.Header,
  93731. HTTPStatusCode: res.StatusCode,
  93732. },
  93733. }
  93734. target := &ret
  93735. if err := gensupport.DecodeResponse(target, res); err != nil {
  93736. return nil, err
  93737. }
  93738. return ret, nil
  93739. // {
  93740. // "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.",
  93741. // "httpMethod": "POST",
  93742. // "id": "compute.regionBackendServices.insert",
  93743. // "parameterOrder": [
  93744. // "project",
  93745. // "region"
  93746. // ],
  93747. // "parameters": {
  93748. // "project": {
  93749. // "description": "Project ID for this request.",
  93750. // "location": "path",
  93751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93752. // "required": true,
  93753. // "type": "string"
  93754. // },
  93755. // "region": {
  93756. // "description": "Name of the region scoping this request.",
  93757. // "location": "path",
  93758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93759. // "required": true,
  93760. // "type": "string"
  93761. // },
  93762. // "requestId": {
  93763. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93764. // "location": "query",
  93765. // "type": "string"
  93766. // }
  93767. // },
  93768. // "path": "{project}/regions/{region}/backendServices",
  93769. // "request": {
  93770. // "$ref": "BackendService"
  93771. // },
  93772. // "response": {
  93773. // "$ref": "Operation"
  93774. // },
  93775. // "scopes": [
  93776. // "https://www.googleapis.com/auth/cloud-platform",
  93777. // "https://www.googleapis.com/auth/compute"
  93778. // ]
  93779. // }
  93780. }
  93781. // method id "compute.regionBackendServices.list":
  93782. type RegionBackendServicesListCall struct {
  93783. s *Service
  93784. project string
  93785. region string
  93786. urlParams_ gensupport.URLParams
  93787. ifNoneMatch_ string
  93788. ctx_ context.Context
  93789. header_ http.Header
  93790. }
  93791. // List: Retrieves the list of regional BackendService resources
  93792. // available to the specified project in the given region.
  93793. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  93794. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93795. c.project = project
  93796. c.region = region
  93797. return c
  93798. }
  93799. // Filter sets the optional parameter "filter": A filter expression that
  93800. // filters resources listed in the response. The expression must specify
  93801. // the field name, a comparison operator, and the value that you want to
  93802. // use for filtering. The value must be a string, a number, or a
  93803. // boolean. The comparison operator must be either =, !=, >, or <.
  93804. //
  93805. // For example, if you are filtering Compute Engine instances, you can
  93806. // exclude instances named example-instance by specifying name !=
  93807. // example-instance.
  93808. //
  93809. // You can also filter nested fields. For example, you could specify
  93810. // scheduling.automaticRestart = false to include instances only if they
  93811. // are not scheduled for automatic restarts. You can use filtering on
  93812. // nested fields to filter based on resource labels.
  93813. //
  93814. // To filter on multiple expressions, provide each separate expression
  93815. // within parentheses. For example, (scheduling.automaticRestart = true)
  93816. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93817. // AND expression. However, you can include AND and OR expressions
  93818. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93819. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93820. // true).
  93821. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  93822. c.urlParams_.Set("filter", filter)
  93823. return c
  93824. }
  93825. // MaxResults sets the optional parameter "maxResults": The maximum
  93826. // number of results per page that should be returned. If the number of
  93827. // available results is larger than maxResults, Compute Engine returns a
  93828. // nextPageToken that can be used to get the next page of results in
  93829. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93830. // (Default: 500)
  93831. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  93832. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93833. return c
  93834. }
  93835. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93836. // a certain order. By default, results are returned in alphanumerical
  93837. // order based on the resource name.
  93838. //
  93839. // You can also sort results in descending order based on the creation
  93840. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93841. // based on the creationTimestamp field in reverse chronological order
  93842. // (newest result first). Use this to sort resources like operations so
  93843. // that the newest operation is returned first.
  93844. //
  93845. // Currently, only sorting by name or creationTimestamp desc is
  93846. // supported.
  93847. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  93848. c.urlParams_.Set("orderBy", orderBy)
  93849. return c
  93850. }
  93851. // PageToken sets the optional parameter "pageToken": Specifies a page
  93852. // token to use. Set pageToken to the nextPageToken returned by a
  93853. // previous list request to get the next page of results.
  93854. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  93855. c.urlParams_.Set("pageToken", pageToken)
  93856. return c
  93857. }
  93858. // Fields allows partial responses to be retrieved. See
  93859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93860. // for more information.
  93861. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  93862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93863. return c
  93864. }
  93865. // IfNoneMatch sets the optional parameter which makes the operation
  93866. // fail if the object's ETag matches the given value. This is useful for
  93867. // getting updates only after the object has changed since the last
  93868. // request. Use googleapi.IsNotModified to check whether the response
  93869. // error from Do is the result of In-None-Match.
  93870. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  93871. c.ifNoneMatch_ = entityTag
  93872. return c
  93873. }
  93874. // Context sets the context to be used in this call's Do method. Any
  93875. // pending HTTP request will be aborted if the provided context is
  93876. // canceled.
  93877. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  93878. c.ctx_ = ctx
  93879. return c
  93880. }
  93881. // Header returns an http.Header that can be modified by the caller to
  93882. // add HTTP headers to the request.
  93883. func (c *RegionBackendServicesListCall) Header() http.Header {
  93884. if c.header_ == nil {
  93885. c.header_ = make(http.Header)
  93886. }
  93887. return c.header_
  93888. }
  93889. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  93890. reqHeaders := make(http.Header)
  93891. for k, v := range c.header_ {
  93892. reqHeaders[k] = v
  93893. }
  93894. reqHeaders.Set("User-Agent", c.s.userAgent())
  93895. if c.ifNoneMatch_ != "" {
  93896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93897. }
  93898. var body io.Reader = nil
  93899. c.urlParams_.Set("alt", alt)
  93900. c.urlParams_.Set("prettyPrint", "false")
  93901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  93902. urls += "?" + c.urlParams_.Encode()
  93903. req, err := http.NewRequest("GET", urls, body)
  93904. if err != nil {
  93905. return nil, err
  93906. }
  93907. req.Header = reqHeaders
  93908. googleapi.Expand(req.URL, map[string]string{
  93909. "project": c.project,
  93910. "region": c.region,
  93911. })
  93912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93913. }
  93914. // Do executes the "compute.regionBackendServices.list" call.
  93915. // Exactly one of *BackendServiceList or error will be non-nil. Any
  93916. // non-2xx status code is an error. Response headers are in either
  93917. // *BackendServiceList.ServerResponse.Header or (if a response was
  93918. // returned at all) in error.(*googleapi.Error).Header. Use
  93919. // googleapi.IsNotModified to check whether the returned error was
  93920. // because http.StatusNotModified was returned.
  93921. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  93922. gensupport.SetOptions(c.urlParams_, opts...)
  93923. res, err := c.doRequest("json")
  93924. if res != nil && res.StatusCode == http.StatusNotModified {
  93925. if res.Body != nil {
  93926. res.Body.Close()
  93927. }
  93928. return nil, &googleapi.Error{
  93929. Code: res.StatusCode,
  93930. Header: res.Header,
  93931. }
  93932. }
  93933. if err != nil {
  93934. return nil, err
  93935. }
  93936. defer googleapi.CloseBody(res)
  93937. if err := googleapi.CheckResponse(res); err != nil {
  93938. return nil, err
  93939. }
  93940. ret := &BackendServiceList{
  93941. ServerResponse: googleapi.ServerResponse{
  93942. Header: res.Header,
  93943. HTTPStatusCode: res.StatusCode,
  93944. },
  93945. }
  93946. target := &ret
  93947. if err := gensupport.DecodeResponse(target, res); err != nil {
  93948. return nil, err
  93949. }
  93950. return ret, nil
  93951. // {
  93952. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  93953. // "httpMethod": "GET",
  93954. // "id": "compute.regionBackendServices.list",
  93955. // "parameterOrder": [
  93956. // "project",
  93957. // "region"
  93958. // ],
  93959. // "parameters": {
  93960. // "filter": {
  93961. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93962. // "location": "query",
  93963. // "type": "string"
  93964. // },
  93965. // "maxResults": {
  93966. // "default": "500",
  93967. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93968. // "format": "uint32",
  93969. // "location": "query",
  93970. // "minimum": "0",
  93971. // "type": "integer"
  93972. // },
  93973. // "orderBy": {
  93974. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93975. // "location": "query",
  93976. // "type": "string"
  93977. // },
  93978. // "pageToken": {
  93979. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93980. // "location": "query",
  93981. // "type": "string"
  93982. // },
  93983. // "project": {
  93984. // "description": "Project ID for this request.",
  93985. // "location": "path",
  93986. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93987. // "required": true,
  93988. // "type": "string"
  93989. // },
  93990. // "region": {
  93991. // "description": "Name of the region scoping this request.",
  93992. // "location": "path",
  93993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93994. // "required": true,
  93995. // "type": "string"
  93996. // }
  93997. // },
  93998. // "path": "{project}/regions/{region}/backendServices",
  93999. // "response": {
  94000. // "$ref": "BackendServiceList"
  94001. // },
  94002. // "scopes": [
  94003. // "https://www.googleapis.com/auth/cloud-platform",
  94004. // "https://www.googleapis.com/auth/compute",
  94005. // "https://www.googleapis.com/auth/compute.readonly"
  94006. // ]
  94007. // }
  94008. }
  94009. // Pages invokes f for each page of results.
  94010. // A non-nil error returned from f will halt the iteration.
  94011. // The provided context supersedes any context provided to the Context method.
  94012. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  94013. c.ctx_ = ctx
  94014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94015. for {
  94016. x, err := c.Do()
  94017. if err != nil {
  94018. return err
  94019. }
  94020. if err := f(x); err != nil {
  94021. return err
  94022. }
  94023. if x.NextPageToken == "" {
  94024. return nil
  94025. }
  94026. c.PageToken(x.NextPageToken)
  94027. }
  94028. }
  94029. // method id "compute.regionBackendServices.patch":
  94030. type RegionBackendServicesPatchCall struct {
  94031. s *Service
  94032. project string
  94033. region string
  94034. backendService string
  94035. backendservice *BackendService
  94036. urlParams_ gensupport.URLParams
  94037. ctx_ context.Context
  94038. header_ http.Header
  94039. }
  94040. // Patch: Updates the specified regional BackendService resource with
  94041. // the data included in the request. There are several restrictions and
  94042. // guidelines to keep in mind when updating a backend service. Read
  94043. // Restrictions and Guidelines for more information. This method
  94044. // supports PATCH semantics and uses the JSON merge patch format and
  94045. // processing rules.
  94046. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  94047. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94048. c.project = project
  94049. c.region = region
  94050. c.backendService = backendService
  94051. c.backendservice = backendservice
  94052. return c
  94053. }
  94054. // RequestId sets the optional parameter "requestId": An optional
  94055. // request ID to identify requests. Specify a unique request ID so that
  94056. // if you must retry your request, the server will know to ignore the
  94057. // request if it has already been completed.
  94058. //
  94059. // For example, consider a situation where you make an initial request
  94060. // and the request times out. If you make the request again with the
  94061. // same request ID, the server can check if original operation with the
  94062. // same request ID was received, and if so, will ignore the second
  94063. // request. This prevents clients from accidentally creating duplicate
  94064. // commitments.
  94065. //
  94066. // The request ID must be a valid UUID with the exception that zero UUID
  94067. // is not supported (00000000-0000-0000-0000-000000000000).
  94068. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  94069. c.urlParams_.Set("requestId", requestId)
  94070. return c
  94071. }
  94072. // Fields allows partial responses to be retrieved. See
  94073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94074. // for more information.
  94075. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  94076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94077. return c
  94078. }
  94079. // Context sets the context to be used in this call's Do method. Any
  94080. // pending HTTP request will be aborted if the provided context is
  94081. // canceled.
  94082. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  94083. c.ctx_ = ctx
  94084. return c
  94085. }
  94086. // Header returns an http.Header that can be modified by the caller to
  94087. // add HTTP headers to the request.
  94088. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  94089. if c.header_ == nil {
  94090. c.header_ = make(http.Header)
  94091. }
  94092. return c.header_
  94093. }
  94094. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  94095. reqHeaders := make(http.Header)
  94096. for k, v := range c.header_ {
  94097. reqHeaders[k] = v
  94098. }
  94099. reqHeaders.Set("User-Agent", c.s.userAgent())
  94100. var body io.Reader = nil
  94101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  94102. if err != nil {
  94103. return nil, err
  94104. }
  94105. reqHeaders.Set("Content-Type", "application/json")
  94106. c.urlParams_.Set("alt", alt)
  94107. c.urlParams_.Set("prettyPrint", "false")
  94108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  94109. urls += "?" + c.urlParams_.Encode()
  94110. req, err := http.NewRequest("PATCH", urls, body)
  94111. if err != nil {
  94112. return nil, err
  94113. }
  94114. req.Header = reqHeaders
  94115. googleapi.Expand(req.URL, map[string]string{
  94116. "project": c.project,
  94117. "region": c.region,
  94118. "backendService": c.backendService,
  94119. })
  94120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94121. }
  94122. // Do executes the "compute.regionBackendServices.patch" call.
  94123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94124. // status code is an error. Response headers are in either
  94125. // *Operation.ServerResponse.Header or (if a response was returned at
  94126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94127. // to check whether the returned error was because
  94128. // http.StatusNotModified was returned.
  94129. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94130. gensupport.SetOptions(c.urlParams_, opts...)
  94131. res, err := c.doRequest("json")
  94132. if res != nil && res.StatusCode == http.StatusNotModified {
  94133. if res.Body != nil {
  94134. res.Body.Close()
  94135. }
  94136. return nil, &googleapi.Error{
  94137. Code: res.StatusCode,
  94138. Header: res.Header,
  94139. }
  94140. }
  94141. if err != nil {
  94142. return nil, err
  94143. }
  94144. defer googleapi.CloseBody(res)
  94145. if err := googleapi.CheckResponse(res); err != nil {
  94146. return nil, err
  94147. }
  94148. ret := &Operation{
  94149. ServerResponse: googleapi.ServerResponse{
  94150. Header: res.Header,
  94151. HTTPStatusCode: res.StatusCode,
  94152. },
  94153. }
  94154. target := &ret
  94155. if err := gensupport.DecodeResponse(target, res); err != nil {
  94156. return nil, err
  94157. }
  94158. return ret, nil
  94159. // {
  94160. // "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.",
  94161. // "httpMethod": "PATCH",
  94162. // "id": "compute.regionBackendServices.patch",
  94163. // "parameterOrder": [
  94164. // "project",
  94165. // "region",
  94166. // "backendService"
  94167. // ],
  94168. // "parameters": {
  94169. // "backendService": {
  94170. // "description": "Name of the BackendService resource to patch.",
  94171. // "location": "path",
  94172. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94173. // "required": true,
  94174. // "type": "string"
  94175. // },
  94176. // "project": {
  94177. // "description": "Project ID for this request.",
  94178. // "location": "path",
  94179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94180. // "required": true,
  94181. // "type": "string"
  94182. // },
  94183. // "region": {
  94184. // "description": "Name of the region scoping this request.",
  94185. // "location": "path",
  94186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94187. // "required": true,
  94188. // "type": "string"
  94189. // },
  94190. // "requestId": {
  94191. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94192. // "location": "query",
  94193. // "type": "string"
  94194. // }
  94195. // },
  94196. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  94197. // "request": {
  94198. // "$ref": "BackendService"
  94199. // },
  94200. // "response": {
  94201. // "$ref": "Operation"
  94202. // },
  94203. // "scopes": [
  94204. // "https://www.googleapis.com/auth/cloud-platform",
  94205. // "https://www.googleapis.com/auth/compute"
  94206. // ]
  94207. // }
  94208. }
  94209. // method id "compute.regionBackendServices.testIamPermissions":
  94210. type RegionBackendServicesTestIamPermissionsCall struct {
  94211. s *Service
  94212. project string
  94213. region string
  94214. resource string
  94215. testpermissionsrequest *TestPermissionsRequest
  94216. urlParams_ gensupport.URLParams
  94217. ctx_ context.Context
  94218. header_ http.Header
  94219. }
  94220. // TestIamPermissions: Returns permissions that a caller has on the
  94221. // specified resource.
  94222. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  94223. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94224. c.project = project
  94225. c.region = region
  94226. c.resource = resource
  94227. c.testpermissionsrequest = testpermissionsrequest
  94228. return c
  94229. }
  94230. // Fields allows partial responses to be retrieved. See
  94231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94232. // for more information.
  94233. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  94234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94235. return c
  94236. }
  94237. // Context sets the context to be used in this call's Do method. Any
  94238. // pending HTTP request will be aborted if the provided context is
  94239. // canceled.
  94240. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  94241. c.ctx_ = ctx
  94242. return c
  94243. }
  94244. // Header returns an http.Header that can be modified by the caller to
  94245. // add HTTP headers to the request.
  94246. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  94247. if c.header_ == nil {
  94248. c.header_ = make(http.Header)
  94249. }
  94250. return c.header_
  94251. }
  94252. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  94253. reqHeaders := make(http.Header)
  94254. for k, v := range c.header_ {
  94255. reqHeaders[k] = v
  94256. }
  94257. reqHeaders.Set("User-Agent", c.s.userAgent())
  94258. var body io.Reader = nil
  94259. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  94260. if err != nil {
  94261. return nil, err
  94262. }
  94263. reqHeaders.Set("Content-Type", "application/json")
  94264. c.urlParams_.Set("alt", alt)
  94265. c.urlParams_.Set("prettyPrint", "false")
  94266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  94267. urls += "?" + c.urlParams_.Encode()
  94268. req, err := http.NewRequest("POST", urls, body)
  94269. if err != nil {
  94270. return nil, err
  94271. }
  94272. req.Header = reqHeaders
  94273. googleapi.Expand(req.URL, map[string]string{
  94274. "project": c.project,
  94275. "region": c.region,
  94276. "resource": c.resource,
  94277. })
  94278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94279. }
  94280. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  94281. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  94282. // non-2xx status code is an error. Response headers are in either
  94283. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  94284. // returned at all) in error.(*googleapi.Error).Header. Use
  94285. // googleapi.IsNotModified to check whether the returned error was
  94286. // because http.StatusNotModified was returned.
  94287. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  94288. gensupport.SetOptions(c.urlParams_, opts...)
  94289. res, err := c.doRequest("json")
  94290. if res != nil && res.StatusCode == http.StatusNotModified {
  94291. if res.Body != nil {
  94292. res.Body.Close()
  94293. }
  94294. return nil, &googleapi.Error{
  94295. Code: res.StatusCode,
  94296. Header: res.Header,
  94297. }
  94298. }
  94299. if err != nil {
  94300. return nil, err
  94301. }
  94302. defer googleapi.CloseBody(res)
  94303. if err := googleapi.CheckResponse(res); err != nil {
  94304. return nil, err
  94305. }
  94306. ret := &TestPermissionsResponse{
  94307. ServerResponse: googleapi.ServerResponse{
  94308. Header: res.Header,
  94309. HTTPStatusCode: res.StatusCode,
  94310. },
  94311. }
  94312. target := &ret
  94313. if err := gensupport.DecodeResponse(target, res); err != nil {
  94314. return nil, err
  94315. }
  94316. return ret, nil
  94317. // {
  94318. // "description": "Returns permissions that a caller has on the specified resource.",
  94319. // "httpMethod": "POST",
  94320. // "id": "compute.regionBackendServices.testIamPermissions",
  94321. // "parameterOrder": [
  94322. // "project",
  94323. // "region",
  94324. // "resource"
  94325. // ],
  94326. // "parameters": {
  94327. // "project": {
  94328. // "description": "Project ID for this request.",
  94329. // "location": "path",
  94330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94331. // "required": true,
  94332. // "type": "string"
  94333. // },
  94334. // "region": {
  94335. // "description": "The name of the region for this request.",
  94336. // "location": "path",
  94337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94338. // "required": true,
  94339. // "type": "string"
  94340. // },
  94341. // "resource": {
  94342. // "description": "Name or id of the resource for this request.",
  94343. // "location": "path",
  94344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94345. // "required": true,
  94346. // "type": "string"
  94347. // }
  94348. // },
  94349. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  94350. // "request": {
  94351. // "$ref": "TestPermissionsRequest"
  94352. // },
  94353. // "response": {
  94354. // "$ref": "TestPermissionsResponse"
  94355. // },
  94356. // "scopes": [
  94357. // "https://www.googleapis.com/auth/cloud-platform",
  94358. // "https://www.googleapis.com/auth/compute",
  94359. // "https://www.googleapis.com/auth/compute.readonly"
  94360. // ]
  94361. // }
  94362. }
  94363. // method id "compute.regionBackendServices.update":
  94364. type RegionBackendServicesUpdateCall struct {
  94365. s *Service
  94366. project string
  94367. region string
  94368. backendService string
  94369. backendservice *BackendService
  94370. urlParams_ gensupport.URLParams
  94371. ctx_ context.Context
  94372. header_ http.Header
  94373. }
  94374. // Update: Updates the specified regional BackendService resource with
  94375. // the data included in the request. There are several restrictions and
  94376. // guidelines to keep in mind when updating a backend service. Read
  94377. // Restrictions and Guidelines for more information.
  94378. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  94379. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94380. c.project = project
  94381. c.region = region
  94382. c.backendService = backendService
  94383. c.backendservice = backendservice
  94384. return c
  94385. }
  94386. // RequestId sets the optional parameter "requestId": An optional
  94387. // request ID to identify requests. Specify a unique request ID so that
  94388. // if you must retry your request, the server will know to ignore the
  94389. // request if it has already been completed.
  94390. //
  94391. // For example, consider a situation where you make an initial request
  94392. // and the request times out. If you make the request again with the
  94393. // same request ID, the server can check if original operation with the
  94394. // same request ID was received, and if so, will ignore the second
  94395. // request. This prevents clients from accidentally creating duplicate
  94396. // commitments.
  94397. //
  94398. // The request ID must be a valid UUID with the exception that zero UUID
  94399. // is not supported (00000000-0000-0000-0000-000000000000).
  94400. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  94401. c.urlParams_.Set("requestId", requestId)
  94402. return c
  94403. }
  94404. // Fields allows partial responses to be retrieved. See
  94405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94406. // for more information.
  94407. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  94408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94409. return c
  94410. }
  94411. // Context sets the context to be used in this call's Do method. Any
  94412. // pending HTTP request will be aborted if the provided context is
  94413. // canceled.
  94414. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  94415. c.ctx_ = ctx
  94416. return c
  94417. }
  94418. // Header returns an http.Header that can be modified by the caller to
  94419. // add HTTP headers to the request.
  94420. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  94421. if c.header_ == nil {
  94422. c.header_ = make(http.Header)
  94423. }
  94424. return c.header_
  94425. }
  94426. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  94427. reqHeaders := make(http.Header)
  94428. for k, v := range c.header_ {
  94429. reqHeaders[k] = v
  94430. }
  94431. reqHeaders.Set("User-Agent", c.s.userAgent())
  94432. var body io.Reader = nil
  94433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  94434. if err != nil {
  94435. return nil, err
  94436. }
  94437. reqHeaders.Set("Content-Type", "application/json")
  94438. c.urlParams_.Set("alt", alt)
  94439. c.urlParams_.Set("prettyPrint", "false")
  94440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  94441. urls += "?" + c.urlParams_.Encode()
  94442. req, err := http.NewRequest("PUT", urls, body)
  94443. if err != nil {
  94444. return nil, err
  94445. }
  94446. req.Header = reqHeaders
  94447. googleapi.Expand(req.URL, map[string]string{
  94448. "project": c.project,
  94449. "region": c.region,
  94450. "backendService": c.backendService,
  94451. })
  94452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94453. }
  94454. // Do executes the "compute.regionBackendServices.update" call.
  94455. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94456. // status code is an error. Response headers are in either
  94457. // *Operation.ServerResponse.Header or (if a response was returned at
  94458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94459. // to check whether the returned error was because
  94460. // http.StatusNotModified was returned.
  94461. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94462. gensupport.SetOptions(c.urlParams_, opts...)
  94463. res, err := c.doRequest("json")
  94464. if res != nil && res.StatusCode == http.StatusNotModified {
  94465. if res.Body != nil {
  94466. res.Body.Close()
  94467. }
  94468. return nil, &googleapi.Error{
  94469. Code: res.StatusCode,
  94470. Header: res.Header,
  94471. }
  94472. }
  94473. if err != nil {
  94474. return nil, err
  94475. }
  94476. defer googleapi.CloseBody(res)
  94477. if err := googleapi.CheckResponse(res); err != nil {
  94478. return nil, err
  94479. }
  94480. ret := &Operation{
  94481. ServerResponse: googleapi.ServerResponse{
  94482. Header: res.Header,
  94483. HTTPStatusCode: res.StatusCode,
  94484. },
  94485. }
  94486. target := &ret
  94487. if err := gensupport.DecodeResponse(target, res); err != nil {
  94488. return nil, err
  94489. }
  94490. return ret, nil
  94491. // {
  94492. // "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.",
  94493. // "httpMethod": "PUT",
  94494. // "id": "compute.regionBackendServices.update",
  94495. // "parameterOrder": [
  94496. // "project",
  94497. // "region",
  94498. // "backendService"
  94499. // ],
  94500. // "parameters": {
  94501. // "backendService": {
  94502. // "description": "Name of the BackendService resource to update.",
  94503. // "location": "path",
  94504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94505. // "required": true,
  94506. // "type": "string"
  94507. // },
  94508. // "project": {
  94509. // "description": "Project ID for this request.",
  94510. // "location": "path",
  94511. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94512. // "required": true,
  94513. // "type": "string"
  94514. // },
  94515. // "region": {
  94516. // "description": "Name of the region scoping this request.",
  94517. // "location": "path",
  94518. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94519. // "required": true,
  94520. // "type": "string"
  94521. // },
  94522. // "requestId": {
  94523. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94524. // "location": "query",
  94525. // "type": "string"
  94526. // }
  94527. // },
  94528. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  94529. // "request": {
  94530. // "$ref": "BackendService"
  94531. // },
  94532. // "response": {
  94533. // "$ref": "Operation"
  94534. // },
  94535. // "scopes": [
  94536. // "https://www.googleapis.com/auth/cloud-platform",
  94537. // "https://www.googleapis.com/auth/compute"
  94538. // ]
  94539. // }
  94540. }
  94541. // method id "compute.regionCommitments.aggregatedList":
  94542. type RegionCommitmentsAggregatedListCall struct {
  94543. s *Service
  94544. project string
  94545. urlParams_ gensupport.URLParams
  94546. ifNoneMatch_ string
  94547. ctx_ context.Context
  94548. header_ http.Header
  94549. }
  94550. // AggregatedList: Retrieves an aggregated list of commitments.
  94551. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  94552. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94553. c.project = project
  94554. return c
  94555. }
  94556. // Filter sets the optional parameter "filter": A filter expression that
  94557. // filters resources listed in the response. The expression must specify
  94558. // the field name, a comparison operator, and the value that you want to
  94559. // use for filtering. The value must be a string, a number, or a
  94560. // boolean. The comparison operator must be either =, !=, >, or <.
  94561. //
  94562. // For example, if you are filtering Compute Engine instances, you can
  94563. // exclude instances named example-instance by specifying name !=
  94564. // example-instance.
  94565. //
  94566. // You can also filter nested fields. For example, you could specify
  94567. // scheduling.automaticRestart = false to include instances only if they
  94568. // are not scheduled for automatic restarts. You can use filtering on
  94569. // nested fields to filter based on resource labels.
  94570. //
  94571. // To filter on multiple expressions, provide each separate expression
  94572. // within parentheses. For example, (scheduling.automaticRestart = true)
  94573. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94574. // AND expression. However, you can include AND and OR expressions
  94575. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94576. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94577. // true).
  94578. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  94579. c.urlParams_.Set("filter", filter)
  94580. return c
  94581. }
  94582. // MaxResults sets the optional parameter "maxResults": The maximum
  94583. // number of results per page that should be returned. If the number of
  94584. // available results is larger than maxResults, Compute Engine returns a
  94585. // nextPageToken that can be used to get the next page of results in
  94586. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94587. // (Default: 500)
  94588. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  94589. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94590. return c
  94591. }
  94592. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94593. // a certain order. By default, results are returned in alphanumerical
  94594. // order based on the resource name.
  94595. //
  94596. // You can also sort results in descending order based on the creation
  94597. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94598. // based on the creationTimestamp field in reverse chronological order
  94599. // (newest result first). Use this to sort resources like operations so
  94600. // that the newest operation is returned first.
  94601. //
  94602. // Currently, only sorting by name or creationTimestamp desc is
  94603. // supported.
  94604. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  94605. c.urlParams_.Set("orderBy", orderBy)
  94606. return c
  94607. }
  94608. // PageToken sets the optional parameter "pageToken": Specifies a page
  94609. // token to use. Set pageToken to the nextPageToken returned by a
  94610. // previous list request to get the next page of results.
  94611. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  94612. c.urlParams_.Set("pageToken", pageToken)
  94613. return c
  94614. }
  94615. // Fields allows partial responses to be retrieved. See
  94616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94617. // for more information.
  94618. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  94619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94620. return c
  94621. }
  94622. // IfNoneMatch sets the optional parameter which makes the operation
  94623. // fail if the object's ETag matches the given value. This is useful for
  94624. // getting updates only after the object has changed since the last
  94625. // request. Use googleapi.IsNotModified to check whether the response
  94626. // error from Do is the result of In-None-Match.
  94627. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  94628. c.ifNoneMatch_ = entityTag
  94629. return c
  94630. }
  94631. // Context sets the context to be used in this call's Do method. Any
  94632. // pending HTTP request will be aborted if the provided context is
  94633. // canceled.
  94634. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  94635. c.ctx_ = ctx
  94636. return c
  94637. }
  94638. // Header returns an http.Header that can be modified by the caller to
  94639. // add HTTP headers to the request.
  94640. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  94641. if c.header_ == nil {
  94642. c.header_ = make(http.Header)
  94643. }
  94644. return c.header_
  94645. }
  94646. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  94647. reqHeaders := make(http.Header)
  94648. for k, v := range c.header_ {
  94649. reqHeaders[k] = v
  94650. }
  94651. reqHeaders.Set("User-Agent", c.s.userAgent())
  94652. if c.ifNoneMatch_ != "" {
  94653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94654. }
  94655. var body io.Reader = nil
  94656. c.urlParams_.Set("alt", alt)
  94657. c.urlParams_.Set("prettyPrint", "false")
  94658. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  94659. urls += "?" + c.urlParams_.Encode()
  94660. req, err := http.NewRequest("GET", urls, body)
  94661. if err != nil {
  94662. return nil, err
  94663. }
  94664. req.Header = reqHeaders
  94665. googleapi.Expand(req.URL, map[string]string{
  94666. "project": c.project,
  94667. })
  94668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94669. }
  94670. // Do executes the "compute.regionCommitments.aggregatedList" call.
  94671. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  94672. // Any non-2xx status code is an error. Response headers are in either
  94673. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  94674. // returned at all) in error.(*googleapi.Error).Header. Use
  94675. // googleapi.IsNotModified to check whether the returned error was
  94676. // because http.StatusNotModified was returned.
  94677. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  94678. gensupport.SetOptions(c.urlParams_, opts...)
  94679. res, err := c.doRequest("json")
  94680. if res != nil && res.StatusCode == http.StatusNotModified {
  94681. if res.Body != nil {
  94682. res.Body.Close()
  94683. }
  94684. return nil, &googleapi.Error{
  94685. Code: res.StatusCode,
  94686. Header: res.Header,
  94687. }
  94688. }
  94689. if err != nil {
  94690. return nil, err
  94691. }
  94692. defer googleapi.CloseBody(res)
  94693. if err := googleapi.CheckResponse(res); err != nil {
  94694. return nil, err
  94695. }
  94696. ret := &CommitmentAggregatedList{
  94697. ServerResponse: googleapi.ServerResponse{
  94698. Header: res.Header,
  94699. HTTPStatusCode: res.StatusCode,
  94700. },
  94701. }
  94702. target := &ret
  94703. if err := gensupport.DecodeResponse(target, res); err != nil {
  94704. return nil, err
  94705. }
  94706. return ret, nil
  94707. // {
  94708. // "description": "Retrieves an aggregated list of commitments.",
  94709. // "httpMethod": "GET",
  94710. // "id": "compute.regionCommitments.aggregatedList",
  94711. // "parameterOrder": [
  94712. // "project"
  94713. // ],
  94714. // "parameters": {
  94715. // "filter": {
  94716. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94717. // "location": "query",
  94718. // "type": "string"
  94719. // },
  94720. // "maxResults": {
  94721. // "default": "500",
  94722. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94723. // "format": "uint32",
  94724. // "location": "query",
  94725. // "minimum": "0",
  94726. // "type": "integer"
  94727. // },
  94728. // "orderBy": {
  94729. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94730. // "location": "query",
  94731. // "type": "string"
  94732. // },
  94733. // "pageToken": {
  94734. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94735. // "location": "query",
  94736. // "type": "string"
  94737. // },
  94738. // "project": {
  94739. // "description": "Project ID for this request.",
  94740. // "location": "path",
  94741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94742. // "required": true,
  94743. // "type": "string"
  94744. // }
  94745. // },
  94746. // "path": "{project}/aggregated/commitments",
  94747. // "response": {
  94748. // "$ref": "CommitmentAggregatedList"
  94749. // },
  94750. // "scopes": [
  94751. // "https://www.googleapis.com/auth/cloud-platform",
  94752. // "https://www.googleapis.com/auth/compute",
  94753. // "https://www.googleapis.com/auth/compute.readonly"
  94754. // ]
  94755. // }
  94756. }
  94757. // Pages invokes f for each page of results.
  94758. // A non-nil error returned from f will halt the iteration.
  94759. // The provided context supersedes any context provided to the Context method.
  94760. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  94761. c.ctx_ = ctx
  94762. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94763. for {
  94764. x, err := c.Do()
  94765. if err != nil {
  94766. return err
  94767. }
  94768. if err := f(x); err != nil {
  94769. return err
  94770. }
  94771. if x.NextPageToken == "" {
  94772. return nil
  94773. }
  94774. c.PageToken(x.NextPageToken)
  94775. }
  94776. }
  94777. // method id "compute.regionCommitments.get":
  94778. type RegionCommitmentsGetCall struct {
  94779. s *Service
  94780. project string
  94781. region string
  94782. commitment string
  94783. urlParams_ gensupport.URLParams
  94784. ifNoneMatch_ string
  94785. ctx_ context.Context
  94786. header_ http.Header
  94787. }
  94788. // Get: Returns the specified commitment resource. Gets a list of
  94789. // available commitments by making a list() request.
  94790. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  94791. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94792. c.project = project
  94793. c.region = region
  94794. c.commitment = commitment
  94795. return c
  94796. }
  94797. // Fields allows partial responses to be retrieved. See
  94798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94799. // for more information.
  94800. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  94801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94802. return c
  94803. }
  94804. // IfNoneMatch sets the optional parameter which makes the operation
  94805. // fail if the object's ETag matches the given value. This is useful for
  94806. // getting updates only after the object has changed since the last
  94807. // request. Use googleapi.IsNotModified to check whether the response
  94808. // error from Do is the result of In-None-Match.
  94809. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  94810. c.ifNoneMatch_ = entityTag
  94811. return c
  94812. }
  94813. // Context sets the context to be used in this call's Do method. Any
  94814. // pending HTTP request will be aborted if the provided context is
  94815. // canceled.
  94816. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  94817. c.ctx_ = ctx
  94818. return c
  94819. }
  94820. // Header returns an http.Header that can be modified by the caller to
  94821. // add HTTP headers to the request.
  94822. func (c *RegionCommitmentsGetCall) Header() http.Header {
  94823. if c.header_ == nil {
  94824. c.header_ = make(http.Header)
  94825. }
  94826. return c.header_
  94827. }
  94828. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  94829. reqHeaders := make(http.Header)
  94830. for k, v := range c.header_ {
  94831. reqHeaders[k] = v
  94832. }
  94833. reqHeaders.Set("User-Agent", c.s.userAgent())
  94834. if c.ifNoneMatch_ != "" {
  94835. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94836. }
  94837. var body io.Reader = nil
  94838. c.urlParams_.Set("alt", alt)
  94839. c.urlParams_.Set("prettyPrint", "false")
  94840. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  94841. urls += "?" + c.urlParams_.Encode()
  94842. req, err := http.NewRequest("GET", urls, body)
  94843. if err != nil {
  94844. return nil, err
  94845. }
  94846. req.Header = reqHeaders
  94847. googleapi.Expand(req.URL, map[string]string{
  94848. "project": c.project,
  94849. "region": c.region,
  94850. "commitment": c.commitment,
  94851. })
  94852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94853. }
  94854. // Do executes the "compute.regionCommitments.get" call.
  94855. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  94856. // status code is an error. Response headers are in either
  94857. // *Commitment.ServerResponse.Header or (if a response was returned at
  94858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94859. // to check whether the returned error was because
  94860. // http.StatusNotModified was returned.
  94861. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  94862. gensupport.SetOptions(c.urlParams_, opts...)
  94863. res, err := c.doRequest("json")
  94864. if res != nil && res.StatusCode == http.StatusNotModified {
  94865. if res.Body != nil {
  94866. res.Body.Close()
  94867. }
  94868. return nil, &googleapi.Error{
  94869. Code: res.StatusCode,
  94870. Header: res.Header,
  94871. }
  94872. }
  94873. if err != nil {
  94874. return nil, err
  94875. }
  94876. defer googleapi.CloseBody(res)
  94877. if err := googleapi.CheckResponse(res); err != nil {
  94878. return nil, err
  94879. }
  94880. ret := &Commitment{
  94881. ServerResponse: googleapi.ServerResponse{
  94882. Header: res.Header,
  94883. HTTPStatusCode: res.StatusCode,
  94884. },
  94885. }
  94886. target := &ret
  94887. if err := gensupport.DecodeResponse(target, res); err != nil {
  94888. return nil, err
  94889. }
  94890. return ret, nil
  94891. // {
  94892. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  94893. // "httpMethod": "GET",
  94894. // "id": "compute.regionCommitments.get",
  94895. // "parameterOrder": [
  94896. // "project",
  94897. // "region",
  94898. // "commitment"
  94899. // ],
  94900. // "parameters": {
  94901. // "commitment": {
  94902. // "description": "Name of the commitment to return.",
  94903. // "location": "path",
  94904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94905. // "required": true,
  94906. // "type": "string"
  94907. // },
  94908. // "project": {
  94909. // "description": "Project ID for this request.",
  94910. // "location": "path",
  94911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94912. // "required": true,
  94913. // "type": "string"
  94914. // },
  94915. // "region": {
  94916. // "description": "Name of the region for this request.",
  94917. // "location": "path",
  94918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94919. // "required": true,
  94920. // "type": "string"
  94921. // }
  94922. // },
  94923. // "path": "{project}/regions/{region}/commitments/{commitment}",
  94924. // "response": {
  94925. // "$ref": "Commitment"
  94926. // },
  94927. // "scopes": [
  94928. // "https://www.googleapis.com/auth/cloud-platform",
  94929. // "https://www.googleapis.com/auth/compute",
  94930. // "https://www.googleapis.com/auth/compute.readonly"
  94931. // ]
  94932. // }
  94933. }
  94934. // method id "compute.regionCommitments.insert":
  94935. type RegionCommitmentsInsertCall struct {
  94936. s *Service
  94937. project string
  94938. region string
  94939. commitment *Commitment
  94940. urlParams_ gensupport.URLParams
  94941. ctx_ context.Context
  94942. header_ http.Header
  94943. }
  94944. // Insert: Creates a commitment in the specified project using the data
  94945. // included in the request.
  94946. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  94947. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94948. c.project = project
  94949. c.region = region
  94950. c.commitment = commitment
  94951. return c
  94952. }
  94953. // RequestId sets the optional parameter "requestId": An optional
  94954. // request ID to identify requests. Specify a unique request ID so that
  94955. // if you must retry your request, the server will know to ignore the
  94956. // request if it has already been completed.
  94957. //
  94958. // For example, consider a situation where you make an initial request
  94959. // and the request times out. If you make the request again with the
  94960. // same request ID, the server can check if original operation with the
  94961. // same request ID was received, and if so, will ignore the second
  94962. // request. This prevents clients from accidentally creating duplicate
  94963. // commitments.
  94964. //
  94965. // The request ID must be a valid UUID with the exception that zero UUID
  94966. // is not supported (00000000-0000-0000-0000-000000000000).
  94967. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  94968. c.urlParams_.Set("requestId", requestId)
  94969. return c
  94970. }
  94971. // Fields allows partial responses to be retrieved. See
  94972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94973. // for more information.
  94974. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  94975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94976. return c
  94977. }
  94978. // Context sets the context to be used in this call's Do method. Any
  94979. // pending HTTP request will be aborted if the provided context is
  94980. // canceled.
  94981. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  94982. c.ctx_ = ctx
  94983. return c
  94984. }
  94985. // Header returns an http.Header that can be modified by the caller to
  94986. // add HTTP headers to the request.
  94987. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  94988. if c.header_ == nil {
  94989. c.header_ = make(http.Header)
  94990. }
  94991. return c.header_
  94992. }
  94993. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  94994. reqHeaders := make(http.Header)
  94995. for k, v := range c.header_ {
  94996. reqHeaders[k] = v
  94997. }
  94998. reqHeaders.Set("User-Agent", c.s.userAgent())
  94999. var body io.Reader = nil
  95000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  95001. if err != nil {
  95002. return nil, err
  95003. }
  95004. reqHeaders.Set("Content-Type", "application/json")
  95005. c.urlParams_.Set("alt", alt)
  95006. c.urlParams_.Set("prettyPrint", "false")
  95007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  95008. urls += "?" + c.urlParams_.Encode()
  95009. req, err := http.NewRequest("POST", urls, body)
  95010. if err != nil {
  95011. return nil, err
  95012. }
  95013. req.Header = reqHeaders
  95014. googleapi.Expand(req.URL, map[string]string{
  95015. "project": c.project,
  95016. "region": c.region,
  95017. })
  95018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95019. }
  95020. // Do executes the "compute.regionCommitments.insert" call.
  95021. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95022. // status code is an error. Response headers are in either
  95023. // *Operation.ServerResponse.Header or (if a response was returned at
  95024. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95025. // to check whether the returned error was because
  95026. // http.StatusNotModified was returned.
  95027. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95028. gensupport.SetOptions(c.urlParams_, opts...)
  95029. res, err := c.doRequest("json")
  95030. if res != nil && res.StatusCode == http.StatusNotModified {
  95031. if res.Body != nil {
  95032. res.Body.Close()
  95033. }
  95034. return nil, &googleapi.Error{
  95035. Code: res.StatusCode,
  95036. Header: res.Header,
  95037. }
  95038. }
  95039. if err != nil {
  95040. return nil, err
  95041. }
  95042. defer googleapi.CloseBody(res)
  95043. if err := googleapi.CheckResponse(res); err != nil {
  95044. return nil, err
  95045. }
  95046. ret := &Operation{
  95047. ServerResponse: googleapi.ServerResponse{
  95048. Header: res.Header,
  95049. HTTPStatusCode: res.StatusCode,
  95050. },
  95051. }
  95052. target := &ret
  95053. if err := gensupport.DecodeResponse(target, res); err != nil {
  95054. return nil, err
  95055. }
  95056. return ret, nil
  95057. // {
  95058. // "description": "Creates a commitment in the specified project using the data included in the request.",
  95059. // "httpMethod": "POST",
  95060. // "id": "compute.regionCommitments.insert",
  95061. // "parameterOrder": [
  95062. // "project",
  95063. // "region"
  95064. // ],
  95065. // "parameters": {
  95066. // "project": {
  95067. // "description": "Project ID for this request.",
  95068. // "location": "path",
  95069. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95070. // "required": true,
  95071. // "type": "string"
  95072. // },
  95073. // "region": {
  95074. // "description": "Name of the region for this request.",
  95075. // "location": "path",
  95076. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95077. // "required": true,
  95078. // "type": "string"
  95079. // },
  95080. // "requestId": {
  95081. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95082. // "location": "query",
  95083. // "type": "string"
  95084. // }
  95085. // },
  95086. // "path": "{project}/regions/{region}/commitments",
  95087. // "request": {
  95088. // "$ref": "Commitment"
  95089. // },
  95090. // "response": {
  95091. // "$ref": "Operation"
  95092. // },
  95093. // "scopes": [
  95094. // "https://www.googleapis.com/auth/cloud-platform",
  95095. // "https://www.googleapis.com/auth/compute"
  95096. // ]
  95097. // }
  95098. }
  95099. // method id "compute.regionCommitments.list":
  95100. type RegionCommitmentsListCall struct {
  95101. s *Service
  95102. project string
  95103. region string
  95104. urlParams_ gensupport.URLParams
  95105. ifNoneMatch_ string
  95106. ctx_ context.Context
  95107. header_ http.Header
  95108. }
  95109. // List: Retrieves a list of commitments contained within the specified
  95110. // region.
  95111. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  95112. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95113. c.project = project
  95114. c.region = region
  95115. return c
  95116. }
  95117. // Filter sets the optional parameter "filter": A filter expression that
  95118. // filters resources listed in the response. The expression must specify
  95119. // the field name, a comparison operator, and the value that you want to
  95120. // use for filtering. The value must be a string, a number, or a
  95121. // boolean. The comparison operator must be either =, !=, >, or <.
  95122. //
  95123. // For example, if you are filtering Compute Engine instances, you can
  95124. // exclude instances named example-instance by specifying name !=
  95125. // example-instance.
  95126. //
  95127. // You can also filter nested fields. For example, you could specify
  95128. // scheduling.automaticRestart = false to include instances only if they
  95129. // are not scheduled for automatic restarts. You can use filtering on
  95130. // nested fields to filter based on resource labels.
  95131. //
  95132. // To filter on multiple expressions, provide each separate expression
  95133. // within parentheses. For example, (scheduling.automaticRestart = true)
  95134. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95135. // AND expression. However, you can include AND and OR expressions
  95136. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95137. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95138. // true).
  95139. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  95140. c.urlParams_.Set("filter", filter)
  95141. return c
  95142. }
  95143. // MaxResults sets the optional parameter "maxResults": The maximum
  95144. // number of results per page that should be returned. If the number of
  95145. // available results is larger than maxResults, Compute Engine returns a
  95146. // nextPageToken that can be used to get the next page of results in
  95147. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95148. // (Default: 500)
  95149. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  95150. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95151. return c
  95152. }
  95153. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95154. // a certain order. By default, results are returned in alphanumerical
  95155. // order based on the resource name.
  95156. //
  95157. // You can also sort results in descending order based on the creation
  95158. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95159. // based on the creationTimestamp field in reverse chronological order
  95160. // (newest result first). Use this to sort resources like operations so
  95161. // that the newest operation is returned first.
  95162. //
  95163. // Currently, only sorting by name or creationTimestamp desc is
  95164. // supported.
  95165. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  95166. c.urlParams_.Set("orderBy", orderBy)
  95167. return c
  95168. }
  95169. // PageToken sets the optional parameter "pageToken": Specifies a page
  95170. // token to use. Set pageToken to the nextPageToken returned by a
  95171. // previous list request to get the next page of results.
  95172. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  95173. c.urlParams_.Set("pageToken", pageToken)
  95174. return c
  95175. }
  95176. // Fields allows partial responses to be retrieved. See
  95177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95178. // for more information.
  95179. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  95180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95181. return c
  95182. }
  95183. // IfNoneMatch sets the optional parameter which makes the operation
  95184. // fail if the object's ETag matches the given value. This is useful for
  95185. // getting updates only after the object has changed since the last
  95186. // request. Use googleapi.IsNotModified to check whether the response
  95187. // error from Do is the result of In-None-Match.
  95188. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  95189. c.ifNoneMatch_ = entityTag
  95190. return c
  95191. }
  95192. // Context sets the context to be used in this call's Do method. Any
  95193. // pending HTTP request will be aborted if the provided context is
  95194. // canceled.
  95195. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  95196. c.ctx_ = ctx
  95197. return c
  95198. }
  95199. // Header returns an http.Header that can be modified by the caller to
  95200. // add HTTP headers to the request.
  95201. func (c *RegionCommitmentsListCall) Header() http.Header {
  95202. if c.header_ == nil {
  95203. c.header_ = make(http.Header)
  95204. }
  95205. return c.header_
  95206. }
  95207. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  95208. reqHeaders := make(http.Header)
  95209. for k, v := range c.header_ {
  95210. reqHeaders[k] = v
  95211. }
  95212. reqHeaders.Set("User-Agent", c.s.userAgent())
  95213. if c.ifNoneMatch_ != "" {
  95214. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95215. }
  95216. var body io.Reader = nil
  95217. c.urlParams_.Set("alt", alt)
  95218. c.urlParams_.Set("prettyPrint", "false")
  95219. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  95220. urls += "?" + c.urlParams_.Encode()
  95221. req, err := http.NewRequest("GET", urls, body)
  95222. if err != nil {
  95223. return nil, err
  95224. }
  95225. req.Header = reqHeaders
  95226. googleapi.Expand(req.URL, map[string]string{
  95227. "project": c.project,
  95228. "region": c.region,
  95229. })
  95230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95231. }
  95232. // Do executes the "compute.regionCommitments.list" call.
  95233. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  95234. // status code is an error. Response headers are in either
  95235. // *CommitmentList.ServerResponse.Header or (if a response was returned
  95236. // at all) in error.(*googleapi.Error).Header. Use
  95237. // googleapi.IsNotModified to check whether the returned error was
  95238. // because http.StatusNotModified was returned.
  95239. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  95240. gensupport.SetOptions(c.urlParams_, opts...)
  95241. res, err := c.doRequest("json")
  95242. if res != nil && res.StatusCode == http.StatusNotModified {
  95243. if res.Body != nil {
  95244. res.Body.Close()
  95245. }
  95246. return nil, &googleapi.Error{
  95247. Code: res.StatusCode,
  95248. Header: res.Header,
  95249. }
  95250. }
  95251. if err != nil {
  95252. return nil, err
  95253. }
  95254. defer googleapi.CloseBody(res)
  95255. if err := googleapi.CheckResponse(res); err != nil {
  95256. return nil, err
  95257. }
  95258. ret := &CommitmentList{
  95259. ServerResponse: googleapi.ServerResponse{
  95260. Header: res.Header,
  95261. HTTPStatusCode: res.StatusCode,
  95262. },
  95263. }
  95264. target := &ret
  95265. if err := gensupport.DecodeResponse(target, res); err != nil {
  95266. return nil, err
  95267. }
  95268. return ret, nil
  95269. // {
  95270. // "description": "Retrieves a list of commitments contained within the specified region.",
  95271. // "httpMethod": "GET",
  95272. // "id": "compute.regionCommitments.list",
  95273. // "parameterOrder": [
  95274. // "project",
  95275. // "region"
  95276. // ],
  95277. // "parameters": {
  95278. // "filter": {
  95279. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95280. // "location": "query",
  95281. // "type": "string"
  95282. // },
  95283. // "maxResults": {
  95284. // "default": "500",
  95285. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95286. // "format": "uint32",
  95287. // "location": "query",
  95288. // "minimum": "0",
  95289. // "type": "integer"
  95290. // },
  95291. // "orderBy": {
  95292. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95293. // "location": "query",
  95294. // "type": "string"
  95295. // },
  95296. // "pageToken": {
  95297. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95298. // "location": "query",
  95299. // "type": "string"
  95300. // },
  95301. // "project": {
  95302. // "description": "Project ID for this request.",
  95303. // "location": "path",
  95304. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95305. // "required": true,
  95306. // "type": "string"
  95307. // },
  95308. // "region": {
  95309. // "description": "Name of the region for this request.",
  95310. // "location": "path",
  95311. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95312. // "required": true,
  95313. // "type": "string"
  95314. // }
  95315. // },
  95316. // "path": "{project}/regions/{region}/commitments",
  95317. // "response": {
  95318. // "$ref": "CommitmentList"
  95319. // },
  95320. // "scopes": [
  95321. // "https://www.googleapis.com/auth/cloud-platform",
  95322. // "https://www.googleapis.com/auth/compute",
  95323. // "https://www.googleapis.com/auth/compute.readonly"
  95324. // ]
  95325. // }
  95326. }
  95327. // Pages invokes f for each page of results.
  95328. // A non-nil error returned from f will halt the iteration.
  95329. // The provided context supersedes any context provided to the Context method.
  95330. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  95331. c.ctx_ = ctx
  95332. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95333. for {
  95334. x, err := c.Do()
  95335. if err != nil {
  95336. return err
  95337. }
  95338. if err := f(x); err != nil {
  95339. return err
  95340. }
  95341. if x.NextPageToken == "" {
  95342. return nil
  95343. }
  95344. c.PageToken(x.NextPageToken)
  95345. }
  95346. }
  95347. // method id "compute.regionCommitments.testIamPermissions":
  95348. type RegionCommitmentsTestIamPermissionsCall struct {
  95349. s *Service
  95350. project string
  95351. region string
  95352. resource string
  95353. testpermissionsrequest *TestPermissionsRequest
  95354. urlParams_ gensupport.URLParams
  95355. ctx_ context.Context
  95356. header_ http.Header
  95357. }
  95358. // TestIamPermissions: Returns permissions that a caller has on the
  95359. // specified resource.
  95360. func (r *RegionCommitmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionCommitmentsTestIamPermissionsCall {
  95361. c := &RegionCommitmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95362. c.project = project
  95363. c.region = region
  95364. c.resource = resource
  95365. c.testpermissionsrequest = testpermissionsrequest
  95366. return c
  95367. }
  95368. // Fields allows partial responses to be retrieved. See
  95369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95370. // for more information.
  95371. func (c *RegionCommitmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionCommitmentsTestIamPermissionsCall {
  95372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95373. return c
  95374. }
  95375. // Context sets the context to be used in this call's Do method. Any
  95376. // pending HTTP request will be aborted if the provided context is
  95377. // canceled.
  95378. func (c *RegionCommitmentsTestIamPermissionsCall) Context(ctx context.Context) *RegionCommitmentsTestIamPermissionsCall {
  95379. c.ctx_ = ctx
  95380. return c
  95381. }
  95382. // Header returns an http.Header that can be modified by the caller to
  95383. // add HTTP headers to the request.
  95384. func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header {
  95385. if c.header_ == nil {
  95386. c.header_ = make(http.Header)
  95387. }
  95388. return c.header_
  95389. }
  95390. func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  95391. reqHeaders := make(http.Header)
  95392. for k, v := range c.header_ {
  95393. reqHeaders[k] = v
  95394. }
  95395. reqHeaders.Set("User-Agent", c.s.userAgent())
  95396. var body io.Reader = nil
  95397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  95398. if err != nil {
  95399. return nil, err
  95400. }
  95401. reqHeaders.Set("Content-Type", "application/json")
  95402. c.urlParams_.Set("alt", alt)
  95403. c.urlParams_.Set("prettyPrint", "false")
  95404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{resource}/testIamPermissions")
  95405. urls += "?" + c.urlParams_.Encode()
  95406. req, err := http.NewRequest("POST", urls, body)
  95407. if err != nil {
  95408. return nil, err
  95409. }
  95410. req.Header = reqHeaders
  95411. googleapi.Expand(req.URL, map[string]string{
  95412. "project": c.project,
  95413. "region": c.region,
  95414. "resource": c.resource,
  95415. })
  95416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95417. }
  95418. // Do executes the "compute.regionCommitments.testIamPermissions" call.
  95419. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  95420. // non-2xx status code is an error. Response headers are in either
  95421. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  95422. // returned at all) in error.(*googleapi.Error).Header. Use
  95423. // googleapi.IsNotModified to check whether the returned error was
  95424. // because http.StatusNotModified was returned.
  95425. func (c *RegionCommitmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  95426. gensupport.SetOptions(c.urlParams_, opts...)
  95427. res, err := c.doRequest("json")
  95428. if res != nil && res.StatusCode == http.StatusNotModified {
  95429. if res.Body != nil {
  95430. res.Body.Close()
  95431. }
  95432. return nil, &googleapi.Error{
  95433. Code: res.StatusCode,
  95434. Header: res.Header,
  95435. }
  95436. }
  95437. if err != nil {
  95438. return nil, err
  95439. }
  95440. defer googleapi.CloseBody(res)
  95441. if err := googleapi.CheckResponse(res); err != nil {
  95442. return nil, err
  95443. }
  95444. ret := &TestPermissionsResponse{
  95445. ServerResponse: googleapi.ServerResponse{
  95446. Header: res.Header,
  95447. HTTPStatusCode: res.StatusCode,
  95448. },
  95449. }
  95450. target := &ret
  95451. if err := gensupport.DecodeResponse(target, res); err != nil {
  95452. return nil, err
  95453. }
  95454. return ret, nil
  95455. // {
  95456. // "description": "Returns permissions that a caller has on the specified resource.",
  95457. // "httpMethod": "POST",
  95458. // "id": "compute.regionCommitments.testIamPermissions",
  95459. // "parameterOrder": [
  95460. // "project",
  95461. // "region",
  95462. // "resource"
  95463. // ],
  95464. // "parameters": {
  95465. // "project": {
  95466. // "description": "Project ID for this request.",
  95467. // "location": "path",
  95468. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95469. // "required": true,
  95470. // "type": "string"
  95471. // },
  95472. // "region": {
  95473. // "description": "The name of the region for this request.",
  95474. // "location": "path",
  95475. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95476. // "required": true,
  95477. // "type": "string"
  95478. // },
  95479. // "resource": {
  95480. // "description": "Name or id of the resource for this request.",
  95481. // "location": "path",
  95482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95483. // "required": true,
  95484. // "type": "string"
  95485. // }
  95486. // },
  95487. // "path": "{project}/regions/{region}/commitments/{resource}/testIamPermissions",
  95488. // "request": {
  95489. // "$ref": "TestPermissionsRequest"
  95490. // },
  95491. // "response": {
  95492. // "$ref": "TestPermissionsResponse"
  95493. // },
  95494. // "scopes": [
  95495. // "https://www.googleapis.com/auth/cloud-platform",
  95496. // "https://www.googleapis.com/auth/compute",
  95497. // "https://www.googleapis.com/auth/compute.readonly"
  95498. // ]
  95499. // }
  95500. }
  95501. // method id "compute.regionDiskTypes.get":
  95502. type RegionDiskTypesGetCall struct {
  95503. s *Service
  95504. project string
  95505. region string
  95506. diskType string
  95507. urlParams_ gensupport.URLParams
  95508. ifNoneMatch_ string
  95509. ctx_ context.Context
  95510. header_ http.Header
  95511. }
  95512. // Get: Returns the specified regional disk type. Gets a list of
  95513. // available disk types by making a list() request.
  95514. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  95515. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95516. c.project = project
  95517. c.region = region
  95518. c.diskType = diskType
  95519. return c
  95520. }
  95521. // Fields allows partial responses to be retrieved. See
  95522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95523. // for more information.
  95524. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  95525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95526. return c
  95527. }
  95528. // IfNoneMatch sets the optional parameter which makes the operation
  95529. // fail if the object's ETag matches the given value. This is useful for
  95530. // getting updates only after the object has changed since the last
  95531. // request. Use googleapi.IsNotModified to check whether the response
  95532. // error from Do is the result of In-None-Match.
  95533. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  95534. c.ifNoneMatch_ = entityTag
  95535. return c
  95536. }
  95537. // Context sets the context to be used in this call's Do method. Any
  95538. // pending HTTP request will be aborted if the provided context is
  95539. // canceled.
  95540. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  95541. c.ctx_ = ctx
  95542. return c
  95543. }
  95544. // Header returns an http.Header that can be modified by the caller to
  95545. // add HTTP headers to the request.
  95546. func (c *RegionDiskTypesGetCall) Header() http.Header {
  95547. if c.header_ == nil {
  95548. c.header_ = make(http.Header)
  95549. }
  95550. return c.header_
  95551. }
  95552. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  95553. reqHeaders := make(http.Header)
  95554. for k, v := range c.header_ {
  95555. reqHeaders[k] = v
  95556. }
  95557. reqHeaders.Set("User-Agent", c.s.userAgent())
  95558. if c.ifNoneMatch_ != "" {
  95559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95560. }
  95561. var body io.Reader = nil
  95562. c.urlParams_.Set("alt", alt)
  95563. c.urlParams_.Set("prettyPrint", "false")
  95564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  95565. urls += "?" + c.urlParams_.Encode()
  95566. req, err := http.NewRequest("GET", urls, body)
  95567. if err != nil {
  95568. return nil, err
  95569. }
  95570. req.Header = reqHeaders
  95571. googleapi.Expand(req.URL, map[string]string{
  95572. "project": c.project,
  95573. "region": c.region,
  95574. "diskType": c.diskType,
  95575. })
  95576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95577. }
  95578. // Do executes the "compute.regionDiskTypes.get" call.
  95579. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  95580. // code is an error. Response headers are in either
  95581. // *DiskType.ServerResponse.Header or (if a response was returned at
  95582. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95583. // to check whether the returned error was because
  95584. // http.StatusNotModified was returned.
  95585. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  95586. gensupport.SetOptions(c.urlParams_, opts...)
  95587. res, err := c.doRequest("json")
  95588. if res != nil && res.StatusCode == http.StatusNotModified {
  95589. if res.Body != nil {
  95590. res.Body.Close()
  95591. }
  95592. return nil, &googleapi.Error{
  95593. Code: res.StatusCode,
  95594. Header: res.Header,
  95595. }
  95596. }
  95597. if err != nil {
  95598. return nil, err
  95599. }
  95600. defer googleapi.CloseBody(res)
  95601. if err := googleapi.CheckResponse(res); err != nil {
  95602. return nil, err
  95603. }
  95604. ret := &DiskType{
  95605. ServerResponse: googleapi.ServerResponse{
  95606. Header: res.Header,
  95607. HTTPStatusCode: res.StatusCode,
  95608. },
  95609. }
  95610. target := &ret
  95611. if err := gensupport.DecodeResponse(target, res); err != nil {
  95612. return nil, err
  95613. }
  95614. return ret, nil
  95615. // {
  95616. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  95617. // "httpMethod": "GET",
  95618. // "id": "compute.regionDiskTypes.get",
  95619. // "parameterOrder": [
  95620. // "project",
  95621. // "region",
  95622. // "diskType"
  95623. // ],
  95624. // "parameters": {
  95625. // "diskType": {
  95626. // "description": "Name of the disk type to return.",
  95627. // "location": "path",
  95628. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95629. // "required": true,
  95630. // "type": "string"
  95631. // },
  95632. // "project": {
  95633. // "description": "Project ID for this request.",
  95634. // "location": "path",
  95635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95636. // "required": true,
  95637. // "type": "string"
  95638. // },
  95639. // "region": {
  95640. // "description": "The name of the region for this request.",
  95641. // "location": "path",
  95642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95643. // "required": true,
  95644. // "type": "string"
  95645. // }
  95646. // },
  95647. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  95648. // "response": {
  95649. // "$ref": "DiskType"
  95650. // },
  95651. // "scopes": [
  95652. // "https://www.googleapis.com/auth/cloud-platform",
  95653. // "https://www.googleapis.com/auth/compute",
  95654. // "https://www.googleapis.com/auth/compute.readonly"
  95655. // ]
  95656. // }
  95657. }
  95658. // method id "compute.regionDiskTypes.list":
  95659. type RegionDiskTypesListCall struct {
  95660. s *Service
  95661. project string
  95662. region string
  95663. urlParams_ gensupport.URLParams
  95664. ifNoneMatch_ string
  95665. ctx_ context.Context
  95666. header_ http.Header
  95667. }
  95668. // List: Retrieves a list of regional disk types available to the
  95669. // specified project.
  95670. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  95671. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95672. c.project = project
  95673. c.region = region
  95674. return c
  95675. }
  95676. // Filter sets the optional parameter "filter": A filter expression that
  95677. // filters resources listed in the response. The expression must specify
  95678. // the field name, a comparison operator, and the value that you want to
  95679. // use for filtering. The value must be a string, a number, or a
  95680. // boolean. The comparison operator must be either =, !=, >, or <.
  95681. //
  95682. // For example, if you are filtering Compute Engine instances, you can
  95683. // exclude instances named example-instance by specifying name !=
  95684. // example-instance.
  95685. //
  95686. // You can also filter nested fields. For example, you could specify
  95687. // scheduling.automaticRestart = false to include instances only if they
  95688. // are not scheduled for automatic restarts. You can use filtering on
  95689. // nested fields to filter based on resource labels.
  95690. //
  95691. // To filter on multiple expressions, provide each separate expression
  95692. // within parentheses. For example, (scheduling.automaticRestart = true)
  95693. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95694. // AND expression. However, you can include AND and OR expressions
  95695. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95696. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95697. // true).
  95698. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  95699. c.urlParams_.Set("filter", filter)
  95700. return c
  95701. }
  95702. // MaxResults sets the optional parameter "maxResults": The maximum
  95703. // number of results per page that should be returned. If the number of
  95704. // available results is larger than maxResults, Compute Engine returns a
  95705. // nextPageToken that can be used to get the next page of results in
  95706. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95707. // (Default: 500)
  95708. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  95709. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95710. return c
  95711. }
  95712. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95713. // a certain order. By default, results are returned in alphanumerical
  95714. // order based on the resource name.
  95715. //
  95716. // You can also sort results in descending order based on the creation
  95717. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95718. // based on the creationTimestamp field in reverse chronological order
  95719. // (newest result first). Use this to sort resources like operations so
  95720. // that the newest operation is returned first.
  95721. //
  95722. // Currently, only sorting by name or creationTimestamp desc is
  95723. // supported.
  95724. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  95725. c.urlParams_.Set("orderBy", orderBy)
  95726. return c
  95727. }
  95728. // PageToken sets the optional parameter "pageToken": Specifies a page
  95729. // token to use. Set pageToken to the nextPageToken returned by a
  95730. // previous list request to get the next page of results.
  95731. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  95732. c.urlParams_.Set("pageToken", pageToken)
  95733. return c
  95734. }
  95735. // Fields allows partial responses to be retrieved. See
  95736. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95737. // for more information.
  95738. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  95739. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95740. return c
  95741. }
  95742. // IfNoneMatch sets the optional parameter which makes the operation
  95743. // fail if the object's ETag matches the given value. This is useful for
  95744. // getting updates only after the object has changed since the last
  95745. // request. Use googleapi.IsNotModified to check whether the response
  95746. // error from Do is the result of In-None-Match.
  95747. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  95748. c.ifNoneMatch_ = entityTag
  95749. return c
  95750. }
  95751. // Context sets the context to be used in this call's Do method. Any
  95752. // pending HTTP request will be aborted if the provided context is
  95753. // canceled.
  95754. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  95755. c.ctx_ = ctx
  95756. return c
  95757. }
  95758. // Header returns an http.Header that can be modified by the caller to
  95759. // add HTTP headers to the request.
  95760. func (c *RegionDiskTypesListCall) Header() http.Header {
  95761. if c.header_ == nil {
  95762. c.header_ = make(http.Header)
  95763. }
  95764. return c.header_
  95765. }
  95766. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  95767. reqHeaders := make(http.Header)
  95768. for k, v := range c.header_ {
  95769. reqHeaders[k] = v
  95770. }
  95771. reqHeaders.Set("User-Agent", c.s.userAgent())
  95772. if c.ifNoneMatch_ != "" {
  95773. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95774. }
  95775. var body io.Reader = nil
  95776. c.urlParams_.Set("alt", alt)
  95777. c.urlParams_.Set("prettyPrint", "false")
  95778. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  95779. urls += "?" + c.urlParams_.Encode()
  95780. req, err := http.NewRequest("GET", urls, body)
  95781. if err != nil {
  95782. return nil, err
  95783. }
  95784. req.Header = reqHeaders
  95785. googleapi.Expand(req.URL, map[string]string{
  95786. "project": c.project,
  95787. "region": c.region,
  95788. })
  95789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95790. }
  95791. // Do executes the "compute.regionDiskTypes.list" call.
  95792. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  95793. // non-2xx status code is an error. Response headers are in either
  95794. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  95795. // returned at all) in error.(*googleapi.Error).Header. Use
  95796. // googleapi.IsNotModified to check whether the returned error was
  95797. // because http.StatusNotModified was returned.
  95798. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  95799. gensupport.SetOptions(c.urlParams_, opts...)
  95800. res, err := c.doRequest("json")
  95801. if res != nil && res.StatusCode == http.StatusNotModified {
  95802. if res.Body != nil {
  95803. res.Body.Close()
  95804. }
  95805. return nil, &googleapi.Error{
  95806. Code: res.StatusCode,
  95807. Header: res.Header,
  95808. }
  95809. }
  95810. if err != nil {
  95811. return nil, err
  95812. }
  95813. defer googleapi.CloseBody(res)
  95814. if err := googleapi.CheckResponse(res); err != nil {
  95815. return nil, err
  95816. }
  95817. ret := &RegionDiskTypeList{
  95818. ServerResponse: googleapi.ServerResponse{
  95819. Header: res.Header,
  95820. HTTPStatusCode: res.StatusCode,
  95821. },
  95822. }
  95823. target := &ret
  95824. if err := gensupport.DecodeResponse(target, res); err != nil {
  95825. return nil, err
  95826. }
  95827. return ret, nil
  95828. // {
  95829. // "description": "Retrieves a list of regional disk types available to the specified project.",
  95830. // "httpMethod": "GET",
  95831. // "id": "compute.regionDiskTypes.list",
  95832. // "parameterOrder": [
  95833. // "project",
  95834. // "region"
  95835. // ],
  95836. // "parameters": {
  95837. // "filter": {
  95838. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95839. // "location": "query",
  95840. // "type": "string"
  95841. // },
  95842. // "maxResults": {
  95843. // "default": "500",
  95844. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95845. // "format": "uint32",
  95846. // "location": "query",
  95847. // "minimum": "0",
  95848. // "type": "integer"
  95849. // },
  95850. // "orderBy": {
  95851. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95852. // "location": "query",
  95853. // "type": "string"
  95854. // },
  95855. // "pageToken": {
  95856. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95857. // "location": "query",
  95858. // "type": "string"
  95859. // },
  95860. // "project": {
  95861. // "description": "Project ID for this request.",
  95862. // "location": "path",
  95863. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95864. // "required": true,
  95865. // "type": "string"
  95866. // },
  95867. // "region": {
  95868. // "description": "The name of the region for this request.",
  95869. // "location": "path",
  95870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95871. // "required": true,
  95872. // "type": "string"
  95873. // }
  95874. // },
  95875. // "path": "{project}/regions/{region}/diskTypes",
  95876. // "response": {
  95877. // "$ref": "RegionDiskTypeList"
  95878. // },
  95879. // "scopes": [
  95880. // "https://www.googleapis.com/auth/cloud-platform",
  95881. // "https://www.googleapis.com/auth/compute",
  95882. // "https://www.googleapis.com/auth/compute.readonly"
  95883. // ]
  95884. // }
  95885. }
  95886. // Pages invokes f for each page of results.
  95887. // A non-nil error returned from f will halt the iteration.
  95888. // The provided context supersedes any context provided to the Context method.
  95889. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  95890. c.ctx_ = ctx
  95891. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95892. for {
  95893. x, err := c.Do()
  95894. if err != nil {
  95895. return err
  95896. }
  95897. if err := f(x); err != nil {
  95898. return err
  95899. }
  95900. if x.NextPageToken == "" {
  95901. return nil
  95902. }
  95903. c.PageToken(x.NextPageToken)
  95904. }
  95905. }
  95906. // method id "compute.regionDisks.addResourcePolicies":
  95907. type RegionDisksAddResourcePoliciesCall struct {
  95908. s *Service
  95909. project string
  95910. region string
  95911. disk string
  95912. regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
  95913. urlParams_ gensupport.URLParams
  95914. ctx_ context.Context
  95915. header_ http.Header
  95916. }
  95917. // AddResourcePolicies: Adds existing resource policies to a regional
  95918. // disk. You can only add one policy which will be applied to this disk
  95919. // for scheduling snapshot creation.
  95920. func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
  95921. c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95922. c.project = project
  95923. c.region = region
  95924. c.disk = disk
  95925. c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
  95926. return c
  95927. }
  95928. // RequestId sets the optional parameter "requestId": An optional
  95929. // request ID to identify requests. Specify a unique request ID so that
  95930. // if you must retry your request, the server will know to ignore the
  95931. // request if it has already been completed.
  95932. //
  95933. // For example, consider a situation where you make an initial request
  95934. // and the request times out. If you make the request again with the
  95935. // same request ID, the server can check if original operation with the
  95936. // same request ID was received, and if so, will ignore the second
  95937. // request. This prevents clients from accidentally creating duplicate
  95938. // commitments.
  95939. //
  95940. // The request ID must be a valid UUID with the exception that zero UUID
  95941. // is not supported (00000000-0000-0000-0000-000000000000).
  95942. func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
  95943. c.urlParams_.Set("requestId", requestId)
  95944. return c
  95945. }
  95946. // Fields allows partial responses to be retrieved. See
  95947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95948. // for more information.
  95949. func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
  95950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95951. return c
  95952. }
  95953. // Context sets the context to be used in this call's Do method. Any
  95954. // pending HTTP request will be aborted if the provided context is
  95955. // canceled.
  95956. func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
  95957. c.ctx_ = ctx
  95958. return c
  95959. }
  95960. // Header returns an http.Header that can be modified by the caller to
  95961. // add HTTP headers to the request.
  95962. func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header {
  95963. if c.header_ == nil {
  95964. c.header_ = make(http.Header)
  95965. }
  95966. return c.header_
  95967. }
  95968. func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  95969. reqHeaders := make(http.Header)
  95970. for k, v := range c.header_ {
  95971. reqHeaders[k] = v
  95972. }
  95973. reqHeaders.Set("User-Agent", c.s.userAgent())
  95974. var body io.Reader = nil
  95975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
  95976. if err != nil {
  95977. return nil, err
  95978. }
  95979. reqHeaders.Set("Content-Type", "application/json")
  95980. c.urlParams_.Set("alt", alt)
  95981. c.urlParams_.Set("prettyPrint", "false")
  95982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/addResourcePolicies")
  95983. urls += "?" + c.urlParams_.Encode()
  95984. req, err := http.NewRequest("POST", urls, body)
  95985. if err != nil {
  95986. return nil, err
  95987. }
  95988. req.Header = reqHeaders
  95989. googleapi.Expand(req.URL, map[string]string{
  95990. "project": c.project,
  95991. "region": c.region,
  95992. "disk": c.disk,
  95993. })
  95994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95995. }
  95996. // Do executes the "compute.regionDisks.addResourcePolicies" call.
  95997. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95998. // status code is an error. Response headers are in either
  95999. // *Operation.ServerResponse.Header or (if a response was returned at
  96000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96001. // to check whether the returned error was because
  96002. // http.StatusNotModified was returned.
  96003. func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96004. gensupport.SetOptions(c.urlParams_, opts...)
  96005. res, err := c.doRequest("json")
  96006. if res != nil && res.StatusCode == http.StatusNotModified {
  96007. if res.Body != nil {
  96008. res.Body.Close()
  96009. }
  96010. return nil, &googleapi.Error{
  96011. Code: res.StatusCode,
  96012. Header: res.Header,
  96013. }
  96014. }
  96015. if err != nil {
  96016. return nil, err
  96017. }
  96018. defer googleapi.CloseBody(res)
  96019. if err := googleapi.CheckResponse(res); err != nil {
  96020. return nil, err
  96021. }
  96022. ret := &Operation{
  96023. ServerResponse: googleapi.ServerResponse{
  96024. Header: res.Header,
  96025. HTTPStatusCode: res.StatusCode,
  96026. },
  96027. }
  96028. target := &ret
  96029. if err := gensupport.DecodeResponse(target, res); err != nil {
  96030. return nil, err
  96031. }
  96032. return ret, nil
  96033. // {
  96034. // "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.",
  96035. // "httpMethod": "POST",
  96036. // "id": "compute.regionDisks.addResourcePolicies",
  96037. // "parameterOrder": [
  96038. // "project",
  96039. // "region",
  96040. // "disk"
  96041. // ],
  96042. // "parameters": {
  96043. // "disk": {
  96044. // "description": "The disk name for this request.",
  96045. // "location": "path",
  96046. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96047. // "required": true,
  96048. // "type": "string"
  96049. // },
  96050. // "project": {
  96051. // "description": "Project ID for this request.",
  96052. // "location": "path",
  96053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96054. // "required": true,
  96055. // "type": "string"
  96056. // },
  96057. // "region": {
  96058. // "description": "The name of the region for this request.",
  96059. // "location": "path",
  96060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96061. // "required": true,
  96062. // "type": "string"
  96063. // },
  96064. // "requestId": {
  96065. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96066. // "location": "query",
  96067. // "type": "string"
  96068. // }
  96069. // },
  96070. // "path": "{project}/regions/{region}/disks/{disk}/addResourcePolicies",
  96071. // "request": {
  96072. // "$ref": "RegionDisksAddResourcePoliciesRequest"
  96073. // },
  96074. // "response": {
  96075. // "$ref": "Operation"
  96076. // },
  96077. // "scopes": [
  96078. // "https://www.googleapis.com/auth/cloud-platform",
  96079. // "https://www.googleapis.com/auth/compute"
  96080. // ]
  96081. // }
  96082. }
  96083. // method id "compute.regionDisks.createSnapshot":
  96084. type RegionDisksCreateSnapshotCall struct {
  96085. s *Service
  96086. project string
  96087. region string
  96088. disk string
  96089. snapshot *Snapshot
  96090. urlParams_ gensupport.URLParams
  96091. ctx_ context.Context
  96092. header_ http.Header
  96093. }
  96094. // CreateSnapshot: Creates a snapshot of this regional disk.
  96095. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  96096. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96097. c.project = project
  96098. c.region = region
  96099. c.disk = disk
  96100. c.snapshot = snapshot
  96101. return c
  96102. }
  96103. // GuestFlush sets the optional parameter "guestFlush":
  96104. func (c *RegionDisksCreateSnapshotCall) GuestFlush(guestFlush bool) *RegionDisksCreateSnapshotCall {
  96105. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  96106. return c
  96107. }
  96108. // RequestId sets the optional parameter "requestId": An optional
  96109. // request ID to identify requests. Specify a unique request ID so that
  96110. // if you must retry your request, the server will know to ignore the
  96111. // request if it has already been completed.
  96112. //
  96113. // For example, consider a situation where you make an initial request
  96114. // and the request times out. If you make the request again with the
  96115. // same request ID, the server can check if original operation with the
  96116. // same request ID was received, and if so, will ignore the second
  96117. // request. This prevents clients from accidentally creating duplicate
  96118. // commitments.
  96119. //
  96120. // The request ID must be a valid UUID with the exception that zero UUID
  96121. // is not supported (00000000-0000-0000-0000-000000000000).
  96122. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  96123. c.urlParams_.Set("requestId", requestId)
  96124. return c
  96125. }
  96126. // Fields allows partial responses to be retrieved. See
  96127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96128. // for more information.
  96129. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  96130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96131. return c
  96132. }
  96133. // Context sets the context to be used in this call's Do method. Any
  96134. // pending HTTP request will be aborted if the provided context is
  96135. // canceled.
  96136. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  96137. c.ctx_ = ctx
  96138. return c
  96139. }
  96140. // Header returns an http.Header that can be modified by the caller to
  96141. // add HTTP headers to the request.
  96142. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  96143. if c.header_ == nil {
  96144. c.header_ = make(http.Header)
  96145. }
  96146. return c.header_
  96147. }
  96148. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  96149. reqHeaders := make(http.Header)
  96150. for k, v := range c.header_ {
  96151. reqHeaders[k] = v
  96152. }
  96153. reqHeaders.Set("User-Agent", c.s.userAgent())
  96154. var body io.Reader = nil
  96155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  96156. if err != nil {
  96157. return nil, err
  96158. }
  96159. reqHeaders.Set("Content-Type", "application/json")
  96160. c.urlParams_.Set("alt", alt)
  96161. c.urlParams_.Set("prettyPrint", "false")
  96162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  96163. urls += "?" + c.urlParams_.Encode()
  96164. req, err := http.NewRequest("POST", urls, body)
  96165. if err != nil {
  96166. return nil, err
  96167. }
  96168. req.Header = reqHeaders
  96169. googleapi.Expand(req.URL, map[string]string{
  96170. "project": c.project,
  96171. "region": c.region,
  96172. "disk": c.disk,
  96173. })
  96174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96175. }
  96176. // Do executes the "compute.regionDisks.createSnapshot" call.
  96177. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96178. // status code is an error. Response headers are in either
  96179. // *Operation.ServerResponse.Header or (if a response was returned at
  96180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96181. // to check whether the returned error was because
  96182. // http.StatusNotModified was returned.
  96183. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96184. gensupport.SetOptions(c.urlParams_, opts...)
  96185. res, err := c.doRequest("json")
  96186. if res != nil && res.StatusCode == http.StatusNotModified {
  96187. if res.Body != nil {
  96188. res.Body.Close()
  96189. }
  96190. return nil, &googleapi.Error{
  96191. Code: res.StatusCode,
  96192. Header: res.Header,
  96193. }
  96194. }
  96195. if err != nil {
  96196. return nil, err
  96197. }
  96198. defer googleapi.CloseBody(res)
  96199. if err := googleapi.CheckResponse(res); err != nil {
  96200. return nil, err
  96201. }
  96202. ret := &Operation{
  96203. ServerResponse: googleapi.ServerResponse{
  96204. Header: res.Header,
  96205. HTTPStatusCode: res.StatusCode,
  96206. },
  96207. }
  96208. target := &ret
  96209. if err := gensupport.DecodeResponse(target, res); err != nil {
  96210. return nil, err
  96211. }
  96212. return ret, nil
  96213. // {
  96214. // "description": "Creates a snapshot of this regional disk.",
  96215. // "httpMethod": "POST",
  96216. // "id": "compute.regionDisks.createSnapshot",
  96217. // "parameterOrder": [
  96218. // "project",
  96219. // "region",
  96220. // "disk"
  96221. // ],
  96222. // "parameters": {
  96223. // "disk": {
  96224. // "description": "Name of the regional persistent disk to snapshot.",
  96225. // "location": "path",
  96226. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96227. // "required": true,
  96228. // "type": "string"
  96229. // },
  96230. // "guestFlush": {
  96231. // "location": "query",
  96232. // "type": "boolean"
  96233. // },
  96234. // "project": {
  96235. // "description": "Project ID for this request.",
  96236. // "location": "path",
  96237. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96238. // "required": true,
  96239. // "type": "string"
  96240. // },
  96241. // "region": {
  96242. // "description": "Name of the region for this request.",
  96243. // "location": "path",
  96244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96245. // "required": true,
  96246. // "type": "string"
  96247. // },
  96248. // "requestId": {
  96249. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96250. // "location": "query",
  96251. // "type": "string"
  96252. // }
  96253. // },
  96254. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  96255. // "request": {
  96256. // "$ref": "Snapshot"
  96257. // },
  96258. // "response": {
  96259. // "$ref": "Operation"
  96260. // },
  96261. // "scopes": [
  96262. // "https://www.googleapis.com/auth/cloud-platform",
  96263. // "https://www.googleapis.com/auth/compute"
  96264. // ]
  96265. // }
  96266. }
  96267. // method id "compute.regionDisks.delete":
  96268. type RegionDisksDeleteCall struct {
  96269. s *Service
  96270. project string
  96271. region string
  96272. disk string
  96273. urlParams_ gensupport.URLParams
  96274. ctx_ context.Context
  96275. header_ http.Header
  96276. }
  96277. // Delete: Deletes the specified regional persistent disk. Deleting a
  96278. // regional disk removes all the replicas of its data permanently and is
  96279. // irreversible. However, deleting a disk does not delete any snapshots
  96280. // previously made from the disk. You must separately delete snapshots.
  96281. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  96282. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96283. c.project = project
  96284. c.region = region
  96285. c.disk = disk
  96286. return c
  96287. }
  96288. // RequestId sets the optional parameter "requestId": An optional
  96289. // request ID to identify requests. Specify a unique request ID so that
  96290. // if you must retry your request, the server will know to ignore the
  96291. // request if it has already been completed.
  96292. //
  96293. // For example, consider a situation where you make an initial request
  96294. // and the request times out. If you make the request again with the
  96295. // same request ID, the server can check if original operation with the
  96296. // same request ID was received, and if so, will ignore the second
  96297. // request. This prevents clients from accidentally creating duplicate
  96298. // commitments.
  96299. //
  96300. // The request ID must be a valid UUID with the exception that zero UUID
  96301. // is not supported (00000000-0000-0000-0000-000000000000).
  96302. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  96303. c.urlParams_.Set("requestId", requestId)
  96304. return c
  96305. }
  96306. // Fields allows partial responses to be retrieved. See
  96307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96308. // for more information.
  96309. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  96310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96311. return c
  96312. }
  96313. // Context sets the context to be used in this call's Do method. Any
  96314. // pending HTTP request will be aborted if the provided context is
  96315. // canceled.
  96316. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  96317. c.ctx_ = ctx
  96318. return c
  96319. }
  96320. // Header returns an http.Header that can be modified by the caller to
  96321. // add HTTP headers to the request.
  96322. func (c *RegionDisksDeleteCall) Header() http.Header {
  96323. if c.header_ == nil {
  96324. c.header_ = make(http.Header)
  96325. }
  96326. return c.header_
  96327. }
  96328. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  96329. reqHeaders := make(http.Header)
  96330. for k, v := range c.header_ {
  96331. reqHeaders[k] = v
  96332. }
  96333. reqHeaders.Set("User-Agent", c.s.userAgent())
  96334. var body io.Reader = nil
  96335. c.urlParams_.Set("alt", alt)
  96336. c.urlParams_.Set("prettyPrint", "false")
  96337. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  96338. urls += "?" + c.urlParams_.Encode()
  96339. req, err := http.NewRequest("DELETE", urls, body)
  96340. if err != nil {
  96341. return nil, err
  96342. }
  96343. req.Header = reqHeaders
  96344. googleapi.Expand(req.URL, map[string]string{
  96345. "project": c.project,
  96346. "region": c.region,
  96347. "disk": c.disk,
  96348. })
  96349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96350. }
  96351. // Do executes the "compute.regionDisks.delete" call.
  96352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96353. // status code is an error. Response headers are in either
  96354. // *Operation.ServerResponse.Header or (if a response was returned at
  96355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96356. // to check whether the returned error was because
  96357. // http.StatusNotModified was returned.
  96358. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96359. gensupport.SetOptions(c.urlParams_, opts...)
  96360. res, err := c.doRequest("json")
  96361. if res != nil && res.StatusCode == http.StatusNotModified {
  96362. if res.Body != nil {
  96363. res.Body.Close()
  96364. }
  96365. return nil, &googleapi.Error{
  96366. Code: res.StatusCode,
  96367. Header: res.Header,
  96368. }
  96369. }
  96370. if err != nil {
  96371. return nil, err
  96372. }
  96373. defer googleapi.CloseBody(res)
  96374. if err := googleapi.CheckResponse(res); err != nil {
  96375. return nil, err
  96376. }
  96377. ret := &Operation{
  96378. ServerResponse: googleapi.ServerResponse{
  96379. Header: res.Header,
  96380. HTTPStatusCode: res.StatusCode,
  96381. },
  96382. }
  96383. target := &ret
  96384. if err := gensupport.DecodeResponse(target, res); err != nil {
  96385. return nil, err
  96386. }
  96387. return ret, nil
  96388. // {
  96389. // "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.",
  96390. // "httpMethod": "DELETE",
  96391. // "id": "compute.regionDisks.delete",
  96392. // "parameterOrder": [
  96393. // "project",
  96394. // "region",
  96395. // "disk"
  96396. // ],
  96397. // "parameters": {
  96398. // "disk": {
  96399. // "description": "Name of the regional persistent disk to delete.",
  96400. // "location": "path",
  96401. // "required": true,
  96402. // "type": "string"
  96403. // },
  96404. // "project": {
  96405. // "description": "Project ID for this request.",
  96406. // "location": "path",
  96407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96408. // "required": true,
  96409. // "type": "string"
  96410. // },
  96411. // "region": {
  96412. // "description": "Name of the region for this request.",
  96413. // "location": "path",
  96414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96415. // "required": true,
  96416. // "type": "string"
  96417. // },
  96418. // "requestId": {
  96419. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96420. // "location": "query",
  96421. // "type": "string"
  96422. // }
  96423. // },
  96424. // "path": "{project}/regions/{region}/disks/{disk}",
  96425. // "response": {
  96426. // "$ref": "Operation"
  96427. // },
  96428. // "scopes": [
  96429. // "https://www.googleapis.com/auth/cloud-platform",
  96430. // "https://www.googleapis.com/auth/compute"
  96431. // ]
  96432. // }
  96433. }
  96434. // method id "compute.regionDisks.get":
  96435. type RegionDisksGetCall struct {
  96436. s *Service
  96437. project string
  96438. region string
  96439. disk string
  96440. urlParams_ gensupport.URLParams
  96441. ifNoneMatch_ string
  96442. ctx_ context.Context
  96443. header_ http.Header
  96444. }
  96445. // Get: Returns a specified regional persistent disk.
  96446. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  96447. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96448. c.project = project
  96449. c.region = region
  96450. c.disk = disk
  96451. return c
  96452. }
  96453. // Fields allows partial responses to be retrieved. See
  96454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96455. // for more information.
  96456. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  96457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96458. return c
  96459. }
  96460. // IfNoneMatch sets the optional parameter which makes the operation
  96461. // fail if the object's ETag matches the given value. This is useful for
  96462. // getting updates only after the object has changed since the last
  96463. // request. Use googleapi.IsNotModified to check whether the response
  96464. // error from Do is the result of In-None-Match.
  96465. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  96466. c.ifNoneMatch_ = entityTag
  96467. return c
  96468. }
  96469. // Context sets the context to be used in this call's Do method. Any
  96470. // pending HTTP request will be aborted if the provided context is
  96471. // canceled.
  96472. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  96473. c.ctx_ = ctx
  96474. return c
  96475. }
  96476. // Header returns an http.Header that can be modified by the caller to
  96477. // add HTTP headers to the request.
  96478. func (c *RegionDisksGetCall) Header() http.Header {
  96479. if c.header_ == nil {
  96480. c.header_ = make(http.Header)
  96481. }
  96482. return c.header_
  96483. }
  96484. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  96485. reqHeaders := make(http.Header)
  96486. for k, v := range c.header_ {
  96487. reqHeaders[k] = v
  96488. }
  96489. reqHeaders.Set("User-Agent", c.s.userAgent())
  96490. if c.ifNoneMatch_ != "" {
  96491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96492. }
  96493. var body io.Reader = nil
  96494. c.urlParams_.Set("alt", alt)
  96495. c.urlParams_.Set("prettyPrint", "false")
  96496. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  96497. urls += "?" + c.urlParams_.Encode()
  96498. req, err := http.NewRequest("GET", urls, body)
  96499. if err != nil {
  96500. return nil, err
  96501. }
  96502. req.Header = reqHeaders
  96503. googleapi.Expand(req.URL, map[string]string{
  96504. "project": c.project,
  96505. "region": c.region,
  96506. "disk": c.disk,
  96507. })
  96508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96509. }
  96510. // Do executes the "compute.regionDisks.get" call.
  96511. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  96512. // code is an error. Response headers are in either
  96513. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  96514. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  96515. // whether the returned error was because http.StatusNotModified was
  96516. // returned.
  96517. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  96518. gensupport.SetOptions(c.urlParams_, opts...)
  96519. res, err := c.doRequest("json")
  96520. if res != nil && res.StatusCode == http.StatusNotModified {
  96521. if res.Body != nil {
  96522. res.Body.Close()
  96523. }
  96524. return nil, &googleapi.Error{
  96525. Code: res.StatusCode,
  96526. Header: res.Header,
  96527. }
  96528. }
  96529. if err != nil {
  96530. return nil, err
  96531. }
  96532. defer googleapi.CloseBody(res)
  96533. if err := googleapi.CheckResponse(res); err != nil {
  96534. return nil, err
  96535. }
  96536. ret := &Disk{
  96537. ServerResponse: googleapi.ServerResponse{
  96538. Header: res.Header,
  96539. HTTPStatusCode: res.StatusCode,
  96540. },
  96541. }
  96542. target := &ret
  96543. if err := gensupport.DecodeResponse(target, res); err != nil {
  96544. return nil, err
  96545. }
  96546. return ret, nil
  96547. // {
  96548. // "description": "Returns a specified regional persistent disk.",
  96549. // "httpMethod": "GET",
  96550. // "id": "compute.regionDisks.get",
  96551. // "parameterOrder": [
  96552. // "project",
  96553. // "region",
  96554. // "disk"
  96555. // ],
  96556. // "parameters": {
  96557. // "disk": {
  96558. // "description": "Name of the regional persistent disk to return.",
  96559. // "location": "path",
  96560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96561. // "required": true,
  96562. // "type": "string"
  96563. // },
  96564. // "project": {
  96565. // "description": "Project ID for this request.",
  96566. // "location": "path",
  96567. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96568. // "required": true,
  96569. // "type": "string"
  96570. // },
  96571. // "region": {
  96572. // "description": "Name of the region for this request.",
  96573. // "location": "path",
  96574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96575. // "required": true,
  96576. // "type": "string"
  96577. // }
  96578. // },
  96579. // "path": "{project}/regions/{region}/disks/{disk}",
  96580. // "response": {
  96581. // "$ref": "Disk"
  96582. // },
  96583. // "scopes": [
  96584. // "https://www.googleapis.com/auth/cloud-platform",
  96585. // "https://www.googleapis.com/auth/compute",
  96586. // "https://www.googleapis.com/auth/compute.readonly"
  96587. // ]
  96588. // }
  96589. }
  96590. // method id "compute.regionDisks.insert":
  96591. type RegionDisksInsertCall struct {
  96592. s *Service
  96593. project string
  96594. region string
  96595. disk *Disk
  96596. urlParams_ gensupport.URLParams
  96597. ctx_ context.Context
  96598. header_ http.Header
  96599. }
  96600. // Insert: Creates a persistent regional disk in the specified project
  96601. // using the data included in the request.
  96602. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  96603. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96604. c.project = project
  96605. c.region = region
  96606. c.disk = disk
  96607. return c
  96608. }
  96609. // RequestId sets the optional parameter "requestId": An optional
  96610. // request ID to identify requests. Specify a unique request ID so that
  96611. // if you must retry your request, the server will know to ignore the
  96612. // request if it has already been completed.
  96613. //
  96614. // For example, consider a situation where you make an initial request
  96615. // and the request times out. If you make the request again with the
  96616. // same request ID, the server can check if original operation with the
  96617. // same request ID was received, and if so, will ignore the second
  96618. // request. This prevents clients from accidentally creating duplicate
  96619. // commitments.
  96620. //
  96621. // The request ID must be a valid UUID with the exception that zero UUID
  96622. // is not supported (00000000-0000-0000-0000-000000000000).
  96623. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  96624. c.urlParams_.Set("requestId", requestId)
  96625. return c
  96626. }
  96627. // SourceImage sets the optional parameter "sourceImage": Source image
  96628. // to restore onto a disk.
  96629. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  96630. c.urlParams_.Set("sourceImage", sourceImage)
  96631. return c
  96632. }
  96633. // Fields allows partial responses to be retrieved. See
  96634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96635. // for more information.
  96636. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  96637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96638. return c
  96639. }
  96640. // Context sets the context to be used in this call's Do method. Any
  96641. // pending HTTP request will be aborted if the provided context is
  96642. // canceled.
  96643. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  96644. c.ctx_ = ctx
  96645. return c
  96646. }
  96647. // Header returns an http.Header that can be modified by the caller to
  96648. // add HTTP headers to the request.
  96649. func (c *RegionDisksInsertCall) Header() http.Header {
  96650. if c.header_ == nil {
  96651. c.header_ = make(http.Header)
  96652. }
  96653. return c.header_
  96654. }
  96655. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  96656. reqHeaders := make(http.Header)
  96657. for k, v := range c.header_ {
  96658. reqHeaders[k] = v
  96659. }
  96660. reqHeaders.Set("User-Agent", c.s.userAgent())
  96661. var body io.Reader = nil
  96662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  96663. if err != nil {
  96664. return nil, err
  96665. }
  96666. reqHeaders.Set("Content-Type", "application/json")
  96667. c.urlParams_.Set("alt", alt)
  96668. c.urlParams_.Set("prettyPrint", "false")
  96669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  96670. urls += "?" + c.urlParams_.Encode()
  96671. req, err := http.NewRequest("POST", urls, body)
  96672. if err != nil {
  96673. return nil, err
  96674. }
  96675. req.Header = reqHeaders
  96676. googleapi.Expand(req.URL, map[string]string{
  96677. "project": c.project,
  96678. "region": c.region,
  96679. })
  96680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96681. }
  96682. // Do executes the "compute.regionDisks.insert" call.
  96683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96684. // status code is an error. Response headers are in either
  96685. // *Operation.ServerResponse.Header or (if a response was returned at
  96686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96687. // to check whether the returned error was because
  96688. // http.StatusNotModified was returned.
  96689. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96690. gensupport.SetOptions(c.urlParams_, opts...)
  96691. res, err := c.doRequest("json")
  96692. if res != nil && res.StatusCode == http.StatusNotModified {
  96693. if res.Body != nil {
  96694. res.Body.Close()
  96695. }
  96696. return nil, &googleapi.Error{
  96697. Code: res.StatusCode,
  96698. Header: res.Header,
  96699. }
  96700. }
  96701. if err != nil {
  96702. return nil, err
  96703. }
  96704. defer googleapi.CloseBody(res)
  96705. if err := googleapi.CheckResponse(res); err != nil {
  96706. return nil, err
  96707. }
  96708. ret := &Operation{
  96709. ServerResponse: googleapi.ServerResponse{
  96710. Header: res.Header,
  96711. HTTPStatusCode: res.StatusCode,
  96712. },
  96713. }
  96714. target := &ret
  96715. if err := gensupport.DecodeResponse(target, res); err != nil {
  96716. return nil, err
  96717. }
  96718. return ret, nil
  96719. // {
  96720. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  96721. // "httpMethod": "POST",
  96722. // "id": "compute.regionDisks.insert",
  96723. // "parameterOrder": [
  96724. // "project",
  96725. // "region"
  96726. // ],
  96727. // "parameters": {
  96728. // "project": {
  96729. // "description": "Project ID for this request.",
  96730. // "location": "path",
  96731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96732. // "required": true,
  96733. // "type": "string"
  96734. // },
  96735. // "region": {
  96736. // "description": "Name of the region for this request.",
  96737. // "location": "path",
  96738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96739. // "required": true,
  96740. // "type": "string"
  96741. // },
  96742. // "requestId": {
  96743. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96744. // "location": "query",
  96745. // "type": "string"
  96746. // },
  96747. // "sourceImage": {
  96748. // "description": "Optional. Source image to restore onto a disk.",
  96749. // "location": "query",
  96750. // "type": "string"
  96751. // }
  96752. // },
  96753. // "path": "{project}/regions/{region}/disks",
  96754. // "request": {
  96755. // "$ref": "Disk"
  96756. // },
  96757. // "response": {
  96758. // "$ref": "Operation"
  96759. // },
  96760. // "scopes": [
  96761. // "https://www.googleapis.com/auth/cloud-platform",
  96762. // "https://www.googleapis.com/auth/compute"
  96763. // ]
  96764. // }
  96765. }
  96766. // method id "compute.regionDisks.list":
  96767. type RegionDisksListCall struct {
  96768. s *Service
  96769. project string
  96770. region string
  96771. urlParams_ gensupport.URLParams
  96772. ifNoneMatch_ string
  96773. ctx_ context.Context
  96774. header_ http.Header
  96775. }
  96776. // List: Retrieves the list of persistent disks contained within the
  96777. // specified region.
  96778. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  96779. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96780. c.project = project
  96781. c.region = region
  96782. return c
  96783. }
  96784. // Filter sets the optional parameter "filter": A filter expression that
  96785. // filters resources listed in the response. The expression must specify
  96786. // the field name, a comparison operator, and the value that you want to
  96787. // use for filtering. The value must be a string, a number, or a
  96788. // boolean. The comparison operator must be either =, !=, >, or <.
  96789. //
  96790. // For example, if you are filtering Compute Engine instances, you can
  96791. // exclude instances named example-instance by specifying name !=
  96792. // example-instance.
  96793. //
  96794. // You can also filter nested fields. For example, you could specify
  96795. // scheduling.automaticRestart = false to include instances only if they
  96796. // are not scheduled for automatic restarts. You can use filtering on
  96797. // nested fields to filter based on resource labels.
  96798. //
  96799. // To filter on multiple expressions, provide each separate expression
  96800. // within parentheses. For example, (scheduling.automaticRestart = true)
  96801. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96802. // AND expression. However, you can include AND and OR expressions
  96803. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96804. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96805. // true).
  96806. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  96807. c.urlParams_.Set("filter", filter)
  96808. return c
  96809. }
  96810. // MaxResults sets the optional parameter "maxResults": The maximum
  96811. // number of results per page that should be returned. If the number of
  96812. // available results is larger than maxResults, Compute Engine returns a
  96813. // nextPageToken that can be used to get the next page of results in
  96814. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96815. // (Default: 500)
  96816. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  96817. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96818. return c
  96819. }
  96820. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96821. // a certain order. By default, results are returned in alphanumerical
  96822. // order based on the resource name.
  96823. //
  96824. // You can also sort results in descending order based on the creation
  96825. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96826. // based on the creationTimestamp field in reverse chronological order
  96827. // (newest result first). Use this to sort resources like operations so
  96828. // that the newest operation is returned first.
  96829. //
  96830. // Currently, only sorting by name or creationTimestamp desc is
  96831. // supported.
  96832. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  96833. c.urlParams_.Set("orderBy", orderBy)
  96834. return c
  96835. }
  96836. // PageToken sets the optional parameter "pageToken": Specifies a page
  96837. // token to use. Set pageToken to the nextPageToken returned by a
  96838. // previous list request to get the next page of results.
  96839. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  96840. c.urlParams_.Set("pageToken", pageToken)
  96841. return c
  96842. }
  96843. // Fields allows partial responses to be retrieved. See
  96844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96845. // for more information.
  96846. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  96847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96848. return c
  96849. }
  96850. // IfNoneMatch sets the optional parameter which makes the operation
  96851. // fail if the object's ETag matches the given value. This is useful for
  96852. // getting updates only after the object has changed since the last
  96853. // request. Use googleapi.IsNotModified to check whether the response
  96854. // error from Do is the result of In-None-Match.
  96855. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  96856. c.ifNoneMatch_ = entityTag
  96857. return c
  96858. }
  96859. // Context sets the context to be used in this call's Do method. Any
  96860. // pending HTTP request will be aborted if the provided context is
  96861. // canceled.
  96862. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  96863. c.ctx_ = ctx
  96864. return c
  96865. }
  96866. // Header returns an http.Header that can be modified by the caller to
  96867. // add HTTP headers to the request.
  96868. func (c *RegionDisksListCall) Header() http.Header {
  96869. if c.header_ == nil {
  96870. c.header_ = make(http.Header)
  96871. }
  96872. return c.header_
  96873. }
  96874. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  96875. reqHeaders := make(http.Header)
  96876. for k, v := range c.header_ {
  96877. reqHeaders[k] = v
  96878. }
  96879. reqHeaders.Set("User-Agent", c.s.userAgent())
  96880. if c.ifNoneMatch_ != "" {
  96881. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96882. }
  96883. var body io.Reader = nil
  96884. c.urlParams_.Set("alt", alt)
  96885. c.urlParams_.Set("prettyPrint", "false")
  96886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  96887. urls += "?" + c.urlParams_.Encode()
  96888. req, err := http.NewRequest("GET", urls, body)
  96889. if err != nil {
  96890. return nil, err
  96891. }
  96892. req.Header = reqHeaders
  96893. googleapi.Expand(req.URL, map[string]string{
  96894. "project": c.project,
  96895. "region": c.region,
  96896. })
  96897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96898. }
  96899. // Do executes the "compute.regionDisks.list" call.
  96900. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  96901. // code is an error. Response headers are in either
  96902. // *DiskList.ServerResponse.Header or (if a response was returned at
  96903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96904. // to check whether the returned error was because
  96905. // http.StatusNotModified was returned.
  96906. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  96907. gensupport.SetOptions(c.urlParams_, opts...)
  96908. res, err := c.doRequest("json")
  96909. if res != nil && res.StatusCode == http.StatusNotModified {
  96910. if res.Body != nil {
  96911. res.Body.Close()
  96912. }
  96913. return nil, &googleapi.Error{
  96914. Code: res.StatusCode,
  96915. Header: res.Header,
  96916. }
  96917. }
  96918. if err != nil {
  96919. return nil, err
  96920. }
  96921. defer googleapi.CloseBody(res)
  96922. if err := googleapi.CheckResponse(res); err != nil {
  96923. return nil, err
  96924. }
  96925. ret := &DiskList{
  96926. ServerResponse: googleapi.ServerResponse{
  96927. Header: res.Header,
  96928. HTTPStatusCode: res.StatusCode,
  96929. },
  96930. }
  96931. target := &ret
  96932. if err := gensupport.DecodeResponse(target, res); err != nil {
  96933. return nil, err
  96934. }
  96935. return ret, nil
  96936. // {
  96937. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  96938. // "httpMethod": "GET",
  96939. // "id": "compute.regionDisks.list",
  96940. // "parameterOrder": [
  96941. // "project",
  96942. // "region"
  96943. // ],
  96944. // "parameters": {
  96945. // "filter": {
  96946. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96947. // "location": "query",
  96948. // "type": "string"
  96949. // },
  96950. // "maxResults": {
  96951. // "default": "500",
  96952. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96953. // "format": "uint32",
  96954. // "location": "query",
  96955. // "minimum": "0",
  96956. // "type": "integer"
  96957. // },
  96958. // "orderBy": {
  96959. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96960. // "location": "query",
  96961. // "type": "string"
  96962. // },
  96963. // "pageToken": {
  96964. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96965. // "location": "query",
  96966. // "type": "string"
  96967. // },
  96968. // "project": {
  96969. // "description": "Project ID for this request.",
  96970. // "location": "path",
  96971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96972. // "required": true,
  96973. // "type": "string"
  96974. // },
  96975. // "region": {
  96976. // "description": "Name of the region for this request.",
  96977. // "location": "path",
  96978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96979. // "required": true,
  96980. // "type": "string"
  96981. // }
  96982. // },
  96983. // "path": "{project}/regions/{region}/disks",
  96984. // "response": {
  96985. // "$ref": "DiskList"
  96986. // },
  96987. // "scopes": [
  96988. // "https://www.googleapis.com/auth/cloud-platform",
  96989. // "https://www.googleapis.com/auth/compute",
  96990. // "https://www.googleapis.com/auth/compute.readonly"
  96991. // ]
  96992. // }
  96993. }
  96994. // Pages invokes f for each page of results.
  96995. // A non-nil error returned from f will halt the iteration.
  96996. // The provided context supersedes any context provided to the Context method.
  96997. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  96998. c.ctx_ = ctx
  96999. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97000. for {
  97001. x, err := c.Do()
  97002. if err != nil {
  97003. return err
  97004. }
  97005. if err := f(x); err != nil {
  97006. return err
  97007. }
  97008. if x.NextPageToken == "" {
  97009. return nil
  97010. }
  97011. c.PageToken(x.NextPageToken)
  97012. }
  97013. }
  97014. // method id "compute.regionDisks.removeResourcePolicies":
  97015. type RegionDisksRemoveResourcePoliciesCall struct {
  97016. s *Service
  97017. project string
  97018. region string
  97019. disk string
  97020. regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
  97021. urlParams_ gensupport.URLParams
  97022. ctx_ context.Context
  97023. header_ http.Header
  97024. }
  97025. // RemoveResourcePolicies: Removes resource policies from a regional
  97026. // disk.
  97027. func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
  97028. c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97029. c.project = project
  97030. c.region = region
  97031. c.disk = disk
  97032. c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
  97033. return c
  97034. }
  97035. // RequestId sets the optional parameter "requestId": An optional
  97036. // request ID to identify requests. Specify a unique request ID so that
  97037. // if you must retry your request, the server will know to ignore the
  97038. // request if it has already been completed.
  97039. //
  97040. // For example, consider a situation where you make an initial request
  97041. // and the request times out. If you make the request again with the
  97042. // same request ID, the server can check if original operation with the
  97043. // same request ID was received, and if so, will ignore the second
  97044. // request. This prevents clients from accidentally creating duplicate
  97045. // commitments.
  97046. //
  97047. // The request ID must be a valid UUID with the exception that zero UUID
  97048. // is not supported (00000000-0000-0000-0000-000000000000).
  97049. func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
  97050. c.urlParams_.Set("requestId", requestId)
  97051. return c
  97052. }
  97053. // Fields allows partial responses to be retrieved. See
  97054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97055. // for more information.
  97056. func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
  97057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97058. return c
  97059. }
  97060. // Context sets the context to be used in this call's Do method. Any
  97061. // pending HTTP request will be aborted if the provided context is
  97062. // canceled.
  97063. func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
  97064. c.ctx_ = ctx
  97065. return c
  97066. }
  97067. // Header returns an http.Header that can be modified by the caller to
  97068. // add HTTP headers to the request.
  97069. func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
  97070. if c.header_ == nil {
  97071. c.header_ = make(http.Header)
  97072. }
  97073. return c.header_
  97074. }
  97075. func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  97076. reqHeaders := make(http.Header)
  97077. for k, v := range c.header_ {
  97078. reqHeaders[k] = v
  97079. }
  97080. reqHeaders.Set("User-Agent", c.s.userAgent())
  97081. var body io.Reader = nil
  97082. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
  97083. if err != nil {
  97084. return nil, err
  97085. }
  97086. reqHeaders.Set("Content-Type", "application/json")
  97087. c.urlParams_.Set("alt", alt)
  97088. c.urlParams_.Set("prettyPrint", "false")
  97089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
  97090. urls += "?" + c.urlParams_.Encode()
  97091. req, err := http.NewRequest("POST", urls, body)
  97092. if err != nil {
  97093. return nil, err
  97094. }
  97095. req.Header = reqHeaders
  97096. googleapi.Expand(req.URL, map[string]string{
  97097. "project": c.project,
  97098. "region": c.region,
  97099. "disk": c.disk,
  97100. })
  97101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97102. }
  97103. // Do executes the "compute.regionDisks.removeResourcePolicies" call.
  97104. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97105. // status code is an error. Response headers are in either
  97106. // *Operation.ServerResponse.Header or (if a response was returned at
  97107. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97108. // to check whether the returned error was because
  97109. // http.StatusNotModified was returned.
  97110. func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97111. gensupport.SetOptions(c.urlParams_, opts...)
  97112. res, err := c.doRequest("json")
  97113. if res != nil && res.StatusCode == http.StatusNotModified {
  97114. if res.Body != nil {
  97115. res.Body.Close()
  97116. }
  97117. return nil, &googleapi.Error{
  97118. Code: res.StatusCode,
  97119. Header: res.Header,
  97120. }
  97121. }
  97122. if err != nil {
  97123. return nil, err
  97124. }
  97125. defer googleapi.CloseBody(res)
  97126. if err := googleapi.CheckResponse(res); err != nil {
  97127. return nil, err
  97128. }
  97129. ret := &Operation{
  97130. ServerResponse: googleapi.ServerResponse{
  97131. Header: res.Header,
  97132. HTTPStatusCode: res.StatusCode,
  97133. },
  97134. }
  97135. target := &ret
  97136. if err := gensupport.DecodeResponse(target, res); err != nil {
  97137. return nil, err
  97138. }
  97139. return ret, nil
  97140. // {
  97141. // "description": "Removes resource policies from a regional disk.",
  97142. // "httpMethod": "POST",
  97143. // "id": "compute.regionDisks.removeResourcePolicies",
  97144. // "parameterOrder": [
  97145. // "project",
  97146. // "region",
  97147. // "disk"
  97148. // ],
  97149. // "parameters": {
  97150. // "disk": {
  97151. // "description": "The disk name for this request.",
  97152. // "location": "path",
  97153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97154. // "required": true,
  97155. // "type": "string"
  97156. // },
  97157. // "project": {
  97158. // "description": "Project ID for this request.",
  97159. // "location": "path",
  97160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97161. // "required": true,
  97162. // "type": "string"
  97163. // },
  97164. // "region": {
  97165. // "description": "The name of the region for this request.",
  97166. // "location": "path",
  97167. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97168. // "required": true,
  97169. // "type": "string"
  97170. // },
  97171. // "requestId": {
  97172. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97173. // "location": "query",
  97174. // "type": "string"
  97175. // }
  97176. // },
  97177. // "path": "{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
  97178. // "request": {
  97179. // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
  97180. // },
  97181. // "response": {
  97182. // "$ref": "Operation"
  97183. // },
  97184. // "scopes": [
  97185. // "https://www.googleapis.com/auth/cloud-platform",
  97186. // "https://www.googleapis.com/auth/compute"
  97187. // ]
  97188. // }
  97189. }
  97190. // method id "compute.regionDisks.resize":
  97191. type RegionDisksResizeCall struct {
  97192. s *Service
  97193. project string
  97194. region string
  97195. disk string
  97196. regiondisksresizerequest *RegionDisksResizeRequest
  97197. urlParams_ gensupport.URLParams
  97198. ctx_ context.Context
  97199. header_ http.Header
  97200. }
  97201. // Resize: Resizes the specified regional persistent disk.
  97202. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  97203. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97204. c.project = project
  97205. c.region = region
  97206. c.disk = disk
  97207. c.regiondisksresizerequest = regiondisksresizerequest
  97208. return c
  97209. }
  97210. // RequestId sets the optional parameter "requestId": An optional
  97211. // request ID to identify requests. Specify a unique request ID so that
  97212. // if you must retry your request, the server will know to ignore the
  97213. // request if it has already been completed.
  97214. //
  97215. // For example, consider a situation where you make an initial request
  97216. // and the request times out. If you make the request again with the
  97217. // same request ID, the server can check if original operation with the
  97218. // same request ID was received, and if so, will ignore the second
  97219. // request. This prevents clients from accidentally creating duplicate
  97220. // commitments.
  97221. //
  97222. // The request ID must be a valid UUID with the exception that zero UUID
  97223. // is not supported (00000000-0000-0000-0000-000000000000).
  97224. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  97225. c.urlParams_.Set("requestId", requestId)
  97226. return c
  97227. }
  97228. // Fields allows partial responses to be retrieved. See
  97229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97230. // for more information.
  97231. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  97232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97233. return c
  97234. }
  97235. // Context sets the context to be used in this call's Do method. Any
  97236. // pending HTTP request will be aborted if the provided context is
  97237. // canceled.
  97238. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  97239. c.ctx_ = ctx
  97240. return c
  97241. }
  97242. // Header returns an http.Header that can be modified by the caller to
  97243. // add HTTP headers to the request.
  97244. func (c *RegionDisksResizeCall) Header() http.Header {
  97245. if c.header_ == nil {
  97246. c.header_ = make(http.Header)
  97247. }
  97248. return c.header_
  97249. }
  97250. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  97251. reqHeaders := make(http.Header)
  97252. for k, v := range c.header_ {
  97253. reqHeaders[k] = v
  97254. }
  97255. reqHeaders.Set("User-Agent", c.s.userAgent())
  97256. var body io.Reader = nil
  97257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  97258. if err != nil {
  97259. return nil, err
  97260. }
  97261. reqHeaders.Set("Content-Type", "application/json")
  97262. c.urlParams_.Set("alt", alt)
  97263. c.urlParams_.Set("prettyPrint", "false")
  97264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  97265. urls += "?" + c.urlParams_.Encode()
  97266. req, err := http.NewRequest("POST", urls, body)
  97267. if err != nil {
  97268. return nil, err
  97269. }
  97270. req.Header = reqHeaders
  97271. googleapi.Expand(req.URL, map[string]string{
  97272. "project": c.project,
  97273. "region": c.region,
  97274. "disk": c.disk,
  97275. })
  97276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97277. }
  97278. // Do executes the "compute.regionDisks.resize" call.
  97279. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97280. // status code is an error. Response headers are in either
  97281. // *Operation.ServerResponse.Header or (if a response was returned at
  97282. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97283. // to check whether the returned error was because
  97284. // http.StatusNotModified was returned.
  97285. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97286. gensupport.SetOptions(c.urlParams_, opts...)
  97287. res, err := c.doRequest("json")
  97288. if res != nil && res.StatusCode == http.StatusNotModified {
  97289. if res.Body != nil {
  97290. res.Body.Close()
  97291. }
  97292. return nil, &googleapi.Error{
  97293. Code: res.StatusCode,
  97294. Header: res.Header,
  97295. }
  97296. }
  97297. if err != nil {
  97298. return nil, err
  97299. }
  97300. defer googleapi.CloseBody(res)
  97301. if err := googleapi.CheckResponse(res); err != nil {
  97302. return nil, err
  97303. }
  97304. ret := &Operation{
  97305. ServerResponse: googleapi.ServerResponse{
  97306. Header: res.Header,
  97307. HTTPStatusCode: res.StatusCode,
  97308. },
  97309. }
  97310. target := &ret
  97311. if err := gensupport.DecodeResponse(target, res); err != nil {
  97312. return nil, err
  97313. }
  97314. return ret, nil
  97315. // {
  97316. // "description": "Resizes the specified regional persistent disk.",
  97317. // "httpMethod": "POST",
  97318. // "id": "compute.regionDisks.resize",
  97319. // "parameterOrder": [
  97320. // "project",
  97321. // "region",
  97322. // "disk"
  97323. // ],
  97324. // "parameters": {
  97325. // "disk": {
  97326. // "description": "Name of the regional persistent disk.",
  97327. // "location": "path",
  97328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97329. // "required": true,
  97330. // "type": "string"
  97331. // },
  97332. // "project": {
  97333. // "description": "The project ID for this request.",
  97334. // "location": "path",
  97335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97336. // "required": true,
  97337. // "type": "string"
  97338. // },
  97339. // "region": {
  97340. // "description": "Name of the region for this request.",
  97341. // "location": "path",
  97342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97343. // "required": true,
  97344. // "type": "string"
  97345. // },
  97346. // "requestId": {
  97347. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97348. // "location": "query",
  97349. // "type": "string"
  97350. // }
  97351. // },
  97352. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  97353. // "request": {
  97354. // "$ref": "RegionDisksResizeRequest"
  97355. // },
  97356. // "response": {
  97357. // "$ref": "Operation"
  97358. // },
  97359. // "scopes": [
  97360. // "https://www.googleapis.com/auth/cloud-platform",
  97361. // "https://www.googleapis.com/auth/compute"
  97362. // ]
  97363. // }
  97364. }
  97365. // method id "compute.regionDisks.setLabels":
  97366. type RegionDisksSetLabelsCall struct {
  97367. s *Service
  97368. project string
  97369. region string
  97370. resource string
  97371. regionsetlabelsrequest *RegionSetLabelsRequest
  97372. urlParams_ gensupport.URLParams
  97373. ctx_ context.Context
  97374. header_ http.Header
  97375. }
  97376. // SetLabels: Sets the labels on the target regional disk.
  97377. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  97378. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97379. c.project = project
  97380. c.region = region
  97381. c.resource = resource
  97382. c.regionsetlabelsrequest = regionsetlabelsrequest
  97383. return c
  97384. }
  97385. // RequestId sets the optional parameter "requestId": An optional
  97386. // request ID to identify requests. Specify a unique request ID so that
  97387. // if you must retry your request, the server will know to ignore the
  97388. // request if it has already been completed.
  97389. //
  97390. // For example, consider a situation where you make an initial request
  97391. // and the request times out. If you make the request again with the
  97392. // same request ID, the server can check if original operation with the
  97393. // same request ID was received, and if so, will ignore the second
  97394. // request. This prevents clients from accidentally creating duplicate
  97395. // commitments.
  97396. //
  97397. // The request ID must be a valid UUID with the exception that zero UUID
  97398. // is not supported (00000000-0000-0000-0000-000000000000).
  97399. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  97400. c.urlParams_.Set("requestId", requestId)
  97401. return c
  97402. }
  97403. // Fields allows partial responses to be retrieved. See
  97404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97405. // for more information.
  97406. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  97407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97408. return c
  97409. }
  97410. // Context sets the context to be used in this call's Do method. Any
  97411. // pending HTTP request will be aborted if the provided context is
  97412. // canceled.
  97413. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  97414. c.ctx_ = ctx
  97415. return c
  97416. }
  97417. // Header returns an http.Header that can be modified by the caller to
  97418. // add HTTP headers to the request.
  97419. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  97420. if c.header_ == nil {
  97421. c.header_ = make(http.Header)
  97422. }
  97423. return c.header_
  97424. }
  97425. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  97426. reqHeaders := make(http.Header)
  97427. for k, v := range c.header_ {
  97428. reqHeaders[k] = v
  97429. }
  97430. reqHeaders.Set("User-Agent", c.s.userAgent())
  97431. var body io.Reader = nil
  97432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  97433. if err != nil {
  97434. return nil, err
  97435. }
  97436. reqHeaders.Set("Content-Type", "application/json")
  97437. c.urlParams_.Set("alt", alt)
  97438. c.urlParams_.Set("prettyPrint", "false")
  97439. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  97440. urls += "?" + c.urlParams_.Encode()
  97441. req, err := http.NewRequest("POST", urls, body)
  97442. if err != nil {
  97443. return nil, err
  97444. }
  97445. req.Header = reqHeaders
  97446. googleapi.Expand(req.URL, map[string]string{
  97447. "project": c.project,
  97448. "region": c.region,
  97449. "resource": c.resource,
  97450. })
  97451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97452. }
  97453. // Do executes the "compute.regionDisks.setLabels" call.
  97454. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97455. // status code is an error. Response headers are in either
  97456. // *Operation.ServerResponse.Header or (if a response was returned at
  97457. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97458. // to check whether the returned error was because
  97459. // http.StatusNotModified was returned.
  97460. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97461. gensupport.SetOptions(c.urlParams_, opts...)
  97462. res, err := c.doRequest("json")
  97463. if res != nil && res.StatusCode == http.StatusNotModified {
  97464. if res.Body != nil {
  97465. res.Body.Close()
  97466. }
  97467. return nil, &googleapi.Error{
  97468. Code: res.StatusCode,
  97469. Header: res.Header,
  97470. }
  97471. }
  97472. if err != nil {
  97473. return nil, err
  97474. }
  97475. defer googleapi.CloseBody(res)
  97476. if err := googleapi.CheckResponse(res); err != nil {
  97477. return nil, err
  97478. }
  97479. ret := &Operation{
  97480. ServerResponse: googleapi.ServerResponse{
  97481. Header: res.Header,
  97482. HTTPStatusCode: res.StatusCode,
  97483. },
  97484. }
  97485. target := &ret
  97486. if err := gensupport.DecodeResponse(target, res); err != nil {
  97487. return nil, err
  97488. }
  97489. return ret, nil
  97490. // {
  97491. // "description": "Sets the labels on the target regional disk.",
  97492. // "httpMethod": "POST",
  97493. // "id": "compute.regionDisks.setLabels",
  97494. // "parameterOrder": [
  97495. // "project",
  97496. // "region",
  97497. // "resource"
  97498. // ],
  97499. // "parameters": {
  97500. // "project": {
  97501. // "description": "Project ID for this request.",
  97502. // "location": "path",
  97503. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97504. // "required": true,
  97505. // "type": "string"
  97506. // },
  97507. // "region": {
  97508. // "description": "The region for this request.",
  97509. // "location": "path",
  97510. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97511. // "required": true,
  97512. // "type": "string"
  97513. // },
  97514. // "requestId": {
  97515. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97516. // "location": "query",
  97517. // "type": "string"
  97518. // },
  97519. // "resource": {
  97520. // "description": "Name or id of the resource for this request.",
  97521. // "location": "path",
  97522. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97523. // "required": true,
  97524. // "type": "string"
  97525. // }
  97526. // },
  97527. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  97528. // "request": {
  97529. // "$ref": "RegionSetLabelsRequest"
  97530. // },
  97531. // "response": {
  97532. // "$ref": "Operation"
  97533. // },
  97534. // "scopes": [
  97535. // "https://www.googleapis.com/auth/cloud-platform",
  97536. // "https://www.googleapis.com/auth/compute"
  97537. // ]
  97538. // }
  97539. }
  97540. // method id "compute.regionDisks.testIamPermissions":
  97541. type RegionDisksTestIamPermissionsCall struct {
  97542. s *Service
  97543. project string
  97544. region string
  97545. resource string
  97546. testpermissionsrequest *TestPermissionsRequest
  97547. urlParams_ gensupport.URLParams
  97548. ctx_ context.Context
  97549. header_ http.Header
  97550. }
  97551. // TestIamPermissions: Returns permissions that a caller has on the
  97552. // specified resource.
  97553. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  97554. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97555. c.project = project
  97556. c.region = region
  97557. c.resource = resource
  97558. c.testpermissionsrequest = testpermissionsrequest
  97559. return c
  97560. }
  97561. // Fields allows partial responses to be retrieved. See
  97562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97563. // for more information.
  97564. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  97565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97566. return c
  97567. }
  97568. // Context sets the context to be used in this call's Do method. Any
  97569. // pending HTTP request will be aborted if the provided context is
  97570. // canceled.
  97571. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  97572. c.ctx_ = ctx
  97573. return c
  97574. }
  97575. // Header returns an http.Header that can be modified by the caller to
  97576. // add HTTP headers to the request.
  97577. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  97578. if c.header_ == nil {
  97579. c.header_ = make(http.Header)
  97580. }
  97581. return c.header_
  97582. }
  97583. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  97584. reqHeaders := make(http.Header)
  97585. for k, v := range c.header_ {
  97586. reqHeaders[k] = v
  97587. }
  97588. reqHeaders.Set("User-Agent", c.s.userAgent())
  97589. var body io.Reader = nil
  97590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  97591. if err != nil {
  97592. return nil, err
  97593. }
  97594. reqHeaders.Set("Content-Type", "application/json")
  97595. c.urlParams_.Set("alt", alt)
  97596. c.urlParams_.Set("prettyPrint", "false")
  97597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  97598. urls += "?" + c.urlParams_.Encode()
  97599. req, err := http.NewRequest("POST", urls, body)
  97600. if err != nil {
  97601. return nil, err
  97602. }
  97603. req.Header = reqHeaders
  97604. googleapi.Expand(req.URL, map[string]string{
  97605. "project": c.project,
  97606. "region": c.region,
  97607. "resource": c.resource,
  97608. })
  97609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97610. }
  97611. // Do executes the "compute.regionDisks.testIamPermissions" call.
  97612. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  97613. // non-2xx status code is an error. Response headers are in either
  97614. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  97615. // returned at all) in error.(*googleapi.Error).Header. Use
  97616. // googleapi.IsNotModified to check whether the returned error was
  97617. // because http.StatusNotModified was returned.
  97618. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  97619. gensupport.SetOptions(c.urlParams_, opts...)
  97620. res, err := c.doRequest("json")
  97621. if res != nil && res.StatusCode == http.StatusNotModified {
  97622. if res.Body != nil {
  97623. res.Body.Close()
  97624. }
  97625. return nil, &googleapi.Error{
  97626. Code: res.StatusCode,
  97627. Header: res.Header,
  97628. }
  97629. }
  97630. if err != nil {
  97631. return nil, err
  97632. }
  97633. defer googleapi.CloseBody(res)
  97634. if err := googleapi.CheckResponse(res); err != nil {
  97635. return nil, err
  97636. }
  97637. ret := &TestPermissionsResponse{
  97638. ServerResponse: googleapi.ServerResponse{
  97639. Header: res.Header,
  97640. HTTPStatusCode: res.StatusCode,
  97641. },
  97642. }
  97643. target := &ret
  97644. if err := gensupport.DecodeResponse(target, res); err != nil {
  97645. return nil, err
  97646. }
  97647. return ret, nil
  97648. // {
  97649. // "description": "Returns permissions that a caller has on the specified resource.",
  97650. // "httpMethod": "POST",
  97651. // "id": "compute.regionDisks.testIamPermissions",
  97652. // "parameterOrder": [
  97653. // "project",
  97654. // "region",
  97655. // "resource"
  97656. // ],
  97657. // "parameters": {
  97658. // "project": {
  97659. // "description": "Project ID for this request.",
  97660. // "location": "path",
  97661. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97662. // "required": true,
  97663. // "type": "string"
  97664. // },
  97665. // "region": {
  97666. // "description": "The name of the region for this request.",
  97667. // "location": "path",
  97668. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97669. // "required": true,
  97670. // "type": "string"
  97671. // },
  97672. // "resource": {
  97673. // "description": "Name or id of the resource for this request.",
  97674. // "location": "path",
  97675. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97676. // "required": true,
  97677. // "type": "string"
  97678. // }
  97679. // },
  97680. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  97681. // "request": {
  97682. // "$ref": "TestPermissionsRequest"
  97683. // },
  97684. // "response": {
  97685. // "$ref": "TestPermissionsResponse"
  97686. // },
  97687. // "scopes": [
  97688. // "https://www.googleapis.com/auth/cloud-platform",
  97689. // "https://www.googleapis.com/auth/compute",
  97690. // "https://www.googleapis.com/auth/compute.readonly"
  97691. // ]
  97692. // }
  97693. }
  97694. // method id "compute.regionHealthChecks.delete":
  97695. type RegionHealthChecksDeleteCall struct {
  97696. s *Service
  97697. project string
  97698. region string
  97699. healthCheck string
  97700. urlParams_ gensupport.URLParams
  97701. ctx_ context.Context
  97702. header_ http.Header
  97703. }
  97704. // Delete: Deletes the specified HealthCheck resource.
  97705. func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall {
  97706. c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97707. c.project = project
  97708. c.region = region
  97709. c.healthCheck = healthCheck
  97710. return c
  97711. }
  97712. // RequestId sets the optional parameter "requestId": An optional
  97713. // request ID to identify requests. Specify a unique request ID so that
  97714. // if you must retry your request, the server will know to ignore the
  97715. // request if it has already been completed.
  97716. //
  97717. // For example, consider a situation where you make an initial request
  97718. // and the request times out. If you make the request again with the
  97719. // same request ID, the server can check if original operation with the
  97720. // same request ID was received, and if so, will ignore the second
  97721. // request. This prevents clients from accidentally creating duplicate
  97722. // commitments.
  97723. //
  97724. // The request ID must be a valid UUID with the exception that zero UUID
  97725. // is not supported (00000000-0000-0000-0000-000000000000).
  97726. func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall {
  97727. c.urlParams_.Set("requestId", requestId)
  97728. return c
  97729. }
  97730. // Fields allows partial responses to be retrieved. See
  97731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97732. // for more information.
  97733. func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall {
  97734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97735. return c
  97736. }
  97737. // Context sets the context to be used in this call's Do method. Any
  97738. // pending HTTP request will be aborted if the provided context is
  97739. // canceled.
  97740. func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall {
  97741. c.ctx_ = ctx
  97742. return c
  97743. }
  97744. // Header returns an http.Header that can be modified by the caller to
  97745. // add HTTP headers to the request.
  97746. func (c *RegionHealthChecksDeleteCall) Header() http.Header {
  97747. if c.header_ == nil {
  97748. c.header_ = make(http.Header)
  97749. }
  97750. return c.header_
  97751. }
  97752. func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  97753. reqHeaders := make(http.Header)
  97754. for k, v := range c.header_ {
  97755. reqHeaders[k] = v
  97756. }
  97757. reqHeaders.Set("User-Agent", c.s.userAgent())
  97758. var body io.Reader = nil
  97759. c.urlParams_.Set("alt", alt)
  97760. c.urlParams_.Set("prettyPrint", "false")
  97761. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  97762. urls += "?" + c.urlParams_.Encode()
  97763. req, err := http.NewRequest("DELETE", urls, body)
  97764. if err != nil {
  97765. return nil, err
  97766. }
  97767. req.Header = reqHeaders
  97768. googleapi.Expand(req.URL, map[string]string{
  97769. "project": c.project,
  97770. "region": c.region,
  97771. "healthCheck": c.healthCheck,
  97772. })
  97773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97774. }
  97775. // Do executes the "compute.regionHealthChecks.delete" call.
  97776. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97777. // status code is an error. Response headers are in either
  97778. // *Operation.ServerResponse.Header or (if a response was returned at
  97779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97780. // to check whether the returned error was because
  97781. // http.StatusNotModified was returned.
  97782. func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97783. gensupport.SetOptions(c.urlParams_, opts...)
  97784. res, err := c.doRequest("json")
  97785. if res != nil && res.StatusCode == http.StatusNotModified {
  97786. if res.Body != nil {
  97787. res.Body.Close()
  97788. }
  97789. return nil, &googleapi.Error{
  97790. Code: res.StatusCode,
  97791. Header: res.Header,
  97792. }
  97793. }
  97794. if err != nil {
  97795. return nil, err
  97796. }
  97797. defer googleapi.CloseBody(res)
  97798. if err := googleapi.CheckResponse(res); err != nil {
  97799. return nil, err
  97800. }
  97801. ret := &Operation{
  97802. ServerResponse: googleapi.ServerResponse{
  97803. Header: res.Header,
  97804. HTTPStatusCode: res.StatusCode,
  97805. },
  97806. }
  97807. target := &ret
  97808. if err := gensupport.DecodeResponse(target, res); err != nil {
  97809. return nil, err
  97810. }
  97811. return ret, nil
  97812. // {
  97813. // "description": "Deletes the specified HealthCheck resource.",
  97814. // "httpMethod": "DELETE",
  97815. // "id": "compute.regionHealthChecks.delete",
  97816. // "parameterOrder": [
  97817. // "project",
  97818. // "region",
  97819. // "healthCheck"
  97820. // ],
  97821. // "parameters": {
  97822. // "healthCheck": {
  97823. // "description": "Name of the HealthCheck resource to delete.",
  97824. // "location": "path",
  97825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97826. // "required": true,
  97827. // "type": "string"
  97828. // },
  97829. // "project": {
  97830. // "description": "Project ID for this request.",
  97831. // "location": "path",
  97832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97833. // "required": true,
  97834. // "type": "string"
  97835. // },
  97836. // "region": {
  97837. // "description": "Name of the region scoping this request.",
  97838. // "location": "path",
  97839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97840. // "required": true,
  97841. // "type": "string"
  97842. // },
  97843. // "requestId": {
  97844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97845. // "location": "query",
  97846. // "type": "string"
  97847. // }
  97848. // },
  97849. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  97850. // "response": {
  97851. // "$ref": "Operation"
  97852. // },
  97853. // "scopes": [
  97854. // "https://www.googleapis.com/auth/cloud-platform",
  97855. // "https://www.googleapis.com/auth/compute"
  97856. // ]
  97857. // }
  97858. }
  97859. // method id "compute.regionHealthChecks.get":
  97860. type RegionHealthChecksGetCall struct {
  97861. s *Service
  97862. project string
  97863. region string
  97864. healthCheck string
  97865. urlParams_ gensupport.URLParams
  97866. ifNoneMatch_ string
  97867. ctx_ context.Context
  97868. header_ http.Header
  97869. }
  97870. // Get: Returns the specified HealthCheck resource. Gets a list of
  97871. // available health checks by making a list() request.
  97872. func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall {
  97873. c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97874. c.project = project
  97875. c.region = region
  97876. c.healthCheck = healthCheck
  97877. return c
  97878. }
  97879. // Fields allows partial responses to be retrieved. See
  97880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97881. // for more information.
  97882. func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall {
  97883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97884. return c
  97885. }
  97886. // IfNoneMatch sets the optional parameter which makes the operation
  97887. // fail if the object's ETag matches the given value. This is useful for
  97888. // getting updates only after the object has changed since the last
  97889. // request. Use googleapi.IsNotModified to check whether the response
  97890. // error from Do is the result of In-None-Match.
  97891. func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall {
  97892. c.ifNoneMatch_ = entityTag
  97893. return c
  97894. }
  97895. // Context sets the context to be used in this call's Do method. Any
  97896. // pending HTTP request will be aborted if the provided context is
  97897. // canceled.
  97898. func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall {
  97899. c.ctx_ = ctx
  97900. return c
  97901. }
  97902. // Header returns an http.Header that can be modified by the caller to
  97903. // add HTTP headers to the request.
  97904. func (c *RegionHealthChecksGetCall) Header() http.Header {
  97905. if c.header_ == nil {
  97906. c.header_ = make(http.Header)
  97907. }
  97908. return c.header_
  97909. }
  97910. func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  97911. reqHeaders := make(http.Header)
  97912. for k, v := range c.header_ {
  97913. reqHeaders[k] = v
  97914. }
  97915. reqHeaders.Set("User-Agent", c.s.userAgent())
  97916. if c.ifNoneMatch_ != "" {
  97917. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97918. }
  97919. var body io.Reader = nil
  97920. c.urlParams_.Set("alt", alt)
  97921. c.urlParams_.Set("prettyPrint", "false")
  97922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  97923. urls += "?" + c.urlParams_.Encode()
  97924. req, err := http.NewRequest("GET", urls, body)
  97925. if err != nil {
  97926. return nil, err
  97927. }
  97928. req.Header = reqHeaders
  97929. googleapi.Expand(req.URL, map[string]string{
  97930. "project": c.project,
  97931. "region": c.region,
  97932. "healthCheck": c.healthCheck,
  97933. })
  97934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97935. }
  97936. // Do executes the "compute.regionHealthChecks.get" call.
  97937. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  97938. // status code is an error. Response headers are in either
  97939. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  97940. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97941. // to check whether the returned error was because
  97942. // http.StatusNotModified was returned.
  97943. func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  97944. gensupport.SetOptions(c.urlParams_, opts...)
  97945. res, err := c.doRequest("json")
  97946. if res != nil && res.StatusCode == http.StatusNotModified {
  97947. if res.Body != nil {
  97948. res.Body.Close()
  97949. }
  97950. return nil, &googleapi.Error{
  97951. Code: res.StatusCode,
  97952. Header: res.Header,
  97953. }
  97954. }
  97955. if err != nil {
  97956. return nil, err
  97957. }
  97958. defer googleapi.CloseBody(res)
  97959. if err := googleapi.CheckResponse(res); err != nil {
  97960. return nil, err
  97961. }
  97962. ret := &HealthCheck{
  97963. ServerResponse: googleapi.ServerResponse{
  97964. Header: res.Header,
  97965. HTTPStatusCode: res.StatusCode,
  97966. },
  97967. }
  97968. target := &ret
  97969. if err := gensupport.DecodeResponse(target, res); err != nil {
  97970. return nil, err
  97971. }
  97972. return ret, nil
  97973. // {
  97974. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  97975. // "httpMethod": "GET",
  97976. // "id": "compute.regionHealthChecks.get",
  97977. // "parameterOrder": [
  97978. // "project",
  97979. // "region",
  97980. // "healthCheck"
  97981. // ],
  97982. // "parameters": {
  97983. // "healthCheck": {
  97984. // "description": "Name of the HealthCheck resource to return.",
  97985. // "location": "path",
  97986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97987. // "required": true,
  97988. // "type": "string"
  97989. // },
  97990. // "project": {
  97991. // "description": "Project ID for this request.",
  97992. // "location": "path",
  97993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97994. // "required": true,
  97995. // "type": "string"
  97996. // },
  97997. // "region": {
  97998. // "description": "Name of the region scoping this request.",
  97999. // "location": "path",
  98000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98001. // "required": true,
  98002. // "type": "string"
  98003. // }
  98004. // },
  98005. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  98006. // "response": {
  98007. // "$ref": "HealthCheck"
  98008. // },
  98009. // "scopes": [
  98010. // "https://www.googleapis.com/auth/cloud-platform",
  98011. // "https://www.googleapis.com/auth/compute",
  98012. // "https://www.googleapis.com/auth/compute.readonly"
  98013. // ]
  98014. // }
  98015. }
  98016. // method id "compute.regionHealthChecks.insert":
  98017. type RegionHealthChecksInsertCall struct {
  98018. s *Service
  98019. project string
  98020. region string
  98021. healthcheck *HealthCheck
  98022. urlParams_ gensupport.URLParams
  98023. ctx_ context.Context
  98024. header_ http.Header
  98025. }
  98026. // Insert: Creates a HealthCheck resource in the specified project using
  98027. // the data included in the request.
  98028. func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall {
  98029. c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98030. c.project = project
  98031. c.region = region
  98032. c.healthcheck = healthcheck
  98033. return c
  98034. }
  98035. // RequestId sets the optional parameter "requestId": An optional
  98036. // request ID to identify requests. Specify a unique request ID so that
  98037. // if you must retry your request, the server will know to ignore the
  98038. // request if it has already been completed.
  98039. //
  98040. // For example, consider a situation where you make an initial request
  98041. // and the request times out. If you make the request again with the
  98042. // same request ID, the server can check if original operation with the
  98043. // same request ID was received, and if so, will ignore the second
  98044. // request. This prevents clients from accidentally creating duplicate
  98045. // commitments.
  98046. //
  98047. // The request ID must be a valid UUID with the exception that zero UUID
  98048. // is not supported (00000000-0000-0000-0000-000000000000).
  98049. func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall {
  98050. c.urlParams_.Set("requestId", requestId)
  98051. return c
  98052. }
  98053. // Fields allows partial responses to be retrieved. See
  98054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98055. // for more information.
  98056. func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall {
  98057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98058. return c
  98059. }
  98060. // Context sets the context to be used in this call's Do method. Any
  98061. // pending HTTP request will be aborted if the provided context is
  98062. // canceled.
  98063. func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall {
  98064. c.ctx_ = ctx
  98065. return c
  98066. }
  98067. // Header returns an http.Header that can be modified by the caller to
  98068. // add HTTP headers to the request.
  98069. func (c *RegionHealthChecksInsertCall) Header() http.Header {
  98070. if c.header_ == nil {
  98071. c.header_ = make(http.Header)
  98072. }
  98073. return c.header_
  98074. }
  98075. func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  98076. reqHeaders := make(http.Header)
  98077. for k, v := range c.header_ {
  98078. reqHeaders[k] = v
  98079. }
  98080. reqHeaders.Set("User-Agent", c.s.userAgent())
  98081. var body io.Reader = nil
  98082. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  98083. if err != nil {
  98084. return nil, err
  98085. }
  98086. reqHeaders.Set("Content-Type", "application/json")
  98087. c.urlParams_.Set("alt", alt)
  98088. c.urlParams_.Set("prettyPrint", "false")
  98089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  98090. urls += "?" + c.urlParams_.Encode()
  98091. req, err := http.NewRequest("POST", urls, body)
  98092. if err != nil {
  98093. return nil, err
  98094. }
  98095. req.Header = reqHeaders
  98096. googleapi.Expand(req.URL, map[string]string{
  98097. "project": c.project,
  98098. "region": c.region,
  98099. })
  98100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98101. }
  98102. // Do executes the "compute.regionHealthChecks.insert" call.
  98103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98104. // status code is an error. Response headers are in either
  98105. // *Operation.ServerResponse.Header or (if a response was returned at
  98106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98107. // to check whether the returned error was because
  98108. // http.StatusNotModified was returned.
  98109. func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98110. gensupport.SetOptions(c.urlParams_, opts...)
  98111. res, err := c.doRequest("json")
  98112. if res != nil && res.StatusCode == http.StatusNotModified {
  98113. if res.Body != nil {
  98114. res.Body.Close()
  98115. }
  98116. return nil, &googleapi.Error{
  98117. Code: res.StatusCode,
  98118. Header: res.Header,
  98119. }
  98120. }
  98121. if err != nil {
  98122. return nil, err
  98123. }
  98124. defer googleapi.CloseBody(res)
  98125. if err := googleapi.CheckResponse(res); err != nil {
  98126. return nil, err
  98127. }
  98128. ret := &Operation{
  98129. ServerResponse: googleapi.ServerResponse{
  98130. Header: res.Header,
  98131. HTTPStatusCode: res.StatusCode,
  98132. },
  98133. }
  98134. target := &ret
  98135. if err := gensupport.DecodeResponse(target, res); err != nil {
  98136. return nil, err
  98137. }
  98138. return ret, nil
  98139. // {
  98140. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  98141. // "httpMethod": "POST",
  98142. // "id": "compute.regionHealthChecks.insert",
  98143. // "parameterOrder": [
  98144. // "project",
  98145. // "region"
  98146. // ],
  98147. // "parameters": {
  98148. // "project": {
  98149. // "description": "Project ID for this request.",
  98150. // "location": "path",
  98151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98152. // "required": true,
  98153. // "type": "string"
  98154. // },
  98155. // "region": {
  98156. // "description": "Name of the region scoping this request.",
  98157. // "location": "path",
  98158. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98159. // "required": true,
  98160. // "type": "string"
  98161. // },
  98162. // "requestId": {
  98163. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98164. // "location": "query",
  98165. // "type": "string"
  98166. // }
  98167. // },
  98168. // "path": "{project}/regions/{region}/healthChecks",
  98169. // "request": {
  98170. // "$ref": "HealthCheck"
  98171. // },
  98172. // "response": {
  98173. // "$ref": "Operation"
  98174. // },
  98175. // "scopes": [
  98176. // "https://www.googleapis.com/auth/cloud-platform",
  98177. // "https://www.googleapis.com/auth/compute"
  98178. // ]
  98179. // }
  98180. }
  98181. // method id "compute.regionHealthChecks.list":
  98182. type RegionHealthChecksListCall struct {
  98183. s *Service
  98184. project string
  98185. region string
  98186. urlParams_ gensupport.URLParams
  98187. ifNoneMatch_ string
  98188. ctx_ context.Context
  98189. header_ http.Header
  98190. }
  98191. // List: Retrieves the list of HealthCheck resources available to the
  98192. // specified project.
  98193. func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall {
  98194. c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98195. c.project = project
  98196. c.region = region
  98197. return c
  98198. }
  98199. // Filter sets the optional parameter "filter": A filter expression that
  98200. // filters resources listed in the response. The expression must specify
  98201. // the field name, a comparison operator, and the value that you want to
  98202. // use for filtering. The value must be a string, a number, or a
  98203. // boolean. The comparison operator must be either =, !=, >, or <.
  98204. //
  98205. // For example, if you are filtering Compute Engine instances, you can
  98206. // exclude instances named example-instance by specifying name !=
  98207. // example-instance.
  98208. //
  98209. // You can also filter nested fields. For example, you could specify
  98210. // scheduling.automaticRestart = false to include instances only if they
  98211. // are not scheduled for automatic restarts. You can use filtering on
  98212. // nested fields to filter based on resource labels.
  98213. //
  98214. // To filter on multiple expressions, provide each separate expression
  98215. // within parentheses. For example, (scheduling.automaticRestart = true)
  98216. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98217. // AND expression. However, you can include AND and OR expressions
  98218. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98219. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98220. // true).
  98221. func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall {
  98222. c.urlParams_.Set("filter", filter)
  98223. return c
  98224. }
  98225. // MaxResults sets the optional parameter "maxResults": The maximum
  98226. // number of results per page that should be returned. If the number of
  98227. // available results is larger than maxResults, Compute Engine returns a
  98228. // nextPageToken that can be used to get the next page of results in
  98229. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98230. // (Default: 500)
  98231. func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall {
  98232. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98233. return c
  98234. }
  98235. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98236. // a certain order. By default, results are returned in alphanumerical
  98237. // order based on the resource name.
  98238. //
  98239. // You can also sort results in descending order based on the creation
  98240. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98241. // based on the creationTimestamp field in reverse chronological order
  98242. // (newest result first). Use this to sort resources like operations so
  98243. // that the newest operation is returned first.
  98244. //
  98245. // Currently, only sorting by name or creationTimestamp desc is
  98246. // supported.
  98247. func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall {
  98248. c.urlParams_.Set("orderBy", orderBy)
  98249. return c
  98250. }
  98251. // PageToken sets the optional parameter "pageToken": Specifies a page
  98252. // token to use. Set pageToken to the nextPageToken returned by a
  98253. // previous list request to get the next page of results.
  98254. func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall {
  98255. c.urlParams_.Set("pageToken", pageToken)
  98256. return c
  98257. }
  98258. // Fields allows partial responses to be retrieved. See
  98259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98260. // for more information.
  98261. func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall {
  98262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98263. return c
  98264. }
  98265. // IfNoneMatch sets the optional parameter which makes the operation
  98266. // fail if the object's ETag matches the given value. This is useful for
  98267. // getting updates only after the object has changed since the last
  98268. // request. Use googleapi.IsNotModified to check whether the response
  98269. // error from Do is the result of In-None-Match.
  98270. func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall {
  98271. c.ifNoneMatch_ = entityTag
  98272. return c
  98273. }
  98274. // Context sets the context to be used in this call's Do method. Any
  98275. // pending HTTP request will be aborted if the provided context is
  98276. // canceled.
  98277. func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall {
  98278. c.ctx_ = ctx
  98279. return c
  98280. }
  98281. // Header returns an http.Header that can be modified by the caller to
  98282. // add HTTP headers to the request.
  98283. func (c *RegionHealthChecksListCall) Header() http.Header {
  98284. if c.header_ == nil {
  98285. c.header_ = make(http.Header)
  98286. }
  98287. return c.header_
  98288. }
  98289. func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  98290. reqHeaders := make(http.Header)
  98291. for k, v := range c.header_ {
  98292. reqHeaders[k] = v
  98293. }
  98294. reqHeaders.Set("User-Agent", c.s.userAgent())
  98295. if c.ifNoneMatch_ != "" {
  98296. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98297. }
  98298. var body io.Reader = nil
  98299. c.urlParams_.Set("alt", alt)
  98300. c.urlParams_.Set("prettyPrint", "false")
  98301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  98302. urls += "?" + c.urlParams_.Encode()
  98303. req, err := http.NewRequest("GET", urls, body)
  98304. if err != nil {
  98305. return nil, err
  98306. }
  98307. req.Header = reqHeaders
  98308. googleapi.Expand(req.URL, map[string]string{
  98309. "project": c.project,
  98310. "region": c.region,
  98311. })
  98312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98313. }
  98314. // Do executes the "compute.regionHealthChecks.list" call.
  98315. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  98316. // status code is an error. Response headers are in either
  98317. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  98318. // at all) in error.(*googleapi.Error).Header. Use
  98319. // googleapi.IsNotModified to check whether the returned error was
  98320. // because http.StatusNotModified was returned.
  98321. func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  98322. gensupport.SetOptions(c.urlParams_, opts...)
  98323. res, err := c.doRequest("json")
  98324. if res != nil && res.StatusCode == http.StatusNotModified {
  98325. if res.Body != nil {
  98326. res.Body.Close()
  98327. }
  98328. return nil, &googleapi.Error{
  98329. Code: res.StatusCode,
  98330. Header: res.Header,
  98331. }
  98332. }
  98333. if err != nil {
  98334. return nil, err
  98335. }
  98336. defer googleapi.CloseBody(res)
  98337. if err := googleapi.CheckResponse(res); err != nil {
  98338. return nil, err
  98339. }
  98340. ret := &HealthCheckList{
  98341. ServerResponse: googleapi.ServerResponse{
  98342. Header: res.Header,
  98343. HTTPStatusCode: res.StatusCode,
  98344. },
  98345. }
  98346. target := &ret
  98347. if err := gensupport.DecodeResponse(target, res); err != nil {
  98348. return nil, err
  98349. }
  98350. return ret, nil
  98351. // {
  98352. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  98353. // "httpMethod": "GET",
  98354. // "id": "compute.regionHealthChecks.list",
  98355. // "parameterOrder": [
  98356. // "project",
  98357. // "region"
  98358. // ],
  98359. // "parameters": {
  98360. // "filter": {
  98361. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  98362. // "location": "query",
  98363. // "type": "string"
  98364. // },
  98365. // "maxResults": {
  98366. // "default": "500",
  98367. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  98368. // "format": "uint32",
  98369. // "location": "query",
  98370. // "minimum": "0",
  98371. // "type": "integer"
  98372. // },
  98373. // "orderBy": {
  98374. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  98375. // "location": "query",
  98376. // "type": "string"
  98377. // },
  98378. // "pageToken": {
  98379. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  98380. // "location": "query",
  98381. // "type": "string"
  98382. // },
  98383. // "project": {
  98384. // "description": "Project ID for this request.",
  98385. // "location": "path",
  98386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98387. // "required": true,
  98388. // "type": "string"
  98389. // },
  98390. // "region": {
  98391. // "description": "Name of the region scoping this request.",
  98392. // "location": "path",
  98393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98394. // "required": true,
  98395. // "type": "string"
  98396. // }
  98397. // },
  98398. // "path": "{project}/regions/{region}/healthChecks",
  98399. // "response": {
  98400. // "$ref": "HealthCheckList"
  98401. // },
  98402. // "scopes": [
  98403. // "https://www.googleapis.com/auth/cloud-platform",
  98404. // "https://www.googleapis.com/auth/compute",
  98405. // "https://www.googleapis.com/auth/compute.readonly"
  98406. // ]
  98407. // }
  98408. }
  98409. // Pages invokes f for each page of results.
  98410. // A non-nil error returned from f will halt the iteration.
  98411. // The provided context supersedes any context provided to the Context method.
  98412. func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  98413. c.ctx_ = ctx
  98414. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98415. for {
  98416. x, err := c.Do()
  98417. if err != nil {
  98418. return err
  98419. }
  98420. if err := f(x); err != nil {
  98421. return err
  98422. }
  98423. if x.NextPageToken == "" {
  98424. return nil
  98425. }
  98426. c.PageToken(x.NextPageToken)
  98427. }
  98428. }
  98429. // method id "compute.regionHealthChecks.patch":
  98430. type RegionHealthChecksPatchCall struct {
  98431. s *Service
  98432. project string
  98433. region string
  98434. healthCheck string
  98435. healthcheck *HealthCheck
  98436. urlParams_ gensupport.URLParams
  98437. ctx_ context.Context
  98438. header_ http.Header
  98439. }
  98440. // Patch: Updates a HealthCheck resource in the specified project using
  98441. // the data included in the request. This method supports PATCH
  98442. // semantics and uses the JSON merge patch format and processing rules.
  98443. func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall {
  98444. c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98445. c.project = project
  98446. c.region = region
  98447. c.healthCheck = healthCheck
  98448. c.healthcheck = healthcheck
  98449. return c
  98450. }
  98451. // RequestId sets the optional parameter "requestId": An optional
  98452. // request ID to identify requests. Specify a unique request ID so that
  98453. // if you must retry your request, the server will know to ignore the
  98454. // request if it has already been completed.
  98455. //
  98456. // For example, consider a situation where you make an initial request
  98457. // and the request times out. If you make the request again with the
  98458. // same request ID, the server can check if original operation with the
  98459. // same request ID was received, and if so, will ignore the second
  98460. // request. This prevents clients from accidentally creating duplicate
  98461. // commitments.
  98462. //
  98463. // The request ID must be a valid UUID with the exception that zero UUID
  98464. // is not supported (00000000-0000-0000-0000-000000000000).
  98465. func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall {
  98466. c.urlParams_.Set("requestId", requestId)
  98467. return c
  98468. }
  98469. // Fields allows partial responses to be retrieved. See
  98470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98471. // for more information.
  98472. func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall {
  98473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98474. return c
  98475. }
  98476. // Context sets the context to be used in this call's Do method. Any
  98477. // pending HTTP request will be aborted if the provided context is
  98478. // canceled.
  98479. func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall {
  98480. c.ctx_ = ctx
  98481. return c
  98482. }
  98483. // Header returns an http.Header that can be modified by the caller to
  98484. // add HTTP headers to the request.
  98485. func (c *RegionHealthChecksPatchCall) Header() http.Header {
  98486. if c.header_ == nil {
  98487. c.header_ = make(http.Header)
  98488. }
  98489. return c.header_
  98490. }
  98491. func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  98492. reqHeaders := make(http.Header)
  98493. for k, v := range c.header_ {
  98494. reqHeaders[k] = v
  98495. }
  98496. reqHeaders.Set("User-Agent", c.s.userAgent())
  98497. var body io.Reader = nil
  98498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  98499. if err != nil {
  98500. return nil, err
  98501. }
  98502. reqHeaders.Set("Content-Type", "application/json")
  98503. c.urlParams_.Set("alt", alt)
  98504. c.urlParams_.Set("prettyPrint", "false")
  98505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  98506. urls += "?" + c.urlParams_.Encode()
  98507. req, err := http.NewRequest("PATCH", urls, body)
  98508. if err != nil {
  98509. return nil, err
  98510. }
  98511. req.Header = reqHeaders
  98512. googleapi.Expand(req.URL, map[string]string{
  98513. "project": c.project,
  98514. "region": c.region,
  98515. "healthCheck": c.healthCheck,
  98516. })
  98517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98518. }
  98519. // Do executes the "compute.regionHealthChecks.patch" call.
  98520. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98521. // status code is an error. Response headers are in either
  98522. // *Operation.ServerResponse.Header or (if a response was returned at
  98523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98524. // to check whether the returned error was because
  98525. // http.StatusNotModified was returned.
  98526. func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98527. gensupport.SetOptions(c.urlParams_, opts...)
  98528. res, err := c.doRequest("json")
  98529. if res != nil && res.StatusCode == http.StatusNotModified {
  98530. if res.Body != nil {
  98531. res.Body.Close()
  98532. }
  98533. return nil, &googleapi.Error{
  98534. Code: res.StatusCode,
  98535. Header: res.Header,
  98536. }
  98537. }
  98538. if err != nil {
  98539. return nil, err
  98540. }
  98541. defer googleapi.CloseBody(res)
  98542. if err := googleapi.CheckResponse(res); err != nil {
  98543. return nil, err
  98544. }
  98545. ret := &Operation{
  98546. ServerResponse: googleapi.ServerResponse{
  98547. Header: res.Header,
  98548. HTTPStatusCode: res.StatusCode,
  98549. },
  98550. }
  98551. target := &ret
  98552. if err := gensupport.DecodeResponse(target, res); err != nil {
  98553. return nil, err
  98554. }
  98555. return ret, nil
  98556. // {
  98557. // "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.",
  98558. // "httpMethod": "PATCH",
  98559. // "id": "compute.regionHealthChecks.patch",
  98560. // "parameterOrder": [
  98561. // "project",
  98562. // "region",
  98563. // "healthCheck"
  98564. // ],
  98565. // "parameters": {
  98566. // "healthCheck": {
  98567. // "description": "Name of the HealthCheck resource to patch.",
  98568. // "location": "path",
  98569. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98570. // "required": true,
  98571. // "type": "string"
  98572. // },
  98573. // "project": {
  98574. // "description": "Project ID for this request.",
  98575. // "location": "path",
  98576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98577. // "required": true,
  98578. // "type": "string"
  98579. // },
  98580. // "region": {
  98581. // "description": "Name of the region scoping this request.",
  98582. // "location": "path",
  98583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98584. // "required": true,
  98585. // "type": "string"
  98586. // },
  98587. // "requestId": {
  98588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98589. // "location": "query",
  98590. // "type": "string"
  98591. // }
  98592. // },
  98593. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  98594. // "request": {
  98595. // "$ref": "HealthCheck"
  98596. // },
  98597. // "response": {
  98598. // "$ref": "Operation"
  98599. // },
  98600. // "scopes": [
  98601. // "https://www.googleapis.com/auth/cloud-platform",
  98602. // "https://www.googleapis.com/auth/compute"
  98603. // ]
  98604. // }
  98605. }
  98606. // method id "compute.regionHealthChecks.testIamPermissions":
  98607. type RegionHealthChecksTestIamPermissionsCall struct {
  98608. s *Service
  98609. project string
  98610. region string
  98611. resource string
  98612. testpermissionsrequest *TestPermissionsRequest
  98613. urlParams_ gensupport.URLParams
  98614. ctx_ context.Context
  98615. header_ http.Header
  98616. }
  98617. // TestIamPermissions: Returns permissions that a caller has on the
  98618. // specified resource.
  98619. func (r *RegionHealthChecksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthChecksTestIamPermissionsCall {
  98620. c := &RegionHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98621. c.project = project
  98622. c.region = region
  98623. c.resource = resource
  98624. c.testpermissionsrequest = testpermissionsrequest
  98625. return c
  98626. }
  98627. // Fields allows partial responses to be retrieved. See
  98628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98629. // for more information.
  98630. func (c *RegionHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthChecksTestIamPermissionsCall {
  98631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98632. return c
  98633. }
  98634. // Context sets the context to be used in this call's Do method. Any
  98635. // pending HTTP request will be aborted if the provided context is
  98636. // canceled.
  98637. func (c *RegionHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthChecksTestIamPermissionsCall {
  98638. c.ctx_ = ctx
  98639. return c
  98640. }
  98641. // Header returns an http.Header that can be modified by the caller to
  98642. // add HTTP headers to the request.
  98643. func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header {
  98644. if c.header_ == nil {
  98645. c.header_ = make(http.Header)
  98646. }
  98647. return c.header_
  98648. }
  98649. func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  98650. reqHeaders := make(http.Header)
  98651. for k, v := range c.header_ {
  98652. reqHeaders[k] = v
  98653. }
  98654. reqHeaders.Set("User-Agent", c.s.userAgent())
  98655. var body io.Reader = nil
  98656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  98657. if err != nil {
  98658. return nil, err
  98659. }
  98660. reqHeaders.Set("Content-Type", "application/json")
  98661. c.urlParams_.Set("alt", alt)
  98662. c.urlParams_.Set("prettyPrint", "false")
  98663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions")
  98664. urls += "?" + c.urlParams_.Encode()
  98665. req, err := http.NewRequest("POST", urls, body)
  98666. if err != nil {
  98667. return nil, err
  98668. }
  98669. req.Header = reqHeaders
  98670. googleapi.Expand(req.URL, map[string]string{
  98671. "project": c.project,
  98672. "region": c.region,
  98673. "resource": c.resource,
  98674. })
  98675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98676. }
  98677. // Do executes the "compute.regionHealthChecks.testIamPermissions" call.
  98678. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  98679. // non-2xx status code is an error. Response headers are in either
  98680. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  98681. // returned at all) in error.(*googleapi.Error).Header. Use
  98682. // googleapi.IsNotModified to check whether the returned error was
  98683. // because http.StatusNotModified was returned.
  98684. func (c *RegionHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  98685. gensupport.SetOptions(c.urlParams_, opts...)
  98686. res, err := c.doRequest("json")
  98687. if res != nil && res.StatusCode == http.StatusNotModified {
  98688. if res.Body != nil {
  98689. res.Body.Close()
  98690. }
  98691. return nil, &googleapi.Error{
  98692. Code: res.StatusCode,
  98693. Header: res.Header,
  98694. }
  98695. }
  98696. if err != nil {
  98697. return nil, err
  98698. }
  98699. defer googleapi.CloseBody(res)
  98700. if err := googleapi.CheckResponse(res); err != nil {
  98701. return nil, err
  98702. }
  98703. ret := &TestPermissionsResponse{
  98704. ServerResponse: googleapi.ServerResponse{
  98705. Header: res.Header,
  98706. HTTPStatusCode: res.StatusCode,
  98707. },
  98708. }
  98709. target := &ret
  98710. if err := gensupport.DecodeResponse(target, res); err != nil {
  98711. return nil, err
  98712. }
  98713. return ret, nil
  98714. // {
  98715. // "description": "Returns permissions that a caller has on the specified resource.",
  98716. // "httpMethod": "POST",
  98717. // "id": "compute.regionHealthChecks.testIamPermissions",
  98718. // "parameterOrder": [
  98719. // "project",
  98720. // "region",
  98721. // "resource"
  98722. // ],
  98723. // "parameters": {
  98724. // "project": {
  98725. // "description": "Project ID for this request.",
  98726. // "location": "path",
  98727. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98728. // "required": true,
  98729. // "type": "string"
  98730. // },
  98731. // "region": {
  98732. // "description": "The name of the region for this request.",
  98733. // "location": "path",
  98734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98735. // "required": true,
  98736. // "type": "string"
  98737. // },
  98738. // "resource": {
  98739. // "description": "Name or id of the resource for this request.",
  98740. // "location": "path",
  98741. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98742. // "required": true,
  98743. // "type": "string"
  98744. // }
  98745. // },
  98746. // "path": "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions",
  98747. // "request": {
  98748. // "$ref": "TestPermissionsRequest"
  98749. // },
  98750. // "response": {
  98751. // "$ref": "TestPermissionsResponse"
  98752. // },
  98753. // "scopes": [
  98754. // "https://www.googleapis.com/auth/cloud-platform",
  98755. // "https://www.googleapis.com/auth/compute",
  98756. // "https://www.googleapis.com/auth/compute.readonly"
  98757. // ]
  98758. // }
  98759. }
  98760. // method id "compute.regionHealthChecks.update":
  98761. type RegionHealthChecksUpdateCall struct {
  98762. s *Service
  98763. project string
  98764. region string
  98765. healthCheck string
  98766. healthcheck *HealthCheck
  98767. urlParams_ gensupport.URLParams
  98768. ctx_ context.Context
  98769. header_ http.Header
  98770. }
  98771. // Update: Updates a HealthCheck resource in the specified project using
  98772. // the data included in the request.
  98773. func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall {
  98774. c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98775. c.project = project
  98776. c.region = region
  98777. c.healthCheck = healthCheck
  98778. c.healthcheck = healthcheck
  98779. return c
  98780. }
  98781. // RequestId sets the optional parameter "requestId": An optional
  98782. // request ID to identify requests. Specify a unique request ID so that
  98783. // if you must retry your request, the server will know to ignore the
  98784. // request if it has already been completed.
  98785. //
  98786. // For example, consider a situation where you make an initial request
  98787. // and the request times out. If you make the request again with the
  98788. // same request ID, the server can check if original operation with the
  98789. // same request ID was received, and if so, will ignore the second
  98790. // request. This prevents clients from accidentally creating duplicate
  98791. // commitments.
  98792. //
  98793. // The request ID must be a valid UUID with the exception that zero UUID
  98794. // is not supported (00000000-0000-0000-0000-000000000000).
  98795. func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall {
  98796. c.urlParams_.Set("requestId", requestId)
  98797. return c
  98798. }
  98799. // Fields allows partial responses to be retrieved. See
  98800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98801. // for more information.
  98802. func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall {
  98803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98804. return c
  98805. }
  98806. // Context sets the context to be used in this call's Do method. Any
  98807. // pending HTTP request will be aborted if the provided context is
  98808. // canceled.
  98809. func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall {
  98810. c.ctx_ = ctx
  98811. return c
  98812. }
  98813. // Header returns an http.Header that can be modified by the caller to
  98814. // add HTTP headers to the request.
  98815. func (c *RegionHealthChecksUpdateCall) Header() http.Header {
  98816. if c.header_ == nil {
  98817. c.header_ = make(http.Header)
  98818. }
  98819. return c.header_
  98820. }
  98821. func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  98822. reqHeaders := make(http.Header)
  98823. for k, v := range c.header_ {
  98824. reqHeaders[k] = v
  98825. }
  98826. reqHeaders.Set("User-Agent", c.s.userAgent())
  98827. var body io.Reader = nil
  98828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  98829. if err != nil {
  98830. return nil, err
  98831. }
  98832. reqHeaders.Set("Content-Type", "application/json")
  98833. c.urlParams_.Set("alt", alt)
  98834. c.urlParams_.Set("prettyPrint", "false")
  98835. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  98836. urls += "?" + c.urlParams_.Encode()
  98837. req, err := http.NewRequest("PUT", urls, body)
  98838. if err != nil {
  98839. return nil, err
  98840. }
  98841. req.Header = reqHeaders
  98842. googleapi.Expand(req.URL, map[string]string{
  98843. "project": c.project,
  98844. "region": c.region,
  98845. "healthCheck": c.healthCheck,
  98846. })
  98847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98848. }
  98849. // Do executes the "compute.regionHealthChecks.update" call.
  98850. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98851. // status code is an error. Response headers are in either
  98852. // *Operation.ServerResponse.Header or (if a response was returned at
  98853. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98854. // to check whether the returned error was because
  98855. // http.StatusNotModified was returned.
  98856. func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98857. gensupport.SetOptions(c.urlParams_, opts...)
  98858. res, err := c.doRequest("json")
  98859. if res != nil && res.StatusCode == http.StatusNotModified {
  98860. if res.Body != nil {
  98861. res.Body.Close()
  98862. }
  98863. return nil, &googleapi.Error{
  98864. Code: res.StatusCode,
  98865. Header: res.Header,
  98866. }
  98867. }
  98868. if err != nil {
  98869. return nil, err
  98870. }
  98871. defer googleapi.CloseBody(res)
  98872. if err := googleapi.CheckResponse(res); err != nil {
  98873. return nil, err
  98874. }
  98875. ret := &Operation{
  98876. ServerResponse: googleapi.ServerResponse{
  98877. Header: res.Header,
  98878. HTTPStatusCode: res.StatusCode,
  98879. },
  98880. }
  98881. target := &ret
  98882. if err := gensupport.DecodeResponse(target, res); err != nil {
  98883. return nil, err
  98884. }
  98885. return ret, nil
  98886. // {
  98887. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  98888. // "httpMethod": "PUT",
  98889. // "id": "compute.regionHealthChecks.update",
  98890. // "parameterOrder": [
  98891. // "project",
  98892. // "region",
  98893. // "healthCheck"
  98894. // ],
  98895. // "parameters": {
  98896. // "healthCheck": {
  98897. // "description": "Name of the HealthCheck resource to update.",
  98898. // "location": "path",
  98899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98900. // "required": true,
  98901. // "type": "string"
  98902. // },
  98903. // "project": {
  98904. // "description": "Project ID for this request.",
  98905. // "location": "path",
  98906. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98907. // "required": true,
  98908. // "type": "string"
  98909. // },
  98910. // "region": {
  98911. // "description": "Name of the region scoping this request.",
  98912. // "location": "path",
  98913. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98914. // "required": true,
  98915. // "type": "string"
  98916. // },
  98917. // "requestId": {
  98918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98919. // "location": "query",
  98920. // "type": "string"
  98921. // }
  98922. // },
  98923. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  98924. // "request": {
  98925. // "$ref": "HealthCheck"
  98926. // },
  98927. // "response": {
  98928. // "$ref": "Operation"
  98929. // },
  98930. // "scopes": [
  98931. // "https://www.googleapis.com/auth/cloud-platform",
  98932. // "https://www.googleapis.com/auth/compute"
  98933. // ]
  98934. // }
  98935. }
  98936. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  98937. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  98938. s *Service
  98939. project string
  98940. region string
  98941. instanceGroupManager string
  98942. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  98943. urlParams_ gensupport.URLParams
  98944. ctx_ context.Context
  98945. header_ http.Header
  98946. }
  98947. // AbandonInstances: Flags the specified instances to be immediately
  98948. // removed from the managed instance group. Abandoning an instance does
  98949. // not delete the instance, but it does remove the instance from any
  98950. // target pools that are applied by the managed instance group. This
  98951. // method reduces the targetSize of the managed instance group by the
  98952. // number of instances that you abandon. This operation is marked as
  98953. // DONE when the action is scheduled even if the instances have not yet
  98954. // been removed from the group. You must separately verify the status of
  98955. // the abandoning action with the listmanagedinstances method.
  98956. //
  98957. // If the group is part of a backend service that has enabled connection
  98958. // draining, it can take up to 60 seconds after the connection draining
  98959. // duration has elapsed before the VM instance is removed or
  98960. // deleted.
  98961. //
  98962. // You can specify a maximum of 1000 instances with this method per
  98963. // request.
  98964. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  98965. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98966. c.project = project
  98967. c.region = region
  98968. c.instanceGroupManager = instanceGroupManager
  98969. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  98970. return c
  98971. }
  98972. // RequestId sets the optional parameter "requestId": An optional
  98973. // request ID to identify requests. Specify a unique request ID so that
  98974. // if you must retry your request, the server will know to ignore the
  98975. // request if it has already been completed.
  98976. //
  98977. // For example, consider a situation where you make an initial request
  98978. // and the request times out. If you make the request again with the
  98979. // same request ID, the server can check if original operation with the
  98980. // same request ID was received, and if so, will ignore the second
  98981. // request. This prevents clients from accidentally creating duplicate
  98982. // commitments.
  98983. //
  98984. // The request ID must be a valid UUID with the exception that zero UUID
  98985. // is not supported (00000000-0000-0000-0000-000000000000).
  98986. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  98987. c.urlParams_.Set("requestId", requestId)
  98988. return c
  98989. }
  98990. // Fields allows partial responses to be retrieved. See
  98991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98992. // for more information.
  98993. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  98994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98995. return c
  98996. }
  98997. // Context sets the context to be used in this call's Do method. Any
  98998. // pending HTTP request will be aborted if the provided context is
  98999. // canceled.
  99000. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  99001. c.ctx_ = ctx
  99002. return c
  99003. }
  99004. // Header returns an http.Header that can be modified by the caller to
  99005. // add HTTP headers to the request.
  99006. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  99007. if c.header_ == nil {
  99008. c.header_ = make(http.Header)
  99009. }
  99010. return c.header_
  99011. }
  99012. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  99013. reqHeaders := make(http.Header)
  99014. for k, v := range c.header_ {
  99015. reqHeaders[k] = v
  99016. }
  99017. reqHeaders.Set("User-Agent", c.s.userAgent())
  99018. var body io.Reader = nil
  99019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  99020. if err != nil {
  99021. return nil, err
  99022. }
  99023. reqHeaders.Set("Content-Type", "application/json")
  99024. c.urlParams_.Set("alt", alt)
  99025. c.urlParams_.Set("prettyPrint", "false")
  99026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  99027. urls += "?" + c.urlParams_.Encode()
  99028. req, err := http.NewRequest("POST", urls, body)
  99029. if err != nil {
  99030. return nil, err
  99031. }
  99032. req.Header = reqHeaders
  99033. googleapi.Expand(req.URL, map[string]string{
  99034. "project": c.project,
  99035. "region": c.region,
  99036. "instanceGroupManager": c.instanceGroupManager,
  99037. })
  99038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99039. }
  99040. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  99041. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99042. // status code is an error. Response headers are in either
  99043. // *Operation.ServerResponse.Header or (if a response was returned at
  99044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99045. // to check whether the returned error was because
  99046. // http.StatusNotModified was returned.
  99047. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99048. gensupport.SetOptions(c.urlParams_, opts...)
  99049. res, err := c.doRequest("json")
  99050. if res != nil && res.StatusCode == http.StatusNotModified {
  99051. if res.Body != nil {
  99052. res.Body.Close()
  99053. }
  99054. return nil, &googleapi.Error{
  99055. Code: res.StatusCode,
  99056. Header: res.Header,
  99057. }
  99058. }
  99059. if err != nil {
  99060. return nil, err
  99061. }
  99062. defer googleapi.CloseBody(res)
  99063. if err := googleapi.CheckResponse(res); err != nil {
  99064. return nil, err
  99065. }
  99066. ret := &Operation{
  99067. ServerResponse: googleapi.ServerResponse{
  99068. Header: res.Header,
  99069. HTTPStatusCode: res.StatusCode,
  99070. },
  99071. }
  99072. target := &ret
  99073. if err := gensupport.DecodeResponse(target, res); err != nil {
  99074. return nil, err
  99075. }
  99076. return ret, nil
  99077. // {
  99078. // "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.",
  99079. // "httpMethod": "POST",
  99080. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  99081. // "parameterOrder": [
  99082. // "project",
  99083. // "region",
  99084. // "instanceGroupManager"
  99085. // ],
  99086. // "parameters": {
  99087. // "instanceGroupManager": {
  99088. // "description": "Name of the managed instance group.",
  99089. // "location": "path",
  99090. // "required": true,
  99091. // "type": "string"
  99092. // },
  99093. // "project": {
  99094. // "description": "Project ID for this request.",
  99095. // "location": "path",
  99096. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99097. // "required": true,
  99098. // "type": "string"
  99099. // },
  99100. // "region": {
  99101. // "description": "Name of the region scoping this request.",
  99102. // "location": "path",
  99103. // "required": true,
  99104. // "type": "string"
  99105. // },
  99106. // "requestId": {
  99107. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99108. // "location": "query",
  99109. // "type": "string"
  99110. // }
  99111. // },
  99112. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  99113. // "request": {
  99114. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  99115. // },
  99116. // "response": {
  99117. // "$ref": "Operation"
  99118. // },
  99119. // "scopes": [
  99120. // "https://www.googleapis.com/auth/cloud-platform",
  99121. // "https://www.googleapis.com/auth/compute"
  99122. // ]
  99123. // }
  99124. }
  99125. // method id "compute.regionInstanceGroupManagers.applyUpdatesToInstances":
  99126. type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct {
  99127. s *Service
  99128. project string
  99129. region string
  99130. instanceGroupManager string
  99131. regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest
  99132. urlParams_ gensupport.URLParams
  99133. ctx_ context.Context
  99134. header_ http.Header
  99135. }
  99136. // ApplyUpdatesToInstances: Apply updates to selected instances the
  99137. // managed instance group.
  99138. func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  99139. c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99140. c.project = project
  99141. c.region = region
  99142. c.instanceGroupManager = instanceGroupManager
  99143. c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest
  99144. return c
  99145. }
  99146. // Fields allows partial responses to be retrieved. See
  99147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99148. // for more information.
  99149. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  99150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99151. return c
  99152. }
  99153. // Context sets the context to be used in this call's Do method. Any
  99154. // pending HTTP request will be aborted if the provided context is
  99155. // canceled.
  99156. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  99157. c.ctx_ = ctx
  99158. return c
  99159. }
  99160. // Header returns an http.Header that can be modified by the caller to
  99161. // add HTTP headers to the request.
  99162. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  99163. if c.header_ == nil {
  99164. c.header_ = make(http.Header)
  99165. }
  99166. return c.header_
  99167. }
  99168. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  99169. reqHeaders := make(http.Header)
  99170. for k, v := range c.header_ {
  99171. reqHeaders[k] = v
  99172. }
  99173. reqHeaders.Set("User-Agent", c.s.userAgent())
  99174. var body io.Reader = nil
  99175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest)
  99176. if err != nil {
  99177. return nil, err
  99178. }
  99179. reqHeaders.Set("Content-Type", "application/json")
  99180. c.urlParams_.Set("alt", alt)
  99181. c.urlParams_.Set("prettyPrint", "false")
  99182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  99183. urls += "?" + c.urlParams_.Encode()
  99184. req, err := http.NewRequest("POST", urls, body)
  99185. if err != nil {
  99186. return nil, err
  99187. }
  99188. req.Header = reqHeaders
  99189. googleapi.Expand(req.URL, map[string]string{
  99190. "project": c.project,
  99191. "region": c.region,
  99192. "instanceGroupManager": c.instanceGroupManager,
  99193. })
  99194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99195. }
  99196. // Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call.
  99197. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99198. // status code is an error. Response headers are in either
  99199. // *Operation.ServerResponse.Header or (if a response was returned at
  99200. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99201. // to check whether the returned error was because
  99202. // http.StatusNotModified was returned.
  99203. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99204. gensupport.SetOptions(c.urlParams_, opts...)
  99205. res, err := c.doRequest("json")
  99206. if res != nil && res.StatusCode == http.StatusNotModified {
  99207. if res.Body != nil {
  99208. res.Body.Close()
  99209. }
  99210. return nil, &googleapi.Error{
  99211. Code: res.StatusCode,
  99212. Header: res.Header,
  99213. }
  99214. }
  99215. if err != nil {
  99216. return nil, err
  99217. }
  99218. defer googleapi.CloseBody(res)
  99219. if err := googleapi.CheckResponse(res); err != nil {
  99220. return nil, err
  99221. }
  99222. ret := &Operation{
  99223. ServerResponse: googleapi.ServerResponse{
  99224. Header: res.Header,
  99225. HTTPStatusCode: res.StatusCode,
  99226. },
  99227. }
  99228. target := &ret
  99229. if err := gensupport.DecodeResponse(target, res); err != nil {
  99230. return nil, err
  99231. }
  99232. return ret, nil
  99233. // {
  99234. // "description": "Apply updates to selected instances the managed instance group.",
  99235. // "httpMethod": "POST",
  99236. // "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances",
  99237. // "parameterOrder": [
  99238. // "project",
  99239. // "region",
  99240. // "instanceGroupManager"
  99241. // ],
  99242. // "parameters": {
  99243. // "instanceGroupManager": {
  99244. // "description": "The name of the managed instance group, should conform to RFC1035.",
  99245. // "location": "path",
  99246. // "required": true,
  99247. // "type": "string"
  99248. // },
  99249. // "project": {
  99250. // "description": "Project ID for this request.",
  99251. // "location": "path",
  99252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99253. // "required": true,
  99254. // "type": "string"
  99255. // },
  99256. // "region": {
  99257. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  99258. // "location": "path",
  99259. // "required": true,
  99260. // "type": "string"
  99261. // }
  99262. // },
  99263. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  99264. // "request": {
  99265. // "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest"
  99266. // },
  99267. // "response": {
  99268. // "$ref": "Operation"
  99269. // },
  99270. // "scopes": [
  99271. // "https://www.googleapis.com/auth/cloud-platform",
  99272. // "https://www.googleapis.com/auth/compute"
  99273. // ]
  99274. // }
  99275. }
  99276. // method id "compute.regionInstanceGroupManagers.delete":
  99277. type RegionInstanceGroupManagersDeleteCall struct {
  99278. s *Service
  99279. project string
  99280. region string
  99281. instanceGroupManager string
  99282. urlParams_ gensupport.URLParams
  99283. ctx_ context.Context
  99284. header_ http.Header
  99285. }
  99286. // Delete: Deletes the specified managed instance group and all of the
  99287. // instances in that group.
  99288. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  99289. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99290. c.project = project
  99291. c.region = region
  99292. c.instanceGroupManager = instanceGroupManager
  99293. return c
  99294. }
  99295. // RequestId sets the optional parameter "requestId": An optional
  99296. // request ID to identify requests. Specify a unique request ID so that
  99297. // if you must retry your request, the server will know to ignore the
  99298. // request if it has already been completed.
  99299. //
  99300. // For example, consider a situation where you make an initial request
  99301. // and the request times out. If you make the request again with the
  99302. // same request ID, the server can check if original operation with the
  99303. // same request ID was received, and if so, will ignore the second
  99304. // request. This prevents clients from accidentally creating duplicate
  99305. // commitments.
  99306. //
  99307. // The request ID must be a valid UUID with the exception that zero UUID
  99308. // is not supported (00000000-0000-0000-0000-000000000000).
  99309. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  99310. c.urlParams_.Set("requestId", requestId)
  99311. return c
  99312. }
  99313. // Fields allows partial responses to be retrieved. See
  99314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99315. // for more information.
  99316. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  99317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99318. return c
  99319. }
  99320. // Context sets the context to be used in this call's Do method. Any
  99321. // pending HTTP request will be aborted if the provided context is
  99322. // canceled.
  99323. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  99324. c.ctx_ = ctx
  99325. return c
  99326. }
  99327. // Header returns an http.Header that can be modified by the caller to
  99328. // add HTTP headers to the request.
  99329. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  99330. if c.header_ == nil {
  99331. c.header_ = make(http.Header)
  99332. }
  99333. return c.header_
  99334. }
  99335. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  99336. reqHeaders := make(http.Header)
  99337. for k, v := range c.header_ {
  99338. reqHeaders[k] = v
  99339. }
  99340. reqHeaders.Set("User-Agent", c.s.userAgent())
  99341. var body io.Reader = nil
  99342. c.urlParams_.Set("alt", alt)
  99343. c.urlParams_.Set("prettyPrint", "false")
  99344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  99345. urls += "?" + c.urlParams_.Encode()
  99346. req, err := http.NewRequest("DELETE", urls, body)
  99347. if err != nil {
  99348. return nil, err
  99349. }
  99350. req.Header = reqHeaders
  99351. googleapi.Expand(req.URL, map[string]string{
  99352. "project": c.project,
  99353. "region": c.region,
  99354. "instanceGroupManager": c.instanceGroupManager,
  99355. })
  99356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99357. }
  99358. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  99359. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99360. // status code is an error. Response headers are in either
  99361. // *Operation.ServerResponse.Header or (if a response was returned at
  99362. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99363. // to check whether the returned error was because
  99364. // http.StatusNotModified was returned.
  99365. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99366. gensupport.SetOptions(c.urlParams_, opts...)
  99367. res, err := c.doRequest("json")
  99368. if res != nil && res.StatusCode == http.StatusNotModified {
  99369. if res.Body != nil {
  99370. res.Body.Close()
  99371. }
  99372. return nil, &googleapi.Error{
  99373. Code: res.StatusCode,
  99374. Header: res.Header,
  99375. }
  99376. }
  99377. if err != nil {
  99378. return nil, err
  99379. }
  99380. defer googleapi.CloseBody(res)
  99381. if err := googleapi.CheckResponse(res); err != nil {
  99382. return nil, err
  99383. }
  99384. ret := &Operation{
  99385. ServerResponse: googleapi.ServerResponse{
  99386. Header: res.Header,
  99387. HTTPStatusCode: res.StatusCode,
  99388. },
  99389. }
  99390. target := &ret
  99391. if err := gensupport.DecodeResponse(target, res); err != nil {
  99392. return nil, err
  99393. }
  99394. return ret, nil
  99395. // {
  99396. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  99397. // "httpMethod": "DELETE",
  99398. // "id": "compute.regionInstanceGroupManagers.delete",
  99399. // "parameterOrder": [
  99400. // "project",
  99401. // "region",
  99402. // "instanceGroupManager"
  99403. // ],
  99404. // "parameters": {
  99405. // "instanceGroupManager": {
  99406. // "description": "Name of the managed instance group to delete.",
  99407. // "location": "path",
  99408. // "required": true,
  99409. // "type": "string"
  99410. // },
  99411. // "project": {
  99412. // "description": "Project ID for this request.",
  99413. // "location": "path",
  99414. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99415. // "required": true,
  99416. // "type": "string"
  99417. // },
  99418. // "region": {
  99419. // "description": "Name of the region scoping this request.",
  99420. // "location": "path",
  99421. // "required": true,
  99422. // "type": "string"
  99423. // },
  99424. // "requestId": {
  99425. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99426. // "location": "query",
  99427. // "type": "string"
  99428. // }
  99429. // },
  99430. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  99431. // "response": {
  99432. // "$ref": "Operation"
  99433. // },
  99434. // "scopes": [
  99435. // "https://www.googleapis.com/auth/cloud-platform",
  99436. // "https://www.googleapis.com/auth/compute"
  99437. // ]
  99438. // }
  99439. }
  99440. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  99441. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  99442. s *Service
  99443. project string
  99444. region string
  99445. instanceGroupManager string
  99446. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  99447. urlParams_ gensupport.URLParams
  99448. ctx_ context.Context
  99449. header_ http.Header
  99450. }
  99451. // DeleteInstances: Flags the specified instances in the managed
  99452. // instance group to be immediately deleted. The instances are also
  99453. // removed from any target pools of which they were a member. This
  99454. // method reduces the targetSize of the managed instance group by the
  99455. // number of instances that you delete. The deleteInstances operation is
  99456. // marked DONE if the deleteInstances request is successful. The
  99457. // underlying actions take additional time. You must separately verify
  99458. // the status of the deleting action with the listmanagedinstances
  99459. // method.
  99460. //
  99461. // If the group is part of a backend service that has enabled connection
  99462. // draining, it can take up to 60 seconds after the connection draining
  99463. // duration has elapsed before the VM instance is removed or
  99464. // deleted.
  99465. //
  99466. // You can specify a maximum of 1000 instances with this method per
  99467. // request.
  99468. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  99469. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99470. c.project = project
  99471. c.region = region
  99472. c.instanceGroupManager = instanceGroupManager
  99473. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  99474. return c
  99475. }
  99476. // RequestId sets the optional parameter "requestId": An optional
  99477. // request ID to identify requests. Specify a unique request ID so that
  99478. // if you must retry your request, the server will know to ignore the
  99479. // request if it has already been completed.
  99480. //
  99481. // For example, consider a situation where you make an initial request
  99482. // and the request times out. If you make the request again with the
  99483. // same request ID, the server can check if original operation with the
  99484. // same request ID was received, and if so, will ignore the second
  99485. // request. This prevents clients from accidentally creating duplicate
  99486. // commitments.
  99487. //
  99488. // The request ID must be a valid UUID with the exception that zero UUID
  99489. // is not supported (00000000-0000-0000-0000-000000000000).
  99490. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  99491. c.urlParams_.Set("requestId", requestId)
  99492. return c
  99493. }
  99494. // Fields allows partial responses to be retrieved. See
  99495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99496. // for more information.
  99497. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  99498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99499. return c
  99500. }
  99501. // Context sets the context to be used in this call's Do method. Any
  99502. // pending HTTP request will be aborted if the provided context is
  99503. // canceled.
  99504. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  99505. c.ctx_ = ctx
  99506. return c
  99507. }
  99508. // Header returns an http.Header that can be modified by the caller to
  99509. // add HTTP headers to the request.
  99510. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  99511. if c.header_ == nil {
  99512. c.header_ = make(http.Header)
  99513. }
  99514. return c.header_
  99515. }
  99516. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  99517. reqHeaders := make(http.Header)
  99518. for k, v := range c.header_ {
  99519. reqHeaders[k] = v
  99520. }
  99521. reqHeaders.Set("User-Agent", c.s.userAgent())
  99522. var body io.Reader = nil
  99523. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  99524. if err != nil {
  99525. return nil, err
  99526. }
  99527. reqHeaders.Set("Content-Type", "application/json")
  99528. c.urlParams_.Set("alt", alt)
  99529. c.urlParams_.Set("prettyPrint", "false")
  99530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  99531. urls += "?" + c.urlParams_.Encode()
  99532. req, err := http.NewRequest("POST", urls, body)
  99533. if err != nil {
  99534. return nil, err
  99535. }
  99536. req.Header = reqHeaders
  99537. googleapi.Expand(req.URL, map[string]string{
  99538. "project": c.project,
  99539. "region": c.region,
  99540. "instanceGroupManager": c.instanceGroupManager,
  99541. })
  99542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99543. }
  99544. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  99545. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99546. // status code is an error. Response headers are in either
  99547. // *Operation.ServerResponse.Header or (if a response was returned at
  99548. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99549. // to check whether the returned error was because
  99550. // http.StatusNotModified was returned.
  99551. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99552. gensupport.SetOptions(c.urlParams_, opts...)
  99553. res, err := c.doRequest("json")
  99554. if res != nil && res.StatusCode == http.StatusNotModified {
  99555. if res.Body != nil {
  99556. res.Body.Close()
  99557. }
  99558. return nil, &googleapi.Error{
  99559. Code: res.StatusCode,
  99560. Header: res.Header,
  99561. }
  99562. }
  99563. if err != nil {
  99564. return nil, err
  99565. }
  99566. defer googleapi.CloseBody(res)
  99567. if err := googleapi.CheckResponse(res); err != nil {
  99568. return nil, err
  99569. }
  99570. ret := &Operation{
  99571. ServerResponse: googleapi.ServerResponse{
  99572. Header: res.Header,
  99573. HTTPStatusCode: res.StatusCode,
  99574. },
  99575. }
  99576. target := &ret
  99577. if err := gensupport.DecodeResponse(target, res); err != nil {
  99578. return nil, err
  99579. }
  99580. return ret, nil
  99581. // {
  99582. // "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.",
  99583. // "httpMethod": "POST",
  99584. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  99585. // "parameterOrder": [
  99586. // "project",
  99587. // "region",
  99588. // "instanceGroupManager"
  99589. // ],
  99590. // "parameters": {
  99591. // "instanceGroupManager": {
  99592. // "description": "Name of the managed instance group.",
  99593. // "location": "path",
  99594. // "required": true,
  99595. // "type": "string"
  99596. // },
  99597. // "project": {
  99598. // "description": "Project ID for this request.",
  99599. // "location": "path",
  99600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99601. // "required": true,
  99602. // "type": "string"
  99603. // },
  99604. // "region": {
  99605. // "description": "Name of the region scoping this request.",
  99606. // "location": "path",
  99607. // "required": true,
  99608. // "type": "string"
  99609. // },
  99610. // "requestId": {
  99611. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99612. // "location": "query",
  99613. // "type": "string"
  99614. // }
  99615. // },
  99616. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  99617. // "request": {
  99618. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  99619. // },
  99620. // "response": {
  99621. // "$ref": "Operation"
  99622. // },
  99623. // "scopes": [
  99624. // "https://www.googleapis.com/auth/cloud-platform",
  99625. // "https://www.googleapis.com/auth/compute"
  99626. // ]
  99627. // }
  99628. }
  99629. // method id "compute.regionInstanceGroupManagers.deletePerInstanceConfigs":
  99630. type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct {
  99631. s *Service
  99632. project string
  99633. region string
  99634. instanceGroupManager string
  99635. regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq
  99636. urlParams_ gensupport.URLParams
  99637. ctx_ context.Context
  99638. header_ http.Header
  99639. }
  99640. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  99641. // the managed instance group.
  99642. func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  99643. c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99644. c.project = project
  99645. c.region = region
  99646. c.instanceGroupManager = instanceGroupManager
  99647. c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq
  99648. return c
  99649. }
  99650. // Fields allows partial responses to be retrieved. See
  99651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99652. // for more information.
  99653. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  99654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99655. return c
  99656. }
  99657. // Context sets the context to be used in this call's Do method. Any
  99658. // pending HTTP request will be aborted if the provided context is
  99659. // canceled.
  99660. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  99661. c.ctx_ = ctx
  99662. return c
  99663. }
  99664. // Header returns an http.Header that can be modified by the caller to
  99665. // add HTTP headers to the request.
  99666. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  99667. if c.header_ == nil {
  99668. c.header_ = make(http.Header)
  99669. }
  99670. return c.header_
  99671. }
  99672. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  99673. reqHeaders := make(http.Header)
  99674. for k, v := range c.header_ {
  99675. reqHeaders[k] = v
  99676. }
  99677. reqHeaders.Set("User-Agent", c.s.userAgent())
  99678. var body io.Reader = nil
  99679. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq)
  99680. if err != nil {
  99681. return nil, err
  99682. }
  99683. reqHeaders.Set("Content-Type", "application/json")
  99684. c.urlParams_.Set("alt", alt)
  99685. c.urlParams_.Set("prettyPrint", "false")
  99686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  99687. urls += "?" + c.urlParams_.Encode()
  99688. req, err := http.NewRequest("POST", urls, body)
  99689. if err != nil {
  99690. return nil, err
  99691. }
  99692. req.Header = reqHeaders
  99693. googleapi.Expand(req.URL, map[string]string{
  99694. "project": c.project,
  99695. "region": c.region,
  99696. "instanceGroupManager": c.instanceGroupManager,
  99697. })
  99698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99699. }
  99700. // Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call.
  99701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99702. // status code is an error. Response headers are in either
  99703. // *Operation.ServerResponse.Header or (if a response was returned at
  99704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99705. // to check whether the returned error was because
  99706. // http.StatusNotModified was returned.
  99707. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99708. gensupport.SetOptions(c.urlParams_, opts...)
  99709. res, err := c.doRequest("json")
  99710. if res != nil && res.StatusCode == http.StatusNotModified {
  99711. if res.Body != nil {
  99712. res.Body.Close()
  99713. }
  99714. return nil, &googleapi.Error{
  99715. Code: res.StatusCode,
  99716. Header: res.Header,
  99717. }
  99718. }
  99719. if err != nil {
  99720. return nil, err
  99721. }
  99722. defer googleapi.CloseBody(res)
  99723. if err := googleapi.CheckResponse(res); err != nil {
  99724. return nil, err
  99725. }
  99726. ret := &Operation{
  99727. ServerResponse: googleapi.ServerResponse{
  99728. Header: res.Header,
  99729. HTTPStatusCode: res.StatusCode,
  99730. },
  99731. }
  99732. target := &ret
  99733. if err := gensupport.DecodeResponse(target, res); err != nil {
  99734. return nil, err
  99735. }
  99736. return ret, nil
  99737. // {
  99738. // "description": "Deletes selected per-instance configs for the managed instance group.",
  99739. // "httpMethod": "POST",
  99740. // "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs",
  99741. // "parameterOrder": [
  99742. // "project",
  99743. // "region",
  99744. // "instanceGroupManager"
  99745. // ],
  99746. // "parameters": {
  99747. // "instanceGroupManager": {
  99748. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  99749. // "location": "path",
  99750. // "required": true,
  99751. // "type": "string"
  99752. // },
  99753. // "project": {
  99754. // "description": "Project ID for this request.",
  99755. // "location": "path",
  99756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99757. // "required": true,
  99758. // "type": "string"
  99759. // },
  99760. // "region": {
  99761. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  99762. // "location": "path",
  99763. // "required": true,
  99764. // "type": "string"
  99765. // }
  99766. // },
  99767. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  99768. // "request": {
  99769. // "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq"
  99770. // },
  99771. // "response": {
  99772. // "$ref": "Operation"
  99773. // },
  99774. // "scopes": [
  99775. // "https://www.googleapis.com/auth/cloud-platform",
  99776. // "https://www.googleapis.com/auth/compute"
  99777. // ]
  99778. // }
  99779. }
  99780. // method id "compute.regionInstanceGroupManagers.get":
  99781. type RegionInstanceGroupManagersGetCall struct {
  99782. s *Service
  99783. project string
  99784. region string
  99785. instanceGroupManager string
  99786. urlParams_ gensupport.URLParams
  99787. ifNoneMatch_ string
  99788. ctx_ context.Context
  99789. header_ http.Header
  99790. }
  99791. // Get: Returns all of the details about the specified managed instance
  99792. // group.
  99793. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  99794. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99795. c.project = project
  99796. c.region = region
  99797. c.instanceGroupManager = instanceGroupManager
  99798. return c
  99799. }
  99800. // Fields allows partial responses to be retrieved. See
  99801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99802. // for more information.
  99803. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  99804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99805. return c
  99806. }
  99807. // IfNoneMatch sets the optional parameter which makes the operation
  99808. // fail if the object's ETag matches the given value. This is useful for
  99809. // getting updates only after the object has changed since the last
  99810. // request. Use googleapi.IsNotModified to check whether the response
  99811. // error from Do is the result of In-None-Match.
  99812. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  99813. c.ifNoneMatch_ = entityTag
  99814. return c
  99815. }
  99816. // Context sets the context to be used in this call's Do method. Any
  99817. // pending HTTP request will be aborted if the provided context is
  99818. // canceled.
  99819. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  99820. c.ctx_ = ctx
  99821. return c
  99822. }
  99823. // Header returns an http.Header that can be modified by the caller to
  99824. // add HTTP headers to the request.
  99825. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  99826. if c.header_ == nil {
  99827. c.header_ = make(http.Header)
  99828. }
  99829. return c.header_
  99830. }
  99831. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  99832. reqHeaders := make(http.Header)
  99833. for k, v := range c.header_ {
  99834. reqHeaders[k] = v
  99835. }
  99836. reqHeaders.Set("User-Agent", c.s.userAgent())
  99837. if c.ifNoneMatch_ != "" {
  99838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99839. }
  99840. var body io.Reader = nil
  99841. c.urlParams_.Set("alt", alt)
  99842. c.urlParams_.Set("prettyPrint", "false")
  99843. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  99844. urls += "?" + c.urlParams_.Encode()
  99845. req, err := http.NewRequest("GET", urls, body)
  99846. if err != nil {
  99847. return nil, err
  99848. }
  99849. req.Header = reqHeaders
  99850. googleapi.Expand(req.URL, map[string]string{
  99851. "project": c.project,
  99852. "region": c.region,
  99853. "instanceGroupManager": c.instanceGroupManager,
  99854. })
  99855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99856. }
  99857. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  99858. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  99859. // non-2xx status code is an error. Response headers are in either
  99860. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  99861. // returned at all) in error.(*googleapi.Error).Header. Use
  99862. // googleapi.IsNotModified to check whether the returned error was
  99863. // because http.StatusNotModified was returned.
  99864. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  99865. gensupport.SetOptions(c.urlParams_, opts...)
  99866. res, err := c.doRequest("json")
  99867. if res != nil && res.StatusCode == http.StatusNotModified {
  99868. if res.Body != nil {
  99869. res.Body.Close()
  99870. }
  99871. return nil, &googleapi.Error{
  99872. Code: res.StatusCode,
  99873. Header: res.Header,
  99874. }
  99875. }
  99876. if err != nil {
  99877. return nil, err
  99878. }
  99879. defer googleapi.CloseBody(res)
  99880. if err := googleapi.CheckResponse(res); err != nil {
  99881. return nil, err
  99882. }
  99883. ret := &InstanceGroupManager{
  99884. ServerResponse: googleapi.ServerResponse{
  99885. Header: res.Header,
  99886. HTTPStatusCode: res.StatusCode,
  99887. },
  99888. }
  99889. target := &ret
  99890. if err := gensupport.DecodeResponse(target, res); err != nil {
  99891. return nil, err
  99892. }
  99893. return ret, nil
  99894. // {
  99895. // "description": "Returns all of the details about the specified managed instance group.",
  99896. // "httpMethod": "GET",
  99897. // "id": "compute.regionInstanceGroupManagers.get",
  99898. // "parameterOrder": [
  99899. // "project",
  99900. // "region",
  99901. // "instanceGroupManager"
  99902. // ],
  99903. // "parameters": {
  99904. // "instanceGroupManager": {
  99905. // "description": "Name of the managed instance group to return.",
  99906. // "location": "path",
  99907. // "required": true,
  99908. // "type": "string"
  99909. // },
  99910. // "project": {
  99911. // "description": "Project ID for this request.",
  99912. // "location": "path",
  99913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99914. // "required": true,
  99915. // "type": "string"
  99916. // },
  99917. // "region": {
  99918. // "description": "Name of the region scoping this request.",
  99919. // "location": "path",
  99920. // "required": true,
  99921. // "type": "string"
  99922. // }
  99923. // },
  99924. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  99925. // "response": {
  99926. // "$ref": "InstanceGroupManager"
  99927. // },
  99928. // "scopes": [
  99929. // "https://www.googleapis.com/auth/cloud-platform",
  99930. // "https://www.googleapis.com/auth/compute",
  99931. // "https://www.googleapis.com/auth/compute.readonly"
  99932. // ]
  99933. // }
  99934. }
  99935. // method id "compute.regionInstanceGroupManagers.insert":
  99936. type RegionInstanceGroupManagersInsertCall struct {
  99937. s *Service
  99938. project string
  99939. region string
  99940. instancegroupmanager *InstanceGroupManager
  99941. urlParams_ gensupport.URLParams
  99942. ctx_ context.Context
  99943. header_ http.Header
  99944. }
  99945. // Insert: Creates a managed instance group using the information that
  99946. // you specify in the request. After the group is created, instances in
  99947. // the group are created using the specified instance template. This
  99948. // operation is marked as DONE when the group is created even if the
  99949. // instances in the group have not yet been created. You must separately
  99950. // verify the status of the individual instances with the
  99951. // listmanagedinstances method.
  99952. //
  99953. // A regional managed instance group can contain up to 2000 instances.
  99954. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  99955. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99956. c.project = project
  99957. c.region = region
  99958. c.instancegroupmanager = instancegroupmanager
  99959. return c
  99960. }
  99961. // RequestId sets the optional parameter "requestId": An optional
  99962. // request ID to identify requests. Specify a unique request ID so that
  99963. // if you must retry your request, the server will know to ignore the
  99964. // request if it has already been completed.
  99965. //
  99966. // For example, consider a situation where you make an initial request
  99967. // and the request times out. If you make the request again with the
  99968. // same request ID, the server can check if original operation with the
  99969. // same request ID was received, and if so, will ignore the second
  99970. // request. This prevents clients from accidentally creating duplicate
  99971. // commitments.
  99972. //
  99973. // The request ID must be a valid UUID with the exception that zero UUID
  99974. // is not supported (00000000-0000-0000-0000-000000000000).
  99975. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  99976. c.urlParams_.Set("requestId", requestId)
  99977. return c
  99978. }
  99979. // Fields allows partial responses to be retrieved. See
  99980. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99981. // for more information.
  99982. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  99983. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99984. return c
  99985. }
  99986. // Context sets the context to be used in this call's Do method. Any
  99987. // pending HTTP request will be aborted if the provided context is
  99988. // canceled.
  99989. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  99990. c.ctx_ = ctx
  99991. return c
  99992. }
  99993. // Header returns an http.Header that can be modified by the caller to
  99994. // add HTTP headers to the request.
  99995. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  99996. if c.header_ == nil {
  99997. c.header_ = make(http.Header)
  99998. }
  99999. return c.header_
  100000. }
  100001. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  100002. reqHeaders := make(http.Header)
  100003. for k, v := range c.header_ {
  100004. reqHeaders[k] = v
  100005. }
  100006. reqHeaders.Set("User-Agent", c.s.userAgent())
  100007. var body io.Reader = nil
  100008. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  100009. if err != nil {
  100010. return nil, err
  100011. }
  100012. reqHeaders.Set("Content-Type", "application/json")
  100013. c.urlParams_.Set("alt", alt)
  100014. c.urlParams_.Set("prettyPrint", "false")
  100015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  100016. urls += "?" + c.urlParams_.Encode()
  100017. req, err := http.NewRequest("POST", urls, body)
  100018. if err != nil {
  100019. return nil, err
  100020. }
  100021. req.Header = reqHeaders
  100022. googleapi.Expand(req.URL, map[string]string{
  100023. "project": c.project,
  100024. "region": c.region,
  100025. })
  100026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100027. }
  100028. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  100029. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100030. // status code is an error. Response headers are in either
  100031. // *Operation.ServerResponse.Header or (if a response was returned at
  100032. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100033. // to check whether the returned error was because
  100034. // http.StatusNotModified was returned.
  100035. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100036. gensupport.SetOptions(c.urlParams_, opts...)
  100037. res, err := c.doRequest("json")
  100038. if res != nil && res.StatusCode == http.StatusNotModified {
  100039. if res.Body != nil {
  100040. res.Body.Close()
  100041. }
  100042. return nil, &googleapi.Error{
  100043. Code: res.StatusCode,
  100044. Header: res.Header,
  100045. }
  100046. }
  100047. if err != nil {
  100048. return nil, err
  100049. }
  100050. defer googleapi.CloseBody(res)
  100051. if err := googleapi.CheckResponse(res); err != nil {
  100052. return nil, err
  100053. }
  100054. ret := &Operation{
  100055. ServerResponse: googleapi.ServerResponse{
  100056. Header: res.Header,
  100057. HTTPStatusCode: res.StatusCode,
  100058. },
  100059. }
  100060. target := &ret
  100061. if err := gensupport.DecodeResponse(target, res); err != nil {
  100062. return nil, err
  100063. }
  100064. return ret, nil
  100065. // {
  100066. // "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.",
  100067. // "httpMethod": "POST",
  100068. // "id": "compute.regionInstanceGroupManagers.insert",
  100069. // "parameterOrder": [
  100070. // "project",
  100071. // "region"
  100072. // ],
  100073. // "parameters": {
  100074. // "project": {
  100075. // "description": "Project ID for this request.",
  100076. // "location": "path",
  100077. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100078. // "required": true,
  100079. // "type": "string"
  100080. // },
  100081. // "region": {
  100082. // "description": "Name of the region scoping this request.",
  100083. // "location": "path",
  100084. // "required": true,
  100085. // "type": "string"
  100086. // },
  100087. // "requestId": {
  100088. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100089. // "location": "query",
  100090. // "type": "string"
  100091. // }
  100092. // },
  100093. // "path": "{project}/regions/{region}/instanceGroupManagers",
  100094. // "request": {
  100095. // "$ref": "InstanceGroupManager"
  100096. // },
  100097. // "response": {
  100098. // "$ref": "Operation"
  100099. // },
  100100. // "scopes": [
  100101. // "https://www.googleapis.com/auth/cloud-platform",
  100102. // "https://www.googleapis.com/auth/compute"
  100103. // ]
  100104. // }
  100105. }
  100106. // method id "compute.regionInstanceGroupManagers.list":
  100107. type RegionInstanceGroupManagersListCall struct {
  100108. s *Service
  100109. project string
  100110. region string
  100111. urlParams_ gensupport.URLParams
  100112. ifNoneMatch_ string
  100113. ctx_ context.Context
  100114. header_ http.Header
  100115. }
  100116. // List: Retrieves the list of managed instance groups that are
  100117. // contained within the specified region.
  100118. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  100119. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100120. c.project = project
  100121. c.region = region
  100122. return c
  100123. }
  100124. // Filter sets the optional parameter "filter": A filter expression that
  100125. // filters resources listed in the response. The expression must specify
  100126. // the field name, a comparison operator, and the value that you want to
  100127. // use for filtering. The value must be a string, a number, or a
  100128. // boolean. The comparison operator must be either =, !=, >, or <.
  100129. //
  100130. // For example, if you are filtering Compute Engine instances, you can
  100131. // exclude instances named example-instance by specifying name !=
  100132. // example-instance.
  100133. //
  100134. // You can also filter nested fields. For example, you could specify
  100135. // scheduling.automaticRestart = false to include instances only if they
  100136. // are not scheduled for automatic restarts. You can use filtering on
  100137. // nested fields to filter based on resource labels.
  100138. //
  100139. // To filter on multiple expressions, provide each separate expression
  100140. // within parentheses. For example, (scheduling.automaticRestart = true)
  100141. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100142. // AND expression. However, you can include AND and OR expressions
  100143. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100144. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100145. // true).
  100146. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  100147. c.urlParams_.Set("filter", filter)
  100148. return c
  100149. }
  100150. // MaxResults sets the optional parameter "maxResults": The maximum
  100151. // number of results per page that should be returned. If the number of
  100152. // available results is larger than maxResults, Compute Engine returns a
  100153. // nextPageToken that can be used to get the next page of results in
  100154. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100155. // (Default: 500)
  100156. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  100157. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100158. return c
  100159. }
  100160. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100161. // a certain order. By default, results are returned in alphanumerical
  100162. // order based on the resource name.
  100163. //
  100164. // You can also sort results in descending order based on the creation
  100165. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100166. // based on the creationTimestamp field in reverse chronological order
  100167. // (newest result first). Use this to sort resources like operations so
  100168. // that the newest operation is returned first.
  100169. //
  100170. // Currently, only sorting by name or creationTimestamp desc is
  100171. // supported.
  100172. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  100173. c.urlParams_.Set("orderBy", orderBy)
  100174. return c
  100175. }
  100176. // PageToken sets the optional parameter "pageToken": Specifies a page
  100177. // token to use. Set pageToken to the nextPageToken returned by a
  100178. // previous list request to get the next page of results.
  100179. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  100180. c.urlParams_.Set("pageToken", pageToken)
  100181. return c
  100182. }
  100183. // Fields allows partial responses to be retrieved. See
  100184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100185. // for more information.
  100186. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  100187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100188. return c
  100189. }
  100190. // IfNoneMatch sets the optional parameter which makes the operation
  100191. // fail if the object's ETag matches the given value. This is useful for
  100192. // getting updates only after the object has changed since the last
  100193. // request. Use googleapi.IsNotModified to check whether the response
  100194. // error from Do is the result of In-None-Match.
  100195. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  100196. c.ifNoneMatch_ = entityTag
  100197. return c
  100198. }
  100199. // Context sets the context to be used in this call's Do method. Any
  100200. // pending HTTP request will be aborted if the provided context is
  100201. // canceled.
  100202. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  100203. c.ctx_ = ctx
  100204. return c
  100205. }
  100206. // Header returns an http.Header that can be modified by the caller to
  100207. // add HTTP headers to the request.
  100208. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  100209. if c.header_ == nil {
  100210. c.header_ = make(http.Header)
  100211. }
  100212. return c.header_
  100213. }
  100214. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  100215. reqHeaders := make(http.Header)
  100216. for k, v := range c.header_ {
  100217. reqHeaders[k] = v
  100218. }
  100219. reqHeaders.Set("User-Agent", c.s.userAgent())
  100220. if c.ifNoneMatch_ != "" {
  100221. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100222. }
  100223. var body io.Reader = nil
  100224. c.urlParams_.Set("alt", alt)
  100225. c.urlParams_.Set("prettyPrint", "false")
  100226. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  100227. urls += "?" + c.urlParams_.Encode()
  100228. req, err := http.NewRequest("GET", urls, body)
  100229. if err != nil {
  100230. return nil, err
  100231. }
  100232. req.Header = reqHeaders
  100233. googleapi.Expand(req.URL, map[string]string{
  100234. "project": c.project,
  100235. "region": c.region,
  100236. })
  100237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100238. }
  100239. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  100240. // Exactly one of *RegionInstanceGroupManagerList or error will be
  100241. // non-nil. Any non-2xx status code is an error. Response headers are in
  100242. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  100243. // response was returned at all) in error.(*googleapi.Error).Header. Use
  100244. // googleapi.IsNotModified to check whether the returned error was
  100245. // because http.StatusNotModified was returned.
  100246. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  100247. gensupport.SetOptions(c.urlParams_, opts...)
  100248. res, err := c.doRequest("json")
  100249. if res != nil && res.StatusCode == http.StatusNotModified {
  100250. if res.Body != nil {
  100251. res.Body.Close()
  100252. }
  100253. return nil, &googleapi.Error{
  100254. Code: res.StatusCode,
  100255. Header: res.Header,
  100256. }
  100257. }
  100258. if err != nil {
  100259. return nil, err
  100260. }
  100261. defer googleapi.CloseBody(res)
  100262. if err := googleapi.CheckResponse(res); err != nil {
  100263. return nil, err
  100264. }
  100265. ret := &RegionInstanceGroupManagerList{
  100266. ServerResponse: googleapi.ServerResponse{
  100267. Header: res.Header,
  100268. HTTPStatusCode: res.StatusCode,
  100269. },
  100270. }
  100271. target := &ret
  100272. if err := gensupport.DecodeResponse(target, res); err != nil {
  100273. return nil, err
  100274. }
  100275. return ret, nil
  100276. // {
  100277. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  100278. // "httpMethod": "GET",
  100279. // "id": "compute.regionInstanceGroupManagers.list",
  100280. // "parameterOrder": [
  100281. // "project",
  100282. // "region"
  100283. // ],
  100284. // "parameters": {
  100285. // "filter": {
  100286. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100287. // "location": "query",
  100288. // "type": "string"
  100289. // },
  100290. // "maxResults": {
  100291. // "default": "500",
  100292. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100293. // "format": "uint32",
  100294. // "location": "query",
  100295. // "minimum": "0",
  100296. // "type": "integer"
  100297. // },
  100298. // "orderBy": {
  100299. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100300. // "location": "query",
  100301. // "type": "string"
  100302. // },
  100303. // "pageToken": {
  100304. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100305. // "location": "query",
  100306. // "type": "string"
  100307. // },
  100308. // "project": {
  100309. // "description": "Project ID for this request.",
  100310. // "location": "path",
  100311. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100312. // "required": true,
  100313. // "type": "string"
  100314. // },
  100315. // "region": {
  100316. // "description": "Name of the region scoping this request.",
  100317. // "location": "path",
  100318. // "required": true,
  100319. // "type": "string"
  100320. // }
  100321. // },
  100322. // "path": "{project}/regions/{region}/instanceGroupManagers",
  100323. // "response": {
  100324. // "$ref": "RegionInstanceGroupManagerList"
  100325. // },
  100326. // "scopes": [
  100327. // "https://www.googleapis.com/auth/cloud-platform",
  100328. // "https://www.googleapis.com/auth/compute",
  100329. // "https://www.googleapis.com/auth/compute.readonly"
  100330. // ]
  100331. // }
  100332. }
  100333. // Pages invokes f for each page of results.
  100334. // A non-nil error returned from f will halt the iteration.
  100335. // The provided context supersedes any context provided to the Context method.
  100336. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  100337. c.ctx_ = ctx
  100338. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100339. for {
  100340. x, err := c.Do()
  100341. if err != nil {
  100342. return err
  100343. }
  100344. if err := f(x); err != nil {
  100345. return err
  100346. }
  100347. if x.NextPageToken == "" {
  100348. return nil
  100349. }
  100350. c.PageToken(x.NextPageToken)
  100351. }
  100352. }
  100353. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  100354. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  100355. s *Service
  100356. project string
  100357. region string
  100358. instanceGroupManager string
  100359. urlParams_ gensupport.URLParams
  100360. ctx_ context.Context
  100361. header_ http.Header
  100362. }
  100363. // ListManagedInstances: Lists the instances in the managed instance
  100364. // group and instances that are scheduled to be created. The list
  100365. // includes any current actions that the group has scheduled for its
  100366. // instances.
  100367. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  100368. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100369. c.project = project
  100370. c.region = region
  100371. c.instanceGroupManager = instanceGroupManager
  100372. return c
  100373. }
  100374. // Filter sets the optional parameter "filter": A filter expression that
  100375. // filters resources listed in the response. The expression must specify
  100376. // the field name, a comparison operator, and the value that you want to
  100377. // use for filtering. The value must be a string, a number, or a
  100378. // boolean. The comparison operator must be either =, !=, >, or <.
  100379. //
  100380. // For example, if you are filtering Compute Engine instances, you can
  100381. // exclude instances named example-instance by specifying name !=
  100382. // example-instance.
  100383. //
  100384. // You can also filter nested fields. For example, you could specify
  100385. // scheduling.automaticRestart = false to include instances only if they
  100386. // are not scheduled for automatic restarts. You can use filtering on
  100387. // nested fields to filter based on resource labels.
  100388. //
  100389. // To filter on multiple expressions, provide each separate expression
  100390. // within parentheses. For example, (scheduling.automaticRestart = true)
  100391. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100392. // AND expression. However, you can include AND and OR expressions
  100393. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100394. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100395. // true).
  100396. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  100397. c.urlParams_.Set("filter", filter)
  100398. return c
  100399. }
  100400. // MaxResults sets the optional parameter "maxResults": The maximum
  100401. // number of results per page that should be returned. If the number of
  100402. // available results is larger than maxResults, Compute Engine returns a
  100403. // nextPageToken that can be used to get the next page of results in
  100404. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100405. // (Default: 500)
  100406. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  100407. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100408. return c
  100409. }
  100410. // OrderBy sets the optional parameter "order_by": Sorts list results by
  100411. // a certain order. By default, results are returned in alphanumerical
  100412. // order based on the resource name.
  100413. //
  100414. // You can also sort results in descending order based on the creation
  100415. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100416. // based on the creationTimestamp field in reverse chronological order
  100417. // (newest result first). Use this to sort resources like operations so
  100418. // that the newest operation is returned first.
  100419. //
  100420. // Currently, only sorting by name or creationTimestamp desc is
  100421. // supported.
  100422. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  100423. c.urlParams_.Set("order_by", orderBy)
  100424. return c
  100425. }
  100426. // PageToken sets the optional parameter "pageToken": Specifies a page
  100427. // token to use. Set pageToken to the nextPageToken returned by a
  100428. // previous list request to get the next page of results.
  100429. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  100430. c.urlParams_.Set("pageToken", pageToken)
  100431. return c
  100432. }
  100433. // Fields allows partial responses to be retrieved. See
  100434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100435. // for more information.
  100436. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  100437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100438. return c
  100439. }
  100440. // Context sets the context to be used in this call's Do method. Any
  100441. // pending HTTP request will be aborted if the provided context is
  100442. // canceled.
  100443. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  100444. c.ctx_ = ctx
  100445. return c
  100446. }
  100447. // Header returns an http.Header that can be modified by the caller to
  100448. // add HTTP headers to the request.
  100449. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  100450. if c.header_ == nil {
  100451. c.header_ = make(http.Header)
  100452. }
  100453. return c.header_
  100454. }
  100455. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  100456. reqHeaders := make(http.Header)
  100457. for k, v := range c.header_ {
  100458. reqHeaders[k] = v
  100459. }
  100460. reqHeaders.Set("User-Agent", c.s.userAgent())
  100461. var body io.Reader = nil
  100462. c.urlParams_.Set("alt", alt)
  100463. c.urlParams_.Set("prettyPrint", "false")
  100464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  100465. urls += "?" + c.urlParams_.Encode()
  100466. req, err := http.NewRequest("POST", urls, body)
  100467. if err != nil {
  100468. return nil, err
  100469. }
  100470. req.Header = reqHeaders
  100471. googleapi.Expand(req.URL, map[string]string{
  100472. "project": c.project,
  100473. "region": c.region,
  100474. "instanceGroupManager": c.instanceGroupManager,
  100475. })
  100476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100477. }
  100478. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  100479. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  100480. // error will be non-nil. Any non-2xx status code is an error. Response
  100481. // headers are in either
  100482. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  100483. // r or (if a response was returned at all) in
  100484. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  100485. // whether the returned error was because http.StatusNotModified was
  100486. // returned.
  100487. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  100488. gensupport.SetOptions(c.urlParams_, opts...)
  100489. res, err := c.doRequest("json")
  100490. if res != nil && res.StatusCode == http.StatusNotModified {
  100491. if res.Body != nil {
  100492. res.Body.Close()
  100493. }
  100494. return nil, &googleapi.Error{
  100495. Code: res.StatusCode,
  100496. Header: res.Header,
  100497. }
  100498. }
  100499. if err != nil {
  100500. return nil, err
  100501. }
  100502. defer googleapi.CloseBody(res)
  100503. if err := googleapi.CheckResponse(res); err != nil {
  100504. return nil, err
  100505. }
  100506. ret := &RegionInstanceGroupManagersListInstancesResponse{
  100507. ServerResponse: googleapi.ServerResponse{
  100508. Header: res.Header,
  100509. HTTPStatusCode: res.StatusCode,
  100510. },
  100511. }
  100512. target := &ret
  100513. if err := gensupport.DecodeResponse(target, res); err != nil {
  100514. return nil, err
  100515. }
  100516. return ret, nil
  100517. // {
  100518. // "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.",
  100519. // "httpMethod": "POST",
  100520. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  100521. // "parameterOrder": [
  100522. // "project",
  100523. // "region",
  100524. // "instanceGroupManager"
  100525. // ],
  100526. // "parameters": {
  100527. // "filter": {
  100528. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100529. // "location": "query",
  100530. // "type": "string"
  100531. // },
  100532. // "instanceGroupManager": {
  100533. // "description": "The name of the managed instance group.",
  100534. // "location": "path",
  100535. // "required": true,
  100536. // "type": "string"
  100537. // },
  100538. // "maxResults": {
  100539. // "default": "500",
  100540. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100541. // "format": "uint32",
  100542. // "location": "query",
  100543. // "minimum": "0",
  100544. // "type": "integer"
  100545. // },
  100546. // "order_by": {
  100547. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100548. // "location": "query",
  100549. // "type": "string"
  100550. // },
  100551. // "pageToken": {
  100552. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100553. // "location": "query",
  100554. // "type": "string"
  100555. // },
  100556. // "project": {
  100557. // "description": "Project ID for this request.",
  100558. // "location": "path",
  100559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100560. // "required": true,
  100561. // "type": "string"
  100562. // },
  100563. // "region": {
  100564. // "description": "Name of the region scoping this request.",
  100565. // "location": "path",
  100566. // "required": true,
  100567. // "type": "string"
  100568. // }
  100569. // },
  100570. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  100571. // "response": {
  100572. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  100573. // },
  100574. // "scopes": [
  100575. // "https://www.googleapis.com/auth/cloud-platform",
  100576. // "https://www.googleapis.com/auth/compute",
  100577. // "https://www.googleapis.com/auth/compute.readonly"
  100578. // ]
  100579. // }
  100580. }
  100581. // Pages invokes f for each page of results.
  100582. // A non-nil error returned from f will halt the iteration.
  100583. // The provided context supersedes any context provided to the Context method.
  100584. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  100585. c.ctx_ = ctx
  100586. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100587. for {
  100588. x, err := c.Do()
  100589. if err != nil {
  100590. return err
  100591. }
  100592. if err := f(x); err != nil {
  100593. return err
  100594. }
  100595. if x.NextPageToken == "" {
  100596. return nil
  100597. }
  100598. c.PageToken(x.NextPageToken)
  100599. }
  100600. }
  100601. // method id "compute.regionInstanceGroupManagers.listPerInstanceConfigs":
  100602. type RegionInstanceGroupManagersListPerInstanceConfigsCall struct {
  100603. s *Service
  100604. project string
  100605. region string
  100606. instanceGroupManager string
  100607. urlParams_ gensupport.URLParams
  100608. ctx_ context.Context
  100609. header_ http.Header
  100610. }
  100611. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  100612. // for the managed instance group.
  100613. func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100614. c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100615. c.project = project
  100616. c.region = region
  100617. c.instanceGroupManager = instanceGroupManager
  100618. return c
  100619. }
  100620. // Filter sets the optional parameter "filter": A filter expression that
  100621. // filters resources listed in the response. The expression must specify
  100622. // the field name, a comparison operator, and the value that you want to
  100623. // use for filtering. The value must be a string, a number, or a
  100624. // boolean. The comparison operator must be either =, !=, >, or <.
  100625. //
  100626. // For example, if you are filtering Compute Engine instances, you can
  100627. // exclude instances named example-instance by specifying name !=
  100628. // example-instance.
  100629. //
  100630. // You can also filter nested fields. For example, you could specify
  100631. // scheduling.automaticRestart = false to include instances only if they
  100632. // are not scheduled for automatic restarts. You can use filtering on
  100633. // nested fields to filter based on resource labels.
  100634. //
  100635. // To filter on multiple expressions, provide each separate expression
  100636. // within parentheses. For example, (scheduling.automaticRestart = true)
  100637. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100638. // AND expression. However, you can include AND and OR expressions
  100639. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100640. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100641. // true).
  100642. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100643. c.urlParams_.Set("filter", filter)
  100644. return c
  100645. }
  100646. // MaxResults sets the optional parameter "maxResults": The maximum
  100647. // number of results per page that should be returned. If the number of
  100648. // available results is larger than maxResults, Compute Engine returns a
  100649. // nextPageToken that can be used to get the next page of results in
  100650. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100651. // (Default: 500)
  100652. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100653. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100654. return c
  100655. }
  100656. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100657. // a certain order. By default, results are returned in alphanumerical
  100658. // order based on the resource name.
  100659. //
  100660. // You can also sort results in descending order based on the creation
  100661. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100662. // based on the creationTimestamp field in reverse chronological order
  100663. // (newest result first). Use this to sort resources like operations so
  100664. // that the newest operation is returned first.
  100665. //
  100666. // Currently, only sorting by name or creationTimestamp desc is
  100667. // supported.
  100668. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100669. c.urlParams_.Set("orderBy", orderBy)
  100670. return c
  100671. }
  100672. // PageToken sets the optional parameter "pageToken": Specifies a page
  100673. // token to use. Set pageToken to the nextPageToken returned by a
  100674. // previous list request to get the next page of results.
  100675. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100676. c.urlParams_.Set("pageToken", pageToken)
  100677. return c
  100678. }
  100679. // Fields allows partial responses to be retrieved. See
  100680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100681. // for more information.
  100682. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100684. return c
  100685. }
  100686. // Context sets the context to be used in this call's Do method. Any
  100687. // pending HTTP request will be aborted if the provided context is
  100688. // canceled.
  100689. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  100690. c.ctx_ = ctx
  100691. return c
  100692. }
  100693. // Header returns an http.Header that can be modified by the caller to
  100694. // add HTTP headers to the request.
  100695. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  100696. if c.header_ == nil {
  100697. c.header_ = make(http.Header)
  100698. }
  100699. return c.header_
  100700. }
  100701. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  100702. reqHeaders := make(http.Header)
  100703. for k, v := range c.header_ {
  100704. reqHeaders[k] = v
  100705. }
  100706. reqHeaders.Set("User-Agent", c.s.userAgent())
  100707. var body io.Reader = nil
  100708. c.urlParams_.Set("alt", alt)
  100709. c.urlParams_.Set("prettyPrint", "false")
  100710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  100711. urls += "?" + c.urlParams_.Encode()
  100712. req, err := http.NewRequest("POST", urls, body)
  100713. if err != nil {
  100714. return nil, err
  100715. }
  100716. req.Header = reqHeaders
  100717. googleapi.Expand(req.URL, map[string]string{
  100718. "project": c.project,
  100719. "region": c.region,
  100720. "instanceGroupManager": c.instanceGroupManager,
  100721. })
  100722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100723. }
  100724. // Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call.
  100725. // Exactly one of *RegionInstanceGroupManagersListInstanceConfigsResp or
  100726. // error will be non-nil. Any non-2xx status code is an error. Response
  100727. // headers are in either
  100728. // *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Hea
  100729. // der or (if a response was returned at all) in
  100730. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  100731. // whether the returned error was because http.StatusNotModified was
  100732. // returned.
  100733. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) {
  100734. gensupport.SetOptions(c.urlParams_, opts...)
  100735. res, err := c.doRequest("json")
  100736. if res != nil && res.StatusCode == http.StatusNotModified {
  100737. if res.Body != nil {
  100738. res.Body.Close()
  100739. }
  100740. return nil, &googleapi.Error{
  100741. Code: res.StatusCode,
  100742. Header: res.Header,
  100743. }
  100744. }
  100745. if err != nil {
  100746. return nil, err
  100747. }
  100748. defer googleapi.CloseBody(res)
  100749. if err := googleapi.CheckResponse(res); err != nil {
  100750. return nil, err
  100751. }
  100752. ret := &RegionInstanceGroupManagersListInstanceConfigsResp{
  100753. ServerResponse: googleapi.ServerResponse{
  100754. Header: res.Header,
  100755. HTTPStatusCode: res.StatusCode,
  100756. },
  100757. }
  100758. target := &ret
  100759. if err := gensupport.DecodeResponse(target, res); err != nil {
  100760. return nil, err
  100761. }
  100762. return ret, nil
  100763. // {
  100764. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  100765. // "httpMethod": "POST",
  100766. // "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs",
  100767. // "parameterOrder": [
  100768. // "project",
  100769. // "region",
  100770. // "instanceGroupManager"
  100771. // ],
  100772. // "parameters": {
  100773. // "filter": {
  100774. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100775. // "location": "query",
  100776. // "type": "string"
  100777. // },
  100778. // "instanceGroupManager": {
  100779. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  100780. // "location": "path",
  100781. // "required": true,
  100782. // "type": "string"
  100783. // },
  100784. // "maxResults": {
  100785. // "default": "500",
  100786. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100787. // "format": "uint32",
  100788. // "location": "query",
  100789. // "minimum": "0",
  100790. // "type": "integer"
  100791. // },
  100792. // "orderBy": {
  100793. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100794. // "location": "query",
  100795. // "type": "string"
  100796. // },
  100797. // "pageToken": {
  100798. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100799. // "location": "query",
  100800. // "type": "string"
  100801. // },
  100802. // "project": {
  100803. // "description": "Project ID for this request.",
  100804. // "location": "path",
  100805. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100806. // "required": true,
  100807. // "type": "string"
  100808. // },
  100809. // "region": {
  100810. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  100811. // "location": "path",
  100812. // "required": true,
  100813. // "type": "string"
  100814. // }
  100815. // },
  100816. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  100817. // "response": {
  100818. // "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp"
  100819. // },
  100820. // "scopes": [
  100821. // "https://www.googleapis.com/auth/cloud-platform",
  100822. // "https://www.googleapis.com/auth/compute",
  100823. // "https://www.googleapis.com/auth/compute.readonly"
  100824. // ]
  100825. // }
  100826. }
  100827. // Pages invokes f for each page of results.
  100828. // A non-nil error returned from f will halt the iteration.
  100829. // The provided context supersedes any context provided to the Context method.
  100830. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error {
  100831. c.ctx_ = ctx
  100832. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100833. for {
  100834. x, err := c.Do()
  100835. if err != nil {
  100836. return err
  100837. }
  100838. if err := f(x); err != nil {
  100839. return err
  100840. }
  100841. if x.NextPageToken == "" {
  100842. return nil
  100843. }
  100844. c.PageToken(x.NextPageToken)
  100845. }
  100846. }
  100847. // method id "compute.regionInstanceGroupManagers.patch":
  100848. type RegionInstanceGroupManagersPatchCall struct {
  100849. s *Service
  100850. project string
  100851. region string
  100852. instanceGroupManager string
  100853. instancegroupmanager *InstanceGroupManager
  100854. urlParams_ gensupport.URLParams
  100855. ctx_ context.Context
  100856. header_ http.Header
  100857. }
  100858. // Patch: Updates a managed instance group using the information that
  100859. // you specify in the request. This operation is marked as DONE when the
  100860. // group is patched even if the instances in the group are still in the
  100861. // process of being patched. You must separately verify the status of
  100862. // the individual instances with the listmanagedinstances method. This
  100863. // method supports PATCH semantics and uses the JSON merge patch format
  100864. // and processing rules.
  100865. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  100866. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100867. c.project = project
  100868. c.region = region
  100869. c.instanceGroupManager = instanceGroupManager
  100870. c.instancegroupmanager = instancegroupmanager
  100871. return c
  100872. }
  100873. // RequestId sets the optional parameter "requestId": An optional
  100874. // request ID to identify requests. Specify a unique request ID so that
  100875. // if you must retry your request, the server will know to ignore the
  100876. // request if it has already been completed.
  100877. //
  100878. // For example, consider a situation where you make an initial request
  100879. // and the request times out. If you make the request again with the
  100880. // same request ID, the server can check if original operation with the
  100881. // same request ID was received, and if so, will ignore the second
  100882. // request. This prevents clients from accidentally creating duplicate
  100883. // commitments.
  100884. //
  100885. // The request ID must be a valid UUID with the exception that zero UUID
  100886. // is not supported (00000000-0000-0000-0000-000000000000).
  100887. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  100888. c.urlParams_.Set("requestId", requestId)
  100889. return c
  100890. }
  100891. // Fields allows partial responses to be retrieved. See
  100892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100893. // for more information.
  100894. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  100895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100896. return c
  100897. }
  100898. // Context sets the context to be used in this call's Do method. Any
  100899. // pending HTTP request will be aborted if the provided context is
  100900. // canceled.
  100901. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  100902. c.ctx_ = ctx
  100903. return c
  100904. }
  100905. // Header returns an http.Header that can be modified by the caller to
  100906. // add HTTP headers to the request.
  100907. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  100908. if c.header_ == nil {
  100909. c.header_ = make(http.Header)
  100910. }
  100911. return c.header_
  100912. }
  100913. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  100914. reqHeaders := make(http.Header)
  100915. for k, v := range c.header_ {
  100916. reqHeaders[k] = v
  100917. }
  100918. reqHeaders.Set("User-Agent", c.s.userAgent())
  100919. var body io.Reader = nil
  100920. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  100921. if err != nil {
  100922. return nil, err
  100923. }
  100924. reqHeaders.Set("Content-Type", "application/json")
  100925. c.urlParams_.Set("alt", alt)
  100926. c.urlParams_.Set("prettyPrint", "false")
  100927. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  100928. urls += "?" + c.urlParams_.Encode()
  100929. req, err := http.NewRequest("PATCH", urls, body)
  100930. if err != nil {
  100931. return nil, err
  100932. }
  100933. req.Header = reqHeaders
  100934. googleapi.Expand(req.URL, map[string]string{
  100935. "project": c.project,
  100936. "region": c.region,
  100937. "instanceGroupManager": c.instanceGroupManager,
  100938. })
  100939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100940. }
  100941. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  100942. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100943. // status code is an error. Response headers are in either
  100944. // *Operation.ServerResponse.Header or (if a response was returned at
  100945. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100946. // to check whether the returned error was because
  100947. // http.StatusNotModified was returned.
  100948. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100949. gensupport.SetOptions(c.urlParams_, opts...)
  100950. res, err := c.doRequest("json")
  100951. if res != nil && res.StatusCode == http.StatusNotModified {
  100952. if res.Body != nil {
  100953. res.Body.Close()
  100954. }
  100955. return nil, &googleapi.Error{
  100956. Code: res.StatusCode,
  100957. Header: res.Header,
  100958. }
  100959. }
  100960. if err != nil {
  100961. return nil, err
  100962. }
  100963. defer googleapi.CloseBody(res)
  100964. if err := googleapi.CheckResponse(res); err != nil {
  100965. return nil, err
  100966. }
  100967. ret := &Operation{
  100968. ServerResponse: googleapi.ServerResponse{
  100969. Header: res.Header,
  100970. HTTPStatusCode: res.StatusCode,
  100971. },
  100972. }
  100973. target := &ret
  100974. if err := gensupport.DecodeResponse(target, res); err != nil {
  100975. return nil, err
  100976. }
  100977. return ret, nil
  100978. // {
  100979. // "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.",
  100980. // "httpMethod": "PATCH",
  100981. // "id": "compute.regionInstanceGroupManagers.patch",
  100982. // "parameterOrder": [
  100983. // "project",
  100984. // "region",
  100985. // "instanceGroupManager"
  100986. // ],
  100987. // "parameters": {
  100988. // "instanceGroupManager": {
  100989. // "description": "The name of the instance group manager.",
  100990. // "location": "path",
  100991. // "required": true,
  100992. // "type": "string"
  100993. // },
  100994. // "project": {
  100995. // "description": "Project ID for this request.",
  100996. // "location": "path",
  100997. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100998. // "required": true,
  100999. // "type": "string"
  101000. // },
  101001. // "region": {
  101002. // "description": "Name of the region scoping this request.",
  101003. // "location": "path",
  101004. // "required": true,
  101005. // "type": "string"
  101006. // },
  101007. // "requestId": {
  101008. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101009. // "location": "query",
  101010. // "type": "string"
  101011. // }
  101012. // },
  101013. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  101014. // "request": {
  101015. // "$ref": "InstanceGroupManager"
  101016. // },
  101017. // "response": {
  101018. // "$ref": "Operation"
  101019. // },
  101020. // "scopes": [
  101021. // "https://www.googleapis.com/auth/cloud-platform",
  101022. // "https://www.googleapis.com/auth/compute"
  101023. // ]
  101024. // }
  101025. }
  101026. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  101027. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  101028. s *Service
  101029. project string
  101030. region string
  101031. instanceGroupManager string
  101032. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  101033. urlParams_ gensupport.URLParams
  101034. ctx_ context.Context
  101035. header_ http.Header
  101036. }
  101037. // RecreateInstances: Flags the specified instances in the managed
  101038. // instance group to be immediately recreated. The instances are deleted
  101039. // and recreated using the current instance template for the managed
  101040. // instance group. This operation is marked as DONE when the flag is set
  101041. // even if the instances have not yet been recreated. You must
  101042. // separately verify the status of the recreating action with the
  101043. // listmanagedinstances method.
  101044. //
  101045. // If the group is part of a backend service that has enabled connection
  101046. // draining, it can take up to 60 seconds after the connection draining
  101047. // duration has elapsed before the VM instance is removed or
  101048. // deleted.
  101049. //
  101050. // You can specify a maximum of 1000 instances with this method per
  101051. // request.
  101052. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  101053. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101054. c.project = project
  101055. c.region = region
  101056. c.instanceGroupManager = instanceGroupManager
  101057. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  101058. return c
  101059. }
  101060. // RequestId sets the optional parameter "requestId": An optional
  101061. // request ID to identify requests. Specify a unique request ID so that
  101062. // if you must retry your request, the server will know to ignore the
  101063. // request if it has already been completed.
  101064. //
  101065. // For example, consider a situation where you make an initial request
  101066. // and the request times out. If you make the request again with the
  101067. // same request ID, the server can check if original operation with the
  101068. // same request ID was received, and if so, will ignore the second
  101069. // request. This prevents clients from accidentally creating duplicate
  101070. // commitments.
  101071. //
  101072. // The request ID must be a valid UUID with the exception that zero UUID
  101073. // is not supported (00000000-0000-0000-0000-000000000000).
  101074. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  101075. c.urlParams_.Set("requestId", requestId)
  101076. return c
  101077. }
  101078. // Fields allows partial responses to be retrieved. See
  101079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101080. // for more information.
  101081. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  101082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101083. return c
  101084. }
  101085. // Context sets the context to be used in this call's Do method. Any
  101086. // pending HTTP request will be aborted if the provided context is
  101087. // canceled.
  101088. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  101089. c.ctx_ = ctx
  101090. return c
  101091. }
  101092. // Header returns an http.Header that can be modified by the caller to
  101093. // add HTTP headers to the request.
  101094. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  101095. if c.header_ == nil {
  101096. c.header_ = make(http.Header)
  101097. }
  101098. return c.header_
  101099. }
  101100. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  101101. reqHeaders := make(http.Header)
  101102. for k, v := range c.header_ {
  101103. reqHeaders[k] = v
  101104. }
  101105. reqHeaders.Set("User-Agent", c.s.userAgent())
  101106. var body io.Reader = nil
  101107. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  101108. if err != nil {
  101109. return nil, err
  101110. }
  101111. reqHeaders.Set("Content-Type", "application/json")
  101112. c.urlParams_.Set("alt", alt)
  101113. c.urlParams_.Set("prettyPrint", "false")
  101114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  101115. urls += "?" + c.urlParams_.Encode()
  101116. req, err := http.NewRequest("POST", urls, body)
  101117. if err != nil {
  101118. return nil, err
  101119. }
  101120. req.Header = reqHeaders
  101121. googleapi.Expand(req.URL, map[string]string{
  101122. "project": c.project,
  101123. "region": c.region,
  101124. "instanceGroupManager": c.instanceGroupManager,
  101125. })
  101126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101127. }
  101128. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  101129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101130. // status code is an error. Response headers are in either
  101131. // *Operation.ServerResponse.Header or (if a response was returned at
  101132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101133. // to check whether the returned error was because
  101134. // http.StatusNotModified was returned.
  101135. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101136. gensupport.SetOptions(c.urlParams_, opts...)
  101137. res, err := c.doRequest("json")
  101138. if res != nil && res.StatusCode == http.StatusNotModified {
  101139. if res.Body != nil {
  101140. res.Body.Close()
  101141. }
  101142. return nil, &googleapi.Error{
  101143. Code: res.StatusCode,
  101144. Header: res.Header,
  101145. }
  101146. }
  101147. if err != nil {
  101148. return nil, err
  101149. }
  101150. defer googleapi.CloseBody(res)
  101151. if err := googleapi.CheckResponse(res); err != nil {
  101152. return nil, err
  101153. }
  101154. ret := &Operation{
  101155. ServerResponse: googleapi.ServerResponse{
  101156. Header: res.Header,
  101157. HTTPStatusCode: res.StatusCode,
  101158. },
  101159. }
  101160. target := &ret
  101161. if err := gensupport.DecodeResponse(target, res); err != nil {
  101162. return nil, err
  101163. }
  101164. return ret, nil
  101165. // {
  101166. // "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.",
  101167. // "httpMethod": "POST",
  101168. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  101169. // "parameterOrder": [
  101170. // "project",
  101171. // "region",
  101172. // "instanceGroupManager"
  101173. // ],
  101174. // "parameters": {
  101175. // "instanceGroupManager": {
  101176. // "description": "Name of the managed instance group.",
  101177. // "location": "path",
  101178. // "required": true,
  101179. // "type": "string"
  101180. // },
  101181. // "project": {
  101182. // "description": "Project ID for this request.",
  101183. // "location": "path",
  101184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101185. // "required": true,
  101186. // "type": "string"
  101187. // },
  101188. // "region": {
  101189. // "description": "Name of the region scoping this request.",
  101190. // "location": "path",
  101191. // "required": true,
  101192. // "type": "string"
  101193. // },
  101194. // "requestId": {
  101195. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101196. // "location": "query",
  101197. // "type": "string"
  101198. // }
  101199. // },
  101200. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  101201. // "request": {
  101202. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  101203. // },
  101204. // "response": {
  101205. // "$ref": "Operation"
  101206. // },
  101207. // "scopes": [
  101208. // "https://www.googleapis.com/auth/cloud-platform",
  101209. // "https://www.googleapis.com/auth/compute"
  101210. // ]
  101211. // }
  101212. }
  101213. // method id "compute.regionInstanceGroupManagers.resize":
  101214. type RegionInstanceGroupManagersResizeCall struct {
  101215. s *Service
  101216. project string
  101217. region string
  101218. instanceGroupManager string
  101219. urlParams_ gensupport.URLParams
  101220. ctx_ context.Context
  101221. header_ http.Header
  101222. }
  101223. // Resize: Changes the intended size of the managed instance group. If
  101224. // you increase the size, the group creates new instances using the
  101225. // current instance template. If you decrease the size, the group
  101226. // deletes one or more instances.
  101227. //
  101228. // The resize operation is marked DONE if the resize request is
  101229. // successful. The underlying actions take additional time. You must
  101230. // separately verify the status of the creating or deleting actions with
  101231. // the listmanagedinstances method.
  101232. //
  101233. // If the group is part of a backend service that has enabled connection
  101234. // draining, it can take up to 60 seconds after the connection draining
  101235. // duration has elapsed before the VM instance is removed or deleted.
  101236. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  101237. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101238. c.project = project
  101239. c.region = region
  101240. c.instanceGroupManager = instanceGroupManager
  101241. c.urlParams_.Set("size", fmt.Sprint(size))
  101242. return c
  101243. }
  101244. // RequestId sets the optional parameter "requestId": An optional
  101245. // request ID to identify requests. Specify a unique request ID so that
  101246. // if you must retry your request, the server will know to ignore the
  101247. // request if it has already been completed.
  101248. //
  101249. // For example, consider a situation where you make an initial request
  101250. // and the request times out. If you make the request again with the
  101251. // same request ID, the server can check if original operation with the
  101252. // same request ID was received, and if so, will ignore the second
  101253. // request. This prevents clients from accidentally creating duplicate
  101254. // commitments.
  101255. //
  101256. // The request ID must be a valid UUID with the exception that zero UUID
  101257. // is not supported (00000000-0000-0000-0000-000000000000).
  101258. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  101259. c.urlParams_.Set("requestId", requestId)
  101260. return c
  101261. }
  101262. // Fields allows partial responses to be retrieved. See
  101263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101264. // for more information.
  101265. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  101266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101267. return c
  101268. }
  101269. // Context sets the context to be used in this call's Do method. Any
  101270. // pending HTTP request will be aborted if the provided context is
  101271. // canceled.
  101272. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  101273. c.ctx_ = ctx
  101274. return c
  101275. }
  101276. // Header returns an http.Header that can be modified by the caller to
  101277. // add HTTP headers to the request.
  101278. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  101279. if c.header_ == nil {
  101280. c.header_ = make(http.Header)
  101281. }
  101282. return c.header_
  101283. }
  101284. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  101285. reqHeaders := make(http.Header)
  101286. for k, v := range c.header_ {
  101287. reqHeaders[k] = v
  101288. }
  101289. reqHeaders.Set("User-Agent", c.s.userAgent())
  101290. var body io.Reader = nil
  101291. c.urlParams_.Set("alt", alt)
  101292. c.urlParams_.Set("prettyPrint", "false")
  101293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  101294. urls += "?" + c.urlParams_.Encode()
  101295. req, err := http.NewRequest("POST", urls, body)
  101296. if err != nil {
  101297. return nil, err
  101298. }
  101299. req.Header = reqHeaders
  101300. googleapi.Expand(req.URL, map[string]string{
  101301. "project": c.project,
  101302. "region": c.region,
  101303. "instanceGroupManager": c.instanceGroupManager,
  101304. })
  101305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101306. }
  101307. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  101308. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101309. // status code is an error. Response headers are in either
  101310. // *Operation.ServerResponse.Header or (if a response was returned at
  101311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101312. // to check whether the returned error was because
  101313. // http.StatusNotModified was returned.
  101314. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101315. gensupport.SetOptions(c.urlParams_, opts...)
  101316. res, err := c.doRequest("json")
  101317. if res != nil && res.StatusCode == http.StatusNotModified {
  101318. if res.Body != nil {
  101319. res.Body.Close()
  101320. }
  101321. return nil, &googleapi.Error{
  101322. Code: res.StatusCode,
  101323. Header: res.Header,
  101324. }
  101325. }
  101326. if err != nil {
  101327. return nil, err
  101328. }
  101329. defer googleapi.CloseBody(res)
  101330. if err := googleapi.CheckResponse(res); err != nil {
  101331. return nil, err
  101332. }
  101333. ret := &Operation{
  101334. ServerResponse: googleapi.ServerResponse{
  101335. Header: res.Header,
  101336. HTTPStatusCode: res.StatusCode,
  101337. },
  101338. }
  101339. target := &ret
  101340. if err := gensupport.DecodeResponse(target, res); err != nil {
  101341. return nil, err
  101342. }
  101343. return ret, nil
  101344. // {
  101345. // "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.",
  101346. // "httpMethod": "POST",
  101347. // "id": "compute.regionInstanceGroupManagers.resize",
  101348. // "parameterOrder": [
  101349. // "project",
  101350. // "region",
  101351. // "instanceGroupManager",
  101352. // "size"
  101353. // ],
  101354. // "parameters": {
  101355. // "instanceGroupManager": {
  101356. // "description": "Name of the managed instance group.",
  101357. // "location": "path",
  101358. // "required": true,
  101359. // "type": "string"
  101360. // },
  101361. // "project": {
  101362. // "description": "Project ID for this request.",
  101363. // "location": "path",
  101364. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101365. // "required": true,
  101366. // "type": "string"
  101367. // },
  101368. // "region": {
  101369. // "description": "Name of the region scoping this request.",
  101370. // "location": "path",
  101371. // "required": true,
  101372. // "type": "string"
  101373. // },
  101374. // "requestId": {
  101375. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101376. // "location": "query",
  101377. // "type": "string"
  101378. // },
  101379. // "size": {
  101380. // "description": "Number of instances that should exist in this instance group manager.",
  101381. // "format": "int32",
  101382. // "location": "query",
  101383. // "minimum": "0",
  101384. // "required": true,
  101385. // "type": "integer"
  101386. // }
  101387. // },
  101388. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  101389. // "response": {
  101390. // "$ref": "Operation"
  101391. // },
  101392. // "scopes": [
  101393. // "https://www.googleapis.com/auth/cloud-platform",
  101394. // "https://www.googleapis.com/auth/compute"
  101395. // ]
  101396. // }
  101397. }
  101398. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  101399. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  101400. s *Service
  101401. project string
  101402. region string
  101403. instanceGroupManager string
  101404. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  101405. urlParams_ gensupport.URLParams
  101406. ctx_ context.Context
  101407. header_ http.Header
  101408. }
  101409. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  101410. // instances in this managed instance group. [Deprecated] This method is
  101411. // deprecated. Please use Patch instead.
  101412. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  101413. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101414. c.project = project
  101415. c.region = region
  101416. c.instanceGroupManager = instanceGroupManager
  101417. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  101418. return c
  101419. }
  101420. // RequestId sets the optional parameter "requestId": An optional
  101421. // request ID to identify requests. Specify a unique request ID so that
  101422. // if you must retry your request, the server will know to ignore the
  101423. // request if it has already been completed.
  101424. //
  101425. // For example, consider a situation where you make an initial request
  101426. // and the request times out. If you make the request again with the
  101427. // same request ID, the server can check if original operation with the
  101428. // same request ID was received, and if so, will ignore the second
  101429. // request. This prevents clients from accidentally creating duplicate
  101430. // commitments.
  101431. //
  101432. // The request ID must be a valid UUID with the exception that zero UUID
  101433. // is not supported (00000000-0000-0000-0000-000000000000).
  101434. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  101435. c.urlParams_.Set("requestId", requestId)
  101436. return c
  101437. }
  101438. // Fields allows partial responses to be retrieved. See
  101439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101440. // for more information.
  101441. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  101442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101443. return c
  101444. }
  101445. // Context sets the context to be used in this call's Do method. Any
  101446. // pending HTTP request will be aborted if the provided context is
  101447. // canceled.
  101448. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  101449. c.ctx_ = ctx
  101450. return c
  101451. }
  101452. // Header returns an http.Header that can be modified by the caller to
  101453. // add HTTP headers to the request.
  101454. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  101455. if c.header_ == nil {
  101456. c.header_ = make(http.Header)
  101457. }
  101458. return c.header_
  101459. }
  101460. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  101461. reqHeaders := make(http.Header)
  101462. for k, v := range c.header_ {
  101463. reqHeaders[k] = v
  101464. }
  101465. reqHeaders.Set("User-Agent", c.s.userAgent())
  101466. var body io.Reader = nil
  101467. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  101468. if err != nil {
  101469. return nil, err
  101470. }
  101471. reqHeaders.Set("Content-Type", "application/json")
  101472. c.urlParams_.Set("alt", alt)
  101473. c.urlParams_.Set("prettyPrint", "false")
  101474. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  101475. urls += "?" + c.urlParams_.Encode()
  101476. req, err := http.NewRequest("POST", urls, body)
  101477. if err != nil {
  101478. return nil, err
  101479. }
  101480. req.Header = reqHeaders
  101481. googleapi.Expand(req.URL, map[string]string{
  101482. "project": c.project,
  101483. "region": c.region,
  101484. "instanceGroupManager": c.instanceGroupManager,
  101485. })
  101486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101487. }
  101488. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  101489. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101490. // status code is an error. Response headers are in either
  101491. // *Operation.ServerResponse.Header or (if a response was returned at
  101492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101493. // to check whether the returned error was because
  101494. // http.StatusNotModified was returned.
  101495. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101496. gensupport.SetOptions(c.urlParams_, opts...)
  101497. res, err := c.doRequest("json")
  101498. if res != nil && res.StatusCode == http.StatusNotModified {
  101499. if res.Body != nil {
  101500. res.Body.Close()
  101501. }
  101502. return nil, &googleapi.Error{
  101503. Code: res.StatusCode,
  101504. Header: res.Header,
  101505. }
  101506. }
  101507. if err != nil {
  101508. return nil, err
  101509. }
  101510. defer googleapi.CloseBody(res)
  101511. if err := googleapi.CheckResponse(res); err != nil {
  101512. return nil, err
  101513. }
  101514. ret := &Operation{
  101515. ServerResponse: googleapi.ServerResponse{
  101516. Header: res.Header,
  101517. HTTPStatusCode: res.StatusCode,
  101518. },
  101519. }
  101520. target := &ret
  101521. if err := gensupport.DecodeResponse(target, res); err != nil {
  101522. return nil, err
  101523. }
  101524. return ret, nil
  101525. // {
  101526. // "description": "Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.",
  101527. // "httpMethod": "POST",
  101528. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  101529. // "parameterOrder": [
  101530. // "project",
  101531. // "region",
  101532. // "instanceGroupManager"
  101533. // ],
  101534. // "parameters": {
  101535. // "instanceGroupManager": {
  101536. // "description": "Name of the managed instance group.",
  101537. // "location": "path",
  101538. // "required": true,
  101539. // "type": "string"
  101540. // },
  101541. // "project": {
  101542. // "description": "Project ID for this request.",
  101543. // "location": "path",
  101544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101545. // "required": true,
  101546. // "type": "string"
  101547. // },
  101548. // "region": {
  101549. // "description": "Name of the region scoping this request.",
  101550. // "location": "path",
  101551. // "required": true,
  101552. // "type": "string"
  101553. // },
  101554. // "requestId": {
  101555. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101556. // "location": "query",
  101557. // "type": "string"
  101558. // }
  101559. // },
  101560. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  101561. // "request": {
  101562. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  101563. // },
  101564. // "response": {
  101565. // "$ref": "Operation"
  101566. // },
  101567. // "scopes": [
  101568. // "https://www.googleapis.com/auth/cloud-platform",
  101569. // "https://www.googleapis.com/auth/compute"
  101570. // ]
  101571. // }
  101572. }
  101573. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  101574. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  101575. s *Service
  101576. project string
  101577. region string
  101578. instanceGroupManager string
  101579. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  101580. urlParams_ gensupport.URLParams
  101581. ctx_ context.Context
  101582. header_ http.Header
  101583. }
  101584. // SetInstanceTemplate: Sets the instance template to use when creating
  101585. // new instances or recreating instances in this group. Existing
  101586. // instances are not affected.
  101587. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  101588. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101589. c.project = project
  101590. c.region = region
  101591. c.instanceGroupManager = instanceGroupManager
  101592. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  101593. return c
  101594. }
  101595. // RequestId sets the optional parameter "requestId": An optional
  101596. // request ID to identify requests. Specify a unique request ID so that
  101597. // if you must retry your request, the server will know to ignore the
  101598. // request if it has already been completed.
  101599. //
  101600. // For example, consider a situation where you make an initial request
  101601. // and the request times out. If you make the request again with the
  101602. // same request ID, the server can check if original operation with the
  101603. // same request ID was received, and if so, will ignore the second
  101604. // request. This prevents clients from accidentally creating duplicate
  101605. // commitments.
  101606. //
  101607. // The request ID must be a valid UUID with the exception that zero UUID
  101608. // is not supported (00000000-0000-0000-0000-000000000000).
  101609. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  101610. c.urlParams_.Set("requestId", requestId)
  101611. return c
  101612. }
  101613. // Fields allows partial responses to be retrieved. See
  101614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101615. // for more information.
  101616. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  101617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101618. return c
  101619. }
  101620. // Context sets the context to be used in this call's Do method. Any
  101621. // pending HTTP request will be aborted if the provided context is
  101622. // canceled.
  101623. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  101624. c.ctx_ = ctx
  101625. return c
  101626. }
  101627. // Header returns an http.Header that can be modified by the caller to
  101628. // add HTTP headers to the request.
  101629. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  101630. if c.header_ == nil {
  101631. c.header_ = make(http.Header)
  101632. }
  101633. return c.header_
  101634. }
  101635. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  101636. reqHeaders := make(http.Header)
  101637. for k, v := range c.header_ {
  101638. reqHeaders[k] = v
  101639. }
  101640. reqHeaders.Set("User-Agent", c.s.userAgent())
  101641. var body io.Reader = nil
  101642. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  101643. if err != nil {
  101644. return nil, err
  101645. }
  101646. reqHeaders.Set("Content-Type", "application/json")
  101647. c.urlParams_.Set("alt", alt)
  101648. c.urlParams_.Set("prettyPrint", "false")
  101649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  101650. urls += "?" + c.urlParams_.Encode()
  101651. req, err := http.NewRequest("POST", urls, body)
  101652. if err != nil {
  101653. return nil, err
  101654. }
  101655. req.Header = reqHeaders
  101656. googleapi.Expand(req.URL, map[string]string{
  101657. "project": c.project,
  101658. "region": c.region,
  101659. "instanceGroupManager": c.instanceGroupManager,
  101660. })
  101661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101662. }
  101663. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  101664. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101665. // status code is an error. Response headers are in either
  101666. // *Operation.ServerResponse.Header or (if a response was returned at
  101667. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101668. // to check whether the returned error was because
  101669. // http.StatusNotModified was returned.
  101670. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101671. gensupport.SetOptions(c.urlParams_, opts...)
  101672. res, err := c.doRequest("json")
  101673. if res != nil && res.StatusCode == http.StatusNotModified {
  101674. if res.Body != nil {
  101675. res.Body.Close()
  101676. }
  101677. return nil, &googleapi.Error{
  101678. Code: res.StatusCode,
  101679. Header: res.Header,
  101680. }
  101681. }
  101682. if err != nil {
  101683. return nil, err
  101684. }
  101685. defer googleapi.CloseBody(res)
  101686. if err := googleapi.CheckResponse(res); err != nil {
  101687. return nil, err
  101688. }
  101689. ret := &Operation{
  101690. ServerResponse: googleapi.ServerResponse{
  101691. Header: res.Header,
  101692. HTTPStatusCode: res.StatusCode,
  101693. },
  101694. }
  101695. target := &ret
  101696. if err := gensupport.DecodeResponse(target, res); err != nil {
  101697. return nil, err
  101698. }
  101699. return ret, nil
  101700. // {
  101701. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  101702. // "httpMethod": "POST",
  101703. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  101704. // "parameterOrder": [
  101705. // "project",
  101706. // "region",
  101707. // "instanceGroupManager"
  101708. // ],
  101709. // "parameters": {
  101710. // "instanceGroupManager": {
  101711. // "description": "The name of the managed instance group.",
  101712. // "location": "path",
  101713. // "required": true,
  101714. // "type": "string"
  101715. // },
  101716. // "project": {
  101717. // "description": "Project ID for this request.",
  101718. // "location": "path",
  101719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101720. // "required": true,
  101721. // "type": "string"
  101722. // },
  101723. // "region": {
  101724. // "description": "Name of the region scoping this request.",
  101725. // "location": "path",
  101726. // "required": true,
  101727. // "type": "string"
  101728. // },
  101729. // "requestId": {
  101730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101731. // "location": "query",
  101732. // "type": "string"
  101733. // }
  101734. // },
  101735. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  101736. // "request": {
  101737. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  101738. // },
  101739. // "response": {
  101740. // "$ref": "Operation"
  101741. // },
  101742. // "scopes": [
  101743. // "https://www.googleapis.com/auth/cloud-platform",
  101744. // "https://www.googleapis.com/auth/compute"
  101745. // ]
  101746. // }
  101747. }
  101748. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  101749. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  101750. s *Service
  101751. project string
  101752. region string
  101753. instanceGroupManager string
  101754. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  101755. urlParams_ gensupport.URLParams
  101756. ctx_ context.Context
  101757. header_ http.Header
  101758. }
  101759. // SetTargetPools: Modifies the target pools to which all new instances
  101760. // in this group are assigned. Existing instances in the group are not
  101761. // affected.
  101762. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  101763. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101764. c.project = project
  101765. c.region = region
  101766. c.instanceGroupManager = instanceGroupManager
  101767. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  101768. return c
  101769. }
  101770. // RequestId sets the optional parameter "requestId": An optional
  101771. // request ID to identify requests. Specify a unique request ID so that
  101772. // if you must retry your request, the server will know to ignore the
  101773. // request if it has already been completed.
  101774. //
  101775. // For example, consider a situation where you make an initial request
  101776. // and the request times out. If you make the request again with the
  101777. // same request ID, the server can check if original operation with the
  101778. // same request ID was received, and if so, will ignore the second
  101779. // request. This prevents clients from accidentally creating duplicate
  101780. // commitments.
  101781. //
  101782. // The request ID must be a valid UUID with the exception that zero UUID
  101783. // is not supported (00000000-0000-0000-0000-000000000000).
  101784. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  101785. c.urlParams_.Set("requestId", requestId)
  101786. return c
  101787. }
  101788. // Fields allows partial responses to be retrieved. See
  101789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101790. // for more information.
  101791. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  101792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101793. return c
  101794. }
  101795. // Context sets the context to be used in this call's Do method. Any
  101796. // pending HTTP request will be aborted if the provided context is
  101797. // canceled.
  101798. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  101799. c.ctx_ = ctx
  101800. return c
  101801. }
  101802. // Header returns an http.Header that can be modified by the caller to
  101803. // add HTTP headers to the request.
  101804. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  101805. if c.header_ == nil {
  101806. c.header_ = make(http.Header)
  101807. }
  101808. return c.header_
  101809. }
  101810. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  101811. reqHeaders := make(http.Header)
  101812. for k, v := range c.header_ {
  101813. reqHeaders[k] = v
  101814. }
  101815. reqHeaders.Set("User-Agent", c.s.userAgent())
  101816. var body io.Reader = nil
  101817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  101818. if err != nil {
  101819. return nil, err
  101820. }
  101821. reqHeaders.Set("Content-Type", "application/json")
  101822. c.urlParams_.Set("alt", alt)
  101823. c.urlParams_.Set("prettyPrint", "false")
  101824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  101825. urls += "?" + c.urlParams_.Encode()
  101826. req, err := http.NewRequest("POST", urls, body)
  101827. if err != nil {
  101828. return nil, err
  101829. }
  101830. req.Header = reqHeaders
  101831. googleapi.Expand(req.URL, map[string]string{
  101832. "project": c.project,
  101833. "region": c.region,
  101834. "instanceGroupManager": c.instanceGroupManager,
  101835. })
  101836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101837. }
  101838. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  101839. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101840. // status code is an error. Response headers are in either
  101841. // *Operation.ServerResponse.Header or (if a response was returned at
  101842. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101843. // to check whether the returned error was because
  101844. // http.StatusNotModified was returned.
  101845. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101846. gensupport.SetOptions(c.urlParams_, opts...)
  101847. res, err := c.doRequest("json")
  101848. if res != nil && res.StatusCode == http.StatusNotModified {
  101849. if res.Body != nil {
  101850. res.Body.Close()
  101851. }
  101852. return nil, &googleapi.Error{
  101853. Code: res.StatusCode,
  101854. Header: res.Header,
  101855. }
  101856. }
  101857. if err != nil {
  101858. return nil, err
  101859. }
  101860. defer googleapi.CloseBody(res)
  101861. if err := googleapi.CheckResponse(res); err != nil {
  101862. return nil, err
  101863. }
  101864. ret := &Operation{
  101865. ServerResponse: googleapi.ServerResponse{
  101866. Header: res.Header,
  101867. HTTPStatusCode: res.StatusCode,
  101868. },
  101869. }
  101870. target := &ret
  101871. if err := gensupport.DecodeResponse(target, res); err != nil {
  101872. return nil, err
  101873. }
  101874. return ret, nil
  101875. // {
  101876. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  101877. // "httpMethod": "POST",
  101878. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  101879. // "parameterOrder": [
  101880. // "project",
  101881. // "region",
  101882. // "instanceGroupManager"
  101883. // ],
  101884. // "parameters": {
  101885. // "instanceGroupManager": {
  101886. // "description": "Name of the managed instance group.",
  101887. // "location": "path",
  101888. // "required": true,
  101889. // "type": "string"
  101890. // },
  101891. // "project": {
  101892. // "description": "Project ID for this request.",
  101893. // "location": "path",
  101894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101895. // "required": true,
  101896. // "type": "string"
  101897. // },
  101898. // "region": {
  101899. // "description": "Name of the region scoping this request.",
  101900. // "location": "path",
  101901. // "required": true,
  101902. // "type": "string"
  101903. // },
  101904. // "requestId": {
  101905. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101906. // "location": "query",
  101907. // "type": "string"
  101908. // }
  101909. // },
  101910. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  101911. // "request": {
  101912. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  101913. // },
  101914. // "response": {
  101915. // "$ref": "Operation"
  101916. // },
  101917. // "scopes": [
  101918. // "https://www.googleapis.com/auth/cloud-platform",
  101919. // "https://www.googleapis.com/auth/compute"
  101920. // ]
  101921. // }
  101922. }
  101923. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  101924. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  101925. s *Service
  101926. project string
  101927. region string
  101928. resource string
  101929. testpermissionsrequest *TestPermissionsRequest
  101930. urlParams_ gensupport.URLParams
  101931. ctx_ context.Context
  101932. header_ http.Header
  101933. }
  101934. // TestIamPermissions: Returns permissions that a caller has on the
  101935. // specified resource.
  101936. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  101937. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101938. c.project = project
  101939. c.region = region
  101940. c.resource = resource
  101941. c.testpermissionsrequest = testpermissionsrequest
  101942. return c
  101943. }
  101944. // Fields allows partial responses to be retrieved. See
  101945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101946. // for more information.
  101947. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  101948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101949. return c
  101950. }
  101951. // Context sets the context to be used in this call's Do method. Any
  101952. // pending HTTP request will be aborted if the provided context is
  101953. // canceled.
  101954. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  101955. c.ctx_ = ctx
  101956. return c
  101957. }
  101958. // Header returns an http.Header that can be modified by the caller to
  101959. // add HTTP headers to the request.
  101960. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  101961. if c.header_ == nil {
  101962. c.header_ = make(http.Header)
  101963. }
  101964. return c.header_
  101965. }
  101966. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101967. reqHeaders := make(http.Header)
  101968. for k, v := range c.header_ {
  101969. reqHeaders[k] = v
  101970. }
  101971. reqHeaders.Set("User-Agent", c.s.userAgent())
  101972. var body io.Reader = nil
  101973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101974. if err != nil {
  101975. return nil, err
  101976. }
  101977. reqHeaders.Set("Content-Type", "application/json")
  101978. c.urlParams_.Set("alt", alt)
  101979. c.urlParams_.Set("prettyPrint", "false")
  101980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  101981. urls += "?" + c.urlParams_.Encode()
  101982. req, err := http.NewRequest("POST", urls, body)
  101983. if err != nil {
  101984. return nil, err
  101985. }
  101986. req.Header = reqHeaders
  101987. googleapi.Expand(req.URL, map[string]string{
  101988. "project": c.project,
  101989. "region": c.region,
  101990. "resource": c.resource,
  101991. })
  101992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101993. }
  101994. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  101995. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101996. // non-2xx status code is an error. Response headers are in either
  101997. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101998. // returned at all) in error.(*googleapi.Error).Header. Use
  101999. // googleapi.IsNotModified to check whether the returned error was
  102000. // because http.StatusNotModified was returned.
  102001. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  102002. gensupport.SetOptions(c.urlParams_, opts...)
  102003. res, err := c.doRequest("json")
  102004. if res != nil && res.StatusCode == http.StatusNotModified {
  102005. if res.Body != nil {
  102006. res.Body.Close()
  102007. }
  102008. return nil, &googleapi.Error{
  102009. Code: res.StatusCode,
  102010. Header: res.Header,
  102011. }
  102012. }
  102013. if err != nil {
  102014. return nil, err
  102015. }
  102016. defer googleapi.CloseBody(res)
  102017. if err := googleapi.CheckResponse(res); err != nil {
  102018. return nil, err
  102019. }
  102020. ret := &TestPermissionsResponse{
  102021. ServerResponse: googleapi.ServerResponse{
  102022. Header: res.Header,
  102023. HTTPStatusCode: res.StatusCode,
  102024. },
  102025. }
  102026. target := &ret
  102027. if err := gensupport.DecodeResponse(target, res); err != nil {
  102028. return nil, err
  102029. }
  102030. return ret, nil
  102031. // {
  102032. // "description": "Returns permissions that a caller has on the specified resource.",
  102033. // "httpMethod": "POST",
  102034. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  102035. // "parameterOrder": [
  102036. // "project",
  102037. // "region",
  102038. // "resource"
  102039. // ],
  102040. // "parameters": {
  102041. // "project": {
  102042. // "description": "Project ID for this request.",
  102043. // "location": "path",
  102044. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102045. // "required": true,
  102046. // "type": "string"
  102047. // },
  102048. // "region": {
  102049. // "description": "The name of the region for this request.",
  102050. // "location": "path",
  102051. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102052. // "required": true,
  102053. // "type": "string"
  102054. // },
  102055. // "resource": {
  102056. // "description": "Name or id of the resource for this request.",
  102057. // "location": "path",
  102058. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102059. // "required": true,
  102060. // "type": "string"
  102061. // }
  102062. // },
  102063. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  102064. // "request": {
  102065. // "$ref": "TestPermissionsRequest"
  102066. // },
  102067. // "response": {
  102068. // "$ref": "TestPermissionsResponse"
  102069. // },
  102070. // "scopes": [
  102071. // "https://www.googleapis.com/auth/cloud-platform",
  102072. // "https://www.googleapis.com/auth/compute",
  102073. // "https://www.googleapis.com/auth/compute.readonly"
  102074. // ]
  102075. // }
  102076. }
  102077. // method id "compute.regionInstanceGroupManagers.update":
  102078. type RegionInstanceGroupManagersUpdateCall struct {
  102079. s *Service
  102080. project string
  102081. region string
  102082. instanceGroupManager string
  102083. instancegroupmanager *InstanceGroupManager
  102084. urlParams_ gensupport.URLParams
  102085. ctx_ context.Context
  102086. header_ http.Header
  102087. }
  102088. // Update: Updates a managed instance group using the information that
  102089. // you specify in the request. This operation is marked as DONE when the
  102090. // group is updated even if the instances in the group have not yet been
  102091. // updated. You must separately verify the status of the individual
  102092. // instances with the listmanagedinstances method.
  102093. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  102094. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102095. c.project = project
  102096. c.region = region
  102097. c.instanceGroupManager = instanceGroupManager
  102098. c.instancegroupmanager = instancegroupmanager
  102099. return c
  102100. }
  102101. // RequestId sets the optional parameter "requestId": An optional
  102102. // request ID to identify requests. Specify a unique request ID so that
  102103. // if you must retry your request, the server will know to ignore the
  102104. // request if it has already been completed.
  102105. //
  102106. // For example, consider a situation where you make an initial request
  102107. // and the request times out. If you make the request again with the
  102108. // same request ID, the server can check if original operation with the
  102109. // same request ID was received, and if so, will ignore the second
  102110. // request. This prevents clients from accidentally creating duplicate
  102111. // commitments.
  102112. //
  102113. // The request ID must be a valid UUID with the exception that zero UUID
  102114. // is not supported (00000000-0000-0000-0000-000000000000).
  102115. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  102116. c.urlParams_.Set("requestId", requestId)
  102117. return c
  102118. }
  102119. // Fields allows partial responses to be retrieved. See
  102120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102121. // for more information.
  102122. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  102123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102124. return c
  102125. }
  102126. // Context sets the context to be used in this call's Do method. Any
  102127. // pending HTTP request will be aborted if the provided context is
  102128. // canceled.
  102129. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  102130. c.ctx_ = ctx
  102131. return c
  102132. }
  102133. // Header returns an http.Header that can be modified by the caller to
  102134. // add HTTP headers to the request.
  102135. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  102136. if c.header_ == nil {
  102137. c.header_ = make(http.Header)
  102138. }
  102139. return c.header_
  102140. }
  102141. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  102142. reqHeaders := make(http.Header)
  102143. for k, v := range c.header_ {
  102144. reqHeaders[k] = v
  102145. }
  102146. reqHeaders.Set("User-Agent", c.s.userAgent())
  102147. var body io.Reader = nil
  102148. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  102149. if err != nil {
  102150. return nil, err
  102151. }
  102152. reqHeaders.Set("Content-Type", "application/json")
  102153. c.urlParams_.Set("alt", alt)
  102154. c.urlParams_.Set("prettyPrint", "false")
  102155. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  102156. urls += "?" + c.urlParams_.Encode()
  102157. req, err := http.NewRequest("PUT", urls, body)
  102158. if err != nil {
  102159. return nil, err
  102160. }
  102161. req.Header = reqHeaders
  102162. googleapi.Expand(req.URL, map[string]string{
  102163. "project": c.project,
  102164. "region": c.region,
  102165. "instanceGroupManager": c.instanceGroupManager,
  102166. })
  102167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102168. }
  102169. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  102170. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102171. // status code is an error. Response headers are in either
  102172. // *Operation.ServerResponse.Header or (if a response was returned at
  102173. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102174. // to check whether the returned error was because
  102175. // http.StatusNotModified was returned.
  102176. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102177. gensupport.SetOptions(c.urlParams_, opts...)
  102178. res, err := c.doRequest("json")
  102179. if res != nil && res.StatusCode == http.StatusNotModified {
  102180. if res.Body != nil {
  102181. res.Body.Close()
  102182. }
  102183. return nil, &googleapi.Error{
  102184. Code: res.StatusCode,
  102185. Header: res.Header,
  102186. }
  102187. }
  102188. if err != nil {
  102189. return nil, err
  102190. }
  102191. defer googleapi.CloseBody(res)
  102192. if err := googleapi.CheckResponse(res); err != nil {
  102193. return nil, err
  102194. }
  102195. ret := &Operation{
  102196. ServerResponse: googleapi.ServerResponse{
  102197. Header: res.Header,
  102198. HTTPStatusCode: res.StatusCode,
  102199. },
  102200. }
  102201. target := &ret
  102202. if err := gensupport.DecodeResponse(target, res); err != nil {
  102203. return nil, err
  102204. }
  102205. return ret, nil
  102206. // {
  102207. // "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.",
  102208. // "httpMethod": "PUT",
  102209. // "id": "compute.regionInstanceGroupManagers.update",
  102210. // "parameterOrder": [
  102211. // "project",
  102212. // "region",
  102213. // "instanceGroupManager"
  102214. // ],
  102215. // "parameters": {
  102216. // "instanceGroupManager": {
  102217. // "description": "The name of the instance group manager.",
  102218. // "location": "path",
  102219. // "required": true,
  102220. // "type": "string"
  102221. // },
  102222. // "project": {
  102223. // "description": "Project ID for this request.",
  102224. // "location": "path",
  102225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102226. // "required": true,
  102227. // "type": "string"
  102228. // },
  102229. // "region": {
  102230. // "description": "Name of the region scoping this request.",
  102231. // "location": "path",
  102232. // "required": true,
  102233. // "type": "string"
  102234. // },
  102235. // "requestId": {
  102236. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102237. // "location": "query",
  102238. // "type": "string"
  102239. // }
  102240. // },
  102241. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  102242. // "request": {
  102243. // "$ref": "InstanceGroupManager"
  102244. // },
  102245. // "response": {
  102246. // "$ref": "Operation"
  102247. // },
  102248. // "scopes": [
  102249. // "https://www.googleapis.com/auth/cloud-platform",
  102250. // "https://www.googleapis.com/auth/compute"
  102251. // ]
  102252. // }
  102253. }
  102254. // method id "compute.regionInstanceGroupManagers.updatePerInstanceConfigs":
  102255. type RegionInstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  102256. s *Service
  102257. project string
  102258. region string
  102259. instanceGroupManager string
  102260. regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq
  102261. urlParams_ gensupport.URLParams
  102262. ctx_ context.Context
  102263. header_ http.Header
  102264. }
  102265. // UpdatePerInstanceConfigs: Insert or patch (for the ones that already
  102266. // exist) per-instance configs for the managed instance group.
  102267. // perInstanceConfig.instance serves as a key used to distinguish
  102268. // whether to perform insert or patch.
  102269. func (r *RegionInstanceGroupManagersService) UpdatePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  102270. c := &RegionInstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102271. c.project = project
  102272. c.region = region
  102273. c.instanceGroupManager = instanceGroupManager
  102274. c.regioninstancegroupmanagerupdateinstanceconfigreq = regioninstancegroupmanagerupdateinstanceconfigreq
  102275. return c
  102276. }
  102277. // RequestId sets the optional parameter "requestId": An optional
  102278. // request ID to identify requests. Specify a unique request ID so that
  102279. // if you must retry your request, the server will know to ignore the
  102280. // request if it has already been completed.
  102281. //
  102282. // For example, consider a situation where you make an initial request
  102283. // and the request times out. If you make the request again with the
  102284. // same request ID, the server can check if original operation with the
  102285. // same request ID was received, and if so, will ignore the second
  102286. // request. This prevents clients from accidentally creating duplicate
  102287. // commitments.
  102288. //
  102289. // The request ID must be a valid UUID with the exception that zero UUID
  102290. // is not supported (00000000-0000-0000-0000-000000000000).
  102291. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  102292. c.urlParams_.Set("requestId", requestId)
  102293. return c
  102294. }
  102295. // Fields allows partial responses to be retrieved. See
  102296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102297. // for more information.
  102298. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  102299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102300. return c
  102301. }
  102302. // Context sets the context to be used in this call's Do method. Any
  102303. // pending HTTP request will be aborted if the provided context is
  102304. // canceled.
  102305. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  102306. c.ctx_ = ctx
  102307. return c
  102308. }
  102309. // Header returns an http.Header that can be modified by the caller to
  102310. // add HTTP headers to the request.
  102311. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  102312. if c.header_ == nil {
  102313. c.header_ = make(http.Header)
  102314. }
  102315. return c.header_
  102316. }
  102317. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  102318. reqHeaders := make(http.Header)
  102319. for k, v := range c.header_ {
  102320. reqHeaders[k] = v
  102321. }
  102322. reqHeaders.Set("User-Agent", c.s.userAgent())
  102323. var body io.Reader = nil
  102324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq)
  102325. if err != nil {
  102326. return nil, err
  102327. }
  102328. reqHeaders.Set("Content-Type", "application/json")
  102329. c.urlParams_.Set("alt", alt)
  102330. c.urlParams_.Set("prettyPrint", "false")
  102331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  102332. urls += "?" + c.urlParams_.Encode()
  102333. req, err := http.NewRequest("POST", urls, body)
  102334. if err != nil {
  102335. return nil, err
  102336. }
  102337. req.Header = reqHeaders
  102338. googleapi.Expand(req.URL, map[string]string{
  102339. "project": c.project,
  102340. "region": c.region,
  102341. "instanceGroupManager": c.instanceGroupManager,
  102342. })
  102343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102344. }
  102345. // Do executes the "compute.regionInstanceGroupManagers.updatePerInstanceConfigs" call.
  102346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102347. // status code is an error. Response headers are in either
  102348. // *Operation.ServerResponse.Header or (if a response was returned at
  102349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102350. // to check whether the returned error was because
  102351. // http.StatusNotModified was returned.
  102352. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102353. gensupport.SetOptions(c.urlParams_, opts...)
  102354. res, err := c.doRequest("json")
  102355. if res != nil && res.StatusCode == http.StatusNotModified {
  102356. if res.Body != nil {
  102357. res.Body.Close()
  102358. }
  102359. return nil, &googleapi.Error{
  102360. Code: res.StatusCode,
  102361. Header: res.Header,
  102362. }
  102363. }
  102364. if err != nil {
  102365. return nil, err
  102366. }
  102367. defer googleapi.CloseBody(res)
  102368. if err := googleapi.CheckResponse(res); err != nil {
  102369. return nil, err
  102370. }
  102371. ret := &Operation{
  102372. ServerResponse: googleapi.ServerResponse{
  102373. Header: res.Header,
  102374. HTTPStatusCode: res.StatusCode,
  102375. },
  102376. }
  102377. target := &ret
  102378. if err := gensupport.DecodeResponse(target, res); err != nil {
  102379. return nil, err
  102380. }
  102381. return ret, nil
  102382. // {
  102383. // "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  102384. // "httpMethod": "POST",
  102385. // "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs",
  102386. // "parameterOrder": [
  102387. // "project",
  102388. // "region",
  102389. // "instanceGroupManager"
  102390. // ],
  102391. // "parameters": {
  102392. // "instanceGroupManager": {
  102393. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  102394. // "location": "path",
  102395. // "required": true,
  102396. // "type": "string"
  102397. // },
  102398. // "project": {
  102399. // "description": "Project ID for this request.",
  102400. // "location": "path",
  102401. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102402. // "required": true,
  102403. // "type": "string"
  102404. // },
  102405. // "region": {
  102406. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  102407. // "location": "path",
  102408. // "required": true,
  102409. // "type": "string"
  102410. // },
  102411. // "requestId": {
  102412. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102413. // "location": "query",
  102414. // "type": "string"
  102415. // }
  102416. // },
  102417. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  102418. // "request": {
  102419. // "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq"
  102420. // },
  102421. // "response": {
  102422. // "$ref": "Operation"
  102423. // },
  102424. // "scopes": [
  102425. // "https://www.googleapis.com/auth/cloud-platform",
  102426. // "https://www.googleapis.com/auth/compute"
  102427. // ]
  102428. // }
  102429. }
  102430. // method id "compute.regionInstanceGroups.get":
  102431. type RegionInstanceGroupsGetCall struct {
  102432. s *Service
  102433. project string
  102434. region string
  102435. instanceGroup string
  102436. urlParams_ gensupport.URLParams
  102437. ifNoneMatch_ string
  102438. ctx_ context.Context
  102439. header_ http.Header
  102440. }
  102441. // Get: Returns the specified instance group resource.
  102442. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  102443. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102444. c.project = project
  102445. c.region = region
  102446. c.instanceGroup = instanceGroup
  102447. return c
  102448. }
  102449. // Fields allows partial responses to be retrieved. See
  102450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102451. // for more information.
  102452. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  102453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102454. return c
  102455. }
  102456. // IfNoneMatch sets the optional parameter which makes the operation
  102457. // fail if the object's ETag matches the given value. This is useful for
  102458. // getting updates only after the object has changed since the last
  102459. // request. Use googleapi.IsNotModified to check whether the response
  102460. // error from Do is the result of In-None-Match.
  102461. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  102462. c.ifNoneMatch_ = entityTag
  102463. return c
  102464. }
  102465. // Context sets the context to be used in this call's Do method. Any
  102466. // pending HTTP request will be aborted if the provided context is
  102467. // canceled.
  102468. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  102469. c.ctx_ = ctx
  102470. return c
  102471. }
  102472. // Header returns an http.Header that can be modified by the caller to
  102473. // add HTTP headers to the request.
  102474. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  102475. if c.header_ == nil {
  102476. c.header_ = make(http.Header)
  102477. }
  102478. return c.header_
  102479. }
  102480. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  102481. reqHeaders := make(http.Header)
  102482. for k, v := range c.header_ {
  102483. reqHeaders[k] = v
  102484. }
  102485. reqHeaders.Set("User-Agent", c.s.userAgent())
  102486. if c.ifNoneMatch_ != "" {
  102487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102488. }
  102489. var body io.Reader = nil
  102490. c.urlParams_.Set("alt", alt)
  102491. c.urlParams_.Set("prettyPrint", "false")
  102492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  102493. urls += "?" + c.urlParams_.Encode()
  102494. req, err := http.NewRequest("GET", urls, body)
  102495. if err != nil {
  102496. return nil, err
  102497. }
  102498. req.Header = reqHeaders
  102499. googleapi.Expand(req.URL, map[string]string{
  102500. "project": c.project,
  102501. "region": c.region,
  102502. "instanceGroup": c.instanceGroup,
  102503. })
  102504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102505. }
  102506. // Do executes the "compute.regionInstanceGroups.get" call.
  102507. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  102508. // status code is an error. Response headers are in either
  102509. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  102510. // at all) in error.(*googleapi.Error).Header. Use
  102511. // googleapi.IsNotModified to check whether the returned error was
  102512. // because http.StatusNotModified was returned.
  102513. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  102514. gensupport.SetOptions(c.urlParams_, opts...)
  102515. res, err := c.doRequest("json")
  102516. if res != nil && res.StatusCode == http.StatusNotModified {
  102517. if res.Body != nil {
  102518. res.Body.Close()
  102519. }
  102520. return nil, &googleapi.Error{
  102521. Code: res.StatusCode,
  102522. Header: res.Header,
  102523. }
  102524. }
  102525. if err != nil {
  102526. return nil, err
  102527. }
  102528. defer googleapi.CloseBody(res)
  102529. if err := googleapi.CheckResponse(res); err != nil {
  102530. return nil, err
  102531. }
  102532. ret := &InstanceGroup{
  102533. ServerResponse: googleapi.ServerResponse{
  102534. Header: res.Header,
  102535. HTTPStatusCode: res.StatusCode,
  102536. },
  102537. }
  102538. target := &ret
  102539. if err := gensupport.DecodeResponse(target, res); err != nil {
  102540. return nil, err
  102541. }
  102542. return ret, nil
  102543. // {
  102544. // "description": "Returns the specified instance group resource.",
  102545. // "httpMethod": "GET",
  102546. // "id": "compute.regionInstanceGroups.get",
  102547. // "parameterOrder": [
  102548. // "project",
  102549. // "region",
  102550. // "instanceGroup"
  102551. // ],
  102552. // "parameters": {
  102553. // "instanceGroup": {
  102554. // "description": "Name of the instance group resource to return.",
  102555. // "location": "path",
  102556. // "required": true,
  102557. // "type": "string"
  102558. // },
  102559. // "project": {
  102560. // "description": "Project ID for this request.",
  102561. // "location": "path",
  102562. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102563. // "required": true,
  102564. // "type": "string"
  102565. // },
  102566. // "region": {
  102567. // "description": "Name of the region scoping this request.",
  102568. // "location": "path",
  102569. // "required": true,
  102570. // "type": "string"
  102571. // }
  102572. // },
  102573. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  102574. // "response": {
  102575. // "$ref": "InstanceGroup"
  102576. // },
  102577. // "scopes": [
  102578. // "https://www.googleapis.com/auth/cloud-platform",
  102579. // "https://www.googleapis.com/auth/compute",
  102580. // "https://www.googleapis.com/auth/compute.readonly"
  102581. // ]
  102582. // }
  102583. }
  102584. // method id "compute.regionInstanceGroups.list":
  102585. type RegionInstanceGroupsListCall struct {
  102586. s *Service
  102587. project string
  102588. region string
  102589. urlParams_ gensupport.URLParams
  102590. ifNoneMatch_ string
  102591. ctx_ context.Context
  102592. header_ http.Header
  102593. }
  102594. // List: Retrieves the list of instance group resources contained within
  102595. // the specified region.
  102596. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  102597. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102598. c.project = project
  102599. c.region = region
  102600. return c
  102601. }
  102602. // Filter sets the optional parameter "filter": A filter expression that
  102603. // filters resources listed in the response. The expression must specify
  102604. // the field name, a comparison operator, and the value that you want to
  102605. // use for filtering. The value must be a string, a number, or a
  102606. // boolean. The comparison operator must be either =, !=, >, or <.
  102607. //
  102608. // For example, if you are filtering Compute Engine instances, you can
  102609. // exclude instances named example-instance by specifying name !=
  102610. // example-instance.
  102611. //
  102612. // You can also filter nested fields. For example, you could specify
  102613. // scheduling.automaticRestart = false to include instances only if they
  102614. // are not scheduled for automatic restarts. You can use filtering on
  102615. // nested fields to filter based on resource labels.
  102616. //
  102617. // To filter on multiple expressions, provide each separate expression
  102618. // within parentheses. For example, (scheduling.automaticRestart = true)
  102619. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102620. // AND expression. However, you can include AND and OR expressions
  102621. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102622. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102623. // true).
  102624. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  102625. c.urlParams_.Set("filter", filter)
  102626. return c
  102627. }
  102628. // MaxResults sets the optional parameter "maxResults": The maximum
  102629. // number of results per page that should be returned. If the number of
  102630. // available results is larger than maxResults, Compute Engine returns a
  102631. // nextPageToken that can be used to get the next page of results in
  102632. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102633. // (Default: 500)
  102634. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  102635. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102636. return c
  102637. }
  102638. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102639. // a certain order. By default, results are returned in alphanumerical
  102640. // order based on the resource name.
  102641. //
  102642. // You can also sort results in descending order based on the creation
  102643. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102644. // based on the creationTimestamp field in reverse chronological order
  102645. // (newest result first). Use this to sort resources like operations so
  102646. // that the newest operation is returned first.
  102647. //
  102648. // Currently, only sorting by name or creationTimestamp desc is
  102649. // supported.
  102650. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  102651. c.urlParams_.Set("orderBy", orderBy)
  102652. return c
  102653. }
  102654. // PageToken sets the optional parameter "pageToken": Specifies a page
  102655. // token to use. Set pageToken to the nextPageToken returned by a
  102656. // previous list request to get the next page of results.
  102657. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  102658. c.urlParams_.Set("pageToken", pageToken)
  102659. return c
  102660. }
  102661. // Fields allows partial responses to be retrieved. See
  102662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102663. // for more information.
  102664. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  102665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102666. return c
  102667. }
  102668. // IfNoneMatch sets the optional parameter which makes the operation
  102669. // fail if the object's ETag matches the given value. This is useful for
  102670. // getting updates only after the object has changed since the last
  102671. // request. Use googleapi.IsNotModified to check whether the response
  102672. // error from Do is the result of In-None-Match.
  102673. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  102674. c.ifNoneMatch_ = entityTag
  102675. return c
  102676. }
  102677. // Context sets the context to be used in this call's Do method. Any
  102678. // pending HTTP request will be aborted if the provided context is
  102679. // canceled.
  102680. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  102681. c.ctx_ = ctx
  102682. return c
  102683. }
  102684. // Header returns an http.Header that can be modified by the caller to
  102685. // add HTTP headers to the request.
  102686. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  102687. if c.header_ == nil {
  102688. c.header_ = make(http.Header)
  102689. }
  102690. return c.header_
  102691. }
  102692. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  102693. reqHeaders := make(http.Header)
  102694. for k, v := range c.header_ {
  102695. reqHeaders[k] = v
  102696. }
  102697. reqHeaders.Set("User-Agent", c.s.userAgent())
  102698. if c.ifNoneMatch_ != "" {
  102699. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102700. }
  102701. var body io.Reader = nil
  102702. c.urlParams_.Set("alt", alt)
  102703. c.urlParams_.Set("prettyPrint", "false")
  102704. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  102705. urls += "?" + c.urlParams_.Encode()
  102706. req, err := http.NewRequest("GET", urls, body)
  102707. if err != nil {
  102708. return nil, err
  102709. }
  102710. req.Header = reqHeaders
  102711. googleapi.Expand(req.URL, map[string]string{
  102712. "project": c.project,
  102713. "region": c.region,
  102714. })
  102715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102716. }
  102717. // Do executes the "compute.regionInstanceGroups.list" call.
  102718. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  102719. // non-2xx status code is an error. Response headers are in either
  102720. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  102721. // returned at all) in error.(*googleapi.Error).Header. Use
  102722. // googleapi.IsNotModified to check whether the returned error was
  102723. // because http.StatusNotModified was returned.
  102724. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  102725. gensupport.SetOptions(c.urlParams_, opts...)
  102726. res, err := c.doRequest("json")
  102727. if res != nil && res.StatusCode == http.StatusNotModified {
  102728. if res.Body != nil {
  102729. res.Body.Close()
  102730. }
  102731. return nil, &googleapi.Error{
  102732. Code: res.StatusCode,
  102733. Header: res.Header,
  102734. }
  102735. }
  102736. if err != nil {
  102737. return nil, err
  102738. }
  102739. defer googleapi.CloseBody(res)
  102740. if err := googleapi.CheckResponse(res); err != nil {
  102741. return nil, err
  102742. }
  102743. ret := &RegionInstanceGroupList{
  102744. ServerResponse: googleapi.ServerResponse{
  102745. Header: res.Header,
  102746. HTTPStatusCode: res.StatusCode,
  102747. },
  102748. }
  102749. target := &ret
  102750. if err := gensupport.DecodeResponse(target, res); err != nil {
  102751. return nil, err
  102752. }
  102753. return ret, nil
  102754. // {
  102755. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  102756. // "httpMethod": "GET",
  102757. // "id": "compute.regionInstanceGroups.list",
  102758. // "parameterOrder": [
  102759. // "project",
  102760. // "region"
  102761. // ],
  102762. // "parameters": {
  102763. // "filter": {
  102764. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  102765. // "location": "query",
  102766. // "type": "string"
  102767. // },
  102768. // "maxResults": {
  102769. // "default": "500",
  102770. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  102771. // "format": "uint32",
  102772. // "location": "query",
  102773. // "minimum": "0",
  102774. // "type": "integer"
  102775. // },
  102776. // "orderBy": {
  102777. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  102778. // "location": "query",
  102779. // "type": "string"
  102780. // },
  102781. // "pageToken": {
  102782. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  102783. // "location": "query",
  102784. // "type": "string"
  102785. // },
  102786. // "project": {
  102787. // "description": "Project ID for this request.",
  102788. // "location": "path",
  102789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102790. // "required": true,
  102791. // "type": "string"
  102792. // },
  102793. // "region": {
  102794. // "description": "Name of the region scoping this request.",
  102795. // "location": "path",
  102796. // "required": true,
  102797. // "type": "string"
  102798. // }
  102799. // },
  102800. // "path": "{project}/regions/{region}/instanceGroups",
  102801. // "response": {
  102802. // "$ref": "RegionInstanceGroupList"
  102803. // },
  102804. // "scopes": [
  102805. // "https://www.googleapis.com/auth/cloud-platform",
  102806. // "https://www.googleapis.com/auth/compute",
  102807. // "https://www.googleapis.com/auth/compute.readonly"
  102808. // ]
  102809. // }
  102810. }
  102811. // Pages invokes f for each page of results.
  102812. // A non-nil error returned from f will halt the iteration.
  102813. // The provided context supersedes any context provided to the Context method.
  102814. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  102815. c.ctx_ = ctx
  102816. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102817. for {
  102818. x, err := c.Do()
  102819. if err != nil {
  102820. return err
  102821. }
  102822. if err := f(x); err != nil {
  102823. return err
  102824. }
  102825. if x.NextPageToken == "" {
  102826. return nil
  102827. }
  102828. c.PageToken(x.NextPageToken)
  102829. }
  102830. }
  102831. // method id "compute.regionInstanceGroups.listInstances":
  102832. type RegionInstanceGroupsListInstancesCall struct {
  102833. s *Service
  102834. project string
  102835. region string
  102836. instanceGroup string
  102837. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  102838. urlParams_ gensupport.URLParams
  102839. ctx_ context.Context
  102840. header_ http.Header
  102841. }
  102842. // ListInstances: Lists the instances in the specified instance group
  102843. // and displays information about the named ports. Depending on the
  102844. // specified options, this method can list all instances or only the
  102845. // instances that are running.
  102846. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  102847. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102848. c.project = project
  102849. c.region = region
  102850. c.instanceGroup = instanceGroup
  102851. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  102852. return c
  102853. }
  102854. // Filter sets the optional parameter "filter": A filter expression that
  102855. // filters resources listed in the response. The expression must specify
  102856. // the field name, a comparison operator, and the value that you want to
  102857. // use for filtering. The value must be a string, a number, or a
  102858. // boolean. The comparison operator must be either =, !=, >, or <.
  102859. //
  102860. // For example, if you are filtering Compute Engine instances, you can
  102861. // exclude instances named example-instance by specifying name !=
  102862. // example-instance.
  102863. //
  102864. // You can also filter nested fields. For example, you could specify
  102865. // scheduling.automaticRestart = false to include instances only if they
  102866. // are not scheduled for automatic restarts. You can use filtering on
  102867. // nested fields to filter based on resource labels.
  102868. //
  102869. // To filter on multiple expressions, provide each separate expression
  102870. // within parentheses. For example, (scheduling.automaticRestart = true)
  102871. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102872. // AND expression. However, you can include AND and OR expressions
  102873. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102874. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102875. // true).
  102876. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  102877. c.urlParams_.Set("filter", filter)
  102878. return c
  102879. }
  102880. // MaxResults sets the optional parameter "maxResults": The maximum
  102881. // number of results per page that should be returned. If the number of
  102882. // available results is larger than maxResults, Compute Engine returns a
  102883. // nextPageToken that can be used to get the next page of results in
  102884. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102885. // (Default: 500)
  102886. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  102887. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102888. return c
  102889. }
  102890. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102891. // a certain order. By default, results are returned in alphanumerical
  102892. // order based on the resource name.
  102893. //
  102894. // You can also sort results in descending order based on the creation
  102895. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102896. // based on the creationTimestamp field in reverse chronological order
  102897. // (newest result first). Use this to sort resources like operations so
  102898. // that the newest operation is returned first.
  102899. //
  102900. // Currently, only sorting by name or creationTimestamp desc is
  102901. // supported.
  102902. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  102903. c.urlParams_.Set("orderBy", orderBy)
  102904. return c
  102905. }
  102906. // PageToken sets the optional parameter "pageToken": Specifies a page
  102907. // token to use. Set pageToken to the nextPageToken returned by a
  102908. // previous list request to get the next page of results.
  102909. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  102910. c.urlParams_.Set("pageToken", pageToken)
  102911. return c
  102912. }
  102913. // Fields allows partial responses to be retrieved. See
  102914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102915. // for more information.
  102916. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  102917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102918. return c
  102919. }
  102920. // Context sets the context to be used in this call's Do method. Any
  102921. // pending HTTP request will be aborted if the provided context is
  102922. // canceled.
  102923. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  102924. c.ctx_ = ctx
  102925. return c
  102926. }
  102927. // Header returns an http.Header that can be modified by the caller to
  102928. // add HTTP headers to the request.
  102929. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  102930. if c.header_ == nil {
  102931. c.header_ = make(http.Header)
  102932. }
  102933. return c.header_
  102934. }
  102935. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  102936. reqHeaders := make(http.Header)
  102937. for k, v := range c.header_ {
  102938. reqHeaders[k] = v
  102939. }
  102940. reqHeaders.Set("User-Agent", c.s.userAgent())
  102941. var body io.Reader = nil
  102942. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  102943. if err != nil {
  102944. return nil, err
  102945. }
  102946. reqHeaders.Set("Content-Type", "application/json")
  102947. c.urlParams_.Set("alt", alt)
  102948. c.urlParams_.Set("prettyPrint", "false")
  102949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  102950. urls += "?" + c.urlParams_.Encode()
  102951. req, err := http.NewRequest("POST", urls, body)
  102952. if err != nil {
  102953. return nil, err
  102954. }
  102955. req.Header = reqHeaders
  102956. googleapi.Expand(req.URL, map[string]string{
  102957. "project": c.project,
  102958. "region": c.region,
  102959. "instanceGroup": c.instanceGroup,
  102960. })
  102961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102962. }
  102963. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  102964. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  102965. // non-nil. Any non-2xx status code is an error. Response headers are in
  102966. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  102967. // (if a response was returned at all) in
  102968. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  102969. // whether the returned error was because http.StatusNotModified was
  102970. // returned.
  102971. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  102972. gensupport.SetOptions(c.urlParams_, opts...)
  102973. res, err := c.doRequest("json")
  102974. if res != nil && res.StatusCode == http.StatusNotModified {
  102975. if res.Body != nil {
  102976. res.Body.Close()
  102977. }
  102978. return nil, &googleapi.Error{
  102979. Code: res.StatusCode,
  102980. Header: res.Header,
  102981. }
  102982. }
  102983. if err != nil {
  102984. return nil, err
  102985. }
  102986. defer googleapi.CloseBody(res)
  102987. if err := googleapi.CheckResponse(res); err != nil {
  102988. return nil, err
  102989. }
  102990. ret := &RegionInstanceGroupsListInstances{
  102991. ServerResponse: googleapi.ServerResponse{
  102992. Header: res.Header,
  102993. HTTPStatusCode: res.StatusCode,
  102994. },
  102995. }
  102996. target := &ret
  102997. if err := gensupport.DecodeResponse(target, res); err != nil {
  102998. return nil, err
  102999. }
  103000. return ret, nil
  103001. // {
  103002. // "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.",
  103003. // "httpMethod": "POST",
  103004. // "id": "compute.regionInstanceGroups.listInstances",
  103005. // "parameterOrder": [
  103006. // "project",
  103007. // "region",
  103008. // "instanceGroup"
  103009. // ],
  103010. // "parameters": {
  103011. // "filter": {
  103012. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  103013. // "location": "query",
  103014. // "type": "string"
  103015. // },
  103016. // "instanceGroup": {
  103017. // "description": "Name of the regional instance group for which we want to list the instances.",
  103018. // "location": "path",
  103019. // "required": true,
  103020. // "type": "string"
  103021. // },
  103022. // "maxResults": {
  103023. // "default": "500",
  103024. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  103025. // "format": "uint32",
  103026. // "location": "query",
  103027. // "minimum": "0",
  103028. // "type": "integer"
  103029. // },
  103030. // "orderBy": {
  103031. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  103032. // "location": "query",
  103033. // "type": "string"
  103034. // },
  103035. // "pageToken": {
  103036. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  103037. // "location": "query",
  103038. // "type": "string"
  103039. // },
  103040. // "project": {
  103041. // "description": "Project ID for this request.",
  103042. // "location": "path",
  103043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103044. // "required": true,
  103045. // "type": "string"
  103046. // },
  103047. // "region": {
  103048. // "description": "Name of the region scoping this request.",
  103049. // "location": "path",
  103050. // "required": true,
  103051. // "type": "string"
  103052. // }
  103053. // },
  103054. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  103055. // "request": {
  103056. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  103057. // },
  103058. // "response": {
  103059. // "$ref": "RegionInstanceGroupsListInstances"
  103060. // },
  103061. // "scopes": [
  103062. // "https://www.googleapis.com/auth/cloud-platform",
  103063. // "https://www.googleapis.com/auth/compute",
  103064. // "https://www.googleapis.com/auth/compute.readonly"
  103065. // ]
  103066. // }
  103067. }
  103068. // Pages invokes f for each page of results.
  103069. // A non-nil error returned from f will halt the iteration.
  103070. // The provided context supersedes any context provided to the Context method.
  103071. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  103072. c.ctx_ = ctx
  103073. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103074. for {
  103075. x, err := c.Do()
  103076. if err != nil {
  103077. return err
  103078. }
  103079. if err := f(x); err != nil {
  103080. return err
  103081. }
  103082. if x.NextPageToken == "" {
  103083. return nil
  103084. }
  103085. c.PageToken(x.NextPageToken)
  103086. }
  103087. }
  103088. // method id "compute.regionInstanceGroups.setNamedPorts":
  103089. type RegionInstanceGroupsSetNamedPortsCall struct {
  103090. s *Service
  103091. project string
  103092. region string
  103093. instanceGroup string
  103094. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  103095. urlParams_ gensupport.URLParams
  103096. ctx_ context.Context
  103097. header_ http.Header
  103098. }
  103099. // SetNamedPorts: Sets the named ports for the specified regional
  103100. // instance group.
  103101. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  103102. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103103. c.project = project
  103104. c.region = region
  103105. c.instanceGroup = instanceGroup
  103106. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  103107. return c
  103108. }
  103109. // RequestId sets the optional parameter "requestId": An optional
  103110. // request ID to identify requests. Specify a unique request ID so that
  103111. // if you must retry your request, the server will know to ignore the
  103112. // request if it has already been completed.
  103113. //
  103114. // For example, consider a situation where you make an initial request
  103115. // and the request times out. If you make the request again with the
  103116. // same request ID, the server can check if original operation with the
  103117. // same request ID was received, and if so, will ignore the second
  103118. // request. This prevents clients from accidentally creating duplicate
  103119. // commitments.
  103120. //
  103121. // The request ID must be a valid UUID with the exception that zero UUID
  103122. // is not supported (00000000-0000-0000-0000-000000000000).
  103123. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  103124. c.urlParams_.Set("requestId", requestId)
  103125. return c
  103126. }
  103127. // Fields allows partial responses to be retrieved. See
  103128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103129. // for more information.
  103130. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  103131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103132. return c
  103133. }
  103134. // Context sets the context to be used in this call's Do method. Any
  103135. // pending HTTP request will be aborted if the provided context is
  103136. // canceled.
  103137. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  103138. c.ctx_ = ctx
  103139. return c
  103140. }
  103141. // Header returns an http.Header that can be modified by the caller to
  103142. // add HTTP headers to the request.
  103143. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  103144. if c.header_ == nil {
  103145. c.header_ = make(http.Header)
  103146. }
  103147. return c.header_
  103148. }
  103149. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  103150. reqHeaders := make(http.Header)
  103151. for k, v := range c.header_ {
  103152. reqHeaders[k] = v
  103153. }
  103154. reqHeaders.Set("User-Agent", c.s.userAgent())
  103155. var body io.Reader = nil
  103156. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  103157. if err != nil {
  103158. return nil, err
  103159. }
  103160. reqHeaders.Set("Content-Type", "application/json")
  103161. c.urlParams_.Set("alt", alt)
  103162. c.urlParams_.Set("prettyPrint", "false")
  103163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  103164. urls += "?" + c.urlParams_.Encode()
  103165. req, err := http.NewRequest("POST", urls, body)
  103166. if err != nil {
  103167. return nil, err
  103168. }
  103169. req.Header = reqHeaders
  103170. googleapi.Expand(req.URL, map[string]string{
  103171. "project": c.project,
  103172. "region": c.region,
  103173. "instanceGroup": c.instanceGroup,
  103174. })
  103175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103176. }
  103177. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  103178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103179. // status code is an error. Response headers are in either
  103180. // *Operation.ServerResponse.Header or (if a response was returned at
  103181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103182. // to check whether the returned error was because
  103183. // http.StatusNotModified was returned.
  103184. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103185. gensupport.SetOptions(c.urlParams_, opts...)
  103186. res, err := c.doRequest("json")
  103187. if res != nil && res.StatusCode == http.StatusNotModified {
  103188. if res.Body != nil {
  103189. res.Body.Close()
  103190. }
  103191. return nil, &googleapi.Error{
  103192. Code: res.StatusCode,
  103193. Header: res.Header,
  103194. }
  103195. }
  103196. if err != nil {
  103197. return nil, err
  103198. }
  103199. defer googleapi.CloseBody(res)
  103200. if err := googleapi.CheckResponse(res); err != nil {
  103201. return nil, err
  103202. }
  103203. ret := &Operation{
  103204. ServerResponse: googleapi.ServerResponse{
  103205. Header: res.Header,
  103206. HTTPStatusCode: res.StatusCode,
  103207. },
  103208. }
  103209. target := &ret
  103210. if err := gensupport.DecodeResponse(target, res); err != nil {
  103211. return nil, err
  103212. }
  103213. return ret, nil
  103214. // {
  103215. // "description": "Sets the named ports for the specified regional instance group.",
  103216. // "httpMethod": "POST",
  103217. // "id": "compute.regionInstanceGroups.setNamedPorts",
  103218. // "parameterOrder": [
  103219. // "project",
  103220. // "region",
  103221. // "instanceGroup"
  103222. // ],
  103223. // "parameters": {
  103224. // "instanceGroup": {
  103225. // "description": "The name of the regional instance group where the named ports are updated.",
  103226. // "location": "path",
  103227. // "required": true,
  103228. // "type": "string"
  103229. // },
  103230. // "project": {
  103231. // "description": "Project ID for this request.",
  103232. // "location": "path",
  103233. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103234. // "required": true,
  103235. // "type": "string"
  103236. // },
  103237. // "region": {
  103238. // "description": "Name of the region scoping this request.",
  103239. // "location": "path",
  103240. // "required": true,
  103241. // "type": "string"
  103242. // },
  103243. // "requestId": {
  103244. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103245. // "location": "query",
  103246. // "type": "string"
  103247. // }
  103248. // },
  103249. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  103250. // "request": {
  103251. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  103252. // },
  103253. // "response": {
  103254. // "$ref": "Operation"
  103255. // },
  103256. // "scopes": [
  103257. // "https://www.googleapis.com/auth/cloud-platform",
  103258. // "https://www.googleapis.com/auth/compute"
  103259. // ]
  103260. // }
  103261. }
  103262. // method id "compute.regionInstanceGroups.testIamPermissions":
  103263. type RegionInstanceGroupsTestIamPermissionsCall struct {
  103264. s *Service
  103265. project string
  103266. region string
  103267. resource string
  103268. testpermissionsrequest *TestPermissionsRequest
  103269. urlParams_ gensupport.URLParams
  103270. ctx_ context.Context
  103271. header_ http.Header
  103272. }
  103273. // TestIamPermissions: Returns permissions that a caller has on the
  103274. // specified resource.
  103275. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  103276. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103277. c.project = project
  103278. c.region = region
  103279. c.resource = resource
  103280. c.testpermissionsrequest = testpermissionsrequest
  103281. return c
  103282. }
  103283. // Fields allows partial responses to be retrieved. See
  103284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103285. // for more information.
  103286. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  103287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103288. return c
  103289. }
  103290. // Context sets the context to be used in this call's Do method. Any
  103291. // pending HTTP request will be aborted if the provided context is
  103292. // canceled.
  103293. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  103294. c.ctx_ = ctx
  103295. return c
  103296. }
  103297. // Header returns an http.Header that can be modified by the caller to
  103298. // add HTTP headers to the request.
  103299. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  103300. if c.header_ == nil {
  103301. c.header_ = make(http.Header)
  103302. }
  103303. return c.header_
  103304. }
  103305. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  103306. reqHeaders := make(http.Header)
  103307. for k, v := range c.header_ {
  103308. reqHeaders[k] = v
  103309. }
  103310. reqHeaders.Set("User-Agent", c.s.userAgent())
  103311. var body io.Reader = nil
  103312. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  103313. if err != nil {
  103314. return nil, err
  103315. }
  103316. reqHeaders.Set("Content-Type", "application/json")
  103317. c.urlParams_.Set("alt", alt)
  103318. c.urlParams_.Set("prettyPrint", "false")
  103319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  103320. urls += "?" + c.urlParams_.Encode()
  103321. req, err := http.NewRequest("POST", urls, body)
  103322. if err != nil {
  103323. return nil, err
  103324. }
  103325. req.Header = reqHeaders
  103326. googleapi.Expand(req.URL, map[string]string{
  103327. "project": c.project,
  103328. "region": c.region,
  103329. "resource": c.resource,
  103330. })
  103331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103332. }
  103333. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  103334. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  103335. // non-2xx status code is an error. Response headers are in either
  103336. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  103337. // returned at all) in error.(*googleapi.Error).Header. Use
  103338. // googleapi.IsNotModified to check whether the returned error was
  103339. // because http.StatusNotModified was returned.
  103340. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  103341. gensupport.SetOptions(c.urlParams_, opts...)
  103342. res, err := c.doRequest("json")
  103343. if res != nil && res.StatusCode == http.StatusNotModified {
  103344. if res.Body != nil {
  103345. res.Body.Close()
  103346. }
  103347. return nil, &googleapi.Error{
  103348. Code: res.StatusCode,
  103349. Header: res.Header,
  103350. }
  103351. }
  103352. if err != nil {
  103353. return nil, err
  103354. }
  103355. defer googleapi.CloseBody(res)
  103356. if err := googleapi.CheckResponse(res); err != nil {
  103357. return nil, err
  103358. }
  103359. ret := &TestPermissionsResponse{
  103360. ServerResponse: googleapi.ServerResponse{
  103361. Header: res.Header,
  103362. HTTPStatusCode: res.StatusCode,
  103363. },
  103364. }
  103365. target := &ret
  103366. if err := gensupport.DecodeResponse(target, res); err != nil {
  103367. return nil, err
  103368. }
  103369. return ret, nil
  103370. // {
  103371. // "description": "Returns permissions that a caller has on the specified resource.",
  103372. // "httpMethod": "POST",
  103373. // "id": "compute.regionInstanceGroups.testIamPermissions",
  103374. // "parameterOrder": [
  103375. // "project",
  103376. // "region",
  103377. // "resource"
  103378. // ],
  103379. // "parameters": {
  103380. // "project": {
  103381. // "description": "Project ID for this request.",
  103382. // "location": "path",
  103383. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103384. // "required": true,
  103385. // "type": "string"
  103386. // },
  103387. // "region": {
  103388. // "description": "The name of the region for this request.",
  103389. // "location": "path",
  103390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103391. // "required": true,
  103392. // "type": "string"
  103393. // },
  103394. // "resource": {
  103395. // "description": "Name or id of the resource for this request.",
  103396. // "location": "path",
  103397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103398. // "required": true,
  103399. // "type": "string"
  103400. // }
  103401. // },
  103402. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  103403. // "request": {
  103404. // "$ref": "TestPermissionsRequest"
  103405. // },
  103406. // "response": {
  103407. // "$ref": "TestPermissionsResponse"
  103408. // },
  103409. // "scopes": [
  103410. // "https://www.googleapis.com/auth/cloud-platform",
  103411. // "https://www.googleapis.com/auth/compute",
  103412. // "https://www.googleapis.com/auth/compute.readonly"
  103413. // ]
  103414. // }
  103415. }
  103416. // method id "compute.regionOperations.delete":
  103417. type RegionOperationsDeleteCall struct {
  103418. s *Service
  103419. project string
  103420. region string
  103421. operation string
  103422. urlParams_ gensupport.URLParams
  103423. ctx_ context.Context
  103424. header_ http.Header
  103425. }
  103426. // Delete: Deletes the specified region-specific Operations resource.
  103427. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  103428. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  103429. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103430. c.project = project
  103431. c.region = region
  103432. c.operation = operation
  103433. return c
  103434. }
  103435. // Fields allows partial responses to be retrieved. See
  103436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103437. // for more information.
  103438. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  103439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103440. return c
  103441. }
  103442. // Context sets the context to be used in this call's Do method. Any
  103443. // pending HTTP request will be aborted if the provided context is
  103444. // canceled.
  103445. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  103446. c.ctx_ = ctx
  103447. return c
  103448. }
  103449. // Header returns an http.Header that can be modified by the caller to
  103450. // add HTTP headers to the request.
  103451. func (c *RegionOperationsDeleteCall) Header() http.Header {
  103452. if c.header_ == nil {
  103453. c.header_ = make(http.Header)
  103454. }
  103455. return c.header_
  103456. }
  103457. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  103458. reqHeaders := make(http.Header)
  103459. for k, v := range c.header_ {
  103460. reqHeaders[k] = v
  103461. }
  103462. reqHeaders.Set("User-Agent", c.s.userAgent())
  103463. var body io.Reader = nil
  103464. c.urlParams_.Set("alt", alt)
  103465. c.urlParams_.Set("prettyPrint", "false")
  103466. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  103467. urls += "?" + c.urlParams_.Encode()
  103468. req, err := http.NewRequest("DELETE", urls, body)
  103469. if err != nil {
  103470. return nil, err
  103471. }
  103472. req.Header = reqHeaders
  103473. googleapi.Expand(req.URL, map[string]string{
  103474. "project": c.project,
  103475. "region": c.region,
  103476. "operation": c.operation,
  103477. })
  103478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103479. }
  103480. // Do executes the "compute.regionOperations.delete" call.
  103481. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  103482. gensupport.SetOptions(c.urlParams_, opts...)
  103483. res, err := c.doRequest("json")
  103484. if err != nil {
  103485. return err
  103486. }
  103487. defer googleapi.CloseBody(res)
  103488. if err := googleapi.CheckResponse(res); err != nil {
  103489. return err
  103490. }
  103491. return nil
  103492. // {
  103493. // "description": "Deletes the specified region-specific Operations resource.",
  103494. // "httpMethod": "DELETE",
  103495. // "id": "compute.regionOperations.delete",
  103496. // "parameterOrder": [
  103497. // "project",
  103498. // "region",
  103499. // "operation"
  103500. // ],
  103501. // "parameters": {
  103502. // "operation": {
  103503. // "description": "Name of the Operations resource to delete.",
  103504. // "location": "path",
  103505. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103506. // "required": true,
  103507. // "type": "string"
  103508. // },
  103509. // "project": {
  103510. // "description": "Project ID for this request.",
  103511. // "location": "path",
  103512. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103513. // "required": true,
  103514. // "type": "string"
  103515. // },
  103516. // "region": {
  103517. // "description": "Name of the region for this request.",
  103518. // "location": "path",
  103519. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103520. // "required": true,
  103521. // "type": "string"
  103522. // }
  103523. // },
  103524. // "path": "{project}/regions/{region}/operations/{operation}",
  103525. // "scopes": [
  103526. // "https://www.googleapis.com/auth/cloud-platform",
  103527. // "https://www.googleapis.com/auth/compute"
  103528. // ]
  103529. // }
  103530. }
  103531. // method id "compute.regionOperations.get":
  103532. type RegionOperationsGetCall struct {
  103533. s *Service
  103534. project string
  103535. region string
  103536. operation string
  103537. urlParams_ gensupport.URLParams
  103538. ifNoneMatch_ string
  103539. ctx_ context.Context
  103540. header_ http.Header
  103541. }
  103542. // Get: Retrieves the specified region-specific Operations resource.
  103543. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  103544. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  103545. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103546. c.project = project
  103547. c.region = region
  103548. c.operation = operation
  103549. return c
  103550. }
  103551. // Fields allows partial responses to be retrieved. See
  103552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103553. // for more information.
  103554. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  103555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103556. return c
  103557. }
  103558. // IfNoneMatch sets the optional parameter which makes the operation
  103559. // fail if the object's ETag matches the given value. This is useful for
  103560. // getting updates only after the object has changed since the last
  103561. // request. Use googleapi.IsNotModified to check whether the response
  103562. // error from Do is the result of In-None-Match.
  103563. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  103564. c.ifNoneMatch_ = entityTag
  103565. return c
  103566. }
  103567. // Context sets the context to be used in this call's Do method. Any
  103568. // pending HTTP request will be aborted if the provided context is
  103569. // canceled.
  103570. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  103571. c.ctx_ = ctx
  103572. return c
  103573. }
  103574. // Header returns an http.Header that can be modified by the caller to
  103575. // add HTTP headers to the request.
  103576. func (c *RegionOperationsGetCall) Header() http.Header {
  103577. if c.header_ == nil {
  103578. c.header_ = make(http.Header)
  103579. }
  103580. return c.header_
  103581. }
  103582. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  103583. reqHeaders := make(http.Header)
  103584. for k, v := range c.header_ {
  103585. reqHeaders[k] = v
  103586. }
  103587. reqHeaders.Set("User-Agent", c.s.userAgent())
  103588. if c.ifNoneMatch_ != "" {
  103589. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103590. }
  103591. var body io.Reader = nil
  103592. c.urlParams_.Set("alt", alt)
  103593. c.urlParams_.Set("prettyPrint", "false")
  103594. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  103595. urls += "?" + c.urlParams_.Encode()
  103596. req, err := http.NewRequest("GET", urls, body)
  103597. if err != nil {
  103598. return nil, err
  103599. }
  103600. req.Header = reqHeaders
  103601. googleapi.Expand(req.URL, map[string]string{
  103602. "project": c.project,
  103603. "region": c.region,
  103604. "operation": c.operation,
  103605. })
  103606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103607. }
  103608. // Do executes the "compute.regionOperations.get" call.
  103609. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103610. // status code is an error. Response headers are in either
  103611. // *Operation.ServerResponse.Header or (if a response was returned at
  103612. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103613. // to check whether the returned error was because
  103614. // http.StatusNotModified was returned.
  103615. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103616. gensupport.SetOptions(c.urlParams_, opts...)
  103617. res, err := c.doRequest("json")
  103618. if res != nil && res.StatusCode == http.StatusNotModified {
  103619. if res.Body != nil {
  103620. res.Body.Close()
  103621. }
  103622. return nil, &googleapi.Error{
  103623. Code: res.StatusCode,
  103624. Header: res.Header,
  103625. }
  103626. }
  103627. if err != nil {
  103628. return nil, err
  103629. }
  103630. defer googleapi.CloseBody(res)
  103631. if err := googleapi.CheckResponse(res); err != nil {
  103632. return nil, err
  103633. }
  103634. ret := &Operation{
  103635. ServerResponse: googleapi.ServerResponse{
  103636. Header: res.Header,
  103637. HTTPStatusCode: res.StatusCode,
  103638. },
  103639. }
  103640. target := &ret
  103641. if err := gensupport.DecodeResponse(target, res); err != nil {
  103642. return nil, err
  103643. }
  103644. return ret, nil
  103645. // {
  103646. // "description": "Retrieves the specified region-specific Operations resource.",
  103647. // "httpMethod": "GET",
  103648. // "id": "compute.regionOperations.get",
  103649. // "parameterOrder": [
  103650. // "project",
  103651. // "region",
  103652. // "operation"
  103653. // ],
  103654. // "parameters": {
  103655. // "operation": {
  103656. // "description": "Name of the Operations resource to return.",
  103657. // "location": "path",
  103658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103659. // "required": true,
  103660. // "type": "string"
  103661. // },
  103662. // "project": {
  103663. // "description": "Project ID for this request.",
  103664. // "location": "path",
  103665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103666. // "required": true,
  103667. // "type": "string"
  103668. // },
  103669. // "region": {
  103670. // "description": "Name of the region for this request.",
  103671. // "location": "path",
  103672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103673. // "required": true,
  103674. // "type": "string"
  103675. // }
  103676. // },
  103677. // "path": "{project}/regions/{region}/operations/{operation}",
  103678. // "response": {
  103679. // "$ref": "Operation"
  103680. // },
  103681. // "scopes": [
  103682. // "https://www.googleapis.com/auth/cloud-platform",
  103683. // "https://www.googleapis.com/auth/compute",
  103684. // "https://www.googleapis.com/auth/compute.readonly"
  103685. // ]
  103686. // }
  103687. }
  103688. // method id "compute.regionOperations.list":
  103689. type RegionOperationsListCall struct {
  103690. s *Service
  103691. project string
  103692. region string
  103693. urlParams_ gensupport.URLParams
  103694. ifNoneMatch_ string
  103695. ctx_ context.Context
  103696. header_ http.Header
  103697. }
  103698. // List: Retrieves a list of Operation resources contained within the
  103699. // specified region.
  103700. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  103701. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  103702. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103703. c.project = project
  103704. c.region = region
  103705. return c
  103706. }
  103707. // Filter sets the optional parameter "filter": A filter expression that
  103708. // filters resources listed in the response. The expression must specify
  103709. // the field name, a comparison operator, and the value that you want to
  103710. // use for filtering. The value must be a string, a number, or a
  103711. // boolean. The comparison operator must be either =, !=, >, or <.
  103712. //
  103713. // For example, if you are filtering Compute Engine instances, you can
  103714. // exclude instances named example-instance by specifying name !=
  103715. // example-instance.
  103716. //
  103717. // You can also filter nested fields. For example, you could specify
  103718. // scheduling.automaticRestart = false to include instances only if they
  103719. // are not scheduled for automatic restarts. You can use filtering on
  103720. // nested fields to filter based on resource labels.
  103721. //
  103722. // To filter on multiple expressions, provide each separate expression
  103723. // within parentheses. For example, (scheduling.automaticRestart = true)
  103724. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103725. // AND expression. However, you can include AND and OR expressions
  103726. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103727. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103728. // true).
  103729. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  103730. c.urlParams_.Set("filter", filter)
  103731. return c
  103732. }
  103733. // MaxResults sets the optional parameter "maxResults": The maximum
  103734. // number of results per page that should be returned. If the number of
  103735. // available results is larger than maxResults, Compute Engine returns a
  103736. // nextPageToken that can be used to get the next page of results in
  103737. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103738. // (Default: 500)
  103739. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  103740. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103741. return c
  103742. }
  103743. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103744. // a certain order. By default, results are returned in alphanumerical
  103745. // order based on the resource name.
  103746. //
  103747. // You can also sort results in descending order based on the creation
  103748. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103749. // based on the creationTimestamp field in reverse chronological order
  103750. // (newest result first). Use this to sort resources like operations so
  103751. // that the newest operation is returned first.
  103752. //
  103753. // Currently, only sorting by name or creationTimestamp desc is
  103754. // supported.
  103755. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  103756. c.urlParams_.Set("orderBy", orderBy)
  103757. return c
  103758. }
  103759. // PageToken sets the optional parameter "pageToken": Specifies a page
  103760. // token to use. Set pageToken to the nextPageToken returned by a
  103761. // previous list request to get the next page of results.
  103762. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  103763. c.urlParams_.Set("pageToken", pageToken)
  103764. return c
  103765. }
  103766. // Fields allows partial responses to be retrieved. See
  103767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103768. // for more information.
  103769. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  103770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103771. return c
  103772. }
  103773. // IfNoneMatch sets the optional parameter which makes the operation
  103774. // fail if the object's ETag matches the given value. This is useful for
  103775. // getting updates only after the object has changed since the last
  103776. // request. Use googleapi.IsNotModified to check whether the response
  103777. // error from Do is the result of In-None-Match.
  103778. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  103779. c.ifNoneMatch_ = entityTag
  103780. return c
  103781. }
  103782. // Context sets the context to be used in this call's Do method. Any
  103783. // pending HTTP request will be aborted if the provided context is
  103784. // canceled.
  103785. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  103786. c.ctx_ = ctx
  103787. return c
  103788. }
  103789. // Header returns an http.Header that can be modified by the caller to
  103790. // add HTTP headers to the request.
  103791. func (c *RegionOperationsListCall) Header() http.Header {
  103792. if c.header_ == nil {
  103793. c.header_ = make(http.Header)
  103794. }
  103795. return c.header_
  103796. }
  103797. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  103798. reqHeaders := make(http.Header)
  103799. for k, v := range c.header_ {
  103800. reqHeaders[k] = v
  103801. }
  103802. reqHeaders.Set("User-Agent", c.s.userAgent())
  103803. if c.ifNoneMatch_ != "" {
  103804. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103805. }
  103806. var body io.Reader = nil
  103807. c.urlParams_.Set("alt", alt)
  103808. c.urlParams_.Set("prettyPrint", "false")
  103809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  103810. urls += "?" + c.urlParams_.Encode()
  103811. req, err := http.NewRequest("GET", urls, body)
  103812. if err != nil {
  103813. return nil, err
  103814. }
  103815. req.Header = reqHeaders
  103816. googleapi.Expand(req.URL, map[string]string{
  103817. "project": c.project,
  103818. "region": c.region,
  103819. })
  103820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103821. }
  103822. // Do executes the "compute.regionOperations.list" call.
  103823. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  103824. // status code is an error. Response headers are in either
  103825. // *OperationList.ServerResponse.Header or (if a response was returned
  103826. // at all) in error.(*googleapi.Error).Header. Use
  103827. // googleapi.IsNotModified to check whether the returned error was
  103828. // because http.StatusNotModified was returned.
  103829. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  103830. gensupport.SetOptions(c.urlParams_, opts...)
  103831. res, err := c.doRequest("json")
  103832. if res != nil && res.StatusCode == http.StatusNotModified {
  103833. if res.Body != nil {
  103834. res.Body.Close()
  103835. }
  103836. return nil, &googleapi.Error{
  103837. Code: res.StatusCode,
  103838. Header: res.Header,
  103839. }
  103840. }
  103841. if err != nil {
  103842. return nil, err
  103843. }
  103844. defer googleapi.CloseBody(res)
  103845. if err := googleapi.CheckResponse(res); err != nil {
  103846. return nil, err
  103847. }
  103848. ret := &OperationList{
  103849. ServerResponse: googleapi.ServerResponse{
  103850. Header: res.Header,
  103851. HTTPStatusCode: res.StatusCode,
  103852. },
  103853. }
  103854. target := &ret
  103855. if err := gensupport.DecodeResponse(target, res); err != nil {
  103856. return nil, err
  103857. }
  103858. return ret, nil
  103859. // {
  103860. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  103861. // "httpMethod": "GET",
  103862. // "id": "compute.regionOperations.list",
  103863. // "parameterOrder": [
  103864. // "project",
  103865. // "region"
  103866. // ],
  103867. // "parameters": {
  103868. // "filter": {
  103869. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  103870. // "location": "query",
  103871. // "type": "string"
  103872. // },
  103873. // "maxResults": {
  103874. // "default": "500",
  103875. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  103876. // "format": "uint32",
  103877. // "location": "query",
  103878. // "minimum": "0",
  103879. // "type": "integer"
  103880. // },
  103881. // "orderBy": {
  103882. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  103883. // "location": "query",
  103884. // "type": "string"
  103885. // },
  103886. // "pageToken": {
  103887. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  103888. // "location": "query",
  103889. // "type": "string"
  103890. // },
  103891. // "project": {
  103892. // "description": "Project ID for this request.",
  103893. // "location": "path",
  103894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103895. // "required": true,
  103896. // "type": "string"
  103897. // },
  103898. // "region": {
  103899. // "description": "Name of the region for this request.",
  103900. // "location": "path",
  103901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103902. // "required": true,
  103903. // "type": "string"
  103904. // }
  103905. // },
  103906. // "path": "{project}/regions/{region}/operations",
  103907. // "response": {
  103908. // "$ref": "OperationList"
  103909. // },
  103910. // "scopes": [
  103911. // "https://www.googleapis.com/auth/cloud-platform",
  103912. // "https://www.googleapis.com/auth/compute",
  103913. // "https://www.googleapis.com/auth/compute.readonly"
  103914. // ]
  103915. // }
  103916. }
  103917. // Pages invokes f for each page of results.
  103918. // A non-nil error returned from f will halt the iteration.
  103919. // The provided context supersedes any context provided to the Context method.
  103920. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  103921. c.ctx_ = ctx
  103922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103923. for {
  103924. x, err := c.Do()
  103925. if err != nil {
  103926. return err
  103927. }
  103928. if err := f(x); err != nil {
  103929. return err
  103930. }
  103931. if x.NextPageToken == "" {
  103932. return nil
  103933. }
  103934. c.PageToken(x.NextPageToken)
  103935. }
  103936. }
  103937. // method id "compute.regionOperations.wait":
  103938. type RegionOperationsWaitCall struct {
  103939. s *Service
  103940. project string
  103941. region string
  103942. operation string
  103943. urlParams_ gensupport.URLParams
  103944. ctx_ context.Context
  103945. header_ http.Header
  103946. }
  103947. // Wait: Waits for the specified region-specific Operations resource
  103948. // until it is done or timeout, and retrieves the specified Operations
  103949. // resource. 1. Immediately returns when the operation is already done.
  103950. // 2. Waits for no more than the default deadline (2 minutes, subject to
  103951. // change) and then returns the current state of the operation, which
  103952. // may be DONE or still in progress. 3. Is best-effort: a. The server
  103953. // can wait less than the default deadline or zero seconds, in overload
  103954. // situations. b. There is no guarantee that the operation is actually
  103955. // done when returns. 4. User should be prepared to retry if the
  103956. // operation is not DONE.
  103957. func (r *RegionOperationsService) Wait(project string, region string, operation string) *RegionOperationsWaitCall {
  103958. c := &RegionOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103959. c.project = project
  103960. c.region = region
  103961. c.operation = operation
  103962. return c
  103963. }
  103964. // Fields allows partial responses to be retrieved. See
  103965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103966. // for more information.
  103967. func (c *RegionOperationsWaitCall) Fields(s ...googleapi.Field) *RegionOperationsWaitCall {
  103968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103969. return c
  103970. }
  103971. // Context sets the context to be used in this call's Do method. Any
  103972. // pending HTTP request will be aborted if the provided context is
  103973. // canceled.
  103974. func (c *RegionOperationsWaitCall) Context(ctx context.Context) *RegionOperationsWaitCall {
  103975. c.ctx_ = ctx
  103976. return c
  103977. }
  103978. // Header returns an http.Header that can be modified by the caller to
  103979. // add HTTP headers to the request.
  103980. func (c *RegionOperationsWaitCall) Header() http.Header {
  103981. if c.header_ == nil {
  103982. c.header_ = make(http.Header)
  103983. }
  103984. return c.header_
  103985. }
  103986. func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  103987. reqHeaders := make(http.Header)
  103988. for k, v := range c.header_ {
  103989. reqHeaders[k] = v
  103990. }
  103991. reqHeaders.Set("User-Agent", c.s.userAgent())
  103992. var body io.Reader = nil
  103993. c.urlParams_.Set("alt", alt)
  103994. c.urlParams_.Set("prettyPrint", "false")
  103995. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}/wait")
  103996. urls += "?" + c.urlParams_.Encode()
  103997. req, err := http.NewRequest("POST", urls, body)
  103998. if err != nil {
  103999. return nil, err
  104000. }
  104001. req.Header = reqHeaders
  104002. googleapi.Expand(req.URL, map[string]string{
  104003. "project": c.project,
  104004. "region": c.region,
  104005. "operation": c.operation,
  104006. })
  104007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104008. }
  104009. // Do executes the "compute.regionOperations.wait" call.
  104010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104011. // status code is an error. Response headers are in either
  104012. // *Operation.ServerResponse.Header or (if a response was returned at
  104013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104014. // to check whether the returned error was because
  104015. // http.StatusNotModified was returned.
  104016. func (c *RegionOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104017. gensupport.SetOptions(c.urlParams_, opts...)
  104018. res, err := c.doRequest("json")
  104019. if res != nil && res.StatusCode == http.StatusNotModified {
  104020. if res.Body != nil {
  104021. res.Body.Close()
  104022. }
  104023. return nil, &googleapi.Error{
  104024. Code: res.StatusCode,
  104025. Header: res.Header,
  104026. }
  104027. }
  104028. if err != nil {
  104029. return nil, err
  104030. }
  104031. defer googleapi.CloseBody(res)
  104032. if err := googleapi.CheckResponse(res); err != nil {
  104033. return nil, err
  104034. }
  104035. ret := &Operation{
  104036. ServerResponse: googleapi.ServerResponse{
  104037. Header: res.Header,
  104038. HTTPStatusCode: res.StatusCode,
  104039. },
  104040. }
  104041. target := &ret
  104042. if err := gensupport.DecodeResponse(target, res); err != nil {
  104043. return nil, err
  104044. }
  104045. return ret, nil
  104046. // {
  104047. // "description": "Waits for the specified region-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  104048. // "httpMethod": "POST",
  104049. // "id": "compute.regionOperations.wait",
  104050. // "parameterOrder": [
  104051. // "project",
  104052. // "region",
  104053. // "operation"
  104054. // ],
  104055. // "parameters": {
  104056. // "operation": {
  104057. // "description": "Name of the Operations resource to return.",
  104058. // "location": "path",
  104059. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104060. // "required": true,
  104061. // "type": "string"
  104062. // },
  104063. // "project": {
  104064. // "description": "Project ID for this request.",
  104065. // "location": "path",
  104066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104067. // "required": true,
  104068. // "type": "string"
  104069. // },
  104070. // "region": {
  104071. // "description": "Name of the region for this request.",
  104072. // "location": "path",
  104073. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104074. // "required": true,
  104075. // "type": "string"
  104076. // }
  104077. // },
  104078. // "path": "{project}/regions/{region}/operations/{operation}/wait",
  104079. // "response": {
  104080. // "$ref": "Operation"
  104081. // },
  104082. // "scopes": [
  104083. // "https://www.googleapis.com/auth/cloud-platform",
  104084. // "https://www.googleapis.com/auth/compute",
  104085. // "https://www.googleapis.com/auth/compute.readonly"
  104086. // ]
  104087. // }
  104088. }
  104089. // method id "compute.regionSslCertificates.delete":
  104090. type RegionSslCertificatesDeleteCall struct {
  104091. s *Service
  104092. project string
  104093. region string
  104094. sslCertificate string
  104095. urlParams_ gensupport.URLParams
  104096. ctx_ context.Context
  104097. header_ http.Header
  104098. }
  104099. // Delete: Deletes the specified SslCertificate resource in the region.
  104100. func (r *RegionSslCertificatesService) Delete(project string, region string, sslCertificate string) *RegionSslCertificatesDeleteCall {
  104101. c := &RegionSslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104102. c.project = project
  104103. c.region = region
  104104. c.sslCertificate = sslCertificate
  104105. return c
  104106. }
  104107. // RequestId sets the optional parameter "requestId": An optional
  104108. // request ID to identify requests. Specify a unique request ID so that
  104109. // if you must retry your request, the server will know to ignore the
  104110. // request if it has already been completed.
  104111. //
  104112. // For example, consider a situation where you make an initial request
  104113. // and the request times out. If you make the request again with the
  104114. // same request ID, the server can check if original operation with the
  104115. // same request ID was received, and if so, will ignore the second
  104116. // request. This prevents clients from accidentally creating duplicate
  104117. // commitments.
  104118. //
  104119. // The request ID must be a valid UUID with the exception that zero UUID
  104120. // is not supported (00000000-0000-0000-0000-000000000000).
  104121. func (c *RegionSslCertificatesDeleteCall) RequestId(requestId string) *RegionSslCertificatesDeleteCall {
  104122. c.urlParams_.Set("requestId", requestId)
  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 *RegionSslCertificatesDeleteCall) Fields(s ...googleapi.Field) *RegionSslCertificatesDeleteCall {
  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 *RegionSslCertificatesDeleteCall) Context(ctx context.Context) *RegionSslCertificatesDeleteCall {
  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 *RegionSslCertificatesDeleteCall) Header() http.Header {
  104142. if c.header_ == nil {
  104143. c.header_ = make(http.Header)
  104144. }
  104145. return c.header_
  104146. }
  104147. func (c *RegionSslCertificatesDeleteCall) 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. c.urlParams_.Set("alt", alt)
  104155. c.urlParams_.Set("prettyPrint", "false")
  104156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  104157. urls += "?" + c.urlParams_.Encode()
  104158. req, err := http.NewRequest("DELETE", urls, body)
  104159. if err != nil {
  104160. return nil, err
  104161. }
  104162. req.Header = reqHeaders
  104163. googleapi.Expand(req.URL, map[string]string{
  104164. "project": c.project,
  104165. "region": c.region,
  104166. "sslCertificate": c.sslCertificate,
  104167. })
  104168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104169. }
  104170. // Do executes the "compute.regionSslCertificates.delete" call.
  104171. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104172. // status code is an error. Response headers are in either
  104173. // *Operation.ServerResponse.Header or (if a response was returned at
  104174. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104175. // to check whether the returned error was because
  104176. // http.StatusNotModified was returned.
  104177. func (c *RegionSslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104178. gensupport.SetOptions(c.urlParams_, opts...)
  104179. res, err := c.doRequest("json")
  104180. if res != nil && res.StatusCode == http.StatusNotModified {
  104181. if res.Body != nil {
  104182. res.Body.Close()
  104183. }
  104184. return nil, &googleapi.Error{
  104185. Code: res.StatusCode,
  104186. Header: res.Header,
  104187. }
  104188. }
  104189. if err != nil {
  104190. return nil, err
  104191. }
  104192. defer googleapi.CloseBody(res)
  104193. if err := googleapi.CheckResponse(res); err != nil {
  104194. return nil, err
  104195. }
  104196. ret := &Operation{
  104197. ServerResponse: googleapi.ServerResponse{
  104198. Header: res.Header,
  104199. HTTPStatusCode: res.StatusCode,
  104200. },
  104201. }
  104202. target := &ret
  104203. if err := gensupport.DecodeResponse(target, res); err != nil {
  104204. return nil, err
  104205. }
  104206. return ret, nil
  104207. // {
  104208. // "description": "Deletes the specified SslCertificate resource in the region.",
  104209. // "httpMethod": "DELETE",
  104210. // "id": "compute.regionSslCertificates.delete",
  104211. // "parameterOrder": [
  104212. // "project",
  104213. // "region",
  104214. // "sslCertificate"
  104215. // ],
  104216. // "parameters": {
  104217. // "project": {
  104218. // "description": "Project ID for this request.",
  104219. // "location": "path",
  104220. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104221. // "required": true,
  104222. // "type": "string"
  104223. // },
  104224. // "region": {
  104225. // "description": "Name of the region scoping this request.",
  104226. // "location": "path",
  104227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104228. // "required": true,
  104229. // "type": "string"
  104230. // },
  104231. // "requestId": {
  104232. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104233. // "location": "query",
  104234. // "type": "string"
  104235. // },
  104236. // "sslCertificate": {
  104237. // "description": "Name of the SslCertificate resource to delete.",
  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}/regions/{region}/sslCertificates/{sslCertificate}",
  104245. // "response": {
  104246. // "$ref": "Operation"
  104247. // },
  104248. // "scopes": [
  104249. // "https://www.googleapis.com/auth/cloud-platform",
  104250. // "https://www.googleapis.com/auth/compute"
  104251. // ]
  104252. // }
  104253. }
  104254. // method id "compute.regionSslCertificates.get":
  104255. type RegionSslCertificatesGetCall struct {
  104256. s *Service
  104257. project string
  104258. region string
  104259. sslCertificate string
  104260. urlParams_ gensupport.URLParams
  104261. ifNoneMatch_ string
  104262. ctx_ context.Context
  104263. header_ http.Header
  104264. }
  104265. // Get: Returns the specified SslCertificate resource in the specified
  104266. // region. Get a list of available SSL certificates by making a list()
  104267. // request.
  104268. func (r *RegionSslCertificatesService) Get(project string, region string, sslCertificate string) *RegionSslCertificatesGetCall {
  104269. c := &RegionSslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104270. c.project = project
  104271. c.region = region
  104272. c.sslCertificate = sslCertificate
  104273. return c
  104274. }
  104275. // Fields allows partial responses to be retrieved. See
  104276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104277. // for more information.
  104278. func (c *RegionSslCertificatesGetCall) Fields(s ...googleapi.Field) *RegionSslCertificatesGetCall {
  104279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104280. return c
  104281. }
  104282. // IfNoneMatch sets the optional parameter which makes the operation
  104283. // fail if the object's ETag matches the given value. This is useful for
  104284. // getting updates only after the object has changed since the last
  104285. // request. Use googleapi.IsNotModified to check whether the response
  104286. // error from Do is the result of In-None-Match.
  104287. func (c *RegionSslCertificatesGetCall) IfNoneMatch(entityTag string) *RegionSslCertificatesGetCall {
  104288. c.ifNoneMatch_ = entityTag
  104289. return c
  104290. }
  104291. // Context sets the context to be used in this call's Do method. Any
  104292. // pending HTTP request will be aborted if the provided context is
  104293. // canceled.
  104294. func (c *RegionSslCertificatesGetCall) Context(ctx context.Context) *RegionSslCertificatesGetCall {
  104295. c.ctx_ = ctx
  104296. return c
  104297. }
  104298. // Header returns an http.Header that can be modified by the caller to
  104299. // add HTTP headers to the request.
  104300. func (c *RegionSslCertificatesGetCall) Header() http.Header {
  104301. if c.header_ == nil {
  104302. c.header_ = make(http.Header)
  104303. }
  104304. return c.header_
  104305. }
  104306. func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  104307. reqHeaders := make(http.Header)
  104308. for k, v := range c.header_ {
  104309. reqHeaders[k] = v
  104310. }
  104311. reqHeaders.Set("User-Agent", c.s.userAgent())
  104312. if c.ifNoneMatch_ != "" {
  104313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104314. }
  104315. var body io.Reader = nil
  104316. c.urlParams_.Set("alt", alt)
  104317. c.urlParams_.Set("prettyPrint", "false")
  104318. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  104319. urls += "?" + c.urlParams_.Encode()
  104320. req, err := http.NewRequest("GET", urls, body)
  104321. if err != nil {
  104322. return nil, err
  104323. }
  104324. req.Header = reqHeaders
  104325. googleapi.Expand(req.URL, map[string]string{
  104326. "project": c.project,
  104327. "region": c.region,
  104328. "sslCertificate": c.sslCertificate,
  104329. })
  104330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104331. }
  104332. // Do executes the "compute.regionSslCertificates.get" call.
  104333. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  104334. // status code is an error. Response headers are in either
  104335. // *SslCertificate.ServerResponse.Header or (if a response was returned
  104336. // at all) in error.(*googleapi.Error).Header. Use
  104337. // googleapi.IsNotModified to check whether the returned error was
  104338. // because http.StatusNotModified was returned.
  104339. func (c *RegionSslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  104340. gensupport.SetOptions(c.urlParams_, opts...)
  104341. res, err := c.doRequest("json")
  104342. if res != nil && res.StatusCode == http.StatusNotModified {
  104343. if res.Body != nil {
  104344. res.Body.Close()
  104345. }
  104346. return nil, &googleapi.Error{
  104347. Code: res.StatusCode,
  104348. Header: res.Header,
  104349. }
  104350. }
  104351. if err != nil {
  104352. return nil, err
  104353. }
  104354. defer googleapi.CloseBody(res)
  104355. if err := googleapi.CheckResponse(res); err != nil {
  104356. return nil, err
  104357. }
  104358. ret := &SslCertificate{
  104359. ServerResponse: googleapi.ServerResponse{
  104360. Header: res.Header,
  104361. HTTPStatusCode: res.StatusCode,
  104362. },
  104363. }
  104364. target := &ret
  104365. if err := gensupport.DecodeResponse(target, res); err != nil {
  104366. return nil, err
  104367. }
  104368. return ret, nil
  104369. // {
  104370. // "description": "Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request.",
  104371. // "httpMethod": "GET",
  104372. // "id": "compute.regionSslCertificates.get",
  104373. // "parameterOrder": [
  104374. // "project",
  104375. // "region",
  104376. // "sslCertificate"
  104377. // ],
  104378. // "parameters": {
  104379. // "project": {
  104380. // "description": "Project ID for this request.",
  104381. // "location": "path",
  104382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104383. // "required": true,
  104384. // "type": "string"
  104385. // },
  104386. // "region": {
  104387. // "description": "Name of the region scoping this request.",
  104388. // "location": "path",
  104389. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104390. // "required": true,
  104391. // "type": "string"
  104392. // },
  104393. // "sslCertificate": {
  104394. // "description": "Name of the SslCertificate resource to return.",
  104395. // "location": "path",
  104396. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104397. // "required": true,
  104398. // "type": "string"
  104399. // }
  104400. // },
  104401. // "path": "{project}/regions/{region}/sslCertificates/{sslCertificate}",
  104402. // "response": {
  104403. // "$ref": "SslCertificate"
  104404. // },
  104405. // "scopes": [
  104406. // "https://www.googleapis.com/auth/cloud-platform",
  104407. // "https://www.googleapis.com/auth/compute",
  104408. // "https://www.googleapis.com/auth/compute.readonly"
  104409. // ]
  104410. // }
  104411. }
  104412. // method id "compute.regionSslCertificates.insert":
  104413. type RegionSslCertificatesInsertCall struct {
  104414. s *Service
  104415. project string
  104416. region string
  104417. sslcertificate *SslCertificate
  104418. urlParams_ gensupport.URLParams
  104419. ctx_ context.Context
  104420. header_ http.Header
  104421. }
  104422. // Insert: Creates a SslCertificate resource in the specified project
  104423. // and region using the data included in the request
  104424. func (r *RegionSslCertificatesService) Insert(project string, region string, sslcertificate *SslCertificate) *RegionSslCertificatesInsertCall {
  104425. c := &RegionSslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104426. c.project = project
  104427. c.region = region
  104428. c.sslcertificate = sslcertificate
  104429. return c
  104430. }
  104431. // RequestId sets the optional parameter "requestId": An optional
  104432. // request ID to identify requests. Specify a unique request ID so that
  104433. // if you must retry your request, the server will know to ignore the
  104434. // request if it has already been completed.
  104435. //
  104436. // For example, consider a situation where you make an initial request
  104437. // and the request times out. If you make the request again with the
  104438. // same request ID, the server can check if original operation with the
  104439. // same request ID was received, and if so, will ignore the second
  104440. // request. This prevents clients from accidentally creating duplicate
  104441. // commitments.
  104442. //
  104443. // The request ID must be a valid UUID with the exception that zero UUID
  104444. // is not supported (00000000-0000-0000-0000-000000000000).
  104445. func (c *RegionSslCertificatesInsertCall) RequestId(requestId string) *RegionSslCertificatesInsertCall {
  104446. c.urlParams_.Set("requestId", requestId)
  104447. return c
  104448. }
  104449. // Fields allows partial responses to be retrieved. See
  104450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104451. // for more information.
  104452. func (c *RegionSslCertificatesInsertCall) Fields(s ...googleapi.Field) *RegionSslCertificatesInsertCall {
  104453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104454. return c
  104455. }
  104456. // Context sets the context to be used in this call's Do method. Any
  104457. // pending HTTP request will be aborted if the provided context is
  104458. // canceled.
  104459. func (c *RegionSslCertificatesInsertCall) Context(ctx context.Context) *RegionSslCertificatesInsertCall {
  104460. c.ctx_ = ctx
  104461. return c
  104462. }
  104463. // Header returns an http.Header that can be modified by the caller to
  104464. // add HTTP headers to the request.
  104465. func (c *RegionSslCertificatesInsertCall) Header() http.Header {
  104466. if c.header_ == nil {
  104467. c.header_ = make(http.Header)
  104468. }
  104469. return c.header_
  104470. }
  104471. func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  104472. reqHeaders := make(http.Header)
  104473. for k, v := range c.header_ {
  104474. reqHeaders[k] = v
  104475. }
  104476. reqHeaders.Set("User-Agent", c.s.userAgent())
  104477. var body io.Reader = nil
  104478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  104479. if err != nil {
  104480. return nil, err
  104481. }
  104482. reqHeaders.Set("Content-Type", "application/json")
  104483. c.urlParams_.Set("alt", alt)
  104484. c.urlParams_.Set("prettyPrint", "false")
  104485. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  104486. urls += "?" + c.urlParams_.Encode()
  104487. req, err := http.NewRequest("POST", urls, body)
  104488. if err != nil {
  104489. return nil, err
  104490. }
  104491. req.Header = reqHeaders
  104492. googleapi.Expand(req.URL, map[string]string{
  104493. "project": c.project,
  104494. "region": c.region,
  104495. })
  104496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104497. }
  104498. // Do executes the "compute.regionSslCertificates.insert" call.
  104499. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104500. // status code is an error. Response headers are in either
  104501. // *Operation.ServerResponse.Header or (if a response was returned at
  104502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104503. // to check whether the returned error was because
  104504. // http.StatusNotModified was returned.
  104505. func (c *RegionSslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104506. gensupport.SetOptions(c.urlParams_, opts...)
  104507. res, err := c.doRequest("json")
  104508. if res != nil && res.StatusCode == http.StatusNotModified {
  104509. if res.Body != nil {
  104510. res.Body.Close()
  104511. }
  104512. return nil, &googleapi.Error{
  104513. Code: res.StatusCode,
  104514. Header: res.Header,
  104515. }
  104516. }
  104517. if err != nil {
  104518. return nil, err
  104519. }
  104520. defer googleapi.CloseBody(res)
  104521. if err := googleapi.CheckResponse(res); err != nil {
  104522. return nil, err
  104523. }
  104524. ret := &Operation{
  104525. ServerResponse: googleapi.ServerResponse{
  104526. Header: res.Header,
  104527. HTTPStatusCode: res.StatusCode,
  104528. },
  104529. }
  104530. target := &ret
  104531. if err := gensupport.DecodeResponse(target, res); err != nil {
  104532. return nil, err
  104533. }
  104534. return ret, nil
  104535. // {
  104536. // "description": "Creates a SslCertificate resource in the specified project and region using the data included in the request",
  104537. // "httpMethod": "POST",
  104538. // "id": "compute.regionSslCertificates.insert",
  104539. // "parameterOrder": [
  104540. // "project",
  104541. // "region"
  104542. // ],
  104543. // "parameters": {
  104544. // "project": {
  104545. // "description": "Project ID for this request.",
  104546. // "location": "path",
  104547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104548. // "required": true,
  104549. // "type": "string"
  104550. // },
  104551. // "region": {
  104552. // "description": "Name of the region scoping this request.",
  104553. // "location": "path",
  104554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104555. // "required": true,
  104556. // "type": "string"
  104557. // },
  104558. // "requestId": {
  104559. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104560. // "location": "query",
  104561. // "type": "string"
  104562. // }
  104563. // },
  104564. // "path": "{project}/regions/{region}/sslCertificates",
  104565. // "request": {
  104566. // "$ref": "SslCertificate"
  104567. // },
  104568. // "response": {
  104569. // "$ref": "Operation"
  104570. // },
  104571. // "scopes": [
  104572. // "https://www.googleapis.com/auth/cloud-platform",
  104573. // "https://www.googleapis.com/auth/compute"
  104574. // ]
  104575. // }
  104576. }
  104577. // method id "compute.regionSslCertificates.list":
  104578. type RegionSslCertificatesListCall struct {
  104579. s *Service
  104580. project string
  104581. region string
  104582. urlParams_ gensupport.URLParams
  104583. ifNoneMatch_ string
  104584. ctx_ context.Context
  104585. header_ http.Header
  104586. }
  104587. // List: Retrieves the list of SslCertificate resources available to the
  104588. // specified project in the specified region.
  104589. func (r *RegionSslCertificatesService) List(project string, region string) *RegionSslCertificatesListCall {
  104590. c := &RegionSslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104591. c.project = project
  104592. c.region = region
  104593. return c
  104594. }
  104595. // Filter sets the optional parameter "filter": A filter expression that
  104596. // filters resources listed in the response. The expression must specify
  104597. // the field name, a comparison operator, and the value that you want to
  104598. // use for filtering. The value must be a string, a number, or a
  104599. // boolean. The comparison operator must be either =, !=, >, or <.
  104600. //
  104601. // For example, if you are filtering Compute Engine instances, you can
  104602. // exclude instances named example-instance by specifying name !=
  104603. // example-instance.
  104604. //
  104605. // You can also filter nested fields. For example, you could specify
  104606. // scheduling.automaticRestart = false to include instances only if they
  104607. // are not scheduled for automatic restarts. You can use filtering on
  104608. // nested fields to filter based on resource labels.
  104609. //
  104610. // To filter on multiple expressions, provide each separate expression
  104611. // within parentheses. For example, (scheduling.automaticRestart = true)
  104612. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  104613. // AND expression. However, you can include AND and OR expressions
  104614. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  104615. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  104616. // true).
  104617. func (c *RegionSslCertificatesListCall) Filter(filter string) *RegionSslCertificatesListCall {
  104618. c.urlParams_.Set("filter", filter)
  104619. return c
  104620. }
  104621. // MaxResults sets the optional parameter "maxResults": The maximum
  104622. // number of results per page that should be returned. If the number of
  104623. // available results is larger than maxResults, Compute Engine returns a
  104624. // nextPageToken that can be used to get the next page of results in
  104625. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  104626. // (Default: 500)
  104627. func (c *RegionSslCertificatesListCall) MaxResults(maxResults int64) *RegionSslCertificatesListCall {
  104628. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  104629. return c
  104630. }
  104631. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  104632. // a certain order. By default, results are returned in alphanumerical
  104633. // order based on the resource name.
  104634. //
  104635. // You can also sort results in descending order based on the creation
  104636. // timestamp using orderBy="creationTimestamp desc". This sorts results
  104637. // based on the creationTimestamp field in reverse chronological order
  104638. // (newest result first). Use this to sort resources like operations so
  104639. // that the newest operation is returned first.
  104640. //
  104641. // Currently, only sorting by name or creationTimestamp desc is
  104642. // supported.
  104643. func (c *RegionSslCertificatesListCall) OrderBy(orderBy string) *RegionSslCertificatesListCall {
  104644. c.urlParams_.Set("orderBy", orderBy)
  104645. return c
  104646. }
  104647. // PageToken sets the optional parameter "pageToken": Specifies a page
  104648. // token to use. Set pageToken to the nextPageToken returned by a
  104649. // previous list request to get the next page of results.
  104650. func (c *RegionSslCertificatesListCall) PageToken(pageToken string) *RegionSslCertificatesListCall {
  104651. c.urlParams_.Set("pageToken", pageToken)
  104652. return c
  104653. }
  104654. // Fields allows partial responses to be retrieved. See
  104655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104656. // for more information.
  104657. func (c *RegionSslCertificatesListCall) Fields(s ...googleapi.Field) *RegionSslCertificatesListCall {
  104658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104659. return c
  104660. }
  104661. // IfNoneMatch sets the optional parameter which makes the operation
  104662. // fail if the object's ETag matches the given value. This is useful for
  104663. // getting updates only after the object has changed since the last
  104664. // request. Use googleapi.IsNotModified to check whether the response
  104665. // error from Do is the result of In-None-Match.
  104666. func (c *RegionSslCertificatesListCall) IfNoneMatch(entityTag string) *RegionSslCertificatesListCall {
  104667. c.ifNoneMatch_ = entityTag
  104668. return c
  104669. }
  104670. // Context sets the context to be used in this call's Do method. Any
  104671. // pending HTTP request will be aborted if the provided context is
  104672. // canceled.
  104673. func (c *RegionSslCertificatesListCall) Context(ctx context.Context) *RegionSslCertificatesListCall {
  104674. c.ctx_ = ctx
  104675. return c
  104676. }
  104677. // Header returns an http.Header that can be modified by the caller to
  104678. // add HTTP headers to the request.
  104679. func (c *RegionSslCertificatesListCall) Header() http.Header {
  104680. if c.header_ == nil {
  104681. c.header_ = make(http.Header)
  104682. }
  104683. return c.header_
  104684. }
  104685. func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  104686. reqHeaders := make(http.Header)
  104687. for k, v := range c.header_ {
  104688. reqHeaders[k] = v
  104689. }
  104690. reqHeaders.Set("User-Agent", c.s.userAgent())
  104691. if c.ifNoneMatch_ != "" {
  104692. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104693. }
  104694. var body io.Reader = nil
  104695. c.urlParams_.Set("alt", alt)
  104696. c.urlParams_.Set("prettyPrint", "false")
  104697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  104698. urls += "?" + c.urlParams_.Encode()
  104699. req, err := http.NewRequest("GET", urls, body)
  104700. if err != nil {
  104701. return nil, err
  104702. }
  104703. req.Header = reqHeaders
  104704. googleapi.Expand(req.URL, map[string]string{
  104705. "project": c.project,
  104706. "region": c.region,
  104707. })
  104708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104709. }
  104710. // Do executes the "compute.regionSslCertificates.list" call.
  104711. // Exactly one of *SslCertificateList or error will be non-nil. Any
  104712. // non-2xx status code is an error. Response headers are in either
  104713. // *SslCertificateList.ServerResponse.Header or (if a response was
  104714. // returned at all) in error.(*googleapi.Error).Header. Use
  104715. // googleapi.IsNotModified to check whether the returned error was
  104716. // because http.StatusNotModified was returned.
  104717. func (c *RegionSslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  104718. gensupport.SetOptions(c.urlParams_, opts...)
  104719. res, err := c.doRequest("json")
  104720. if res != nil && res.StatusCode == http.StatusNotModified {
  104721. if res.Body != nil {
  104722. res.Body.Close()
  104723. }
  104724. return nil, &googleapi.Error{
  104725. Code: res.StatusCode,
  104726. Header: res.Header,
  104727. }
  104728. }
  104729. if err != nil {
  104730. return nil, err
  104731. }
  104732. defer googleapi.CloseBody(res)
  104733. if err := googleapi.CheckResponse(res); err != nil {
  104734. return nil, err
  104735. }
  104736. ret := &SslCertificateList{
  104737. ServerResponse: googleapi.ServerResponse{
  104738. Header: res.Header,
  104739. HTTPStatusCode: res.StatusCode,
  104740. },
  104741. }
  104742. target := &ret
  104743. if err := gensupport.DecodeResponse(target, res); err != nil {
  104744. return nil, err
  104745. }
  104746. return ret, nil
  104747. // {
  104748. // "description": "Retrieves the list of SslCertificate resources available to the specified project in the specified region.",
  104749. // "httpMethod": "GET",
  104750. // "id": "compute.regionSslCertificates.list",
  104751. // "parameterOrder": [
  104752. // "project",
  104753. // "region"
  104754. // ],
  104755. // "parameters": {
  104756. // "filter": {
  104757. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  104758. // "location": "query",
  104759. // "type": "string"
  104760. // },
  104761. // "maxResults": {
  104762. // "default": "500",
  104763. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  104764. // "format": "uint32",
  104765. // "location": "query",
  104766. // "minimum": "0",
  104767. // "type": "integer"
  104768. // },
  104769. // "orderBy": {
  104770. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  104771. // "location": "query",
  104772. // "type": "string"
  104773. // },
  104774. // "pageToken": {
  104775. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  104776. // "location": "query",
  104777. // "type": "string"
  104778. // },
  104779. // "project": {
  104780. // "description": "Project ID for this request.",
  104781. // "location": "path",
  104782. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104783. // "required": true,
  104784. // "type": "string"
  104785. // },
  104786. // "region": {
  104787. // "description": "Name of the region scoping this request.",
  104788. // "location": "path",
  104789. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104790. // "required": true,
  104791. // "type": "string"
  104792. // }
  104793. // },
  104794. // "path": "{project}/regions/{region}/sslCertificates",
  104795. // "response": {
  104796. // "$ref": "SslCertificateList"
  104797. // },
  104798. // "scopes": [
  104799. // "https://www.googleapis.com/auth/cloud-platform",
  104800. // "https://www.googleapis.com/auth/compute",
  104801. // "https://www.googleapis.com/auth/compute.readonly"
  104802. // ]
  104803. // }
  104804. }
  104805. // Pages invokes f for each page of results.
  104806. // A non-nil error returned from f will halt the iteration.
  104807. // The provided context supersedes any context provided to the Context method.
  104808. func (c *RegionSslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  104809. c.ctx_ = ctx
  104810. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104811. for {
  104812. x, err := c.Do()
  104813. if err != nil {
  104814. return err
  104815. }
  104816. if err := f(x); err != nil {
  104817. return err
  104818. }
  104819. if x.NextPageToken == "" {
  104820. return nil
  104821. }
  104822. c.PageToken(x.NextPageToken)
  104823. }
  104824. }
  104825. // method id "compute.regionSslCertificates.testIamPermissions":
  104826. type RegionSslCertificatesTestIamPermissionsCall struct {
  104827. s *Service
  104828. project string
  104829. region string
  104830. resource string
  104831. testpermissionsrequest *TestPermissionsRequest
  104832. urlParams_ gensupport.URLParams
  104833. ctx_ context.Context
  104834. header_ http.Header
  104835. }
  104836. // TestIamPermissions: Returns permissions that a caller has on the
  104837. // specified resource and region.
  104838. func (r *RegionSslCertificatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionSslCertificatesTestIamPermissionsCall {
  104839. c := &RegionSslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104840. c.project = project
  104841. c.region = region
  104842. c.resource = resource
  104843. c.testpermissionsrequest = testpermissionsrequest
  104844. return c
  104845. }
  104846. // Fields allows partial responses to be retrieved. See
  104847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104848. // for more information.
  104849. func (c *RegionSslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionSslCertificatesTestIamPermissionsCall {
  104850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104851. return c
  104852. }
  104853. // Context sets the context to be used in this call's Do method. Any
  104854. // pending HTTP request will be aborted if the provided context is
  104855. // canceled.
  104856. func (c *RegionSslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *RegionSslCertificatesTestIamPermissionsCall {
  104857. c.ctx_ = ctx
  104858. return c
  104859. }
  104860. // Header returns an http.Header that can be modified by the caller to
  104861. // add HTTP headers to the request.
  104862. func (c *RegionSslCertificatesTestIamPermissionsCall) Header() http.Header {
  104863. if c.header_ == nil {
  104864. c.header_ = make(http.Header)
  104865. }
  104866. return c.header_
  104867. }
  104868. func (c *RegionSslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  104869. reqHeaders := make(http.Header)
  104870. for k, v := range c.header_ {
  104871. reqHeaders[k] = v
  104872. }
  104873. reqHeaders.Set("User-Agent", c.s.userAgent())
  104874. var body io.Reader = nil
  104875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  104876. if err != nil {
  104877. return nil, err
  104878. }
  104879. reqHeaders.Set("Content-Type", "application/json")
  104880. c.urlParams_.Set("alt", alt)
  104881. c.urlParams_.Set("prettyPrint", "false")
  104882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions")
  104883. urls += "?" + c.urlParams_.Encode()
  104884. req, err := http.NewRequest("POST", urls, body)
  104885. if err != nil {
  104886. return nil, err
  104887. }
  104888. req.Header = reqHeaders
  104889. googleapi.Expand(req.URL, map[string]string{
  104890. "project": c.project,
  104891. "region": c.region,
  104892. "resource": c.resource,
  104893. })
  104894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104895. }
  104896. // Do executes the "compute.regionSslCertificates.testIamPermissions" call.
  104897. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  104898. // non-2xx status code is an error. Response headers are in either
  104899. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  104900. // returned at all) in error.(*googleapi.Error).Header. Use
  104901. // googleapi.IsNotModified to check whether the returned error was
  104902. // because http.StatusNotModified was returned.
  104903. func (c *RegionSslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  104904. gensupport.SetOptions(c.urlParams_, opts...)
  104905. res, err := c.doRequest("json")
  104906. if res != nil && res.StatusCode == http.StatusNotModified {
  104907. if res.Body != nil {
  104908. res.Body.Close()
  104909. }
  104910. return nil, &googleapi.Error{
  104911. Code: res.StatusCode,
  104912. Header: res.Header,
  104913. }
  104914. }
  104915. if err != nil {
  104916. return nil, err
  104917. }
  104918. defer googleapi.CloseBody(res)
  104919. if err := googleapi.CheckResponse(res); err != nil {
  104920. return nil, err
  104921. }
  104922. ret := &TestPermissionsResponse{
  104923. ServerResponse: googleapi.ServerResponse{
  104924. Header: res.Header,
  104925. HTTPStatusCode: res.StatusCode,
  104926. },
  104927. }
  104928. target := &ret
  104929. if err := gensupport.DecodeResponse(target, res); err != nil {
  104930. return nil, err
  104931. }
  104932. return ret, nil
  104933. // {
  104934. // "description": "Returns permissions that a caller has on the specified resource and region.",
  104935. // "httpMethod": "POST",
  104936. // "id": "compute.regionSslCertificates.testIamPermissions",
  104937. // "parameterOrder": [
  104938. // "project",
  104939. // "region",
  104940. // "resource"
  104941. // ],
  104942. // "parameters": {
  104943. // "project": {
  104944. // "description": "Project ID for this request.",
  104945. // "location": "path",
  104946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104947. // "required": true,
  104948. // "type": "string"
  104949. // },
  104950. // "region": {
  104951. // "description": "The name of the region for this request.",
  104952. // "location": "path",
  104953. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104954. // "required": true,
  104955. // "type": "string"
  104956. // },
  104957. // "resource": {
  104958. // "description": "Name or id of the resource for this request.",
  104959. // "location": "path",
  104960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104961. // "required": true,
  104962. // "type": "string"
  104963. // }
  104964. // },
  104965. // "path": "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions",
  104966. // "request": {
  104967. // "$ref": "TestPermissionsRequest"
  104968. // },
  104969. // "response": {
  104970. // "$ref": "TestPermissionsResponse"
  104971. // },
  104972. // "scopes": [
  104973. // "https://www.googleapis.com/auth/cloud-platform",
  104974. // "https://www.googleapis.com/auth/compute",
  104975. // "https://www.googleapis.com/auth/compute.readonly"
  104976. // ]
  104977. // }
  104978. }
  104979. // method id "compute.regionTargetHttpProxies.delete":
  104980. type RegionTargetHttpProxiesDeleteCall struct {
  104981. s *Service
  104982. project string
  104983. region string
  104984. targetHttpProxy string
  104985. urlParams_ gensupport.URLParams
  104986. ctx_ context.Context
  104987. header_ http.Header
  104988. }
  104989. // Delete: Deletes the specified TargetHttpProxy resource.
  104990. func (r *RegionTargetHttpProxiesService) Delete(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesDeleteCall {
  104991. c := &RegionTargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104992. c.project = project
  104993. c.region = region
  104994. c.targetHttpProxy = targetHttpProxy
  104995. return c
  104996. }
  104997. // RequestId sets the optional parameter "requestId": An optional
  104998. // request ID to identify requests. Specify a unique request ID so that
  104999. // if you must retry your request, the server will know to ignore the
  105000. // request if it has already been completed.
  105001. //
  105002. // For example, consider a situation where you make an initial request
  105003. // and the request times out. If you make the request again with the
  105004. // same request ID, the server can check if original operation with the
  105005. // same request ID was received, and if so, will ignore the second
  105006. // request. This prevents clients from accidentally creating duplicate
  105007. // commitments.
  105008. //
  105009. // The request ID must be a valid UUID with the exception that zero UUID
  105010. // is not supported (00000000-0000-0000-0000-000000000000).
  105011. func (c *RegionTargetHttpProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpProxiesDeleteCall {
  105012. c.urlParams_.Set("requestId", requestId)
  105013. return c
  105014. }
  105015. // Fields allows partial responses to be retrieved. See
  105016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105017. // for more information.
  105018. func (c *RegionTargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesDeleteCall {
  105019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105020. return c
  105021. }
  105022. // Context sets the context to be used in this call's Do method. Any
  105023. // pending HTTP request will be aborted if the provided context is
  105024. // canceled.
  105025. func (c *RegionTargetHttpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpProxiesDeleteCall {
  105026. c.ctx_ = ctx
  105027. return c
  105028. }
  105029. // Header returns an http.Header that can be modified by the caller to
  105030. // add HTTP headers to the request.
  105031. func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header {
  105032. if c.header_ == nil {
  105033. c.header_ = make(http.Header)
  105034. }
  105035. return c.header_
  105036. }
  105037. func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  105038. reqHeaders := make(http.Header)
  105039. for k, v := range c.header_ {
  105040. reqHeaders[k] = v
  105041. }
  105042. reqHeaders.Set("User-Agent", c.s.userAgent())
  105043. var body io.Reader = nil
  105044. c.urlParams_.Set("alt", alt)
  105045. c.urlParams_.Set("prettyPrint", "false")
  105046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  105047. urls += "?" + c.urlParams_.Encode()
  105048. req, err := http.NewRequest("DELETE", urls, body)
  105049. if err != nil {
  105050. return nil, err
  105051. }
  105052. req.Header = reqHeaders
  105053. googleapi.Expand(req.URL, map[string]string{
  105054. "project": c.project,
  105055. "region": c.region,
  105056. "targetHttpProxy": c.targetHttpProxy,
  105057. })
  105058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105059. }
  105060. // Do executes the "compute.regionTargetHttpProxies.delete" call.
  105061. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105062. // status code is an error. Response headers are in either
  105063. // *Operation.ServerResponse.Header or (if a response was returned at
  105064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105065. // to check whether the returned error was because
  105066. // http.StatusNotModified was returned.
  105067. func (c *RegionTargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105068. gensupport.SetOptions(c.urlParams_, opts...)
  105069. res, err := c.doRequest("json")
  105070. if res != nil && res.StatusCode == http.StatusNotModified {
  105071. if res.Body != nil {
  105072. res.Body.Close()
  105073. }
  105074. return nil, &googleapi.Error{
  105075. Code: res.StatusCode,
  105076. Header: res.Header,
  105077. }
  105078. }
  105079. if err != nil {
  105080. return nil, err
  105081. }
  105082. defer googleapi.CloseBody(res)
  105083. if err := googleapi.CheckResponse(res); err != nil {
  105084. return nil, err
  105085. }
  105086. ret := &Operation{
  105087. ServerResponse: googleapi.ServerResponse{
  105088. Header: res.Header,
  105089. HTTPStatusCode: res.StatusCode,
  105090. },
  105091. }
  105092. target := &ret
  105093. if err := gensupport.DecodeResponse(target, res); err != nil {
  105094. return nil, err
  105095. }
  105096. return ret, nil
  105097. // {
  105098. // "description": "Deletes the specified TargetHttpProxy resource.",
  105099. // "httpMethod": "DELETE",
  105100. // "id": "compute.regionTargetHttpProxies.delete",
  105101. // "parameterOrder": [
  105102. // "project",
  105103. // "region",
  105104. // "targetHttpProxy"
  105105. // ],
  105106. // "parameters": {
  105107. // "project": {
  105108. // "description": "Project ID for this request.",
  105109. // "location": "path",
  105110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105111. // "required": true,
  105112. // "type": "string"
  105113. // },
  105114. // "region": {
  105115. // "description": "Name of the region scoping this request.",
  105116. // "location": "path",
  105117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105118. // "required": true,
  105119. // "type": "string"
  105120. // },
  105121. // "requestId": {
  105122. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105123. // "location": "query",
  105124. // "type": "string"
  105125. // },
  105126. // "targetHttpProxy": {
  105127. // "description": "Name of the TargetHttpProxy resource to delete.",
  105128. // "location": "path",
  105129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105130. // "required": true,
  105131. // "type": "string"
  105132. // }
  105133. // },
  105134. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  105135. // "response": {
  105136. // "$ref": "Operation"
  105137. // },
  105138. // "scopes": [
  105139. // "https://www.googleapis.com/auth/cloud-platform",
  105140. // "https://www.googleapis.com/auth/compute"
  105141. // ]
  105142. // }
  105143. }
  105144. // method id "compute.regionTargetHttpProxies.get":
  105145. type RegionTargetHttpProxiesGetCall struct {
  105146. s *Service
  105147. project string
  105148. region string
  105149. targetHttpProxy string
  105150. urlParams_ gensupport.URLParams
  105151. ifNoneMatch_ string
  105152. ctx_ context.Context
  105153. header_ http.Header
  105154. }
  105155. // Get: Returns the specified TargetHttpProxy resource in the specified
  105156. // region. Gets a list of available target HTTP proxies by making a
  105157. // list() request.
  105158. func (r *RegionTargetHttpProxiesService) Get(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesGetCall {
  105159. c := &RegionTargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105160. c.project = project
  105161. c.region = region
  105162. c.targetHttpProxy = targetHttpProxy
  105163. return c
  105164. }
  105165. // Fields allows partial responses to be retrieved. See
  105166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105167. // for more information.
  105168. func (c *RegionTargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesGetCall {
  105169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105170. return c
  105171. }
  105172. // IfNoneMatch sets the optional parameter which makes the operation
  105173. // fail if the object's ETag matches the given value. This is useful for
  105174. // getting updates only after the object has changed since the last
  105175. // request. Use googleapi.IsNotModified to check whether the response
  105176. // error from Do is the result of In-None-Match.
  105177. func (c *RegionTargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesGetCall {
  105178. c.ifNoneMatch_ = entityTag
  105179. return c
  105180. }
  105181. // Context sets the context to be used in this call's Do method. Any
  105182. // pending HTTP request will be aborted if the provided context is
  105183. // canceled.
  105184. func (c *RegionTargetHttpProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpProxiesGetCall {
  105185. c.ctx_ = ctx
  105186. return c
  105187. }
  105188. // Header returns an http.Header that can be modified by the caller to
  105189. // add HTTP headers to the request.
  105190. func (c *RegionTargetHttpProxiesGetCall) Header() http.Header {
  105191. if c.header_ == nil {
  105192. c.header_ = make(http.Header)
  105193. }
  105194. return c.header_
  105195. }
  105196. func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  105197. reqHeaders := make(http.Header)
  105198. for k, v := range c.header_ {
  105199. reqHeaders[k] = v
  105200. }
  105201. reqHeaders.Set("User-Agent", c.s.userAgent())
  105202. if c.ifNoneMatch_ != "" {
  105203. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105204. }
  105205. var body io.Reader = nil
  105206. c.urlParams_.Set("alt", alt)
  105207. c.urlParams_.Set("prettyPrint", "false")
  105208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  105209. urls += "?" + c.urlParams_.Encode()
  105210. req, err := http.NewRequest("GET", urls, body)
  105211. if err != nil {
  105212. return nil, err
  105213. }
  105214. req.Header = reqHeaders
  105215. googleapi.Expand(req.URL, map[string]string{
  105216. "project": c.project,
  105217. "region": c.region,
  105218. "targetHttpProxy": c.targetHttpProxy,
  105219. })
  105220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105221. }
  105222. // Do executes the "compute.regionTargetHttpProxies.get" call.
  105223. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  105224. // status code is an error. Response headers are in either
  105225. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  105226. // at all) in error.(*googleapi.Error).Header. Use
  105227. // googleapi.IsNotModified to check whether the returned error was
  105228. // because http.StatusNotModified was returned.
  105229. func (c *RegionTargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  105230. gensupport.SetOptions(c.urlParams_, opts...)
  105231. res, err := c.doRequest("json")
  105232. if res != nil && res.StatusCode == http.StatusNotModified {
  105233. if res.Body != nil {
  105234. res.Body.Close()
  105235. }
  105236. return nil, &googleapi.Error{
  105237. Code: res.StatusCode,
  105238. Header: res.Header,
  105239. }
  105240. }
  105241. if err != nil {
  105242. return nil, err
  105243. }
  105244. defer googleapi.CloseBody(res)
  105245. if err := googleapi.CheckResponse(res); err != nil {
  105246. return nil, err
  105247. }
  105248. ret := &TargetHttpProxy{
  105249. ServerResponse: googleapi.ServerResponse{
  105250. Header: res.Header,
  105251. HTTPStatusCode: res.StatusCode,
  105252. },
  105253. }
  105254. target := &ret
  105255. if err := gensupport.DecodeResponse(target, res); err != nil {
  105256. return nil, err
  105257. }
  105258. return ret, nil
  105259. // {
  105260. // "description": "Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  105261. // "httpMethod": "GET",
  105262. // "id": "compute.regionTargetHttpProxies.get",
  105263. // "parameterOrder": [
  105264. // "project",
  105265. // "region",
  105266. // "targetHttpProxy"
  105267. // ],
  105268. // "parameters": {
  105269. // "project": {
  105270. // "description": "Project ID for this request.",
  105271. // "location": "path",
  105272. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105273. // "required": true,
  105274. // "type": "string"
  105275. // },
  105276. // "region": {
  105277. // "description": "Name of the region scoping this request.",
  105278. // "location": "path",
  105279. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105280. // "required": true,
  105281. // "type": "string"
  105282. // },
  105283. // "targetHttpProxy": {
  105284. // "description": "Name of the TargetHttpProxy resource to return.",
  105285. // "location": "path",
  105286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105287. // "required": true,
  105288. // "type": "string"
  105289. // }
  105290. // },
  105291. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  105292. // "response": {
  105293. // "$ref": "TargetHttpProxy"
  105294. // },
  105295. // "scopes": [
  105296. // "https://www.googleapis.com/auth/cloud-platform",
  105297. // "https://www.googleapis.com/auth/compute",
  105298. // "https://www.googleapis.com/auth/compute.readonly"
  105299. // ]
  105300. // }
  105301. }
  105302. // method id "compute.regionTargetHttpProxies.insert":
  105303. type RegionTargetHttpProxiesInsertCall struct {
  105304. s *Service
  105305. project string
  105306. region string
  105307. targethttpproxy *TargetHttpProxy
  105308. urlParams_ gensupport.URLParams
  105309. ctx_ context.Context
  105310. header_ http.Header
  105311. }
  105312. // Insert: Creates a TargetHttpProxy resource in the specified project
  105313. // and region using the data included in the request.
  105314. func (r *RegionTargetHttpProxiesService) Insert(project string, region string, targethttpproxy *TargetHttpProxy) *RegionTargetHttpProxiesInsertCall {
  105315. c := &RegionTargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105316. c.project = project
  105317. c.region = region
  105318. c.targethttpproxy = targethttpproxy
  105319. return c
  105320. }
  105321. // RequestId sets the optional parameter "requestId": An optional
  105322. // request ID to identify requests. Specify a unique request ID so that
  105323. // if you must retry your request, the server will know to ignore the
  105324. // request if it has already been completed.
  105325. //
  105326. // For example, consider a situation where you make an initial request
  105327. // and the request times out. If you make the request again with the
  105328. // same request ID, the server can check if original operation with the
  105329. // same request ID was received, and if so, will ignore the second
  105330. // request. This prevents clients from accidentally creating duplicate
  105331. // commitments.
  105332. //
  105333. // The request ID must be a valid UUID with the exception that zero UUID
  105334. // is not supported (00000000-0000-0000-0000-000000000000).
  105335. func (c *RegionTargetHttpProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpProxiesInsertCall {
  105336. c.urlParams_.Set("requestId", requestId)
  105337. return c
  105338. }
  105339. // Fields allows partial responses to be retrieved. See
  105340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105341. // for more information.
  105342. func (c *RegionTargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesInsertCall {
  105343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105344. return c
  105345. }
  105346. // Context sets the context to be used in this call's Do method. Any
  105347. // pending HTTP request will be aborted if the provided context is
  105348. // canceled.
  105349. func (c *RegionTargetHttpProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpProxiesInsertCall {
  105350. c.ctx_ = ctx
  105351. return c
  105352. }
  105353. // Header returns an http.Header that can be modified by the caller to
  105354. // add HTTP headers to the request.
  105355. func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header {
  105356. if c.header_ == nil {
  105357. c.header_ = make(http.Header)
  105358. }
  105359. return c.header_
  105360. }
  105361. func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  105362. reqHeaders := make(http.Header)
  105363. for k, v := range c.header_ {
  105364. reqHeaders[k] = v
  105365. }
  105366. reqHeaders.Set("User-Agent", c.s.userAgent())
  105367. var body io.Reader = nil
  105368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  105369. if err != nil {
  105370. return nil, err
  105371. }
  105372. reqHeaders.Set("Content-Type", "application/json")
  105373. c.urlParams_.Set("alt", alt)
  105374. c.urlParams_.Set("prettyPrint", "false")
  105375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  105376. urls += "?" + c.urlParams_.Encode()
  105377. req, err := http.NewRequest("POST", urls, body)
  105378. if err != nil {
  105379. return nil, err
  105380. }
  105381. req.Header = reqHeaders
  105382. googleapi.Expand(req.URL, map[string]string{
  105383. "project": c.project,
  105384. "region": c.region,
  105385. })
  105386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105387. }
  105388. // Do executes the "compute.regionTargetHttpProxies.insert" call.
  105389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105390. // status code is an error. Response headers are in either
  105391. // *Operation.ServerResponse.Header or (if a response was returned at
  105392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105393. // to check whether the returned error was because
  105394. // http.StatusNotModified was returned.
  105395. func (c *RegionTargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105396. gensupport.SetOptions(c.urlParams_, opts...)
  105397. res, err := c.doRequest("json")
  105398. if res != nil && res.StatusCode == http.StatusNotModified {
  105399. if res.Body != nil {
  105400. res.Body.Close()
  105401. }
  105402. return nil, &googleapi.Error{
  105403. Code: res.StatusCode,
  105404. Header: res.Header,
  105405. }
  105406. }
  105407. if err != nil {
  105408. return nil, err
  105409. }
  105410. defer googleapi.CloseBody(res)
  105411. if err := googleapi.CheckResponse(res); err != nil {
  105412. return nil, err
  105413. }
  105414. ret := &Operation{
  105415. ServerResponse: googleapi.ServerResponse{
  105416. Header: res.Header,
  105417. HTTPStatusCode: res.StatusCode,
  105418. },
  105419. }
  105420. target := &ret
  105421. if err := gensupport.DecodeResponse(target, res); err != nil {
  105422. return nil, err
  105423. }
  105424. return ret, nil
  105425. // {
  105426. // "description": "Creates a TargetHttpProxy resource in the specified project and region using the data included in the request.",
  105427. // "httpMethod": "POST",
  105428. // "id": "compute.regionTargetHttpProxies.insert",
  105429. // "parameterOrder": [
  105430. // "project",
  105431. // "region"
  105432. // ],
  105433. // "parameters": {
  105434. // "project": {
  105435. // "description": "Project ID for this request.",
  105436. // "location": "path",
  105437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105438. // "required": true,
  105439. // "type": "string"
  105440. // },
  105441. // "region": {
  105442. // "description": "Name of the region scoping this request.",
  105443. // "location": "path",
  105444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105445. // "required": true,
  105446. // "type": "string"
  105447. // },
  105448. // "requestId": {
  105449. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105450. // "location": "query",
  105451. // "type": "string"
  105452. // }
  105453. // },
  105454. // "path": "{project}/regions/{region}/targetHttpProxies",
  105455. // "request": {
  105456. // "$ref": "TargetHttpProxy"
  105457. // },
  105458. // "response": {
  105459. // "$ref": "Operation"
  105460. // },
  105461. // "scopes": [
  105462. // "https://www.googleapis.com/auth/cloud-platform",
  105463. // "https://www.googleapis.com/auth/compute"
  105464. // ]
  105465. // }
  105466. }
  105467. // method id "compute.regionTargetHttpProxies.list":
  105468. type RegionTargetHttpProxiesListCall struct {
  105469. s *Service
  105470. project string
  105471. region string
  105472. urlParams_ gensupport.URLParams
  105473. ifNoneMatch_ string
  105474. ctx_ context.Context
  105475. header_ http.Header
  105476. }
  105477. // List: Retrieves the list of TargetHttpProxy resources available to
  105478. // the specified project in the specified region.
  105479. func (r *RegionTargetHttpProxiesService) List(project string, region string) *RegionTargetHttpProxiesListCall {
  105480. c := &RegionTargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105481. c.project = project
  105482. c.region = region
  105483. return c
  105484. }
  105485. // Filter sets the optional parameter "filter": A filter expression that
  105486. // filters resources listed in the response. The expression must specify
  105487. // the field name, a comparison operator, and the value that you want to
  105488. // use for filtering. The value must be a string, a number, or a
  105489. // boolean. The comparison operator must be either =, !=, >, or <.
  105490. //
  105491. // For example, if you are filtering Compute Engine instances, you can
  105492. // exclude instances named example-instance by specifying name !=
  105493. // example-instance.
  105494. //
  105495. // You can also filter nested fields. For example, you could specify
  105496. // scheduling.automaticRestart = false to include instances only if they
  105497. // are not scheduled for automatic restarts. You can use filtering on
  105498. // nested fields to filter based on resource labels.
  105499. //
  105500. // To filter on multiple expressions, provide each separate expression
  105501. // within parentheses. For example, (scheduling.automaticRestart = true)
  105502. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105503. // AND expression. However, you can include AND and OR expressions
  105504. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105505. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105506. // true).
  105507. func (c *RegionTargetHttpProxiesListCall) Filter(filter string) *RegionTargetHttpProxiesListCall {
  105508. c.urlParams_.Set("filter", filter)
  105509. return c
  105510. }
  105511. // MaxResults sets the optional parameter "maxResults": The maximum
  105512. // number of results per page that should be returned. If the number of
  105513. // available results is larger than maxResults, Compute Engine returns a
  105514. // nextPageToken that can be used to get the next page of results in
  105515. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105516. // (Default: 500)
  105517. func (c *RegionTargetHttpProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpProxiesListCall {
  105518. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105519. return c
  105520. }
  105521. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105522. // a certain order. By default, results are returned in alphanumerical
  105523. // order based on the resource name.
  105524. //
  105525. // You can also sort results in descending order based on the creation
  105526. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105527. // based on the creationTimestamp field in reverse chronological order
  105528. // (newest result first). Use this to sort resources like operations so
  105529. // that the newest operation is returned first.
  105530. //
  105531. // Currently, only sorting by name or creationTimestamp desc is
  105532. // supported.
  105533. func (c *RegionTargetHttpProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpProxiesListCall {
  105534. c.urlParams_.Set("orderBy", orderBy)
  105535. return c
  105536. }
  105537. // PageToken sets the optional parameter "pageToken": Specifies a page
  105538. // token to use. Set pageToken to the nextPageToken returned by a
  105539. // previous list request to get the next page of results.
  105540. func (c *RegionTargetHttpProxiesListCall) PageToken(pageToken string) *RegionTargetHttpProxiesListCall {
  105541. c.urlParams_.Set("pageToken", pageToken)
  105542. return c
  105543. }
  105544. // Fields allows partial responses to be retrieved. See
  105545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105546. // for more information.
  105547. func (c *RegionTargetHttpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesListCall {
  105548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105549. return c
  105550. }
  105551. // IfNoneMatch sets the optional parameter which makes the operation
  105552. // fail if the object's ETag matches the given value. This is useful for
  105553. // getting updates only after the object has changed since the last
  105554. // request. Use googleapi.IsNotModified to check whether the response
  105555. // error from Do is the result of In-None-Match.
  105556. func (c *RegionTargetHttpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesListCall {
  105557. c.ifNoneMatch_ = entityTag
  105558. return c
  105559. }
  105560. // Context sets the context to be used in this call's Do method. Any
  105561. // pending HTTP request will be aborted if the provided context is
  105562. // canceled.
  105563. func (c *RegionTargetHttpProxiesListCall) Context(ctx context.Context) *RegionTargetHttpProxiesListCall {
  105564. c.ctx_ = ctx
  105565. return c
  105566. }
  105567. // Header returns an http.Header that can be modified by the caller to
  105568. // add HTTP headers to the request.
  105569. func (c *RegionTargetHttpProxiesListCall) Header() http.Header {
  105570. if c.header_ == nil {
  105571. c.header_ = make(http.Header)
  105572. }
  105573. return c.header_
  105574. }
  105575. func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  105576. reqHeaders := make(http.Header)
  105577. for k, v := range c.header_ {
  105578. reqHeaders[k] = v
  105579. }
  105580. reqHeaders.Set("User-Agent", c.s.userAgent())
  105581. if c.ifNoneMatch_ != "" {
  105582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105583. }
  105584. var body io.Reader = nil
  105585. c.urlParams_.Set("alt", alt)
  105586. c.urlParams_.Set("prettyPrint", "false")
  105587. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  105588. urls += "?" + c.urlParams_.Encode()
  105589. req, err := http.NewRequest("GET", urls, body)
  105590. if err != nil {
  105591. return nil, err
  105592. }
  105593. req.Header = reqHeaders
  105594. googleapi.Expand(req.URL, map[string]string{
  105595. "project": c.project,
  105596. "region": c.region,
  105597. })
  105598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105599. }
  105600. // Do executes the "compute.regionTargetHttpProxies.list" call.
  105601. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  105602. // non-2xx status code is an error. Response headers are in either
  105603. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  105604. // returned at all) in error.(*googleapi.Error).Header. Use
  105605. // googleapi.IsNotModified to check whether the returned error was
  105606. // because http.StatusNotModified was returned.
  105607. func (c *RegionTargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  105608. gensupport.SetOptions(c.urlParams_, opts...)
  105609. res, err := c.doRequest("json")
  105610. if res != nil && res.StatusCode == http.StatusNotModified {
  105611. if res.Body != nil {
  105612. res.Body.Close()
  105613. }
  105614. return nil, &googleapi.Error{
  105615. Code: res.StatusCode,
  105616. Header: res.Header,
  105617. }
  105618. }
  105619. if err != nil {
  105620. return nil, err
  105621. }
  105622. defer googleapi.CloseBody(res)
  105623. if err := googleapi.CheckResponse(res); err != nil {
  105624. return nil, err
  105625. }
  105626. ret := &TargetHttpProxyList{
  105627. ServerResponse: googleapi.ServerResponse{
  105628. Header: res.Header,
  105629. HTTPStatusCode: res.StatusCode,
  105630. },
  105631. }
  105632. target := &ret
  105633. if err := gensupport.DecodeResponse(target, res); err != nil {
  105634. return nil, err
  105635. }
  105636. return ret, nil
  105637. // {
  105638. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.",
  105639. // "httpMethod": "GET",
  105640. // "id": "compute.regionTargetHttpProxies.list",
  105641. // "parameterOrder": [
  105642. // "project",
  105643. // "region"
  105644. // ],
  105645. // "parameters": {
  105646. // "filter": {
  105647. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  105648. // "location": "query",
  105649. // "type": "string"
  105650. // },
  105651. // "maxResults": {
  105652. // "default": "500",
  105653. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  105654. // "format": "uint32",
  105655. // "location": "query",
  105656. // "minimum": "0",
  105657. // "type": "integer"
  105658. // },
  105659. // "orderBy": {
  105660. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  105661. // "location": "query",
  105662. // "type": "string"
  105663. // },
  105664. // "pageToken": {
  105665. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  105666. // "location": "query",
  105667. // "type": "string"
  105668. // },
  105669. // "project": {
  105670. // "description": "Project ID for this request.",
  105671. // "location": "path",
  105672. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105673. // "required": true,
  105674. // "type": "string"
  105675. // },
  105676. // "region": {
  105677. // "description": "Name of the region scoping this request.",
  105678. // "location": "path",
  105679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105680. // "required": true,
  105681. // "type": "string"
  105682. // }
  105683. // },
  105684. // "path": "{project}/regions/{region}/targetHttpProxies",
  105685. // "response": {
  105686. // "$ref": "TargetHttpProxyList"
  105687. // },
  105688. // "scopes": [
  105689. // "https://www.googleapis.com/auth/cloud-platform",
  105690. // "https://www.googleapis.com/auth/compute",
  105691. // "https://www.googleapis.com/auth/compute.readonly"
  105692. // ]
  105693. // }
  105694. }
  105695. // Pages invokes f for each page of results.
  105696. // A non-nil error returned from f will halt the iteration.
  105697. // The provided context supersedes any context provided to the Context method.
  105698. func (c *RegionTargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  105699. c.ctx_ = ctx
  105700. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105701. for {
  105702. x, err := c.Do()
  105703. if err != nil {
  105704. return err
  105705. }
  105706. if err := f(x); err != nil {
  105707. return err
  105708. }
  105709. if x.NextPageToken == "" {
  105710. return nil
  105711. }
  105712. c.PageToken(x.NextPageToken)
  105713. }
  105714. }
  105715. // method id "compute.regionTargetHttpProxies.setUrlMap":
  105716. type RegionTargetHttpProxiesSetUrlMapCall struct {
  105717. s *Service
  105718. project string
  105719. region string
  105720. targetHttpProxy string
  105721. urlmapreference *UrlMapReference
  105722. urlParams_ gensupport.URLParams
  105723. ctx_ context.Context
  105724. header_ http.Header
  105725. }
  105726. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  105727. func (r *RegionTargetHttpProxiesService) SetUrlMap(project string, region string, targetHttpProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpProxiesSetUrlMapCall {
  105728. c := &RegionTargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105729. c.project = project
  105730. c.region = region
  105731. c.targetHttpProxy = targetHttpProxy
  105732. c.urlmapreference = urlmapreference
  105733. return c
  105734. }
  105735. // RequestId sets the optional parameter "requestId": An optional
  105736. // request ID to identify requests. Specify a unique request ID so that
  105737. // if you must retry your request, the server will know to ignore the
  105738. // request if it has already been completed.
  105739. //
  105740. // For example, consider a situation where you make an initial request
  105741. // and the request times out. If you make the request again with the
  105742. // same request ID, the server can check if original operation with the
  105743. // same request ID was received, and if so, will ignore the second
  105744. // request. This prevents clients from accidentally creating duplicate
  105745. // commitments.
  105746. //
  105747. // The request ID must be a valid UUID with the exception that zero UUID
  105748. // is not supported (00000000-0000-0000-0000-000000000000).
  105749. func (c *RegionTargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpProxiesSetUrlMapCall {
  105750. c.urlParams_.Set("requestId", requestId)
  105751. return c
  105752. }
  105753. // Fields allows partial responses to be retrieved. See
  105754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105755. // for more information.
  105756. func (c *RegionTargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesSetUrlMapCall {
  105757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105758. return c
  105759. }
  105760. // Context sets the context to be used in this call's Do method. Any
  105761. // pending HTTP request will be aborted if the provided context is
  105762. // canceled.
  105763. func (c *RegionTargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpProxiesSetUrlMapCall {
  105764. c.ctx_ = ctx
  105765. return c
  105766. }
  105767. // Header returns an http.Header that can be modified by the caller to
  105768. // add HTTP headers to the request.
  105769. func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header {
  105770. if c.header_ == nil {
  105771. c.header_ = make(http.Header)
  105772. }
  105773. return c.header_
  105774. }
  105775. func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  105776. reqHeaders := make(http.Header)
  105777. for k, v := range c.header_ {
  105778. reqHeaders[k] = v
  105779. }
  105780. reqHeaders.Set("User-Agent", c.s.userAgent())
  105781. var body io.Reader = nil
  105782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  105783. if err != nil {
  105784. return nil, err
  105785. }
  105786. reqHeaders.Set("Content-Type", "application/json")
  105787. c.urlParams_.Set("alt", alt)
  105788. c.urlParams_.Set("prettyPrint", "false")
  105789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  105790. urls += "?" + c.urlParams_.Encode()
  105791. req, err := http.NewRequest("POST", urls, body)
  105792. if err != nil {
  105793. return nil, err
  105794. }
  105795. req.Header = reqHeaders
  105796. googleapi.Expand(req.URL, map[string]string{
  105797. "project": c.project,
  105798. "region": c.region,
  105799. "targetHttpProxy": c.targetHttpProxy,
  105800. })
  105801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105802. }
  105803. // Do executes the "compute.regionTargetHttpProxies.setUrlMap" call.
  105804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105805. // status code is an error. Response headers are in either
  105806. // *Operation.ServerResponse.Header or (if a response was returned at
  105807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105808. // to check whether the returned error was because
  105809. // http.StatusNotModified was returned.
  105810. func (c *RegionTargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105811. gensupport.SetOptions(c.urlParams_, opts...)
  105812. res, err := c.doRequest("json")
  105813. if res != nil && res.StatusCode == http.StatusNotModified {
  105814. if res.Body != nil {
  105815. res.Body.Close()
  105816. }
  105817. return nil, &googleapi.Error{
  105818. Code: res.StatusCode,
  105819. Header: res.Header,
  105820. }
  105821. }
  105822. if err != nil {
  105823. return nil, err
  105824. }
  105825. defer googleapi.CloseBody(res)
  105826. if err := googleapi.CheckResponse(res); err != nil {
  105827. return nil, err
  105828. }
  105829. ret := &Operation{
  105830. ServerResponse: googleapi.ServerResponse{
  105831. Header: res.Header,
  105832. HTTPStatusCode: res.StatusCode,
  105833. },
  105834. }
  105835. target := &ret
  105836. if err := gensupport.DecodeResponse(target, res); err != nil {
  105837. return nil, err
  105838. }
  105839. return ret, nil
  105840. // {
  105841. // "description": "Changes the URL map for TargetHttpProxy.",
  105842. // "httpMethod": "POST",
  105843. // "id": "compute.regionTargetHttpProxies.setUrlMap",
  105844. // "parameterOrder": [
  105845. // "project",
  105846. // "region",
  105847. // "targetHttpProxy"
  105848. // ],
  105849. // "parameters": {
  105850. // "project": {
  105851. // "description": "Project ID for this request.",
  105852. // "location": "path",
  105853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105854. // "required": true,
  105855. // "type": "string"
  105856. // },
  105857. // "region": {
  105858. // "description": "Name of the region scoping this request.",
  105859. // "location": "path",
  105860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105861. // "required": true,
  105862. // "type": "string"
  105863. // },
  105864. // "requestId": {
  105865. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105866. // "location": "query",
  105867. // "type": "string"
  105868. // },
  105869. // "targetHttpProxy": {
  105870. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  105871. // "location": "path",
  105872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105873. // "required": true,
  105874. // "type": "string"
  105875. // }
  105876. // },
  105877. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  105878. // "request": {
  105879. // "$ref": "UrlMapReference"
  105880. // },
  105881. // "response": {
  105882. // "$ref": "Operation"
  105883. // },
  105884. // "scopes": [
  105885. // "https://www.googleapis.com/auth/cloud-platform",
  105886. // "https://www.googleapis.com/auth/compute"
  105887. // ]
  105888. // }
  105889. }
  105890. // method id "compute.regionTargetHttpProxies.testIamPermissions":
  105891. type RegionTargetHttpProxiesTestIamPermissionsCall struct {
  105892. s *Service
  105893. project string
  105894. region string
  105895. resource string
  105896. testpermissionsrequest *TestPermissionsRequest
  105897. urlParams_ gensupport.URLParams
  105898. ctx_ context.Context
  105899. header_ http.Header
  105900. }
  105901. // TestIamPermissions: Returns permissions that a caller has on the
  105902. // specified resource.
  105903. func (r *RegionTargetHttpProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpProxiesTestIamPermissionsCall {
  105904. c := &RegionTargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105905. c.project = project
  105906. c.region = region
  105907. c.resource = resource
  105908. c.testpermissionsrequest = testpermissionsrequest
  105909. return c
  105910. }
  105911. // Fields allows partial responses to be retrieved. See
  105912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105913. // for more information.
  105914. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesTestIamPermissionsCall {
  105915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105916. return c
  105917. }
  105918. // Context sets the context to be used in this call's Do method. Any
  105919. // pending HTTP request will be aborted if the provided context is
  105920. // canceled.
  105921. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpProxiesTestIamPermissionsCall {
  105922. c.ctx_ = ctx
  105923. return c
  105924. }
  105925. // Header returns an http.Header that can be modified by the caller to
  105926. // add HTTP headers to the request.
  105927. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  105928. if c.header_ == nil {
  105929. c.header_ = make(http.Header)
  105930. }
  105931. return c.header_
  105932. }
  105933. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  105934. reqHeaders := make(http.Header)
  105935. for k, v := range c.header_ {
  105936. reqHeaders[k] = v
  105937. }
  105938. reqHeaders.Set("User-Agent", c.s.userAgent())
  105939. var body io.Reader = nil
  105940. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105941. if err != nil {
  105942. return nil, err
  105943. }
  105944. reqHeaders.Set("Content-Type", "application/json")
  105945. c.urlParams_.Set("alt", alt)
  105946. c.urlParams_.Set("prettyPrint", "false")
  105947. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions")
  105948. urls += "?" + c.urlParams_.Encode()
  105949. req, err := http.NewRequest("POST", urls, body)
  105950. if err != nil {
  105951. return nil, err
  105952. }
  105953. req.Header = reqHeaders
  105954. googleapi.Expand(req.URL, map[string]string{
  105955. "project": c.project,
  105956. "region": c.region,
  105957. "resource": c.resource,
  105958. })
  105959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105960. }
  105961. // Do executes the "compute.regionTargetHttpProxies.testIamPermissions" call.
  105962. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105963. // non-2xx status code is an error. Response headers are in either
  105964. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105965. // returned at all) in error.(*googleapi.Error).Header. Use
  105966. // googleapi.IsNotModified to check whether the returned error was
  105967. // because http.StatusNotModified was returned.
  105968. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105969. gensupport.SetOptions(c.urlParams_, opts...)
  105970. res, err := c.doRequest("json")
  105971. if res != nil && res.StatusCode == http.StatusNotModified {
  105972. if res.Body != nil {
  105973. res.Body.Close()
  105974. }
  105975. return nil, &googleapi.Error{
  105976. Code: res.StatusCode,
  105977. Header: res.Header,
  105978. }
  105979. }
  105980. if err != nil {
  105981. return nil, err
  105982. }
  105983. defer googleapi.CloseBody(res)
  105984. if err := googleapi.CheckResponse(res); err != nil {
  105985. return nil, err
  105986. }
  105987. ret := &TestPermissionsResponse{
  105988. ServerResponse: googleapi.ServerResponse{
  105989. Header: res.Header,
  105990. HTTPStatusCode: res.StatusCode,
  105991. },
  105992. }
  105993. target := &ret
  105994. if err := gensupport.DecodeResponse(target, res); err != nil {
  105995. return nil, err
  105996. }
  105997. return ret, nil
  105998. // {
  105999. // "description": "Returns permissions that a caller has on the specified resource.",
  106000. // "httpMethod": "POST",
  106001. // "id": "compute.regionTargetHttpProxies.testIamPermissions",
  106002. // "parameterOrder": [
  106003. // "project",
  106004. // "region",
  106005. // "resource"
  106006. // ],
  106007. // "parameters": {
  106008. // "project": {
  106009. // "description": "Project ID for this request.",
  106010. // "location": "path",
  106011. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106012. // "required": true,
  106013. // "type": "string"
  106014. // },
  106015. // "region": {
  106016. // "description": "The name of the region for this request.",
  106017. // "location": "path",
  106018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106019. // "required": true,
  106020. // "type": "string"
  106021. // },
  106022. // "resource": {
  106023. // "description": "Name or id of the resource for this request.",
  106024. // "location": "path",
  106025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  106026. // "required": true,
  106027. // "type": "string"
  106028. // }
  106029. // },
  106030. // "path": "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions",
  106031. // "request": {
  106032. // "$ref": "TestPermissionsRequest"
  106033. // },
  106034. // "response": {
  106035. // "$ref": "TestPermissionsResponse"
  106036. // },
  106037. // "scopes": [
  106038. // "https://www.googleapis.com/auth/cloud-platform",
  106039. // "https://www.googleapis.com/auth/compute",
  106040. // "https://www.googleapis.com/auth/compute.readonly"
  106041. // ]
  106042. // }
  106043. }
  106044. // method id "compute.regionTargetHttpsProxies.delete":
  106045. type RegionTargetHttpsProxiesDeleteCall struct {
  106046. s *Service
  106047. project string
  106048. region string
  106049. targetHttpsProxy string
  106050. urlParams_ gensupport.URLParams
  106051. ctx_ context.Context
  106052. header_ http.Header
  106053. }
  106054. // Delete: Deletes the specified TargetHttpsProxy resource.
  106055. func (r *RegionTargetHttpsProxiesService) Delete(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesDeleteCall {
  106056. c := &RegionTargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106057. c.project = project
  106058. c.region = region
  106059. c.targetHttpsProxy = targetHttpsProxy
  106060. return c
  106061. }
  106062. // RequestId sets the optional parameter "requestId": An optional
  106063. // request ID to identify requests. Specify a unique request ID so that
  106064. // if you must retry your request, the server will know to ignore the
  106065. // request if it has already been completed.
  106066. //
  106067. // For example, consider a situation where you make an initial request
  106068. // and the request times out. If you make the request again with the
  106069. // same request ID, the server can check if original operation with the
  106070. // same request ID was received, and if so, will ignore the second
  106071. // request. This prevents clients from accidentally creating duplicate
  106072. // commitments.
  106073. //
  106074. // The request ID must be a valid UUID with the exception that zero UUID
  106075. // is not supported (00000000-0000-0000-0000-000000000000).
  106076. func (c *RegionTargetHttpsProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpsProxiesDeleteCall {
  106077. c.urlParams_.Set("requestId", requestId)
  106078. return c
  106079. }
  106080. // Fields allows partial responses to be retrieved. See
  106081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106082. // for more information.
  106083. func (c *RegionTargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesDeleteCall {
  106084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106085. return c
  106086. }
  106087. // Context sets the context to be used in this call's Do method. Any
  106088. // pending HTTP request will be aborted if the provided context is
  106089. // canceled.
  106090. func (c *RegionTargetHttpsProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpsProxiesDeleteCall {
  106091. c.ctx_ = ctx
  106092. return c
  106093. }
  106094. // Header returns an http.Header that can be modified by the caller to
  106095. // add HTTP headers to the request.
  106096. func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header {
  106097. if c.header_ == nil {
  106098. c.header_ = make(http.Header)
  106099. }
  106100. return c.header_
  106101. }
  106102. func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  106103. reqHeaders := make(http.Header)
  106104. for k, v := range c.header_ {
  106105. reqHeaders[k] = v
  106106. }
  106107. reqHeaders.Set("User-Agent", c.s.userAgent())
  106108. var body io.Reader = nil
  106109. c.urlParams_.Set("alt", alt)
  106110. c.urlParams_.Set("prettyPrint", "false")
  106111. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  106112. urls += "?" + c.urlParams_.Encode()
  106113. req, err := http.NewRequest("DELETE", urls, body)
  106114. if err != nil {
  106115. return nil, err
  106116. }
  106117. req.Header = reqHeaders
  106118. googleapi.Expand(req.URL, map[string]string{
  106119. "project": c.project,
  106120. "region": c.region,
  106121. "targetHttpsProxy": c.targetHttpsProxy,
  106122. })
  106123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106124. }
  106125. // Do executes the "compute.regionTargetHttpsProxies.delete" call.
  106126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106127. // status code is an error. Response headers are in either
  106128. // *Operation.ServerResponse.Header or (if a response was returned at
  106129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106130. // to check whether the returned error was because
  106131. // http.StatusNotModified was returned.
  106132. func (c *RegionTargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106133. gensupport.SetOptions(c.urlParams_, opts...)
  106134. res, err := c.doRequest("json")
  106135. if res != nil && res.StatusCode == http.StatusNotModified {
  106136. if res.Body != nil {
  106137. res.Body.Close()
  106138. }
  106139. return nil, &googleapi.Error{
  106140. Code: res.StatusCode,
  106141. Header: res.Header,
  106142. }
  106143. }
  106144. if err != nil {
  106145. return nil, err
  106146. }
  106147. defer googleapi.CloseBody(res)
  106148. if err := googleapi.CheckResponse(res); err != nil {
  106149. return nil, err
  106150. }
  106151. ret := &Operation{
  106152. ServerResponse: googleapi.ServerResponse{
  106153. Header: res.Header,
  106154. HTTPStatusCode: res.StatusCode,
  106155. },
  106156. }
  106157. target := &ret
  106158. if err := gensupport.DecodeResponse(target, res); err != nil {
  106159. return nil, err
  106160. }
  106161. return ret, nil
  106162. // {
  106163. // "description": "Deletes the specified TargetHttpsProxy resource.",
  106164. // "httpMethod": "DELETE",
  106165. // "id": "compute.regionTargetHttpsProxies.delete",
  106166. // "parameterOrder": [
  106167. // "project",
  106168. // "region",
  106169. // "targetHttpsProxy"
  106170. // ],
  106171. // "parameters": {
  106172. // "project": {
  106173. // "description": "Project ID for this request.",
  106174. // "location": "path",
  106175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106176. // "required": true,
  106177. // "type": "string"
  106178. // },
  106179. // "region": {
  106180. // "description": "Name of the region scoping this request.",
  106181. // "location": "path",
  106182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106183. // "required": true,
  106184. // "type": "string"
  106185. // },
  106186. // "requestId": {
  106187. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106188. // "location": "query",
  106189. // "type": "string"
  106190. // },
  106191. // "targetHttpsProxy": {
  106192. // "description": "Name of the TargetHttpsProxy resource to delete.",
  106193. // "location": "path",
  106194. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106195. // "required": true,
  106196. // "type": "string"
  106197. // }
  106198. // },
  106199. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  106200. // "response": {
  106201. // "$ref": "Operation"
  106202. // },
  106203. // "scopes": [
  106204. // "https://www.googleapis.com/auth/cloud-platform",
  106205. // "https://www.googleapis.com/auth/compute"
  106206. // ]
  106207. // }
  106208. }
  106209. // method id "compute.regionTargetHttpsProxies.get":
  106210. type RegionTargetHttpsProxiesGetCall struct {
  106211. s *Service
  106212. project string
  106213. region string
  106214. targetHttpsProxy string
  106215. urlParams_ gensupport.URLParams
  106216. ifNoneMatch_ string
  106217. ctx_ context.Context
  106218. header_ http.Header
  106219. }
  106220. // Get: Returns the specified TargetHttpsProxy resource in the specified
  106221. // region. Gets a list of available target HTTP proxies by making a
  106222. // list() request.
  106223. func (r *RegionTargetHttpsProxiesService) Get(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesGetCall {
  106224. c := &RegionTargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106225. c.project = project
  106226. c.region = region
  106227. c.targetHttpsProxy = targetHttpsProxy
  106228. return c
  106229. }
  106230. // Fields allows partial responses to be retrieved. See
  106231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106232. // for more information.
  106233. func (c *RegionTargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesGetCall {
  106234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106235. return c
  106236. }
  106237. // IfNoneMatch sets the optional parameter which makes the operation
  106238. // fail if the object's ETag matches the given value. This is useful for
  106239. // getting updates only after the object has changed since the last
  106240. // request. Use googleapi.IsNotModified to check whether the response
  106241. // error from Do is the result of In-None-Match.
  106242. func (c *RegionTargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesGetCall {
  106243. c.ifNoneMatch_ = entityTag
  106244. return c
  106245. }
  106246. // Context sets the context to be used in this call's Do method. Any
  106247. // pending HTTP request will be aborted if the provided context is
  106248. // canceled.
  106249. func (c *RegionTargetHttpsProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpsProxiesGetCall {
  106250. c.ctx_ = ctx
  106251. return c
  106252. }
  106253. // Header returns an http.Header that can be modified by the caller to
  106254. // add HTTP headers to the request.
  106255. func (c *RegionTargetHttpsProxiesGetCall) Header() http.Header {
  106256. if c.header_ == nil {
  106257. c.header_ = make(http.Header)
  106258. }
  106259. return c.header_
  106260. }
  106261. func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  106262. reqHeaders := make(http.Header)
  106263. for k, v := range c.header_ {
  106264. reqHeaders[k] = v
  106265. }
  106266. reqHeaders.Set("User-Agent", c.s.userAgent())
  106267. if c.ifNoneMatch_ != "" {
  106268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106269. }
  106270. var body io.Reader = nil
  106271. c.urlParams_.Set("alt", alt)
  106272. c.urlParams_.Set("prettyPrint", "false")
  106273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  106274. urls += "?" + c.urlParams_.Encode()
  106275. req, err := http.NewRequest("GET", urls, body)
  106276. if err != nil {
  106277. return nil, err
  106278. }
  106279. req.Header = reqHeaders
  106280. googleapi.Expand(req.URL, map[string]string{
  106281. "project": c.project,
  106282. "region": c.region,
  106283. "targetHttpsProxy": c.targetHttpsProxy,
  106284. })
  106285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106286. }
  106287. // Do executes the "compute.regionTargetHttpsProxies.get" call.
  106288. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  106289. // non-2xx status code is an error. Response headers are in either
  106290. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  106291. // returned at all) in error.(*googleapi.Error).Header. Use
  106292. // googleapi.IsNotModified to check whether the returned error was
  106293. // because http.StatusNotModified was returned.
  106294. func (c *RegionTargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  106295. gensupport.SetOptions(c.urlParams_, opts...)
  106296. res, err := c.doRequest("json")
  106297. if res != nil && res.StatusCode == http.StatusNotModified {
  106298. if res.Body != nil {
  106299. res.Body.Close()
  106300. }
  106301. return nil, &googleapi.Error{
  106302. Code: res.StatusCode,
  106303. Header: res.Header,
  106304. }
  106305. }
  106306. if err != nil {
  106307. return nil, err
  106308. }
  106309. defer googleapi.CloseBody(res)
  106310. if err := googleapi.CheckResponse(res); err != nil {
  106311. return nil, err
  106312. }
  106313. ret := &TargetHttpsProxy{
  106314. ServerResponse: googleapi.ServerResponse{
  106315. Header: res.Header,
  106316. HTTPStatusCode: res.StatusCode,
  106317. },
  106318. }
  106319. target := &ret
  106320. if err := gensupport.DecodeResponse(target, res); err != nil {
  106321. return nil, err
  106322. }
  106323. return ret, nil
  106324. // {
  106325. // "description": "Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  106326. // "httpMethod": "GET",
  106327. // "id": "compute.regionTargetHttpsProxies.get",
  106328. // "parameterOrder": [
  106329. // "project",
  106330. // "region",
  106331. // "targetHttpsProxy"
  106332. // ],
  106333. // "parameters": {
  106334. // "project": {
  106335. // "description": "Project ID for this request.",
  106336. // "location": "path",
  106337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106338. // "required": true,
  106339. // "type": "string"
  106340. // },
  106341. // "region": {
  106342. // "description": "Name of the region scoping this request.",
  106343. // "location": "path",
  106344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106345. // "required": true,
  106346. // "type": "string"
  106347. // },
  106348. // "targetHttpsProxy": {
  106349. // "description": "Name of the TargetHttpsProxy resource to return.",
  106350. // "location": "path",
  106351. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106352. // "required": true,
  106353. // "type": "string"
  106354. // }
  106355. // },
  106356. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  106357. // "response": {
  106358. // "$ref": "TargetHttpsProxy"
  106359. // },
  106360. // "scopes": [
  106361. // "https://www.googleapis.com/auth/cloud-platform",
  106362. // "https://www.googleapis.com/auth/compute",
  106363. // "https://www.googleapis.com/auth/compute.readonly"
  106364. // ]
  106365. // }
  106366. }
  106367. // method id "compute.regionTargetHttpsProxies.insert":
  106368. type RegionTargetHttpsProxiesInsertCall struct {
  106369. s *Service
  106370. project string
  106371. region string
  106372. targethttpsproxy *TargetHttpsProxy
  106373. urlParams_ gensupport.URLParams
  106374. ctx_ context.Context
  106375. header_ http.Header
  106376. }
  106377. // Insert: Creates a TargetHttpsProxy resource in the specified project
  106378. // and region using the data included in the request.
  106379. func (r *RegionTargetHttpsProxiesService) Insert(project string, region string, targethttpsproxy *TargetHttpsProxy) *RegionTargetHttpsProxiesInsertCall {
  106380. c := &RegionTargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106381. c.project = project
  106382. c.region = region
  106383. c.targethttpsproxy = targethttpsproxy
  106384. return c
  106385. }
  106386. // RequestId sets the optional parameter "requestId": An optional
  106387. // request ID to identify requests. Specify a unique request ID so that
  106388. // if you must retry your request, the server will know to ignore the
  106389. // request if it has already been completed.
  106390. //
  106391. // For example, consider a situation where you make an initial request
  106392. // and the request times out. If you make the request again with the
  106393. // same request ID, the server can check if original operation with the
  106394. // same request ID was received, and if so, will ignore the second
  106395. // request. This prevents clients from accidentally creating duplicate
  106396. // commitments.
  106397. //
  106398. // The request ID must be a valid UUID with the exception that zero UUID
  106399. // is not supported (00000000-0000-0000-0000-000000000000).
  106400. func (c *RegionTargetHttpsProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpsProxiesInsertCall {
  106401. c.urlParams_.Set("requestId", requestId)
  106402. return c
  106403. }
  106404. // Fields allows partial responses to be retrieved. See
  106405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106406. // for more information.
  106407. func (c *RegionTargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesInsertCall {
  106408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106409. return c
  106410. }
  106411. // Context sets the context to be used in this call's Do method. Any
  106412. // pending HTTP request will be aborted if the provided context is
  106413. // canceled.
  106414. func (c *RegionTargetHttpsProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpsProxiesInsertCall {
  106415. c.ctx_ = ctx
  106416. return c
  106417. }
  106418. // Header returns an http.Header that can be modified by the caller to
  106419. // add HTTP headers to the request.
  106420. func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header {
  106421. if c.header_ == nil {
  106422. c.header_ = make(http.Header)
  106423. }
  106424. return c.header_
  106425. }
  106426. func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  106427. reqHeaders := make(http.Header)
  106428. for k, v := range c.header_ {
  106429. reqHeaders[k] = v
  106430. }
  106431. reqHeaders.Set("User-Agent", c.s.userAgent())
  106432. var body io.Reader = nil
  106433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  106434. if err != nil {
  106435. return nil, err
  106436. }
  106437. reqHeaders.Set("Content-Type", "application/json")
  106438. c.urlParams_.Set("alt", alt)
  106439. c.urlParams_.Set("prettyPrint", "false")
  106440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  106441. urls += "?" + c.urlParams_.Encode()
  106442. req, err := http.NewRequest("POST", urls, body)
  106443. if err != nil {
  106444. return nil, err
  106445. }
  106446. req.Header = reqHeaders
  106447. googleapi.Expand(req.URL, map[string]string{
  106448. "project": c.project,
  106449. "region": c.region,
  106450. })
  106451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106452. }
  106453. // Do executes the "compute.regionTargetHttpsProxies.insert" call.
  106454. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106455. // status code is an error. Response headers are in either
  106456. // *Operation.ServerResponse.Header or (if a response was returned at
  106457. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106458. // to check whether the returned error was because
  106459. // http.StatusNotModified was returned.
  106460. func (c *RegionTargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106461. gensupport.SetOptions(c.urlParams_, opts...)
  106462. res, err := c.doRequest("json")
  106463. if res != nil && res.StatusCode == http.StatusNotModified {
  106464. if res.Body != nil {
  106465. res.Body.Close()
  106466. }
  106467. return nil, &googleapi.Error{
  106468. Code: res.StatusCode,
  106469. Header: res.Header,
  106470. }
  106471. }
  106472. if err != nil {
  106473. return nil, err
  106474. }
  106475. defer googleapi.CloseBody(res)
  106476. if err := googleapi.CheckResponse(res); err != nil {
  106477. return nil, err
  106478. }
  106479. ret := &Operation{
  106480. ServerResponse: googleapi.ServerResponse{
  106481. Header: res.Header,
  106482. HTTPStatusCode: res.StatusCode,
  106483. },
  106484. }
  106485. target := &ret
  106486. if err := gensupport.DecodeResponse(target, res); err != nil {
  106487. return nil, err
  106488. }
  106489. return ret, nil
  106490. // {
  106491. // "description": "Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.",
  106492. // "httpMethod": "POST",
  106493. // "id": "compute.regionTargetHttpsProxies.insert",
  106494. // "parameterOrder": [
  106495. // "project",
  106496. // "region"
  106497. // ],
  106498. // "parameters": {
  106499. // "project": {
  106500. // "description": "Project ID for this request.",
  106501. // "location": "path",
  106502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106503. // "required": true,
  106504. // "type": "string"
  106505. // },
  106506. // "region": {
  106507. // "description": "Name of the region scoping this request.",
  106508. // "location": "path",
  106509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106510. // "required": true,
  106511. // "type": "string"
  106512. // },
  106513. // "requestId": {
  106514. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106515. // "location": "query",
  106516. // "type": "string"
  106517. // }
  106518. // },
  106519. // "path": "{project}/regions/{region}/targetHttpsProxies",
  106520. // "request": {
  106521. // "$ref": "TargetHttpsProxy"
  106522. // },
  106523. // "response": {
  106524. // "$ref": "Operation"
  106525. // },
  106526. // "scopes": [
  106527. // "https://www.googleapis.com/auth/cloud-platform",
  106528. // "https://www.googleapis.com/auth/compute"
  106529. // ]
  106530. // }
  106531. }
  106532. // method id "compute.regionTargetHttpsProxies.list":
  106533. type RegionTargetHttpsProxiesListCall struct {
  106534. s *Service
  106535. project string
  106536. region string
  106537. urlParams_ gensupport.URLParams
  106538. ifNoneMatch_ string
  106539. ctx_ context.Context
  106540. header_ http.Header
  106541. }
  106542. // List: Retrieves the list of TargetHttpsProxy resources available to
  106543. // the specified project in the specified region.
  106544. func (r *RegionTargetHttpsProxiesService) List(project string, region string) *RegionTargetHttpsProxiesListCall {
  106545. c := &RegionTargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106546. c.project = project
  106547. c.region = region
  106548. return c
  106549. }
  106550. // Filter sets the optional parameter "filter": A filter expression that
  106551. // filters resources listed in the response. The expression must specify
  106552. // the field name, a comparison operator, and the value that you want to
  106553. // use for filtering. The value must be a string, a number, or a
  106554. // boolean. The comparison operator must be either =, !=, >, or <.
  106555. //
  106556. // For example, if you are filtering Compute Engine instances, you can
  106557. // exclude instances named example-instance by specifying name !=
  106558. // example-instance.
  106559. //
  106560. // You can also filter nested fields. For example, you could specify
  106561. // scheduling.automaticRestart = false to include instances only if they
  106562. // are not scheduled for automatic restarts. You can use filtering on
  106563. // nested fields to filter based on resource labels.
  106564. //
  106565. // To filter on multiple expressions, provide each separate expression
  106566. // within parentheses. For example, (scheduling.automaticRestart = true)
  106567. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  106568. // AND expression. However, you can include AND and OR expressions
  106569. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  106570. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  106571. // true).
  106572. func (c *RegionTargetHttpsProxiesListCall) Filter(filter string) *RegionTargetHttpsProxiesListCall {
  106573. c.urlParams_.Set("filter", filter)
  106574. return c
  106575. }
  106576. // MaxResults sets the optional parameter "maxResults": The maximum
  106577. // number of results per page that should be returned. If the number of
  106578. // available results is larger than maxResults, Compute Engine returns a
  106579. // nextPageToken that can be used to get the next page of results in
  106580. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  106581. // (Default: 500)
  106582. func (c *RegionTargetHttpsProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpsProxiesListCall {
  106583. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  106584. return c
  106585. }
  106586. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  106587. // a certain order. By default, results are returned in alphanumerical
  106588. // order based on the resource name.
  106589. //
  106590. // You can also sort results in descending order based on the creation
  106591. // timestamp using orderBy="creationTimestamp desc". This sorts results
  106592. // based on the creationTimestamp field in reverse chronological order
  106593. // (newest result first). Use this to sort resources like operations so
  106594. // that the newest operation is returned first.
  106595. //
  106596. // Currently, only sorting by name or creationTimestamp desc is
  106597. // supported.
  106598. func (c *RegionTargetHttpsProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpsProxiesListCall {
  106599. c.urlParams_.Set("orderBy", orderBy)
  106600. return c
  106601. }
  106602. // PageToken sets the optional parameter "pageToken": Specifies a page
  106603. // token to use. Set pageToken to the nextPageToken returned by a
  106604. // previous list request to get the next page of results.
  106605. func (c *RegionTargetHttpsProxiesListCall) PageToken(pageToken string) *RegionTargetHttpsProxiesListCall {
  106606. c.urlParams_.Set("pageToken", pageToken)
  106607. return c
  106608. }
  106609. // Fields allows partial responses to be retrieved. See
  106610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106611. // for more information.
  106612. func (c *RegionTargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesListCall {
  106613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106614. return c
  106615. }
  106616. // IfNoneMatch sets the optional parameter which makes the operation
  106617. // fail if the object's ETag matches the given value. This is useful for
  106618. // getting updates only after the object has changed since the last
  106619. // request. Use googleapi.IsNotModified to check whether the response
  106620. // error from Do is the result of In-None-Match.
  106621. func (c *RegionTargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesListCall {
  106622. c.ifNoneMatch_ = entityTag
  106623. return c
  106624. }
  106625. // Context sets the context to be used in this call's Do method. Any
  106626. // pending HTTP request will be aborted if the provided context is
  106627. // canceled.
  106628. func (c *RegionTargetHttpsProxiesListCall) Context(ctx context.Context) *RegionTargetHttpsProxiesListCall {
  106629. c.ctx_ = ctx
  106630. return c
  106631. }
  106632. // Header returns an http.Header that can be modified by the caller to
  106633. // add HTTP headers to the request.
  106634. func (c *RegionTargetHttpsProxiesListCall) Header() http.Header {
  106635. if c.header_ == nil {
  106636. c.header_ = make(http.Header)
  106637. }
  106638. return c.header_
  106639. }
  106640. func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  106641. reqHeaders := make(http.Header)
  106642. for k, v := range c.header_ {
  106643. reqHeaders[k] = v
  106644. }
  106645. reqHeaders.Set("User-Agent", c.s.userAgent())
  106646. if c.ifNoneMatch_ != "" {
  106647. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106648. }
  106649. var body io.Reader = nil
  106650. c.urlParams_.Set("alt", alt)
  106651. c.urlParams_.Set("prettyPrint", "false")
  106652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  106653. urls += "?" + c.urlParams_.Encode()
  106654. req, err := http.NewRequest("GET", urls, body)
  106655. if err != nil {
  106656. return nil, err
  106657. }
  106658. req.Header = reqHeaders
  106659. googleapi.Expand(req.URL, map[string]string{
  106660. "project": c.project,
  106661. "region": c.region,
  106662. })
  106663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106664. }
  106665. // Do executes the "compute.regionTargetHttpsProxies.list" call.
  106666. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  106667. // non-2xx status code is an error. Response headers are in either
  106668. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  106669. // returned at all) in error.(*googleapi.Error).Header. Use
  106670. // googleapi.IsNotModified to check whether the returned error was
  106671. // because http.StatusNotModified was returned.
  106672. func (c *RegionTargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  106673. gensupport.SetOptions(c.urlParams_, opts...)
  106674. res, err := c.doRequest("json")
  106675. if res != nil && res.StatusCode == http.StatusNotModified {
  106676. if res.Body != nil {
  106677. res.Body.Close()
  106678. }
  106679. return nil, &googleapi.Error{
  106680. Code: res.StatusCode,
  106681. Header: res.Header,
  106682. }
  106683. }
  106684. if err != nil {
  106685. return nil, err
  106686. }
  106687. defer googleapi.CloseBody(res)
  106688. if err := googleapi.CheckResponse(res); err != nil {
  106689. return nil, err
  106690. }
  106691. ret := &TargetHttpsProxyList{
  106692. ServerResponse: googleapi.ServerResponse{
  106693. Header: res.Header,
  106694. HTTPStatusCode: res.StatusCode,
  106695. },
  106696. }
  106697. target := &ret
  106698. if err := gensupport.DecodeResponse(target, res); err != nil {
  106699. return nil, err
  106700. }
  106701. return ret, nil
  106702. // {
  106703. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.",
  106704. // "httpMethod": "GET",
  106705. // "id": "compute.regionTargetHttpsProxies.list",
  106706. // "parameterOrder": [
  106707. // "project",
  106708. // "region"
  106709. // ],
  106710. // "parameters": {
  106711. // "filter": {
  106712. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  106713. // "location": "query",
  106714. // "type": "string"
  106715. // },
  106716. // "maxResults": {
  106717. // "default": "500",
  106718. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  106719. // "format": "uint32",
  106720. // "location": "query",
  106721. // "minimum": "0",
  106722. // "type": "integer"
  106723. // },
  106724. // "orderBy": {
  106725. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  106726. // "location": "query",
  106727. // "type": "string"
  106728. // },
  106729. // "pageToken": {
  106730. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  106731. // "location": "query",
  106732. // "type": "string"
  106733. // },
  106734. // "project": {
  106735. // "description": "Project ID for this request.",
  106736. // "location": "path",
  106737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106738. // "required": true,
  106739. // "type": "string"
  106740. // },
  106741. // "region": {
  106742. // "description": "Name of the region scoping this request.",
  106743. // "location": "path",
  106744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106745. // "required": true,
  106746. // "type": "string"
  106747. // }
  106748. // },
  106749. // "path": "{project}/regions/{region}/targetHttpsProxies",
  106750. // "response": {
  106751. // "$ref": "TargetHttpsProxyList"
  106752. // },
  106753. // "scopes": [
  106754. // "https://www.googleapis.com/auth/cloud-platform",
  106755. // "https://www.googleapis.com/auth/compute",
  106756. // "https://www.googleapis.com/auth/compute.readonly"
  106757. // ]
  106758. // }
  106759. }
  106760. // Pages invokes f for each page of results.
  106761. // A non-nil error returned from f will halt the iteration.
  106762. // The provided context supersedes any context provided to the Context method.
  106763. func (c *RegionTargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  106764. c.ctx_ = ctx
  106765. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  106766. for {
  106767. x, err := c.Do()
  106768. if err != nil {
  106769. return err
  106770. }
  106771. if err := f(x); err != nil {
  106772. return err
  106773. }
  106774. if x.NextPageToken == "" {
  106775. return nil
  106776. }
  106777. c.PageToken(x.NextPageToken)
  106778. }
  106779. }
  106780. // method id "compute.regionTargetHttpsProxies.setSslCertificates":
  106781. type RegionTargetHttpsProxiesSetSslCertificatesCall struct {
  106782. s *Service
  106783. project string
  106784. region string
  106785. targetHttpsProxy string
  106786. regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest
  106787. urlParams_ gensupport.URLParams
  106788. ctx_ context.Context
  106789. header_ http.Header
  106790. }
  106791. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  106792. func (r *RegionTargetHttpsProxiesService) SetSslCertificates(project string, region string, targetHttpsProxy string, regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  106793. c := &RegionTargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106794. c.project = project
  106795. c.region = region
  106796. c.targetHttpsProxy = targetHttpsProxy
  106797. c.regiontargethttpsproxiessetsslcertificatesrequest = regiontargethttpsproxiessetsslcertificatesrequest
  106798. return c
  106799. }
  106800. // RequestId sets the optional parameter "requestId": An optional
  106801. // request ID to identify requests. Specify a unique request ID so that
  106802. // if you must retry your request, the server will know to ignore the
  106803. // request if it has already been completed.
  106804. //
  106805. // For example, consider a situation where you make an initial request
  106806. // and the request times out. If you make the request again with the
  106807. // same request ID, the server can check if original operation with the
  106808. // same request ID was received, and if so, will ignore the second
  106809. // request. This prevents clients from accidentally creating duplicate
  106810. // commitments.
  106811. //
  106812. // The request ID must be a valid UUID with the exception that zero UUID
  106813. // is not supported (00000000-0000-0000-0000-000000000000).
  106814. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  106815. c.urlParams_.Set("requestId", requestId)
  106816. return c
  106817. }
  106818. // Fields allows partial responses to be retrieved. See
  106819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106820. // for more information.
  106821. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  106822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106823. return c
  106824. }
  106825. // Context sets the context to be used in this call's Do method. Any
  106826. // pending HTTP request will be aborted if the provided context is
  106827. // canceled.
  106828. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  106829. c.ctx_ = ctx
  106830. return c
  106831. }
  106832. // Header returns an http.Header that can be modified by the caller to
  106833. // add HTTP headers to the request.
  106834. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  106835. if c.header_ == nil {
  106836. c.header_ = make(http.Header)
  106837. }
  106838. return c.header_
  106839. }
  106840. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  106841. reqHeaders := make(http.Header)
  106842. for k, v := range c.header_ {
  106843. reqHeaders[k] = v
  106844. }
  106845. reqHeaders.Set("User-Agent", c.s.userAgent())
  106846. var body io.Reader = nil
  106847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest)
  106848. if err != nil {
  106849. return nil, err
  106850. }
  106851. reqHeaders.Set("Content-Type", "application/json")
  106852. c.urlParams_.Set("alt", alt)
  106853. c.urlParams_.Set("prettyPrint", "false")
  106854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  106855. urls += "?" + c.urlParams_.Encode()
  106856. req, err := http.NewRequest("POST", urls, body)
  106857. if err != nil {
  106858. return nil, err
  106859. }
  106860. req.Header = reqHeaders
  106861. googleapi.Expand(req.URL, map[string]string{
  106862. "project": c.project,
  106863. "region": c.region,
  106864. "targetHttpsProxy": c.targetHttpsProxy,
  106865. })
  106866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106867. }
  106868. // Do executes the "compute.regionTargetHttpsProxies.setSslCertificates" call.
  106869. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106870. // status code is an error. Response headers are in either
  106871. // *Operation.ServerResponse.Header or (if a response was returned at
  106872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106873. // to check whether the returned error was because
  106874. // http.StatusNotModified was returned.
  106875. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106876. gensupport.SetOptions(c.urlParams_, opts...)
  106877. res, err := c.doRequest("json")
  106878. if res != nil && res.StatusCode == http.StatusNotModified {
  106879. if res.Body != nil {
  106880. res.Body.Close()
  106881. }
  106882. return nil, &googleapi.Error{
  106883. Code: res.StatusCode,
  106884. Header: res.Header,
  106885. }
  106886. }
  106887. if err != nil {
  106888. return nil, err
  106889. }
  106890. defer googleapi.CloseBody(res)
  106891. if err := googleapi.CheckResponse(res); err != nil {
  106892. return nil, err
  106893. }
  106894. ret := &Operation{
  106895. ServerResponse: googleapi.ServerResponse{
  106896. Header: res.Header,
  106897. HTTPStatusCode: res.StatusCode,
  106898. },
  106899. }
  106900. target := &ret
  106901. if err := gensupport.DecodeResponse(target, res); err != nil {
  106902. return nil, err
  106903. }
  106904. return ret, nil
  106905. // {
  106906. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  106907. // "httpMethod": "POST",
  106908. // "id": "compute.regionTargetHttpsProxies.setSslCertificates",
  106909. // "parameterOrder": [
  106910. // "project",
  106911. // "region",
  106912. // "targetHttpsProxy"
  106913. // ],
  106914. // "parameters": {
  106915. // "project": {
  106916. // "description": "Project ID for this request.",
  106917. // "location": "path",
  106918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106919. // "required": true,
  106920. // "type": "string"
  106921. // },
  106922. // "region": {
  106923. // "description": "Name of the region scoping this request.",
  106924. // "location": "path",
  106925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106926. // "required": true,
  106927. // "type": "string"
  106928. // },
  106929. // "requestId": {
  106930. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106931. // "location": "query",
  106932. // "type": "string"
  106933. // },
  106934. // "targetHttpsProxy": {
  106935. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  106936. // "location": "path",
  106937. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106938. // "required": true,
  106939. // "type": "string"
  106940. // }
  106941. // },
  106942. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  106943. // "request": {
  106944. // "$ref": "RegionTargetHttpsProxiesSetSslCertificatesRequest"
  106945. // },
  106946. // "response": {
  106947. // "$ref": "Operation"
  106948. // },
  106949. // "scopes": [
  106950. // "https://www.googleapis.com/auth/cloud-platform",
  106951. // "https://www.googleapis.com/auth/compute"
  106952. // ]
  106953. // }
  106954. }
  106955. // method id "compute.regionTargetHttpsProxies.setUrlMap":
  106956. type RegionTargetHttpsProxiesSetUrlMapCall struct {
  106957. s *Service
  106958. project string
  106959. region string
  106960. targetHttpsProxy string
  106961. urlmapreference *UrlMapReference
  106962. urlParams_ gensupport.URLParams
  106963. ctx_ context.Context
  106964. header_ http.Header
  106965. }
  106966. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  106967. func (r *RegionTargetHttpsProxiesService) SetUrlMap(project string, region string, targetHttpsProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpsProxiesSetUrlMapCall {
  106968. c := &RegionTargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106969. c.project = project
  106970. c.region = region
  106971. c.targetHttpsProxy = targetHttpsProxy
  106972. c.urlmapreference = urlmapreference
  106973. return c
  106974. }
  106975. // RequestId sets the optional parameter "requestId": An optional
  106976. // request ID to identify requests. Specify a unique request ID so that
  106977. // if you must retry your request, the server will know to ignore the
  106978. // request if it has already been completed.
  106979. //
  106980. // For example, consider a situation where you make an initial request
  106981. // and the request times out. If you make the request again with the
  106982. // same request ID, the server can check if original operation with the
  106983. // same request ID was received, and if so, will ignore the second
  106984. // request. This prevents clients from accidentally creating duplicate
  106985. // commitments.
  106986. //
  106987. // The request ID must be a valid UUID with the exception that zero UUID
  106988. // is not supported (00000000-0000-0000-0000-000000000000).
  106989. func (c *RegionTargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetUrlMapCall {
  106990. c.urlParams_.Set("requestId", requestId)
  106991. return c
  106992. }
  106993. // Fields allows partial responses to be retrieved. See
  106994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106995. // for more information.
  106996. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetUrlMapCall {
  106997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106998. return c
  106999. }
  107000. // Context sets the context to be used in this call's Do method. Any
  107001. // pending HTTP request will be aborted if the provided context is
  107002. // canceled.
  107003. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetUrlMapCall {
  107004. c.ctx_ = ctx
  107005. return c
  107006. }
  107007. // Header returns an http.Header that can be modified by the caller to
  107008. // add HTTP headers to the request.
  107009. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  107010. if c.header_ == nil {
  107011. c.header_ = make(http.Header)
  107012. }
  107013. return c.header_
  107014. }
  107015. func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  107016. reqHeaders := make(http.Header)
  107017. for k, v := range c.header_ {
  107018. reqHeaders[k] = v
  107019. }
  107020. reqHeaders.Set("User-Agent", c.s.userAgent())
  107021. var body io.Reader = nil
  107022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  107023. if err != nil {
  107024. return nil, err
  107025. }
  107026. reqHeaders.Set("Content-Type", "application/json")
  107027. c.urlParams_.Set("alt", alt)
  107028. c.urlParams_.Set("prettyPrint", "false")
  107029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  107030. urls += "?" + c.urlParams_.Encode()
  107031. req, err := http.NewRequest("POST", urls, body)
  107032. if err != nil {
  107033. return nil, err
  107034. }
  107035. req.Header = reqHeaders
  107036. googleapi.Expand(req.URL, map[string]string{
  107037. "project": c.project,
  107038. "region": c.region,
  107039. "targetHttpsProxy": c.targetHttpsProxy,
  107040. })
  107041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107042. }
  107043. // Do executes the "compute.regionTargetHttpsProxies.setUrlMap" call.
  107044. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107045. // status code is an error. Response headers are in either
  107046. // *Operation.ServerResponse.Header or (if a response was returned at
  107047. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107048. // to check whether the returned error was because
  107049. // http.StatusNotModified was returned.
  107050. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107051. gensupport.SetOptions(c.urlParams_, opts...)
  107052. res, err := c.doRequest("json")
  107053. if res != nil && res.StatusCode == http.StatusNotModified {
  107054. if res.Body != nil {
  107055. res.Body.Close()
  107056. }
  107057. return nil, &googleapi.Error{
  107058. Code: res.StatusCode,
  107059. Header: res.Header,
  107060. }
  107061. }
  107062. if err != nil {
  107063. return nil, err
  107064. }
  107065. defer googleapi.CloseBody(res)
  107066. if err := googleapi.CheckResponse(res); err != nil {
  107067. return nil, err
  107068. }
  107069. ret := &Operation{
  107070. ServerResponse: googleapi.ServerResponse{
  107071. Header: res.Header,
  107072. HTTPStatusCode: res.StatusCode,
  107073. },
  107074. }
  107075. target := &ret
  107076. if err := gensupport.DecodeResponse(target, res); err != nil {
  107077. return nil, err
  107078. }
  107079. return ret, nil
  107080. // {
  107081. // "description": "Changes the URL map for TargetHttpsProxy.",
  107082. // "httpMethod": "POST",
  107083. // "id": "compute.regionTargetHttpsProxies.setUrlMap",
  107084. // "parameterOrder": [
  107085. // "project",
  107086. // "region",
  107087. // "targetHttpsProxy"
  107088. // ],
  107089. // "parameters": {
  107090. // "project": {
  107091. // "description": "Project ID for this request.",
  107092. // "location": "path",
  107093. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107094. // "required": true,
  107095. // "type": "string"
  107096. // },
  107097. // "region": {
  107098. // "description": "Name of the region scoping this request.",
  107099. // "location": "path",
  107100. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107101. // "required": true,
  107102. // "type": "string"
  107103. // },
  107104. // "requestId": {
  107105. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107106. // "location": "query",
  107107. // "type": "string"
  107108. // },
  107109. // "targetHttpsProxy": {
  107110. // "description": "Name of the TargetHttpsProxy to set a URL map for.",
  107111. // "location": "path",
  107112. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107113. // "required": true,
  107114. // "type": "string"
  107115. // }
  107116. // },
  107117. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  107118. // "request": {
  107119. // "$ref": "UrlMapReference"
  107120. // },
  107121. // "response": {
  107122. // "$ref": "Operation"
  107123. // },
  107124. // "scopes": [
  107125. // "https://www.googleapis.com/auth/cloud-platform",
  107126. // "https://www.googleapis.com/auth/compute"
  107127. // ]
  107128. // }
  107129. }
  107130. // method id "compute.regionTargetHttpsProxies.testIamPermissions":
  107131. type RegionTargetHttpsProxiesTestIamPermissionsCall struct {
  107132. s *Service
  107133. project string
  107134. region string
  107135. resource string
  107136. testpermissionsrequest *TestPermissionsRequest
  107137. urlParams_ gensupport.URLParams
  107138. ctx_ context.Context
  107139. header_ http.Header
  107140. }
  107141. // TestIamPermissions: Returns permissions that a caller has on the
  107142. // specified resource.
  107143. func (r *RegionTargetHttpsProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  107144. c := &RegionTargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107145. c.project = project
  107146. c.region = region
  107147. c.resource = resource
  107148. c.testpermissionsrequest = testpermissionsrequest
  107149. return c
  107150. }
  107151. // Fields allows partial responses to be retrieved. See
  107152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107153. // for more information.
  107154. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  107155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107156. return c
  107157. }
  107158. // Context sets the context to be used in this call's Do method. Any
  107159. // pending HTTP request will be aborted if the provided context is
  107160. // canceled.
  107161. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  107162. c.ctx_ = ctx
  107163. return c
  107164. }
  107165. // Header returns an http.Header that can be modified by the caller to
  107166. // add HTTP headers to the request.
  107167. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  107168. if c.header_ == nil {
  107169. c.header_ = make(http.Header)
  107170. }
  107171. return c.header_
  107172. }
  107173. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  107174. reqHeaders := make(http.Header)
  107175. for k, v := range c.header_ {
  107176. reqHeaders[k] = v
  107177. }
  107178. reqHeaders.Set("User-Agent", c.s.userAgent())
  107179. var body io.Reader = nil
  107180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  107181. if err != nil {
  107182. return nil, err
  107183. }
  107184. reqHeaders.Set("Content-Type", "application/json")
  107185. c.urlParams_.Set("alt", alt)
  107186. c.urlParams_.Set("prettyPrint", "false")
  107187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions")
  107188. urls += "?" + c.urlParams_.Encode()
  107189. req, err := http.NewRequest("POST", urls, body)
  107190. if err != nil {
  107191. return nil, err
  107192. }
  107193. req.Header = reqHeaders
  107194. googleapi.Expand(req.URL, map[string]string{
  107195. "project": c.project,
  107196. "region": c.region,
  107197. "resource": c.resource,
  107198. })
  107199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107200. }
  107201. // Do executes the "compute.regionTargetHttpsProxies.testIamPermissions" call.
  107202. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  107203. // non-2xx status code is an error. Response headers are in either
  107204. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  107205. // returned at all) in error.(*googleapi.Error).Header. Use
  107206. // googleapi.IsNotModified to check whether the returned error was
  107207. // because http.StatusNotModified was returned.
  107208. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  107209. gensupport.SetOptions(c.urlParams_, opts...)
  107210. res, err := c.doRequest("json")
  107211. if res != nil && res.StatusCode == http.StatusNotModified {
  107212. if res.Body != nil {
  107213. res.Body.Close()
  107214. }
  107215. return nil, &googleapi.Error{
  107216. Code: res.StatusCode,
  107217. Header: res.Header,
  107218. }
  107219. }
  107220. if err != nil {
  107221. return nil, err
  107222. }
  107223. defer googleapi.CloseBody(res)
  107224. if err := googleapi.CheckResponse(res); err != nil {
  107225. return nil, err
  107226. }
  107227. ret := &TestPermissionsResponse{
  107228. ServerResponse: googleapi.ServerResponse{
  107229. Header: res.Header,
  107230. HTTPStatusCode: res.StatusCode,
  107231. },
  107232. }
  107233. target := &ret
  107234. if err := gensupport.DecodeResponse(target, res); err != nil {
  107235. return nil, err
  107236. }
  107237. return ret, nil
  107238. // {
  107239. // "description": "Returns permissions that a caller has on the specified resource.",
  107240. // "httpMethod": "POST",
  107241. // "id": "compute.regionTargetHttpsProxies.testIamPermissions",
  107242. // "parameterOrder": [
  107243. // "project",
  107244. // "region",
  107245. // "resource"
  107246. // ],
  107247. // "parameters": {
  107248. // "project": {
  107249. // "description": "Project ID for this request.",
  107250. // "location": "path",
  107251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107252. // "required": true,
  107253. // "type": "string"
  107254. // },
  107255. // "region": {
  107256. // "description": "The name of the region for this request.",
  107257. // "location": "path",
  107258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107259. // "required": true,
  107260. // "type": "string"
  107261. // },
  107262. // "resource": {
  107263. // "description": "Name or id of the resource for this request.",
  107264. // "location": "path",
  107265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  107266. // "required": true,
  107267. // "type": "string"
  107268. // }
  107269. // },
  107270. // "path": "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions",
  107271. // "request": {
  107272. // "$ref": "TestPermissionsRequest"
  107273. // },
  107274. // "response": {
  107275. // "$ref": "TestPermissionsResponse"
  107276. // },
  107277. // "scopes": [
  107278. // "https://www.googleapis.com/auth/cloud-platform",
  107279. // "https://www.googleapis.com/auth/compute",
  107280. // "https://www.googleapis.com/auth/compute.readonly"
  107281. // ]
  107282. // }
  107283. }
  107284. // method id "compute.regionUrlMaps.delete":
  107285. type RegionUrlMapsDeleteCall struct {
  107286. s *Service
  107287. project string
  107288. region string
  107289. urlMap string
  107290. urlParams_ gensupport.URLParams
  107291. ctx_ context.Context
  107292. header_ http.Header
  107293. }
  107294. // Delete: Deletes the specified UrlMap resource.
  107295. func (r *RegionUrlMapsService) Delete(project string, region string, urlMap string) *RegionUrlMapsDeleteCall {
  107296. c := &RegionUrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107297. c.project = project
  107298. c.region = region
  107299. c.urlMap = urlMap
  107300. return c
  107301. }
  107302. // RequestId sets the optional parameter "requestId": begin_interface:
  107303. // MixerMutationRequestBuilder Request ID to support idempotency.
  107304. func (c *RegionUrlMapsDeleteCall) RequestId(requestId string) *RegionUrlMapsDeleteCall {
  107305. c.urlParams_.Set("requestId", requestId)
  107306. return c
  107307. }
  107308. // Fields allows partial responses to be retrieved. See
  107309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107310. // for more information.
  107311. func (c *RegionUrlMapsDeleteCall) Fields(s ...googleapi.Field) *RegionUrlMapsDeleteCall {
  107312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107313. return c
  107314. }
  107315. // Context sets the context to be used in this call's Do method. Any
  107316. // pending HTTP request will be aborted if the provided context is
  107317. // canceled.
  107318. func (c *RegionUrlMapsDeleteCall) Context(ctx context.Context) *RegionUrlMapsDeleteCall {
  107319. c.ctx_ = ctx
  107320. return c
  107321. }
  107322. // Header returns an http.Header that can be modified by the caller to
  107323. // add HTTP headers to the request.
  107324. func (c *RegionUrlMapsDeleteCall) Header() http.Header {
  107325. if c.header_ == nil {
  107326. c.header_ = make(http.Header)
  107327. }
  107328. return c.header_
  107329. }
  107330. func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  107331. reqHeaders := make(http.Header)
  107332. for k, v := range c.header_ {
  107333. reqHeaders[k] = v
  107334. }
  107335. reqHeaders.Set("User-Agent", c.s.userAgent())
  107336. var body io.Reader = nil
  107337. c.urlParams_.Set("alt", alt)
  107338. c.urlParams_.Set("prettyPrint", "false")
  107339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  107340. urls += "?" + c.urlParams_.Encode()
  107341. req, err := http.NewRequest("DELETE", urls, body)
  107342. if err != nil {
  107343. return nil, err
  107344. }
  107345. req.Header = reqHeaders
  107346. googleapi.Expand(req.URL, map[string]string{
  107347. "project": c.project,
  107348. "region": c.region,
  107349. "urlMap": c.urlMap,
  107350. })
  107351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107352. }
  107353. // Do executes the "compute.regionUrlMaps.delete" call.
  107354. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107355. // status code is an error. Response headers are in either
  107356. // *Operation.ServerResponse.Header or (if a response was returned at
  107357. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107358. // to check whether the returned error was because
  107359. // http.StatusNotModified was returned.
  107360. func (c *RegionUrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107361. gensupport.SetOptions(c.urlParams_, opts...)
  107362. res, err := c.doRequest("json")
  107363. if res != nil && res.StatusCode == http.StatusNotModified {
  107364. if res.Body != nil {
  107365. res.Body.Close()
  107366. }
  107367. return nil, &googleapi.Error{
  107368. Code: res.StatusCode,
  107369. Header: res.Header,
  107370. }
  107371. }
  107372. if err != nil {
  107373. return nil, err
  107374. }
  107375. defer googleapi.CloseBody(res)
  107376. if err := googleapi.CheckResponse(res); err != nil {
  107377. return nil, err
  107378. }
  107379. ret := &Operation{
  107380. ServerResponse: googleapi.ServerResponse{
  107381. Header: res.Header,
  107382. HTTPStatusCode: res.StatusCode,
  107383. },
  107384. }
  107385. target := &ret
  107386. if err := gensupport.DecodeResponse(target, res); err != nil {
  107387. return nil, err
  107388. }
  107389. return ret, nil
  107390. // {
  107391. // "description": "Deletes the specified UrlMap resource.",
  107392. // "httpMethod": "DELETE",
  107393. // "id": "compute.regionUrlMaps.delete",
  107394. // "parameterOrder": [
  107395. // "project",
  107396. // "region",
  107397. // "urlMap"
  107398. // ],
  107399. // "parameters": {
  107400. // "project": {
  107401. // "description": "Project ID for this request.",
  107402. // "location": "path",
  107403. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107404. // "required": true,
  107405. // "type": "string"
  107406. // },
  107407. // "region": {
  107408. // "description": "Name of the region scoping this request.",
  107409. // "location": "path",
  107410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107411. // "required": true,
  107412. // "type": "string"
  107413. // },
  107414. // "requestId": {
  107415. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  107416. // "location": "query",
  107417. // "type": "string"
  107418. // },
  107419. // "urlMap": {
  107420. // "description": "Name of the UrlMap resource to delete.",
  107421. // "location": "path",
  107422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107423. // "required": true,
  107424. // "type": "string"
  107425. // }
  107426. // },
  107427. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  107428. // "response": {
  107429. // "$ref": "Operation"
  107430. // },
  107431. // "scopes": [
  107432. // "https://www.googleapis.com/auth/cloud-platform",
  107433. // "https://www.googleapis.com/auth/compute"
  107434. // ]
  107435. // }
  107436. }
  107437. // method id "compute.regionUrlMaps.get":
  107438. type RegionUrlMapsGetCall struct {
  107439. s *Service
  107440. project string
  107441. region string
  107442. urlMap string
  107443. urlParams_ gensupport.URLParams
  107444. ifNoneMatch_ string
  107445. ctx_ context.Context
  107446. header_ http.Header
  107447. }
  107448. // Get: Returns the specified UrlMap resource. Gets a list of available
  107449. // URL maps by making a list() request.
  107450. func (r *RegionUrlMapsService) Get(project string, region string, urlMap string) *RegionUrlMapsGetCall {
  107451. c := &RegionUrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107452. c.project = project
  107453. c.region = region
  107454. c.urlMap = urlMap
  107455. return c
  107456. }
  107457. // Fields allows partial responses to be retrieved. See
  107458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107459. // for more information.
  107460. func (c *RegionUrlMapsGetCall) Fields(s ...googleapi.Field) *RegionUrlMapsGetCall {
  107461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107462. return c
  107463. }
  107464. // IfNoneMatch sets the optional parameter which makes the operation
  107465. // fail if the object's ETag matches the given value. This is useful for
  107466. // getting updates only after the object has changed since the last
  107467. // request. Use googleapi.IsNotModified to check whether the response
  107468. // error from Do is the result of In-None-Match.
  107469. func (c *RegionUrlMapsGetCall) IfNoneMatch(entityTag string) *RegionUrlMapsGetCall {
  107470. c.ifNoneMatch_ = entityTag
  107471. return c
  107472. }
  107473. // Context sets the context to be used in this call's Do method. Any
  107474. // pending HTTP request will be aborted if the provided context is
  107475. // canceled.
  107476. func (c *RegionUrlMapsGetCall) Context(ctx context.Context) *RegionUrlMapsGetCall {
  107477. c.ctx_ = ctx
  107478. return c
  107479. }
  107480. // Header returns an http.Header that can be modified by the caller to
  107481. // add HTTP headers to the request.
  107482. func (c *RegionUrlMapsGetCall) Header() http.Header {
  107483. if c.header_ == nil {
  107484. c.header_ = make(http.Header)
  107485. }
  107486. return c.header_
  107487. }
  107488. func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  107489. reqHeaders := make(http.Header)
  107490. for k, v := range c.header_ {
  107491. reqHeaders[k] = v
  107492. }
  107493. reqHeaders.Set("User-Agent", c.s.userAgent())
  107494. if c.ifNoneMatch_ != "" {
  107495. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107496. }
  107497. var body io.Reader = nil
  107498. c.urlParams_.Set("alt", alt)
  107499. c.urlParams_.Set("prettyPrint", "false")
  107500. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  107501. urls += "?" + c.urlParams_.Encode()
  107502. req, err := http.NewRequest("GET", urls, body)
  107503. if err != nil {
  107504. return nil, err
  107505. }
  107506. req.Header = reqHeaders
  107507. googleapi.Expand(req.URL, map[string]string{
  107508. "project": c.project,
  107509. "region": c.region,
  107510. "urlMap": c.urlMap,
  107511. })
  107512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107513. }
  107514. // Do executes the "compute.regionUrlMaps.get" call.
  107515. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  107516. // code is an error. Response headers are in either
  107517. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  107518. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  107519. // check whether the returned error was because http.StatusNotModified
  107520. // was returned.
  107521. func (c *RegionUrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  107522. gensupport.SetOptions(c.urlParams_, opts...)
  107523. res, err := c.doRequest("json")
  107524. if res != nil && res.StatusCode == http.StatusNotModified {
  107525. if res.Body != nil {
  107526. res.Body.Close()
  107527. }
  107528. return nil, &googleapi.Error{
  107529. Code: res.StatusCode,
  107530. Header: res.Header,
  107531. }
  107532. }
  107533. if err != nil {
  107534. return nil, err
  107535. }
  107536. defer googleapi.CloseBody(res)
  107537. if err := googleapi.CheckResponse(res); err != nil {
  107538. return nil, err
  107539. }
  107540. ret := &UrlMap{
  107541. ServerResponse: googleapi.ServerResponse{
  107542. Header: res.Header,
  107543. HTTPStatusCode: res.StatusCode,
  107544. },
  107545. }
  107546. target := &ret
  107547. if err := gensupport.DecodeResponse(target, res); err != nil {
  107548. return nil, err
  107549. }
  107550. return ret, nil
  107551. // {
  107552. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  107553. // "httpMethod": "GET",
  107554. // "id": "compute.regionUrlMaps.get",
  107555. // "parameterOrder": [
  107556. // "project",
  107557. // "region",
  107558. // "urlMap"
  107559. // ],
  107560. // "parameters": {
  107561. // "project": {
  107562. // "description": "Project ID for this request.",
  107563. // "location": "path",
  107564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107565. // "required": true,
  107566. // "type": "string"
  107567. // },
  107568. // "region": {
  107569. // "description": "Name of the region scoping this request.",
  107570. // "location": "path",
  107571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107572. // "required": true,
  107573. // "type": "string"
  107574. // },
  107575. // "urlMap": {
  107576. // "description": "Name of the UrlMap resource to return.",
  107577. // "location": "path",
  107578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107579. // "required": true,
  107580. // "type": "string"
  107581. // }
  107582. // },
  107583. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  107584. // "response": {
  107585. // "$ref": "UrlMap"
  107586. // },
  107587. // "scopes": [
  107588. // "https://www.googleapis.com/auth/cloud-platform",
  107589. // "https://www.googleapis.com/auth/compute",
  107590. // "https://www.googleapis.com/auth/compute.readonly"
  107591. // ]
  107592. // }
  107593. }
  107594. // method id "compute.regionUrlMaps.insert":
  107595. type RegionUrlMapsInsertCall struct {
  107596. s *Service
  107597. project string
  107598. region string
  107599. urlmap *UrlMap
  107600. urlParams_ gensupport.URLParams
  107601. ctx_ context.Context
  107602. header_ http.Header
  107603. }
  107604. // Insert: Creates a UrlMap resource in the specified project using the
  107605. // data included in the request.
  107606. func (r *RegionUrlMapsService) Insert(project string, region string, urlmap *UrlMap) *RegionUrlMapsInsertCall {
  107607. c := &RegionUrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107608. c.project = project
  107609. c.region = region
  107610. c.urlmap = urlmap
  107611. return c
  107612. }
  107613. // RequestId sets the optional parameter "requestId": begin_interface:
  107614. // MixerMutationRequestBuilder Request ID to support idempotency.
  107615. func (c *RegionUrlMapsInsertCall) RequestId(requestId string) *RegionUrlMapsInsertCall {
  107616. c.urlParams_.Set("requestId", requestId)
  107617. return c
  107618. }
  107619. // Fields allows partial responses to be retrieved. See
  107620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107621. // for more information.
  107622. func (c *RegionUrlMapsInsertCall) Fields(s ...googleapi.Field) *RegionUrlMapsInsertCall {
  107623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107624. return c
  107625. }
  107626. // Context sets the context to be used in this call's Do method. Any
  107627. // pending HTTP request will be aborted if the provided context is
  107628. // canceled.
  107629. func (c *RegionUrlMapsInsertCall) Context(ctx context.Context) *RegionUrlMapsInsertCall {
  107630. c.ctx_ = ctx
  107631. return c
  107632. }
  107633. // Header returns an http.Header that can be modified by the caller to
  107634. // add HTTP headers to the request.
  107635. func (c *RegionUrlMapsInsertCall) Header() http.Header {
  107636. if c.header_ == nil {
  107637. c.header_ = make(http.Header)
  107638. }
  107639. return c.header_
  107640. }
  107641. func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  107642. reqHeaders := make(http.Header)
  107643. for k, v := range c.header_ {
  107644. reqHeaders[k] = v
  107645. }
  107646. reqHeaders.Set("User-Agent", c.s.userAgent())
  107647. var body io.Reader = nil
  107648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  107649. if err != nil {
  107650. return nil, err
  107651. }
  107652. reqHeaders.Set("Content-Type", "application/json")
  107653. c.urlParams_.Set("alt", alt)
  107654. c.urlParams_.Set("prettyPrint", "false")
  107655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  107656. urls += "?" + c.urlParams_.Encode()
  107657. req, err := http.NewRequest("POST", urls, body)
  107658. if err != nil {
  107659. return nil, err
  107660. }
  107661. req.Header = reqHeaders
  107662. googleapi.Expand(req.URL, map[string]string{
  107663. "project": c.project,
  107664. "region": c.region,
  107665. })
  107666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107667. }
  107668. // Do executes the "compute.regionUrlMaps.insert" call.
  107669. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107670. // status code is an error. Response headers are in either
  107671. // *Operation.ServerResponse.Header or (if a response was returned at
  107672. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107673. // to check whether the returned error was because
  107674. // http.StatusNotModified was returned.
  107675. func (c *RegionUrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107676. gensupport.SetOptions(c.urlParams_, opts...)
  107677. res, err := c.doRequest("json")
  107678. if res != nil && res.StatusCode == http.StatusNotModified {
  107679. if res.Body != nil {
  107680. res.Body.Close()
  107681. }
  107682. return nil, &googleapi.Error{
  107683. Code: res.StatusCode,
  107684. Header: res.Header,
  107685. }
  107686. }
  107687. if err != nil {
  107688. return nil, err
  107689. }
  107690. defer googleapi.CloseBody(res)
  107691. if err := googleapi.CheckResponse(res); err != nil {
  107692. return nil, err
  107693. }
  107694. ret := &Operation{
  107695. ServerResponse: googleapi.ServerResponse{
  107696. Header: res.Header,
  107697. HTTPStatusCode: res.StatusCode,
  107698. },
  107699. }
  107700. target := &ret
  107701. if err := gensupport.DecodeResponse(target, res); err != nil {
  107702. return nil, err
  107703. }
  107704. return ret, nil
  107705. // {
  107706. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  107707. // "httpMethod": "POST",
  107708. // "id": "compute.regionUrlMaps.insert",
  107709. // "parameterOrder": [
  107710. // "project",
  107711. // "region"
  107712. // ],
  107713. // "parameters": {
  107714. // "project": {
  107715. // "description": "Project ID for this request.",
  107716. // "location": "path",
  107717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107718. // "required": true,
  107719. // "type": "string"
  107720. // },
  107721. // "region": {
  107722. // "description": "Name of the region scoping this request.",
  107723. // "location": "path",
  107724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107725. // "required": true,
  107726. // "type": "string"
  107727. // },
  107728. // "requestId": {
  107729. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  107730. // "location": "query",
  107731. // "type": "string"
  107732. // }
  107733. // },
  107734. // "path": "{project}/regions/{region}/urlMaps",
  107735. // "request": {
  107736. // "$ref": "UrlMap"
  107737. // },
  107738. // "response": {
  107739. // "$ref": "Operation"
  107740. // },
  107741. // "scopes": [
  107742. // "https://www.googleapis.com/auth/cloud-platform",
  107743. // "https://www.googleapis.com/auth/compute"
  107744. // ]
  107745. // }
  107746. }
  107747. // method id "compute.regionUrlMaps.invalidateCache":
  107748. type RegionUrlMapsInvalidateCacheCall struct {
  107749. s *Service
  107750. project string
  107751. region string
  107752. urlMap string
  107753. cacheinvalidationrule *CacheInvalidationRule
  107754. urlParams_ gensupport.URLParams
  107755. ctx_ context.Context
  107756. header_ http.Header
  107757. }
  107758. // InvalidateCache: Initiates a cache invalidation operation,
  107759. // invalidating the specified path, scoped to the specified UrlMap.
  107760. func (r *RegionUrlMapsService) InvalidateCache(project string, region string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *RegionUrlMapsInvalidateCacheCall {
  107761. c := &RegionUrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107762. c.project = project
  107763. c.region = region
  107764. c.urlMap = urlMap
  107765. c.cacheinvalidationrule = cacheinvalidationrule
  107766. return c
  107767. }
  107768. // RequestId sets the optional parameter "requestId": begin_interface:
  107769. // MixerMutationRequestBuilder Request ID to support idempotency.
  107770. func (c *RegionUrlMapsInvalidateCacheCall) RequestId(requestId string) *RegionUrlMapsInvalidateCacheCall {
  107771. c.urlParams_.Set("requestId", requestId)
  107772. return c
  107773. }
  107774. // Fields allows partial responses to be retrieved. See
  107775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107776. // for more information.
  107777. func (c *RegionUrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *RegionUrlMapsInvalidateCacheCall {
  107778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107779. return c
  107780. }
  107781. // Context sets the context to be used in this call's Do method. Any
  107782. // pending HTTP request will be aborted if the provided context is
  107783. // canceled.
  107784. func (c *RegionUrlMapsInvalidateCacheCall) Context(ctx context.Context) *RegionUrlMapsInvalidateCacheCall {
  107785. c.ctx_ = ctx
  107786. return c
  107787. }
  107788. // Header returns an http.Header that can be modified by the caller to
  107789. // add HTTP headers to the request.
  107790. func (c *RegionUrlMapsInvalidateCacheCall) Header() http.Header {
  107791. if c.header_ == nil {
  107792. c.header_ = make(http.Header)
  107793. }
  107794. return c.header_
  107795. }
  107796. func (c *RegionUrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  107797. reqHeaders := make(http.Header)
  107798. for k, v := range c.header_ {
  107799. reqHeaders[k] = v
  107800. }
  107801. reqHeaders.Set("User-Agent", c.s.userAgent())
  107802. var body io.Reader = nil
  107803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  107804. if err != nil {
  107805. return nil, err
  107806. }
  107807. reqHeaders.Set("Content-Type", "application/json")
  107808. c.urlParams_.Set("alt", alt)
  107809. c.urlParams_.Set("prettyPrint", "false")
  107810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache")
  107811. urls += "?" + c.urlParams_.Encode()
  107812. req, err := http.NewRequest("POST", urls, body)
  107813. if err != nil {
  107814. return nil, err
  107815. }
  107816. req.Header = reqHeaders
  107817. googleapi.Expand(req.URL, map[string]string{
  107818. "project": c.project,
  107819. "region": c.region,
  107820. "urlMap": c.urlMap,
  107821. })
  107822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107823. }
  107824. // Do executes the "compute.regionUrlMaps.invalidateCache" call.
  107825. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107826. // status code is an error. Response headers are in either
  107827. // *Operation.ServerResponse.Header or (if a response was returned at
  107828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107829. // to check whether the returned error was because
  107830. // http.StatusNotModified was returned.
  107831. func (c *RegionUrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107832. gensupport.SetOptions(c.urlParams_, opts...)
  107833. res, err := c.doRequest("json")
  107834. if res != nil && res.StatusCode == http.StatusNotModified {
  107835. if res.Body != nil {
  107836. res.Body.Close()
  107837. }
  107838. return nil, &googleapi.Error{
  107839. Code: res.StatusCode,
  107840. Header: res.Header,
  107841. }
  107842. }
  107843. if err != nil {
  107844. return nil, err
  107845. }
  107846. defer googleapi.CloseBody(res)
  107847. if err := googleapi.CheckResponse(res); err != nil {
  107848. return nil, err
  107849. }
  107850. ret := &Operation{
  107851. ServerResponse: googleapi.ServerResponse{
  107852. Header: res.Header,
  107853. HTTPStatusCode: res.StatusCode,
  107854. },
  107855. }
  107856. target := &ret
  107857. if err := gensupport.DecodeResponse(target, res); err != nil {
  107858. return nil, err
  107859. }
  107860. return ret, nil
  107861. // {
  107862. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  107863. // "httpMethod": "POST",
  107864. // "id": "compute.regionUrlMaps.invalidateCache",
  107865. // "parameterOrder": [
  107866. // "project",
  107867. // "region",
  107868. // "urlMap"
  107869. // ],
  107870. // "parameters": {
  107871. // "project": {
  107872. // "description": "Project ID for this request.",
  107873. // "location": "path",
  107874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107875. // "required": true,
  107876. // "type": "string"
  107877. // },
  107878. // "region": {
  107879. // "description": "Name of the region scoping this request.",
  107880. // "location": "path",
  107881. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107882. // "required": true,
  107883. // "type": "string"
  107884. // },
  107885. // "requestId": {
  107886. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  107887. // "location": "query",
  107888. // "type": "string"
  107889. // },
  107890. // "urlMap": {
  107891. // "description": "Name of the UrlMap scoping this request.",
  107892. // "location": "path",
  107893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107894. // "required": true,
  107895. // "type": "string"
  107896. // }
  107897. // },
  107898. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache",
  107899. // "request": {
  107900. // "$ref": "CacheInvalidationRule"
  107901. // },
  107902. // "response": {
  107903. // "$ref": "Operation"
  107904. // },
  107905. // "scopes": [
  107906. // "https://www.googleapis.com/auth/cloud-platform",
  107907. // "https://www.googleapis.com/auth/compute"
  107908. // ]
  107909. // }
  107910. }
  107911. // method id "compute.regionUrlMaps.list":
  107912. type RegionUrlMapsListCall struct {
  107913. s *Service
  107914. project string
  107915. region string
  107916. urlParams_ gensupport.URLParams
  107917. ifNoneMatch_ string
  107918. ctx_ context.Context
  107919. header_ http.Header
  107920. }
  107921. // List: Retrieves the list of UrlMap resources available to the
  107922. // specified project in the specified region.
  107923. func (r *RegionUrlMapsService) List(project string, region string) *RegionUrlMapsListCall {
  107924. c := &RegionUrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107925. c.project = project
  107926. c.region = region
  107927. return c
  107928. }
  107929. // Filter sets the optional parameter "filter": A filter expression that
  107930. // filters resources listed in the response. The expression must specify
  107931. // the field name, a comparison operator, and the value that you want to
  107932. // use for filtering. The value must be a string, a number, or a
  107933. // boolean. The comparison operator must be either =, !=, >, or <.
  107934. //
  107935. // For example, if you are filtering Compute Engine instances, you can
  107936. // exclude instances named example-instance by specifying name !=
  107937. // example-instance.
  107938. //
  107939. // You can also filter nested fields. For example, you could specify
  107940. // scheduling.automaticRestart = false to include instances only if they
  107941. // are not scheduled for automatic restarts. You can use filtering on
  107942. // nested fields to filter based on resource labels.
  107943. //
  107944. // To filter on multiple expressions, provide each separate expression
  107945. // within parentheses. For example, (scheduling.automaticRestart = true)
  107946. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107947. // AND expression. However, you can include AND and OR expressions
  107948. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107949. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107950. // true).
  107951. func (c *RegionUrlMapsListCall) Filter(filter string) *RegionUrlMapsListCall {
  107952. c.urlParams_.Set("filter", filter)
  107953. return c
  107954. }
  107955. // MaxResults sets the optional parameter "maxResults": The maximum
  107956. // number of results per page that should be returned. If the number of
  107957. // available results is larger than maxResults, Compute Engine returns a
  107958. // nextPageToken that can be used to get the next page of results in
  107959. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107960. // (Default: 500)
  107961. func (c *RegionUrlMapsListCall) MaxResults(maxResults int64) *RegionUrlMapsListCall {
  107962. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107963. return c
  107964. }
  107965. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107966. // a certain order. By default, results are returned in alphanumerical
  107967. // order based on the resource name.
  107968. //
  107969. // You can also sort results in descending order based on the creation
  107970. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107971. // based on the creationTimestamp field in reverse chronological order
  107972. // (newest result first). Use this to sort resources like operations so
  107973. // that the newest operation is returned first.
  107974. //
  107975. // Currently, only sorting by name or creationTimestamp desc is
  107976. // supported.
  107977. func (c *RegionUrlMapsListCall) OrderBy(orderBy string) *RegionUrlMapsListCall {
  107978. c.urlParams_.Set("orderBy", orderBy)
  107979. return c
  107980. }
  107981. // PageToken sets the optional parameter "pageToken": Specifies a page
  107982. // token to use. Set pageToken to the nextPageToken returned by a
  107983. // previous list request to get the next page of results.
  107984. func (c *RegionUrlMapsListCall) PageToken(pageToken string) *RegionUrlMapsListCall {
  107985. c.urlParams_.Set("pageToken", pageToken)
  107986. return c
  107987. }
  107988. // Fields allows partial responses to be retrieved. See
  107989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107990. // for more information.
  107991. func (c *RegionUrlMapsListCall) Fields(s ...googleapi.Field) *RegionUrlMapsListCall {
  107992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107993. return c
  107994. }
  107995. // IfNoneMatch sets the optional parameter which makes the operation
  107996. // fail if the object's ETag matches the given value. This is useful for
  107997. // getting updates only after the object has changed since the last
  107998. // request. Use googleapi.IsNotModified to check whether the response
  107999. // error from Do is the result of In-None-Match.
  108000. func (c *RegionUrlMapsListCall) IfNoneMatch(entityTag string) *RegionUrlMapsListCall {
  108001. c.ifNoneMatch_ = entityTag
  108002. return c
  108003. }
  108004. // Context sets the context to be used in this call's Do method. Any
  108005. // pending HTTP request will be aborted if the provided context is
  108006. // canceled.
  108007. func (c *RegionUrlMapsListCall) Context(ctx context.Context) *RegionUrlMapsListCall {
  108008. c.ctx_ = ctx
  108009. return c
  108010. }
  108011. // Header returns an http.Header that can be modified by the caller to
  108012. // add HTTP headers to the request.
  108013. func (c *RegionUrlMapsListCall) Header() http.Header {
  108014. if c.header_ == nil {
  108015. c.header_ = make(http.Header)
  108016. }
  108017. return c.header_
  108018. }
  108019. func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  108020. reqHeaders := make(http.Header)
  108021. for k, v := range c.header_ {
  108022. reqHeaders[k] = v
  108023. }
  108024. reqHeaders.Set("User-Agent", c.s.userAgent())
  108025. if c.ifNoneMatch_ != "" {
  108026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108027. }
  108028. var body io.Reader = nil
  108029. c.urlParams_.Set("alt", alt)
  108030. c.urlParams_.Set("prettyPrint", "false")
  108031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  108032. urls += "?" + c.urlParams_.Encode()
  108033. req, err := http.NewRequest("GET", urls, body)
  108034. if err != nil {
  108035. return nil, err
  108036. }
  108037. req.Header = reqHeaders
  108038. googleapi.Expand(req.URL, map[string]string{
  108039. "project": c.project,
  108040. "region": c.region,
  108041. })
  108042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108043. }
  108044. // Do executes the "compute.regionUrlMaps.list" call.
  108045. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  108046. // status code is an error. Response headers are in either
  108047. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  108048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108049. // to check whether the returned error was because
  108050. // http.StatusNotModified was returned.
  108051. func (c *RegionUrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  108052. gensupport.SetOptions(c.urlParams_, opts...)
  108053. res, err := c.doRequest("json")
  108054. if res != nil && res.StatusCode == http.StatusNotModified {
  108055. if res.Body != nil {
  108056. res.Body.Close()
  108057. }
  108058. return nil, &googleapi.Error{
  108059. Code: res.StatusCode,
  108060. Header: res.Header,
  108061. }
  108062. }
  108063. if err != nil {
  108064. return nil, err
  108065. }
  108066. defer googleapi.CloseBody(res)
  108067. if err := googleapi.CheckResponse(res); err != nil {
  108068. return nil, err
  108069. }
  108070. ret := &UrlMapList{
  108071. ServerResponse: googleapi.ServerResponse{
  108072. Header: res.Header,
  108073. HTTPStatusCode: res.StatusCode,
  108074. },
  108075. }
  108076. target := &ret
  108077. if err := gensupport.DecodeResponse(target, res); err != nil {
  108078. return nil, err
  108079. }
  108080. return ret, nil
  108081. // {
  108082. // "description": "Retrieves the list of UrlMap resources available to the specified project in the specified region.",
  108083. // "httpMethod": "GET",
  108084. // "id": "compute.regionUrlMaps.list",
  108085. // "parameterOrder": [
  108086. // "project",
  108087. // "region"
  108088. // ],
  108089. // "parameters": {
  108090. // "filter": {
  108091. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  108092. // "location": "query",
  108093. // "type": "string"
  108094. // },
  108095. // "maxResults": {
  108096. // "default": "500",
  108097. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  108098. // "format": "uint32",
  108099. // "location": "query",
  108100. // "minimum": "0",
  108101. // "type": "integer"
  108102. // },
  108103. // "orderBy": {
  108104. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  108105. // "location": "query",
  108106. // "type": "string"
  108107. // },
  108108. // "pageToken": {
  108109. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  108110. // "location": "query",
  108111. // "type": "string"
  108112. // },
  108113. // "project": {
  108114. // "description": "Project ID for this request.",
  108115. // "location": "path",
  108116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108117. // "required": true,
  108118. // "type": "string"
  108119. // },
  108120. // "region": {
  108121. // "description": "Name of the region scoping this request.",
  108122. // "location": "path",
  108123. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108124. // "required": true,
  108125. // "type": "string"
  108126. // }
  108127. // },
  108128. // "path": "{project}/regions/{region}/urlMaps",
  108129. // "response": {
  108130. // "$ref": "UrlMapList"
  108131. // },
  108132. // "scopes": [
  108133. // "https://www.googleapis.com/auth/cloud-platform",
  108134. // "https://www.googleapis.com/auth/compute",
  108135. // "https://www.googleapis.com/auth/compute.readonly"
  108136. // ]
  108137. // }
  108138. }
  108139. // Pages invokes f for each page of results.
  108140. // A non-nil error returned from f will halt the iteration.
  108141. // The provided context supersedes any context provided to the Context method.
  108142. func (c *RegionUrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  108143. c.ctx_ = ctx
  108144. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108145. for {
  108146. x, err := c.Do()
  108147. if err != nil {
  108148. return err
  108149. }
  108150. if err := f(x); err != nil {
  108151. return err
  108152. }
  108153. if x.NextPageToken == "" {
  108154. return nil
  108155. }
  108156. c.PageToken(x.NextPageToken)
  108157. }
  108158. }
  108159. // method id "compute.regionUrlMaps.patch":
  108160. type RegionUrlMapsPatchCall struct {
  108161. s *Service
  108162. project string
  108163. region string
  108164. urlMap string
  108165. urlmap *UrlMap
  108166. urlParams_ gensupport.URLParams
  108167. ctx_ context.Context
  108168. header_ http.Header
  108169. }
  108170. // Patch: Patches the specified UrlMap resource with the data included
  108171. // in the request. This method supports PATCH semantics and uses JSON
  108172. // merge patch format and processing rules.
  108173. func (r *RegionUrlMapsService) Patch(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsPatchCall {
  108174. c := &RegionUrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108175. c.project = project
  108176. c.region = region
  108177. c.urlMap = urlMap
  108178. c.urlmap = urlmap
  108179. return c
  108180. }
  108181. // RequestId sets the optional parameter "requestId": begin_interface:
  108182. // MixerMutationRequestBuilder Request ID to support idempotency.
  108183. func (c *RegionUrlMapsPatchCall) RequestId(requestId string) *RegionUrlMapsPatchCall {
  108184. c.urlParams_.Set("requestId", requestId)
  108185. return c
  108186. }
  108187. // Fields allows partial responses to be retrieved. See
  108188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108189. // for more information.
  108190. func (c *RegionUrlMapsPatchCall) Fields(s ...googleapi.Field) *RegionUrlMapsPatchCall {
  108191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108192. return c
  108193. }
  108194. // Context sets the context to be used in this call's Do method. Any
  108195. // pending HTTP request will be aborted if the provided context is
  108196. // canceled.
  108197. func (c *RegionUrlMapsPatchCall) Context(ctx context.Context) *RegionUrlMapsPatchCall {
  108198. c.ctx_ = ctx
  108199. return c
  108200. }
  108201. // Header returns an http.Header that can be modified by the caller to
  108202. // add HTTP headers to the request.
  108203. func (c *RegionUrlMapsPatchCall) Header() http.Header {
  108204. if c.header_ == nil {
  108205. c.header_ = make(http.Header)
  108206. }
  108207. return c.header_
  108208. }
  108209. func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  108210. reqHeaders := make(http.Header)
  108211. for k, v := range c.header_ {
  108212. reqHeaders[k] = v
  108213. }
  108214. reqHeaders.Set("User-Agent", c.s.userAgent())
  108215. var body io.Reader = nil
  108216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  108217. if err != nil {
  108218. return nil, err
  108219. }
  108220. reqHeaders.Set("Content-Type", "application/json")
  108221. c.urlParams_.Set("alt", alt)
  108222. c.urlParams_.Set("prettyPrint", "false")
  108223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  108224. urls += "?" + c.urlParams_.Encode()
  108225. req, err := http.NewRequest("PATCH", urls, body)
  108226. if err != nil {
  108227. return nil, err
  108228. }
  108229. req.Header = reqHeaders
  108230. googleapi.Expand(req.URL, map[string]string{
  108231. "project": c.project,
  108232. "region": c.region,
  108233. "urlMap": c.urlMap,
  108234. })
  108235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108236. }
  108237. // Do executes the "compute.regionUrlMaps.patch" call.
  108238. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108239. // status code is an error. Response headers are in either
  108240. // *Operation.ServerResponse.Header or (if a response was returned at
  108241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108242. // to check whether the returned error was because
  108243. // http.StatusNotModified was returned.
  108244. func (c *RegionUrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108245. gensupport.SetOptions(c.urlParams_, opts...)
  108246. res, err := c.doRequest("json")
  108247. if res != nil && res.StatusCode == http.StatusNotModified {
  108248. if res.Body != nil {
  108249. res.Body.Close()
  108250. }
  108251. return nil, &googleapi.Error{
  108252. Code: res.StatusCode,
  108253. Header: res.Header,
  108254. }
  108255. }
  108256. if err != nil {
  108257. return nil, err
  108258. }
  108259. defer googleapi.CloseBody(res)
  108260. if err := googleapi.CheckResponse(res); err != nil {
  108261. return nil, err
  108262. }
  108263. ret := &Operation{
  108264. ServerResponse: googleapi.ServerResponse{
  108265. Header: res.Header,
  108266. HTTPStatusCode: res.StatusCode,
  108267. },
  108268. }
  108269. target := &ret
  108270. if err := gensupport.DecodeResponse(target, res); err != nil {
  108271. return nil, err
  108272. }
  108273. return ret, nil
  108274. // {
  108275. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  108276. // "httpMethod": "PATCH",
  108277. // "id": "compute.regionUrlMaps.patch",
  108278. // "parameterOrder": [
  108279. // "project",
  108280. // "region",
  108281. // "urlMap"
  108282. // ],
  108283. // "parameters": {
  108284. // "project": {
  108285. // "description": "Project ID for this request.",
  108286. // "location": "path",
  108287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108288. // "required": true,
  108289. // "type": "string"
  108290. // },
  108291. // "region": {
  108292. // "description": "Name of the region scoping this request.",
  108293. // "location": "path",
  108294. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108295. // "required": true,
  108296. // "type": "string"
  108297. // },
  108298. // "requestId": {
  108299. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  108300. // "location": "query",
  108301. // "type": "string"
  108302. // },
  108303. // "urlMap": {
  108304. // "description": "Name of the UrlMap resource to patch.",
  108305. // "location": "path",
  108306. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108307. // "required": true,
  108308. // "type": "string"
  108309. // }
  108310. // },
  108311. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  108312. // "request": {
  108313. // "$ref": "UrlMap"
  108314. // },
  108315. // "response": {
  108316. // "$ref": "Operation"
  108317. // },
  108318. // "scopes": [
  108319. // "https://www.googleapis.com/auth/cloud-platform",
  108320. // "https://www.googleapis.com/auth/compute"
  108321. // ]
  108322. // }
  108323. }
  108324. // method id "compute.regionUrlMaps.testIamPermissions":
  108325. type RegionUrlMapsTestIamPermissionsCall struct {
  108326. s *Service
  108327. project string
  108328. region string
  108329. resource string
  108330. testpermissionsrequest *TestPermissionsRequest
  108331. urlParams_ gensupport.URLParams
  108332. ctx_ context.Context
  108333. header_ http.Header
  108334. }
  108335. // TestIamPermissions: Returns permissions that a caller has on the
  108336. // specified resource.
  108337. func (r *RegionUrlMapsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionUrlMapsTestIamPermissionsCall {
  108338. c := &RegionUrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108339. c.project = project
  108340. c.region = region
  108341. c.resource = resource
  108342. c.testpermissionsrequest = testpermissionsrequest
  108343. return c
  108344. }
  108345. // Fields allows partial responses to be retrieved. See
  108346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108347. // for more information.
  108348. func (c *RegionUrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionUrlMapsTestIamPermissionsCall {
  108349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108350. return c
  108351. }
  108352. // Context sets the context to be used in this call's Do method. Any
  108353. // pending HTTP request will be aborted if the provided context is
  108354. // canceled.
  108355. func (c *RegionUrlMapsTestIamPermissionsCall) Context(ctx context.Context) *RegionUrlMapsTestIamPermissionsCall {
  108356. c.ctx_ = ctx
  108357. return c
  108358. }
  108359. // Header returns an http.Header that can be modified by the caller to
  108360. // add HTTP headers to the request.
  108361. func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header {
  108362. if c.header_ == nil {
  108363. c.header_ = make(http.Header)
  108364. }
  108365. return c.header_
  108366. }
  108367. func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  108368. reqHeaders := make(http.Header)
  108369. for k, v := range c.header_ {
  108370. reqHeaders[k] = v
  108371. }
  108372. reqHeaders.Set("User-Agent", c.s.userAgent())
  108373. var body io.Reader = nil
  108374. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  108375. if err != nil {
  108376. return nil, err
  108377. }
  108378. reqHeaders.Set("Content-Type", "application/json")
  108379. c.urlParams_.Set("alt", alt)
  108380. c.urlParams_.Set("prettyPrint", "false")
  108381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions")
  108382. urls += "?" + c.urlParams_.Encode()
  108383. req, err := http.NewRequest("POST", urls, body)
  108384. if err != nil {
  108385. return nil, err
  108386. }
  108387. req.Header = reqHeaders
  108388. googleapi.Expand(req.URL, map[string]string{
  108389. "project": c.project,
  108390. "region": c.region,
  108391. "resource": c.resource,
  108392. })
  108393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108394. }
  108395. // Do executes the "compute.regionUrlMaps.testIamPermissions" call.
  108396. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  108397. // non-2xx status code is an error. Response headers are in either
  108398. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  108399. // returned at all) in error.(*googleapi.Error).Header. Use
  108400. // googleapi.IsNotModified to check whether the returned error was
  108401. // because http.StatusNotModified was returned.
  108402. func (c *RegionUrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  108403. gensupport.SetOptions(c.urlParams_, opts...)
  108404. res, err := c.doRequest("json")
  108405. if res != nil && res.StatusCode == http.StatusNotModified {
  108406. if res.Body != nil {
  108407. res.Body.Close()
  108408. }
  108409. return nil, &googleapi.Error{
  108410. Code: res.StatusCode,
  108411. Header: res.Header,
  108412. }
  108413. }
  108414. if err != nil {
  108415. return nil, err
  108416. }
  108417. defer googleapi.CloseBody(res)
  108418. if err := googleapi.CheckResponse(res); err != nil {
  108419. return nil, err
  108420. }
  108421. ret := &TestPermissionsResponse{
  108422. ServerResponse: googleapi.ServerResponse{
  108423. Header: res.Header,
  108424. HTTPStatusCode: res.StatusCode,
  108425. },
  108426. }
  108427. target := &ret
  108428. if err := gensupport.DecodeResponse(target, res); err != nil {
  108429. return nil, err
  108430. }
  108431. return ret, nil
  108432. // {
  108433. // "description": "Returns permissions that a caller has on the specified resource.",
  108434. // "httpMethod": "POST",
  108435. // "id": "compute.regionUrlMaps.testIamPermissions",
  108436. // "parameterOrder": [
  108437. // "project",
  108438. // "region",
  108439. // "resource"
  108440. // ],
  108441. // "parameters": {
  108442. // "project": {
  108443. // "description": "Project ID for this request.",
  108444. // "location": "path",
  108445. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108446. // "required": true,
  108447. // "type": "string"
  108448. // },
  108449. // "region": {
  108450. // "description": "The name of the region for this request.",
  108451. // "location": "path",
  108452. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108453. // "required": true,
  108454. // "type": "string"
  108455. // },
  108456. // "resource": {
  108457. // "description": "Name or id of the resource for this request.",
  108458. // "location": "path",
  108459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  108460. // "required": true,
  108461. // "type": "string"
  108462. // }
  108463. // },
  108464. // "path": "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions",
  108465. // "request": {
  108466. // "$ref": "TestPermissionsRequest"
  108467. // },
  108468. // "response": {
  108469. // "$ref": "TestPermissionsResponse"
  108470. // },
  108471. // "scopes": [
  108472. // "https://www.googleapis.com/auth/cloud-platform",
  108473. // "https://www.googleapis.com/auth/compute",
  108474. // "https://www.googleapis.com/auth/compute.readonly"
  108475. // ]
  108476. // }
  108477. }
  108478. // method id "compute.regionUrlMaps.update":
  108479. type RegionUrlMapsUpdateCall struct {
  108480. s *Service
  108481. project string
  108482. region string
  108483. urlMap string
  108484. urlmap *UrlMap
  108485. urlParams_ gensupport.URLParams
  108486. ctx_ context.Context
  108487. header_ http.Header
  108488. }
  108489. // Update: Updates the specified UrlMap resource with the data included
  108490. // in the request.
  108491. func (r *RegionUrlMapsService) Update(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsUpdateCall {
  108492. c := &RegionUrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108493. c.project = project
  108494. c.region = region
  108495. c.urlMap = urlMap
  108496. c.urlmap = urlmap
  108497. return c
  108498. }
  108499. // RequestId sets the optional parameter "requestId": begin_interface:
  108500. // MixerMutationRequestBuilder Request ID to support idempotency.
  108501. func (c *RegionUrlMapsUpdateCall) RequestId(requestId string) *RegionUrlMapsUpdateCall {
  108502. c.urlParams_.Set("requestId", requestId)
  108503. return c
  108504. }
  108505. // Fields allows partial responses to be retrieved. See
  108506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108507. // for more information.
  108508. func (c *RegionUrlMapsUpdateCall) Fields(s ...googleapi.Field) *RegionUrlMapsUpdateCall {
  108509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108510. return c
  108511. }
  108512. // Context sets the context to be used in this call's Do method. Any
  108513. // pending HTTP request will be aborted if the provided context is
  108514. // canceled.
  108515. func (c *RegionUrlMapsUpdateCall) Context(ctx context.Context) *RegionUrlMapsUpdateCall {
  108516. c.ctx_ = ctx
  108517. return c
  108518. }
  108519. // Header returns an http.Header that can be modified by the caller to
  108520. // add HTTP headers to the request.
  108521. func (c *RegionUrlMapsUpdateCall) Header() http.Header {
  108522. if c.header_ == nil {
  108523. c.header_ = make(http.Header)
  108524. }
  108525. return c.header_
  108526. }
  108527. func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  108528. reqHeaders := make(http.Header)
  108529. for k, v := range c.header_ {
  108530. reqHeaders[k] = v
  108531. }
  108532. reqHeaders.Set("User-Agent", c.s.userAgent())
  108533. var body io.Reader = nil
  108534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  108535. if err != nil {
  108536. return nil, err
  108537. }
  108538. reqHeaders.Set("Content-Type", "application/json")
  108539. c.urlParams_.Set("alt", alt)
  108540. c.urlParams_.Set("prettyPrint", "false")
  108541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  108542. urls += "?" + c.urlParams_.Encode()
  108543. req, err := http.NewRequest("PUT", urls, body)
  108544. if err != nil {
  108545. return nil, err
  108546. }
  108547. req.Header = reqHeaders
  108548. googleapi.Expand(req.URL, map[string]string{
  108549. "project": c.project,
  108550. "region": c.region,
  108551. "urlMap": c.urlMap,
  108552. })
  108553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108554. }
  108555. // Do executes the "compute.regionUrlMaps.update" call.
  108556. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108557. // status code is an error. Response headers are in either
  108558. // *Operation.ServerResponse.Header or (if a response was returned at
  108559. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108560. // to check whether the returned error was because
  108561. // http.StatusNotModified was returned.
  108562. func (c *RegionUrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108563. gensupport.SetOptions(c.urlParams_, opts...)
  108564. res, err := c.doRequest("json")
  108565. if res != nil && res.StatusCode == http.StatusNotModified {
  108566. if res.Body != nil {
  108567. res.Body.Close()
  108568. }
  108569. return nil, &googleapi.Error{
  108570. Code: res.StatusCode,
  108571. Header: res.Header,
  108572. }
  108573. }
  108574. if err != nil {
  108575. return nil, err
  108576. }
  108577. defer googleapi.CloseBody(res)
  108578. if err := googleapi.CheckResponse(res); err != nil {
  108579. return nil, err
  108580. }
  108581. ret := &Operation{
  108582. ServerResponse: googleapi.ServerResponse{
  108583. Header: res.Header,
  108584. HTTPStatusCode: res.StatusCode,
  108585. },
  108586. }
  108587. target := &ret
  108588. if err := gensupport.DecodeResponse(target, res); err != nil {
  108589. return nil, err
  108590. }
  108591. return ret, nil
  108592. // {
  108593. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  108594. // "httpMethod": "PUT",
  108595. // "id": "compute.regionUrlMaps.update",
  108596. // "parameterOrder": [
  108597. // "project",
  108598. // "region",
  108599. // "urlMap"
  108600. // ],
  108601. // "parameters": {
  108602. // "project": {
  108603. // "description": "Project ID for this request.",
  108604. // "location": "path",
  108605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108606. // "required": true,
  108607. // "type": "string"
  108608. // },
  108609. // "region": {
  108610. // "description": "Name of the region scoping this request.",
  108611. // "location": "path",
  108612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108613. // "required": true,
  108614. // "type": "string"
  108615. // },
  108616. // "requestId": {
  108617. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  108618. // "location": "query",
  108619. // "type": "string"
  108620. // },
  108621. // "urlMap": {
  108622. // "description": "Name of the UrlMap resource to update.",
  108623. // "location": "path",
  108624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108625. // "required": true,
  108626. // "type": "string"
  108627. // }
  108628. // },
  108629. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  108630. // "request": {
  108631. // "$ref": "UrlMap"
  108632. // },
  108633. // "response": {
  108634. // "$ref": "Operation"
  108635. // },
  108636. // "scopes": [
  108637. // "https://www.googleapis.com/auth/cloud-platform",
  108638. // "https://www.googleapis.com/auth/compute"
  108639. // ]
  108640. // }
  108641. }
  108642. // method id "compute.regionUrlMaps.validate":
  108643. type RegionUrlMapsValidateCall struct {
  108644. s *Service
  108645. project string
  108646. region string
  108647. urlMap string
  108648. regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest
  108649. urlParams_ gensupport.URLParams
  108650. ctx_ context.Context
  108651. header_ http.Header
  108652. }
  108653. // Validate: Runs static validation for the UrlMap. In particular, the
  108654. // tests of the provided UrlMap will be run. Calling this method does
  108655. // NOT create the UrlMap.
  108656. func (r *RegionUrlMapsService) Validate(project string, region string, urlMap string, regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest) *RegionUrlMapsValidateCall {
  108657. c := &RegionUrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108658. c.project = project
  108659. c.region = region
  108660. c.urlMap = urlMap
  108661. c.regionurlmapsvalidaterequest = regionurlmapsvalidaterequest
  108662. return c
  108663. }
  108664. // Fields allows partial responses to be retrieved. See
  108665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108666. // for more information.
  108667. func (c *RegionUrlMapsValidateCall) Fields(s ...googleapi.Field) *RegionUrlMapsValidateCall {
  108668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108669. return c
  108670. }
  108671. // Context sets the context to be used in this call's Do method. Any
  108672. // pending HTTP request will be aborted if the provided context is
  108673. // canceled.
  108674. func (c *RegionUrlMapsValidateCall) Context(ctx context.Context) *RegionUrlMapsValidateCall {
  108675. c.ctx_ = ctx
  108676. return c
  108677. }
  108678. // Header returns an http.Header that can be modified by the caller to
  108679. // add HTTP headers to the request.
  108680. func (c *RegionUrlMapsValidateCall) Header() http.Header {
  108681. if c.header_ == nil {
  108682. c.header_ = make(http.Header)
  108683. }
  108684. return c.header_
  108685. }
  108686. func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  108687. reqHeaders := make(http.Header)
  108688. for k, v := range c.header_ {
  108689. reqHeaders[k] = v
  108690. }
  108691. reqHeaders.Set("User-Agent", c.s.userAgent())
  108692. var body io.Reader = nil
  108693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest)
  108694. if err != nil {
  108695. return nil, err
  108696. }
  108697. reqHeaders.Set("Content-Type", "application/json")
  108698. c.urlParams_.Set("alt", alt)
  108699. c.urlParams_.Set("prettyPrint", "false")
  108700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/validate")
  108701. urls += "?" + c.urlParams_.Encode()
  108702. req, err := http.NewRequest("POST", urls, body)
  108703. if err != nil {
  108704. return nil, err
  108705. }
  108706. req.Header = reqHeaders
  108707. googleapi.Expand(req.URL, map[string]string{
  108708. "project": c.project,
  108709. "region": c.region,
  108710. "urlMap": c.urlMap,
  108711. })
  108712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108713. }
  108714. // Do executes the "compute.regionUrlMaps.validate" call.
  108715. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  108716. // non-2xx status code is an error. Response headers are in either
  108717. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  108718. // returned at all) in error.(*googleapi.Error).Header. Use
  108719. // googleapi.IsNotModified to check whether the returned error was
  108720. // because http.StatusNotModified was returned.
  108721. func (c *RegionUrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  108722. gensupport.SetOptions(c.urlParams_, opts...)
  108723. res, err := c.doRequest("json")
  108724. if res != nil && res.StatusCode == http.StatusNotModified {
  108725. if res.Body != nil {
  108726. res.Body.Close()
  108727. }
  108728. return nil, &googleapi.Error{
  108729. Code: res.StatusCode,
  108730. Header: res.Header,
  108731. }
  108732. }
  108733. if err != nil {
  108734. return nil, err
  108735. }
  108736. defer googleapi.CloseBody(res)
  108737. if err := googleapi.CheckResponse(res); err != nil {
  108738. return nil, err
  108739. }
  108740. ret := &UrlMapsValidateResponse{
  108741. ServerResponse: googleapi.ServerResponse{
  108742. Header: res.Header,
  108743. HTTPStatusCode: res.StatusCode,
  108744. },
  108745. }
  108746. target := &ret
  108747. if err := gensupport.DecodeResponse(target, res); err != nil {
  108748. return nil, err
  108749. }
  108750. return ret, nil
  108751. // {
  108752. // "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.",
  108753. // "httpMethod": "POST",
  108754. // "id": "compute.regionUrlMaps.validate",
  108755. // "parameterOrder": [
  108756. // "project",
  108757. // "region",
  108758. // "urlMap"
  108759. // ],
  108760. // "parameters": {
  108761. // "project": {
  108762. // "description": "Project ID for this request.",
  108763. // "location": "path",
  108764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108765. // "required": true,
  108766. // "type": "string"
  108767. // },
  108768. // "region": {
  108769. // "description": "Name of the region scoping this request.",
  108770. // "location": "path",
  108771. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108772. // "required": true,
  108773. // "type": "string"
  108774. // },
  108775. // "urlMap": {
  108776. // "description": "Name of the UrlMap resource to be validated as.",
  108777. // "location": "path",
  108778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108779. // "required": true,
  108780. // "type": "string"
  108781. // }
  108782. // },
  108783. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/validate",
  108784. // "request": {
  108785. // "$ref": "RegionUrlMapsValidateRequest"
  108786. // },
  108787. // "response": {
  108788. // "$ref": "UrlMapsValidateResponse"
  108789. // },
  108790. // "scopes": [
  108791. // "https://www.googleapis.com/auth/cloud-platform",
  108792. // "https://www.googleapis.com/auth/compute"
  108793. // ]
  108794. // }
  108795. }
  108796. // method id "compute.regions.get":
  108797. type RegionsGetCall struct {
  108798. s *Service
  108799. project string
  108800. region string
  108801. urlParams_ gensupport.URLParams
  108802. ifNoneMatch_ string
  108803. ctx_ context.Context
  108804. header_ http.Header
  108805. }
  108806. // Get: Returns the specified Region resource. Gets a list of available
  108807. // regions by making a list() request.
  108808. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  108809. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  108810. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108811. c.project = project
  108812. c.region = region
  108813. return c
  108814. }
  108815. // Fields allows partial responses to be retrieved. See
  108816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108817. // for more information.
  108818. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  108819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108820. return c
  108821. }
  108822. // IfNoneMatch sets the optional parameter which makes the operation
  108823. // fail if the object's ETag matches the given value. This is useful for
  108824. // getting updates only after the object has changed since the last
  108825. // request. Use googleapi.IsNotModified to check whether the response
  108826. // error from Do is the result of In-None-Match.
  108827. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  108828. c.ifNoneMatch_ = entityTag
  108829. return c
  108830. }
  108831. // Context sets the context to be used in this call's Do method. Any
  108832. // pending HTTP request will be aborted if the provided context is
  108833. // canceled.
  108834. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  108835. c.ctx_ = ctx
  108836. return c
  108837. }
  108838. // Header returns an http.Header that can be modified by the caller to
  108839. // add HTTP headers to the request.
  108840. func (c *RegionsGetCall) Header() http.Header {
  108841. if c.header_ == nil {
  108842. c.header_ = make(http.Header)
  108843. }
  108844. return c.header_
  108845. }
  108846. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  108847. reqHeaders := make(http.Header)
  108848. for k, v := range c.header_ {
  108849. reqHeaders[k] = v
  108850. }
  108851. reqHeaders.Set("User-Agent", c.s.userAgent())
  108852. if c.ifNoneMatch_ != "" {
  108853. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108854. }
  108855. var body io.Reader = nil
  108856. c.urlParams_.Set("alt", alt)
  108857. c.urlParams_.Set("prettyPrint", "false")
  108858. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  108859. urls += "?" + c.urlParams_.Encode()
  108860. req, err := http.NewRequest("GET", urls, body)
  108861. if err != nil {
  108862. return nil, err
  108863. }
  108864. req.Header = reqHeaders
  108865. googleapi.Expand(req.URL, map[string]string{
  108866. "project": c.project,
  108867. "region": c.region,
  108868. })
  108869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108870. }
  108871. // Do executes the "compute.regions.get" call.
  108872. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  108873. // code is an error. Response headers are in either
  108874. // *Region.ServerResponse.Header or (if a response was returned at all)
  108875. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  108876. // check whether the returned error was because http.StatusNotModified
  108877. // was returned.
  108878. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  108879. gensupport.SetOptions(c.urlParams_, opts...)
  108880. res, err := c.doRequest("json")
  108881. if res != nil && res.StatusCode == http.StatusNotModified {
  108882. if res.Body != nil {
  108883. res.Body.Close()
  108884. }
  108885. return nil, &googleapi.Error{
  108886. Code: res.StatusCode,
  108887. Header: res.Header,
  108888. }
  108889. }
  108890. if err != nil {
  108891. return nil, err
  108892. }
  108893. defer googleapi.CloseBody(res)
  108894. if err := googleapi.CheckResponse(res); err != nil {
  108895. return nil, err
  108896. }
  108897. ret := &Region{
  108898. ServerResponse: googleapi.ServerResponse{
  108899. Header: res.Header,
  108900. HTTPStatusCode: res.StatusCode,
  108901. },
  108902. }
  108903. target := &ret
  108904. if err := gensupport.DecodeResponse(target, res); err != nil {
  108905. return nil, err
  108906. }
  108907. return ret, nil
  108908. // {
  108909. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  108910. // "httpMethod": "GET",
  108911. // "id": "compute.regions.get",
  108912. // "parameterOrder": [
  108913. // "project",
  108914. // "region"
  108915. // ],
  108916. // "parameters": {
  108917. // "project": {
  108918. // "description": "Project ID for this request.",
  108919. // "location": "path",
  108920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108921. // "required": true,
  108922. // "type": "string"
  108923. // },
  108924. // "region": {
  108925. // "description": "Name of the region resource to return.",
  108926. // "location": "path",
  108927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108928. // "required": true,
  108929. // "type": "string"
  108930. // }
  108931. // },
  108932. // "path": "{project}/regions/{region}",
  108933. // "response": {
  108934. // "$ref": "Region"
  108935. // },
  108936. // "scopes": [
  108937. // "https://www.googleapis.com/auth/cloud-platform",
  108938. // "https://www.googleapis.com/auth/compute",
  108939. // "https://www.googleapis.com/auth/compute.readonly"
  108940. // ]
  108941. // }
  108942. }
  108943. // method id "compute.regions.list":
  108944. type RegionsListCall struct {
  108945. s *Service
  108946. project string
  108947. urlParams_ gensupport.URLParams
  108948. ifNoneMatch_ string
  108949. ctx_ context.Context
  108950. header_ http.Header
  108951. }
  108952. // List: Retrieves the list of region resources available to the
  108953. // specified project.
  108954. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  108955. func (r *RegionsService) List(project string) *RegionsListCall {
  108956. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108957. c.project = project
  108958. return c
  108959. }
  108960. // Filter sets the optional parameter "filter": A filter expression that
  108961. // filters resources listed in the response. The expression must specify
  108962. // the field name, a comparison operator, and the value that you want to
  108963. // use for filtering. The value must be a string, a number, or a
  108964. // boolean. The comparison operator must be either =, !=, >, or <.
  108965. //
  108966. // For example, if you are filtering Compute Engine instances, you can
  108967. // exclude instances named example-instance by specifying name !=
  108968. // example-instance.
  108969. //
  108970. // You can also filter nested fields. For example, you could specify
  108971. // scheduling.automaticRestart = false to include instances only if they
  108972. // are not scheduled for automatic restarts. You can use filtering on
  108973. // nested fields to filter based on resource labels.
  108974. //
  108975. // To filter on multiple expressions, provide each separate expression
  108976. // within parentheses. For example, (scheduling.automaticRestart = true)
  108977. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108978. // AND expression. However, you can include AND and OR expressions
  108979. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108980. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108981. // true).
  108982. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  108983. c.urlParams_.Set("filter", filter)
  108984. return c
  108985. }
  108986. // MaxResults sets the optional parameter "maxResults": The maximum
  108987. // number of results per page that should be returned. If the number of
  108988. // available results is larger than maxResults, Compute Engine returns a
  108989. // nextPageToken that can be used to get the next page of results in
  108990. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108991. // (Default: 500)
  108992. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  108993. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108994. return c
  108995. }
  108996. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108997. // a certain order. By default, results are returned in alphanumerical
  108998. // order based on the resource name.
  108999. //
  109000. // You can also sort results in descending order based on the creation
  109001. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109002. // based on the creationTimestamp field in reverse chronological order
  109003. // (newest result first). Use this to sort resources like operations so
  109004. // that the newest operation is returned first.
  109005. //
  109006. // Currently, only sorting by name or creationTimestamp desc is
  109007. // supported.
  109008. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  109009. c.urlParams_.Set("orderBy", orderBy)
  109010. return c
  109011. }
  109012. // PageToken sets the optional parameter "pageToken": Specifies a page
  109013. // token to use. Set pageToken to the nextPageToken returned by a
  109014. // previous list request to get the next page of results.
  109015. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  109016. c.urlParams_.Set("pageToken", pageToken)
  109017. return c
  109018. }
  109019. // Fields allows partial responses to be retrieved. See
  109020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109021. // for more information.
  109022. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  109023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109024. return c
  109025. }
  109026. // IfNoneMatch sets the optional parameter which makes the operation
  109027. // fail if the object's ETag matches the given value. This is useful for
  109028. // getting updates only after the object has changed since the last
  109029. // request. Use googleapi.IsNotModified to check whether the response
  109030. // error from Do is the result of In-None-Match.
  109031. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  109032. c.ifNoneMatch_ = entityTag
  109033. return c
  109034. }
  109035. // Context sets the context to be used in this call's Do method. Any
  109036. // pending HTTP request will be aborted if the provided context is
  109037. // canceled.
  109038. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  109039. c.ctx_ = ctx
  109040. return c
  109041. }
  109042. // Header returns an http.Header that can be modified by the caller to
  109043. // add HTTP headers to the request.
  109044. func (c *RegionsListCall) Header() http.Header {
  109045. if c.header_ == nil {
  109046. c.header_ = make(http.Header)
  109047. }
  109048. return c.header_
  109049. }
  109050. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  109051. reqHeaders := make(http.Header)
  109052. for k, v := range c.header_ {
  109053. reqHeaders[k] = v
  109054. }
  109055. reqHeaders.Set("User-Agent", c.s.userAgent())
  109056. if c.ifNoneMatch_ != "" {
  109057. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109058. }
  109059. var body io.Reader = nil
  109060. c.urlParams_.Set("alt", alt)
  109061. c.urlParams_.Set("prettyPrint", "false")
  109062. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  109063. urls += "?" + c.urlParams_.Encode()
  109064. req, err := http.NewRequest("GET", urls, body)
  109065. if err != nil {
  109066. return nil, err
  109067. }
  109068. req.Header = reqHeaders
  109069. googleapi.Expand(req.URL, map[string]string{
  109070. "project": c.project,
  109071. })
  109072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109073. }
  109074. // Do executes the "compute.regions.list" call.
  109075. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  109076. // status code is an error. Response headers are in either
  109077. // *RegionList.ServerResponse.Header or (if a response was returned at
  109078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109079. // to check whether the returned error was because
  109080. // http.StatusNotModified was returned.
  109081. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  109082. gensupport.SetOptions(c.urlParams_, opts...)
  109083. res, err := c.doRequest("json")
  109084. if res != nil && res.StatusCode == http.StatusNotModified {
  109085. if res.Body != nil {
  109086. res.Body.Close()
  109087. }
  109088. return nil, &googleapi.Error{
  109089. Code: res.StatusCode,
  109090. Header: res.Header,
  109091. }
  109092. }
  109093. if err != nil {
  109094. return nil, err
  109095. }
  109096. defer googleapi.CloseBody(res)
  109097. if err := googleapi.CheckResponse(res); err != nil {
  109098. return nil, err
  109099. }
  109100. ret := &RegionList{
  109101. ServerResponse: googleapi.ServerResponse{
  109102. Header: res.Header,
  109103. HTTPStatusCode: res.StatusCode,
  109104. },
  109105. }
  109106. target := &ret
  109107. if err := gensupport.DecodeResponse(target, res); err != nil {
  109108. return nil, err
  109109. }
  109110. return ret, nil
  109111. // {
  109112. // "description": "Retrieves the list of region resources available to the specified project.",
  109113. // "httpMethod": "GET",
  109114. // "id": "compute.regions.list",
  109115. // "parameterOrder": [
  109116. // "project"
  109117. // ],
  109118. // "parameters": {
  109119. // "filter": {
  109120. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  109121. // "location": "query",
  109122. // "type": "string"
  109123. // },
  109124. // "maxResults": {
  109125. // "default": "500",
  109126. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  109127. // "format": "uint32",
  109128. // "location": "query",
  109129. // "minimum": "0",
  109130. // "type": "integer"
  109131. // },
  109132. // "orderBy": {
  109133. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  109134. // "location": "query",
  109135. // "type": "string"
  109136. // },
  109137. // "pageToken": {
  109138. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  109139. // "location": "query",
  109140. // "type": "string"
  109141. // },
  109142. // "project": {
  109143. // "description": "Project ID for this request.",
  109144. // "location": "path",
  109145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109146. // "required": true,
  109147. // "type": "string"
  109148. // }
  109149. // },
  109150. // "path": "{project}/regions",
  109151. // "response": {
  109152. // "$ref": "RegionList"
  109153. // },
  109154. // "scopes": [
  109155. // "https://www.googleapis.com/auth/cloud-platform",
  109156. // "https://www.googleapis.com/auth/compute",
  109157. // "https://www.googleapis.com/auth/compute.readonly"
  109158. // ]
  109159. // }
  109160. }
  109161. // Pages invokes f for each page of results.
  109162. // A non-nil error returned from f will halt the iteration.
  109163. // The provided context supersedes any context provided to the Context method.
  109164. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  109165. c.ctx_ = ctx
  109166. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109167. for {
  109168. x, err := c.Do()
  109169. if err != nil {
  109170. return err
  109171. }
  109172. if err := f(x); err != nil {
  109173. return err
  109174. }
  109175. if x.NextPageToken == "" {
  109176. return nil
  109177. }
  109178. c.PageToken(x.NextPageToken)
  109179. }
  109180. }
  109181. // method id "compute.resourcePolicies.aggregatedList":
  109182. type ResourcePoliciesAggregatedListCall struct {
  109183. s *Service
  109184. project string
  109185. urlParams_ gensupport.URLParams
  109186. ifNoneMatch_ string
  109187. ctx_ context.Context
  109188. header_ http.Header
  109189. }
  109190. // AggregatedList: Retrieves an aggregated list of resource policies.
  109191. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  109192. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109193. c.project = project
  109194. return c
  109195. }
  109196. // Filter sets the optional parameter "filter": A filter expression that
  109197. // filters resources listed in the response. The expression must specify
  109198. // the field name, a comparison operator, and the value that you want to
  109199. // use for filtering. The value must be a string, a number, or a
  109200. // boolean. The comparison operator must be either =, !=, >, or <.
  109201. //
  109202. // For example, if you are filtering Compute Engine instances, you can
  109203. // exclude instances named example-instance by specifying name !=
  109204. // example-instance.
  109205. //
  109206. // You can also filter nested fields. For example, you could specify
  109207. // scheduling.automaticRestart = false to include instances only if they
  109208. // are not scheduled for automatic restarts. You can use filtering on
  109209. // nested fields to filter based on resource labels.
  109210. //
  109211. // To filter on multiple expressions, provide each separate expression
  109212. // within parentheses. For example, (scheduling.automaticRestart = true)
  109213. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109214. // AND expression. However, you can include AND and OR expressions
  109215. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109216. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109217. // true).
  109218. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  109219. c.urlParams_.Set("filter", filter)
  109220. return c
  109221. }
  109222. // MaxResults sets the optional parameter "maxResults": The maximum
  109223. // number of results per page that should be returned. If the number of
  109224. // available results is larger than maxResults, Compute Engine returns a
  109225. // nextPageToken that can be used to get the next page of results in
  109226. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109227. // (Default: 500)
  109228. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  109229. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109230. return c
  109231. }
  109232. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109233. // a certain order. By default, results are returned in alphanumerical
  109234. // order based on the resource name.
  109235. //
  109236. // You can also sort results in descending order based on the creation
  109237. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109238. // based on the creationTimestamp field in reverse chronological order
  109239. // (newest result first). Use this to sort resources like operations so
  109240. // that the newest operation is returned first.
  109241. //
  109242. // Currently, only sorting by name or creationTimestamp desc is
  109243. // supported.
  109244. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  109245. c.urlParams_.Set("orderBy", orderBy)
  109246. return c
  109247. }
  109248. // PageToken sets the optional parameter "pageToken": Specifies a page
  109249. // token to use. Set pageToken to the nextPageToken returned by a
  109250. // previous list request to get the next page of results.
  109251. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  109252. c.urlParams_.Set("pageToken", pageToken)
  109253. return c
  109254. }
  109255. // Fields allows partial responses to be retrieved. See
  109256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109257. // for more information.
  109258. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  109259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109260. return c
  109261. }
  109262. // IfNoneMatch sets the optional parameter which makes the operation
  109263. // fail if the object's ETag matches the given value. This is useful for
  109264. // getting updates only after the object has changed since the last
  109265. // request. Use googleapi.IsNotModified to check whether the response
  109266. // error from Do is the result of In-None-Match.
  109267. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  109268. c.ifNoneMatch_ = entityTag
  109269. return c
  109270. }
  109271. // Context sets the context to be used in this call's Do method. Any
  109272. // pending HTTP request will be aborted if the provided context is
  109273. // canceled.
  109274. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  109275. c.ctx_ = ctx
  109276. return c
  109277. }
  109278. // Header returns an http.Header that can be modified by the caller to
  109279. // add HTTP headers to the request.
  109280. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  109281. if c.header_ == nil {
  109282. c.header_ = make(http.Header)
  109283. }
  109284. return c.header_
  109285. }
  109286. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  109287. reqHeaders := make(http.Header)
  109288. for k, v := range c.header_ {
  109289. reqHeaders[k] = v
  109290. }
  109291. reqHeaders.Set("User-Agent", c.s.userAgent())
  109292. if c.ifNoneMatch_ != "" {
  109293. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109294. }
  109295. var body io.Reader = nil
  109296. c.urlParams_.Set("alt", alt)
  109297. c.urlParams_.Set("prettyPrint", "false")
  109298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  109299. urls += "?" + c.urlParams_.Encode()
  109300. req, err := http.NewRequest("GET", urls, body)
  109301. if err != nil {
  109302. return nil, err
  109303. }
  109304. req.Header = reqHeaders
  109305. googleapi.Expand(req.URL, map[string]string{
  109306. "project": c.project,
  109307. })
  109308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109309. }
  109310. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  109311. // Exactly one of *ResourcePolicyAggregatedList or error will be
  109312. // non-nil. Any non-2xx status code is an error. Response headers are in
  109313. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  109314. // response was returned at all) in error.(*googleapi.Error).Header. Use
  109315. // googleapi.IsNotModified to check whether the returned error was
  109316. // because http.StatusNotModified was returned.
  109317. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  109318. gensupport.SetOptions(c.urlParams_, opts...)
  109319. res, err := c.doRequest("json")
  109320. if res != nil && res.StatusCode == http.StatusNotModified {
  109321. if res.Body != nil {
  109322. res.Body.Close()
  109323. }
  109324. return nil, &googleapi.Error{
  109325. Code: res.StatusCode,
  109326. Header: res.Header,
  109327. }
  109328. }
  109329. if err != nil {
  109330. return nil, err
  109331. }
  109332. defer googleapi.CloseBody(res)
  109333. if err := googleapi.CheckResponse(res); err != nil {
  109334. return nil, err
  109335. }
  109336. ret := &ResourcePolicyAggregatedList{
  109337. ServerResponse: googleapi.ServerResponse{
  109338. Header: res.Header,
  109339. HTTPStatusCode: res.StatusCode,
  109340. },
  109341. }
  109342. target := &ret
  109343. if err := gensupport.DecodeResponse(target, res); err != nil {
  109344. return nil, err
  109345. }
  109346. return ret, nil
  109347. // {
  109348. // "description": "Retrieves an aggregated list of resource policies.",
  109349. // "httpMethod": "GET",
  109350. // "id": "compute.resourcePolicies.aggregatedList",
  109351. // "parameterOrder": [
  109352. // "project"
  109353. // ],
  109354. // "parameters": {
  109355. // "filter": {
  109356. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  109357. // "location": "query",
  109358. // "type": "string"
  109359. // },
  109360. // "maxResults": {
  109361. // "default": "500",
  109362. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  109363. // "format": "uint32",
  109364. // "location": "query",
  109365. // "minimum": "0",
  109366. // "type": "integer"
  109367. // },
  109368. // "orderBy": {
  109369. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  109370. // "location": "query",
  109371. // "type": "string"
  109372. // },
  109373. // "pageToken": {
  109374. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  109375. // "location": "query",
  109376. // "type": "string"
  109377. // },
  109378. // "project": {
  109379. // "description": "Project ID for this request.",
  109380. // "location": "path",
  109381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109382. // "required": true,
  109383. // "type": "string"
  109384. // }
  109385. // },
  109386. // "path": "{project}/aggregated/resourcePolicies",
  109387. // "response": {
  109388. // "$ref": "ResourcePolicyAggregatedList"
  109389. // },
  109390. // "scopes": [
  109391. // "https://www.googleapis.com/auth/cloud-platform",
  109392. // "https://www.googleapis.com/auth/compute",
  109393. // "https://www.googleapis.com/auth/compute.readonly"
  109394. // ]
  109395. // }
  109396. }
  109397. // Pages invokes f for each page of results.
  109398. // A non-nil error returned from f will halt the iteration.
  109399. // The provided context supersedes any context provided to the Context method.
  109400. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  109401. c.ctx_ = ctx
  109402. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109403. for {
  109404. x, err := c.Do()
  109405. if err != nil {
  109406. return err
  109407. }
  109408. if err := f(x); err != nil {
  109409. return err
  109410. }
  109411. if x.NextPageToken == "" {
  109412. return nil
  109413. }
  109414. c.PageToken(x.NextPageToken)
  109415. }
  109416. }
  109417. // method id "compute.resourcePolicies.delete":
  109418. type ResourcePoliciesDeleteCall struct {
  109419. s *Service
  109420. project string
  109421. region string
  109422. resourcePolicy string
  109423. urlParams_ gensupport.URLParams
  109424. ctx_ context.Context
  109425. header_ http.Header
  109426. }
  109427. // Delete: Deletes the specified resource policy.
  109428. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  109429. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109430. c.project = project
  109431. c.region = region
  109432. c.resourcePolicy = resourcePolicy
  109433. return c
  109434. }
  109435. // RequestId sets the optional parameter "requestId": An optional
  109436. // request ID to identify requests. Specify a unique request ID so that
  109437. // if you must retry your request, the server will know to ignore the
  109438. // request if it has already been completed.
  109439. //
  109440. // For example, consider a situation where you make an initial request
  109441. // and the request times out. If you make the request again with the
  109442. // same request ID, the server can check if original operation with the
  109443. // same request ID was received, and if so, will ignore the second
  109444. // request. This prevents clients from accidentally creating duplicate
  109445. // commitments.
  109446. //
  109447. // The request ID must be a valid UUID with the exception that zero UUID
  109448. // is not supported (00000000-0000-0000-0000-000000000000).
  109449. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  109450. c.urlParams_.Set("requestId", requestId)
  109451. return c
  109452. }
  109453. // Fields allows partial responses to be retrieved. See
  109454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109455. // for more information.
  109456. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  109457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109458. return c
  109459. }
  109460. // Context sets the context to be used in this call's Do method. Any
  109461. // pending HTTP request will be aborted if the provided context is
  109462. // canceled.
  109463. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  109464. c.ctx_ = ctx
  109465. return c
  109466. }
  109467. // Header returns an http.Header that can be modified by the caller to
  109468. // add HTTP headers to the request.
  109469. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  109470. if c.header_ == nil {
  109471. c.header_ = make(http.Header)
  109472. }
  109473. return c.header_
  109474. }
  109475. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  109476. reqHeaders := make(http.Header)
  109477. for k, v := range c.header_ {
  109478. reqHeaders[k] = v
  109479. }
  109480. reqHeaders.Set("User-Agent", c.s.userAgent())
  109481. var body io.Reader = nil
  109482. c.urlParams_.Set("alt", alt)
  109483. c.urlParams_.Set("prettyPrint", "false")
  109484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  109485. urls += "?" + c.urlParams_.Encode()
  109486. req, err := http.NewRequest("DELETE", urls, body)
  109487. if err != nil {
  109488. return nil, err
  109489. }
  109490. req.Header = reqHeaders
  109491. googleapi.Expand(req.URL, map[string]string{
  109492. "project": c.project,
  109493. "region": c.region,
  109494. "resourcePolicy": c.resourcePolicy,
  109495. })
  109496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109497. }
  109498. // Do executes the "compute.resourcePolicies.delete" call.
  109499. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109500. // status code is an error. Response headers are in either
  109501. // *Operation.ServerResponse.Header or (if a response was returned at
  109502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109503. // to check whether the returned error was because
  109504. // http.StatusNotModified was returned.
  109505. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109506. gensupport.SetOptions(c.urlParams_, opts...)
  109507. res, err := c.doRequest("json")
  109508. if res != nil && res.StatusCode == http.StatusNotModified {
  109509. if res.Body != nil {
  109510. res.Body.Close()
  109511. }
  109512. return nil, &googleapi.Error{
  109513. Code: res.StatusCode,
  109514. Header: res.Header,
  109515. }
  109516. }
  109517. if err != nil {
  109518. return nil, err
  109519. }
  109520. defer googleapi.CloseBody(res)
  109521. if err := googleapi.CheckResponse(res); err != nil {
  109522. return nil, err
  109523. }
  109524. ret := &Operation{
  109525. ServerResponse: googleapi.ServerResponse{
  109526. Header: res.Header,
  109527. HTTPStatusCode: res.StatusCode,
  109528. },
  109529. }
  109530. target := &ret
  109531. if err := gensupport.DecodeResponse(target, res); err != nil {
  109532. return nil, err
  109533. }
  109534. return ret, nil
  109535. // {
  109536. // "description": "Deletes the specified resource policy.",
  109537. // "httpMethod": "DELETE",
  109538. // "id": "compute.resourcePolicies.delete",
  109539. // "parameterOrder": [
  109540. // "project",
  109541. // "region",
  109542. // "resourcePolicy"
  109543. // ],
  109544. // "parameters": {
  109545. // "project": {
  109546. // "description": "Project ID for this request.",
  109547. // "location": "path",
  109548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109549. // "required": true,
  109550. // "type": "string"
  109551. // },
  109552. // "region": {
  109553. // "description": "Name of the region for this request.",
  109554. // "location": "path",
  109555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109556. // "required": true,
  109557. // "type": "string"
  109558. // },
  109559. // "requestId": {
  109560. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109561. // "location": "query",
  109562. // "type": "string"
  109563. // },
  109564. // "resourcePolicy": {
  109565. // "description": "Name of the resource policy to delete.",
  109566. // "location": "path",
  109567. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109568. // "required": true,
  109569. // "type": "string"
  109570. // }
  109571. // },
  109572. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  109573. // "response": {
  109574. // "$ref": "Operation"
  109575. // },
  109576. // "scopes": [
  109577. // "https://www.googleapis.com/auth/cloud-platform",
  109578. // "https://www.googleapis.com/auth/compute"
  109579. // ]
  109580. // }
  109581. }
  109582. // method id "compute.resourcePolicies.get":
  109583. type ResourcePoliciesGetCall struct {
  109584. s *Service
  109585. project string
  109586. region string
  109587. resourcePolicy string
  109588. urlParams_ gensupport.URLParams
  109589. ifNoneMatch_ string
  109590. ctx_ context.Context
  109591. header_ http.Header
  109592. }
  109593. // Get: Retrieves all information of the specified resource policy.
  109594. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  109595. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109596. c.project = project
  109597. c.region = region
  109598. c.resourcePolicy = resourcePolicy
  109599. return c
  109600. }
  109601. // Fields allows partial responses to be retrieved. See
  109602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109603. // for more information.
  109604. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  109605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109606. return c
  109607. }
  109608. // IfNoneMatch sets the optional parameter which makes the operation
  109609. // fail if the object's ETag matches the given value. This is useful for
  109610. // getting updates only after the object has changed since the last
  109611. // request. Use googleapi.IsNotModified to check whether the response
  109612. // error from Do is the result of In-None-Match.
  109613. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  109614. c.ifNoneMatch_ = entityTag
  109615. return c
  109616. }
  109617. // Context sets the context to be used in this call's Do method. Any
  109618. // pending HTTP request will be aborted if the provided context is
  109619. // canceled.
  109620. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  109621. c.ctx_ = ctx
  109622. return c
  109623. }
  109624. // Header returns an http.Header that can be modified by the caller to
  109625. // add HTTP headers to the request.
  109626. func (c *ResourcePoliciesGetCall) Header() http.Header {
  109627. if c.header_ == nil {
  109628. c.header_ = make(http.Header)
  109629. }
  109630. return c.header_
  109631. }
  109632. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  109633. reqHeaders := make(http.Header)
  109634. for k, v := range c.header_ {
  109635. reqHeaders[k] = v
  109636. }
  109637. reqHeaders.Set("User-Agent", c.s.userAgent())
  109638. if c.ifNoneMatch_ != "" {
  109639. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109640. }
  109641. var body io.Reader = nil
  109642. c.urlParams_.Set("alt", alt)
  109643. c.urlParams_.Set("prettyPrint", "false")
  109644. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  109645. urls += "?" + c.urlParams_.Encode()
  109646. req, err := http.NewRequest("GET", urls, body)
  109647. if err != nil {
  109648. return nil, err
  109649. }
  109650. req.Header = reqHeaders
  109651. googleapi.Expand(req.URL, map[string]string{
  109652. "project": c.project,
  109653. "region": c.region,
  109654. "resourcePolicy": c.resourcePolicy,
  109655. })
  109656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109657. }
  109658. // Do executes the "compute.resourcePolicies.get" call.
  109659. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  109660. // status code is an error. Response headers are in either
  109661. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  109662. // at all) in error.(*googleapi.Error).Header. Use
  109663. // googleapi.IsNotModified to check whether the returned error was
  109664. // because http.StatusNotModified was returned.
  109665. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  109666. gensupport.SetOptions(c.urlParams_, opts...)
  109667. res, err := c.doRequest("json")
  109668. if res != nil && res.StatusCode == http.StatusNotModified {
  109669. if res.Body != nil {
  109670. res.Body.Close()
  109671. }
  109672. return nil, &googleapi.Error{
  109673. Code: res.StatusCode,
  109674. Header: res.Header,
  109675. }
  109676. }
  109677. if err != nil {
  109678. return nil, err
  109679. }
  109680. defer googleapi.CloseBody(res)
  109681. if err := googleapi.CheckResponse(res); err != nil {
  109682. return nil, err
  109683. }
  109684. ret := &ResourcePolicy{
  109685. ServerResponse: googleapi.ServerResponse{
  109686. Header: res.Header,
  109687. HTTPStatusCode: res.StatusCode,
  109688. },
  109689. }
  109690. target := &ret
  109691. if err := gensupport.DecodeResponse(target, res); err != nil {
  109692. return nil, err
  109693. }
  109694. return ret, nil
  109695. // {
  109696. // "description": "Retrieves all information of the specified resource policy.",
  109697. // "httpMethod": "GET",
  109698. // "id": "compute.resourcePolicies.get",
  109699. // "parameterOrder": [
  109700. // "project",
  109701. // "region",
  109702. // "resourcePolicy"
  109703. // ],
  109704. // "parameters": {
  109705. // "project": {
  109706. // "description": "Project ID for this request.",
  109707. // "location": "path",
  109708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109709. // "required": true,
  109710. // "type": "string"
  109711. // },
  109712. // "region": {
  109713. // "description": "Name of the region for this request.",
  109714. // "location": "path",
  109715. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109716. // "required": true,
  109717. // "type": "string"
  109718. // },
  109719. // "resourcePolicy": {
  109720. // "description": "Name of the resource policy to retrieve.",
  109721. // "location": "path",
  109722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109723. // "required": true,
  109724. // "type": "string"
  109725. // }
  109726. // },
  109727. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  109728. // "response": {
  109729. // "$ref": "ResourcePolicy"
  109730. // },
  109731. // "scopes": [
  109732. // "https://www.googleapis.com/auth/cloud-platform",
  109733. // "https://www.googleapis.com/auth/compute",
  109734. // "https://www.googleapis.com/auth/compute.readonly"
  109735. // ]
  109736. // }
  109737. }
  109738. // method id "compute.resourcePolicies.getIamPolicy":
  109739. type ResourcePoliciesGetIamPolicyCall struct {
  109740. s *Service
  109741. project string
  109742. region string
  109743. resource string
  109744. urlParams_ gensupport.URLParams
  109745. ifNoneMatch_ string
  109746. ctx_ context.Context
  109747. header_ http.Header
  109748. }
  109749. // GetIamPolicy: Gets the access control policy for a resource. May be
  109750. // empty if no such policy or resource exists.
  109751. func (r *ResourcePoliciesService) GetIamPolicy(project string, region string, resource string) *ResourcePoliciesGetIamPolicyCall {
  109752. c := &ResourcePoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109753. c.project = project
  109754. c.region = region
  109755. c.resource = resource
  109756. return c
  109757. }
  109758. // Fields allows partial responses to be retrieved. See
  109759. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109760. // for more information.
  109761. func (c *ResourcePoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetIamPolicyCall {
  109762. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109763. return c
  109764. }
  109765. // IfNoneMatch sets the optional parameter which makes the operation
  109766. // fail if the object's ETag matches the given value. This is useful for
  109767. // getting updates only after the object has changed since the last
  109768. // request. Use googleapi.IsNotModified to check whether the response
  109769. // error from Do is the result of In-None-Match.
  109770. func (c *ResourcePoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetIamPolicyCall {
  109771. c.ifNoneMatch_ = entityTag
  109772. return c
  109773. }
  109774. // Context sets the context to be used in this call's Do method. Any
  109775. // pending HTTP request will be aborted if the provided context is
  109776. // canceled.
  109777. func (c *ResourcePoliciesGetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesGetIamPolicyCall {
  109778. c.ctx_ = ctx
  109779. return c
  109780. }
  109781. // Header returns an http.Header that can be modified by the caller to
  109782. // add HTTP headers to the request.
  109783. func (c *ResourcePoliciesGetIamPolicyCall) Header() http.Header {
  109784. if c.header_ == nil {
  109785. c.header_ = make(http.Header)
  109786. }
  109787. return c.header_
  109788. }
  109789. func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  109790. reqHeaders := make(http.Header)
  109791. for k, v := range c.header_ {
  109792. reqHeaders[k] = v
  109793. }
  109794. reqHeaders.Set("User-Agent", c.s.userAgent())
  109795. if c.ifNoneMatch_ != "" {
  109796. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109797. }
  109798. var body io.Reader = nil
  109799. c.urlParams_.Set("alt", alt)
  109800. c.urlParams_.Set("prettyPrint", "false")
  109801. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy")
  109802. urls += "?" + c.urlParams_.Encode()
  109803. req, err := http.NewRequest("GET", urls, body)
  109804. if err != nil {
  109805. return nil, err
  109806. }
  109807. req.Header = reqHeaders
  109808. googleapi.Expand(req.URL, map[string]string{
  109809. "project": c.project,
  109810. "region": c.region,
  109811. "resource": c.resource,
  109812. })
  109813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109814. }
  109815. // Do executes the "compute.resourcePolicies.getIamPolicy" call.
  109816. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  109817. // code is an error. Response headers are in either
  109818. // *Policy.ServerResponse.Header or (if a response was returned at all)
  109819. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  109820. // check whether the returned error was because http.StatusNotModified
  109821. // was returned.
  109822. func (c *ResourcePoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  109823. gensupport.SetOptions(c.urlParams_, opts...)
  109824. res, err := c.doRequest("json")
  109825. if res != nil && res.StatusCode == http.StatusNotModified {
  109826. if res.Body != nil {
  109827. res.Body.Close()
  109828. }
  109829. return nil, &googleapi.Error{
  109830. Code: res.StatusCode,
  109831. Header: res.Header,
  109832. }
  109833. }
  109834. if err != nil {
  109835. return nil, err
  109836. }
  109837. defer googleapi.CloseBody(res)
  109838. if err := googleapi.CheckResponse(res); err != nil {
  109839. return nil, err
  109840. }
  109841. ret := &Policy{
  109842. ServerResponse: googleapi.ServerResponse{
  109843. Header: res.Header,
  109844. HTTPStatusCode: res.StatusCode,
  109845. },
  109846. }
  109847. target := &ret
  109848. if err := gensupport.DecodeResponse(target, res); err != nil {
  109849. return nil, err
  109850. }
  109851. return ret, nil
  109852. // {
  109853. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  109854. // "httpMethod": "GET",
  109855. // "id": "compute.resourcePolicies.getIamPolicy",
  109856. // "parameterOrder": [
  109857. // "project",
  109858. // "region",
  109859. // "resource"
  109860. // ],
  109861. // "parameters": {
  109862. // "project": {
  109863. // "description": "Project ID for this request.",
  109864. // "location": "path",
  109865. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109866. // "required": true,
  109867. // "type": "string"
  109868. // },
  109869. // "region": {
  109870. // "description": "The name of the region for this request.",
  109871. // "location": "path",
  109872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109873. // "required": true,
  109874. // "type": "string"
  109875. // },
  109876. // "resource": {
  109877. // "description": "Name or id of the resource for this request.",
  109878. // "location": "path",
  109879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  109880. // "required": true,
  109881. // "type": "string"
  109882. // }
  109883. // },
  109884. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
  109885. // "response": {
  109886. // "$ref": "Policy"
  109887. // },
  109888. // "scopes": [
  109889. // "https://www.googleapis.com/auth/cloud-platform",
  109890. // "https://www.googleapis.com/auth/compute",
  109891. // "https://www.googleapis.com/auth/compute.readonly"
  109892. // ]
  109893. // }
  109894. }
  109895. // method id "compute.resourcePolicies.insert":
  109896. type ResourcePoliciesInsertCall struct {
  109897. s *Service
  109898. project string
  109899. region string
  109900. resourcepolicy *ResourcePolicy
  109901. urlParams_ gensupport.URLParams
  109902. ctx_ context.Context
  109903. header_ http.Header
  109904. }
  109905. // Insert: Creates a new resource policy.
  109906. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  109907. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109908. c.project = project
  109909. c.region = region
  109910. c.resourcepolicy = resourcepolicy
  109911. return c
  109912. }
  109913. // RequestId sets the optional parameter "requestId": An optional
  109914. // request ID to identify requests. Specify a unique request ID so that
  109915. // if you must retry your request, the server will know to ignore the
  109916. // request if it has already been completed.
  109917. //
  109918. // For example, consider a situation where you make an initial request
  109919. // and the request times out. If you make the request again with the
  109920. // same request ID, the server can check if original operation with the
  109921. // same request ID was received, and if so, will ignore the second
  109922. // request. This prevents clients from accidentally creating duplicate
  109923. // commitments.
  109924. //
  109925. // The request ID must be a valid UUID with the exception that zero UUID
  109926. // is not supported (00000000-0000-0000-0000-000000000000).
  109927. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  109928. c.urlParams_.Set("requestId", requestId)
  109929. return c
  109930. }
  109931. // Fields allows partial responses to be retrieved. See
  109932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109933. // for more information.
  109934. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  109935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109936. return c
  109937. }
  109938. // Context sets the context to be used in this call's Do method. Any
  109939. // pending HTTP request will be aborted if the provided context is
  109940. // canceled.
  109941. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  109942. c.ctx_ = ctx
  109943. return c
  109944. }
  109945. // Header returns an http.Header that can be modified by the caller to
  109946. // add HTTP headers to the request.
  109947. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  109948. if c.header_ == nil {
  109949. c.header_ = make(http.Header)
  109950. }
  109951. return c.header_
  109952. }
  109953. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  109954. reqHeaders := make(http.Header)
  109955. for k, v := range c.header_ {
  109956. reqHeaders[k] = v
  109957. }
  109958. reqHeaders.Set("User-Agent", c.s.userAgent())
  109959. var body io.Reader = nil
  109960. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  109961. if err != nil {
  109962. return nil, err
  109963. }
  109964. reqHeaders.Set("Content-Type", "application/json")
  109965. c.urlParams_.Set("alt", alt)
  109966. c.urlParams_.Set("prettyPrint", "false")
  109967. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  109968. urls += "?" + c.urlParams_.Encode()
  109969. req, err := http.NewRequest("POST", urls, body)
  109970. if err != nil {
  109971. return nil, err
  109972. }
  109973. req.Header = reqHeaders
  109974. googleapi.Expand(req.URL, map[string]string{
  109975. "project": c.project,
  109976. "region": c.region,
  109977. })
  109978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109979. }
  109980. // Do executes the "compute.resourcePolicies.insert" call.
  109981. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109982. // status code is an error. Response headers are in either
  109983. // *Operation.ServerResponse.Header or (if a response was returned at
  109984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109985. // to check whether the returned error was because
  109986. // http.StatusNotModified was returned.
  109987. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109988. gensupport.SetOptions(c.urlParams_, opts...)
  109989. res, err := c.doRequest("json")
  109990. if res != nil && res.StatusCode == http.StatusNotModified {
  109991. if res.Body != nil {
  109992. res.Body.Close()
  109993. }
  109994. return nil, &googleapi.Error{
  109995. Code: res.StatusCode,
  109996. Header: res.Header,
  109997. }
  109998. }
  109999. if err != nil {
  110000. return nil, err
  110001. }
  110002. defer googleapi.CloseBody(res)
  110003. if err := googleapi.CheckResponse(res); err != nil {
  110004. return nil, err
  110005. }
  110006. ret := &Operation{
  110007. ServerResponse: googleapi.ServerResponse{
  110008. Header: res.Header,
  110009. HTTPStatusCode: res.StatusCode,
  110010. },
  110011. }
  110012. target := &ret
  110013. if err := gensupport.DecodeResponse(target, res); err != nil {
  110014. return nil, err
  110015. }
  110016. return ret, nil
  110017. // {
  110018. // "description": "Creates a new resource policy.",
  110019. // "httpMethod": "POST",
  110020. // "id": "compute.resourcePolicies.insert",
  110021. // "parameterOrder": [
  110022. // "project",
  110023. // "region"
  110024. // ],
  110025. // "parameters": {
  110026. // "project": {
  110027. // "description": "Project ID for this request.",
  110028. // "location": "path",
  110029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110030. // "required": true,
  110031. // "type": "string"
  110032. // },
  110033. // "region": {
  110034. // "description": "Name of the region for this request.",
  110035. // "location": "path",
  110036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110037. // "required": true,
  110038. // "type": "string"
  110039. // },
  110040. // "requestId": {
  110041. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110042. // "location": "query",
  110043. // "type": "string"
  110044. // }
  110045. // },
  110046. // "path": "{project}/regions/{region}/resourcePolicies",
  110047. // "request": {
  110048. // "$ref": "ResourcePolicy"
  110049. // },
  110050. // "response": {
  110051. // "$ref": "Operation"
  110052. // },
  110053. // "scopes": [
  110054. // "https://www.googleapis.com/auth/cloud-platform",
  110055. // "https://www.googleapis.com/auth/compute"
  110056. // ]
  110057. // }
  110058. }
  110059. // method id "compute.resourcePolicies.list":
  110060. type ResourcePoliciesListCall struct {
  110061. s *Service
  110062. project string
  110063. region string
  110064. urlParams_ gensupport.URLParams
  110065. ifNoneMatch_ string
  110066. ctx_ context.Context
  110067. header_ http.Header
  110068. }
  110069. // List: A list all the resource policies that have been configured for
  110070. // the specified project in specified region.
  110071. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  110072. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110073. c.project = project
  110074. c.region = region
  110075. return c
  110076. }
  110077. // Filter sets the optional parameter "filter": A filter expression that
  110078. // filters resources listed in the response. The expression must specify
  110079. // the field name, a comparison operator, and the value that you want to
  110080. // use for filtering. The value must be a string, a number, or a
  110081. // boolean. The comparison operator must be either =, !=, >, or <.
  110082. //
  110083. // For example, if you are filtering Compute Engine instances, you can
  110084. // exclude instances named example-instance by specifying name !=
  110085. // example-instance.
  110086. //
  110087. // You can also filter nested fields. For example, you could specify
  110088. // scheduling.automaticRestart = false to include instances only if they
  110089. // are not scheduled for automatic restarts. You can use filtering on
  110090. // nested fields to filter based on resource labels.
  110091. //
  110092. // To filter on multiple expressions, provide each separate expression
  110093. // within parentheses. For example, (scheduling.automaticRestart = true)
  110094. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110095. // AND expression. However, you can include AND and OR expressions
  110096. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110097. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110098. // true).
  110099. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  110100. c.urlParams_.Set("filter", filter)
  110101. return c
  110102. }
  110103. // MaxResults sets the optional parameter "maxResults": The maximum
  110104. // number of results per page that should be returned. If the number of
  110105. // available results is larger than maxResults, Compute Engine returns a
  110106. // nextPageToken that can be used to get the next page of results in
  110107. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110108. // (Default: 500)
  110109. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  110110. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110111. return c
  110112. }
  110113. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110114. // a certain order. By default, results are returned in alphanumerical
  110115. // order based on the resource name.
  110116. //
  110117. // You can also sort results in descending order based on the creation
  110118. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110119. // based on the creationTimestamp field in reverse chronological order
  110120. // (newest result first). Use this to sort resources like operations so
  110121. // that the newest operation is returned first.
  110122. //
  110123. // Currently, only sorting by name or creationTimestamp desc is
  110124. // supported.
  110125. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  110126. c.urlParams_.Set("orderBy", orderBy)
  110127. return c
  110128. }
  110129. // PageToken sets the optional parameter "pageToken": Specifies a page
  110130. // token to use. Set pageToken to the nextPageToken returned by a
  110131. // previous list request to get the next page of results.
  110132. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  110133. c.urlParams_.Set("pageToken", pageToken)
  110134. return c
  110135. }
  110136. // Fields allows partial responses to be retrieved. See
  110137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110138. // for more information.
  110139. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  110140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110141. return c
  110142. }
  110143. // IfNoneMatch sets the optional parameter which makes the operation
  110144. // fail if the object's ETag matches the given value. This is useful for
  110145. // getting updates only after the object has changed since the last
  110146. // request. Use googleapi.IsNotModified to check whether the response
  110147. // error from Do is the result of In-None-Match.
  110148. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  110149. c.ifNoneMatch_ = entityTag
  110150. return c
  110151. }
  110152. // Context sets the context to be used in this call's Do method. Any
  110153. // pending HTTP request will be aborted if the provided context is
  110154. // canceled.
  110155. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  110156. c.ctx_ = ctx
  110157. return c
  110158. }
  110159. // Header returns an http.Header that can be modified by the caller to
  110160. // add HTTP headers to the request.
  110161. func (c *ResourcePoliciesListCall) Header() http.Header {
  110162. if c.header_ == nil {
  110163. c.header_ = make(http.Header)
  110164. }
  110165. return c.header_
  110166. }
  110167. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  110168. reqHeaders := make(http.Header)
  110169. for k, v := range c.header_ {
  110170. reqHeaders[k] = v
  110171. }
  110172. reqHeaders.Set("User-Agent", c.s.userAgent())
  110173. if c.ifNoneMatch_ != "" {
  110174. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110175. }
  110176. var body io.Reader = nil
  110177. c.urlParams_.Set("alt", alt)
  110178. c.urlParams_.Set("prettyPrint", "false")
  110179. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  110180. urls += "?" + c.urlParams_.Encode()
  110181. req, err := http.NewRequest("GET", urls, body)
  110182. if err != nil {
  110183. return nil, err
  110184. }
  110185. req.Header = reqHeaders
  110186. googleapi.Expand(req.URL, map[string]string{
  110187. "project": c.project,
  110188. "region": c.region,
  110189. })
  110190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110191. }
  110192. // Do executes the "compute.resourcePolicies.list" call.
  110193. // Exactly one of *ResourcePolicyList or error will be non-nil. Any
  110194. // non-2xx status code is an error. Response headers are in either
  110195. // *ResourcePolicyList.ServerResponse.Header or (if a response was
  110196. // returned at all) in error.(*googleapi.Error).Header. Use
  110197. // googleapi.IsNotModified to check whether the returned error was
  110198. // because http.StatusNotModified was returned.
  110199. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, error) {
  110200. gensupport.SetOptions(c.urlParams_, opts...)
  110201. res, err := c.doRequest("json")
  110202. if res != nil && res.StatusCode == http.StatusNotModified {
  110203. if res.Body != nil {
  110204. res.Body.Close()
  110205. }
  110206. return nil, &googleapi.Error{
  110207. Code: res.StatusCode,
  110208. Header: res.Header,
  110209. }
  110210. }
  110211. if err != nil {
  110212. return nil, err
  110213. }
  110214. defer googleapi.CloseBody(res)
  110215. if err := googleapi.CheckResponse(res); err != nil {
  110216. return nil, err
  110217. }
  110218. ret := &ResourcePolicyList{
  110219. ServerResponse: googleapi.ServerResponse{
  110220. Header: res.Header,
  110221. HTTPStatusCode: res.StatusCode,
  110222. },
  110223. }
  110224. target := &ret
  110225. if err := gensupport.DecodeResponse(target, res); err != nil {
  110226. return nil, err
  110227. }
  110228. return ret, nil
  110229. // {
  110230. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  110231. // "httpMethod": "GET",
  110232. // "id": "compute.resourcePolicies.list",
  110233. // "parameterOrder": [
  110234. // "project",
  110235. // "region"
  110236. // ],
  110237. // "parameters": {
  110238. // "filter": {
  110239. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  110240. // "location": "query",
  110241. // "type": "string"
  110242. // },
  110243. // "maxResults": {
  110244. // "default": "500",
  110245. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  110246. // "format": "uint32",
  110247. // "location": "query",
  110248. // "minimum": "0",
  110249. // "type": "integer"
  110250. // },
  110251. // "orderBy": {
  110252. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  110253. // "location": "query",
  110254. // "type": "string"
  110255. // },
  110256. // "pageToken": {
  110257. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  110258. // "location": "query",
  110259. // "type": "string"
  110260. // },
  110261. // "project": {
  110262. // "description": "Project ID for this request.",
  110263. // "location": "path",
  110264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110265. // "required": true,
  110266. // "type": "string"
  110267. // },
  110268. // "region": {
  110269. // "description": "Name of the region for this request.",
  110270. // "location": "path",
  110271. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110272. // "required": true,
  110273. // "type": "string"
  110274. // }
  110275. // },
  110276. // "path": "{project}/regions/{region}/resourcePolicies",
  110277. // "response": {
  110278. // "$ref": "ResourcePolicyList"
  110279. // },
  110280. // "scopes": [
  110281. // "https://www.googleapis.com/auth/cloud-platform",
  110282. // "https://www.googleapis.com/auth/compute",
  110283. // "https://www.googleapis.com/auth/compute.readonly"
  110284. // ]
  110285. // }
  110286. }
  110287. // Pages invokes f for each page of results.
  110288. // A non-nil error returned from f will halt the iteration.
  110289. // The provided context supersedes any context provided to the Context method.
  110290. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) error) error {
  110291. c.ctx_ = ctx
  110292. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  110293. for {
  110294. x, err := c.Do()
  110295. if err != nil {
  110296. return err
  110297. }
  110298. if err := f(x); err != nil {
  110299. return err
  110300. }
  110301. if x.NextPageToken == "" {
  110302. return nil
  110303. }
  110304. c.PageToken(x.NextPageToken)
  110305. }
  110306. }
  110307. // method id "compute.resourcePolicies.setIamPolicy":
  110308. type ResourcePoliciesSetIamPolicyCall struct {
  110309. s *Service
  110310. project string
  110311. region string
  110312. resource string
  110313. regionsetpolicyrequest *RegionSetPolicyRequest
  110314. urlParams_ gensupport.URLParams
  110315. ctx_ context.Context
  110316. header_ http.Header
  110317. }
  110318. // SetIamPolicy: Sets the access control policy on the specified
  110319. // resource. Replaces any existing policy.
  110320. func (r *ResourcePoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ResourcePoliciesSetIamPolicyCall {
  110321. c := &ResourcePoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110322. c.project = project
  110323. c.region = region
  110324. c.resource = resource
  110325. c.regionsetpolicyrequest = regionsetpolicyrequest
  110326. return c
  110327. }
  110328. // Fields allows partial responses to be retrieved. See
  110329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110330. // for more information.
  110331. func (c *ResourcePoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesSetIamPolicyCall {
  110332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110333. return c
  110334. }
  110335. // Context sets the context to be used in this call's Do method. Any
  110336. // pending HTTP request will be aborted if the provided context is
  110337. // canceled.
  110338. func (c *ResourcePoliciesSetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesSetIamPolicyCall {
  110339. c.ctx_ = ctx
  110340. return c
  110341. }
  110342. // Header returns an http.Header that can be modified by the caller to
  110343. // add HTTP headers to the request.
  110344. func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header {
  110345. if c.header_ == nil {
  110346. c.header_ = make(http.Header)
  110347. }
  110348. return c.header_
  110349. }
  110350. func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  110351. reqHeaders := make(http.Header)
  110352. for k, v := range c.header_ {
  110353. reqHeaders[k] = v
  110354. }
  110355. reqHeaders.Set("User-Agent", c.s.userAgent())
  110356. var body io.Reader = nil
  110357. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  110358. if err != nil {
  110359. return nil, err
  110360. }
  110361. reqHeaders.Set("Content-Type", "application/json")
  110362. c.urlParams_.Set("alt", alt)
  110363. c.urlParams_.Set("prettyPrint", "false")
  110364. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy")
  110365. urls += "?" + c.urlParams_.Encode()
  110366. req, err := http.NewRequest("POST", urls, body)
  110367. if err != nil {
  110368. return nil, err
  110369. }
  110370. req.Header = reqHeaders
  110371. googleapi.Expand(req.URL, map[string]string{
  110372. "project": c.project,
  110373. "region": c.region,
  110374. "resource": c.resource,
  110375. })
  110376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110377. }
  110378. // Do executes the "compute.resourcePolicies.setIamPolicy" call.
  110379. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  110380. // code is an error. Response headers are in either
  110381. // *Policy.ServerResponse.Header or (if a response was returned at all)
  110382. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  110383. // check whether the returned error was because http.StatusNotModified
  110384. // was returned.
  110385. func (c *ResourcePoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  110386. gensupport.SetOptions(c.urlParams_, opts...)
  110387. res, err := c.doRequest("json")
  110388. if res != nil && res.StatusCode == http.StatusNotModified {
  110389. if res.Body != nil {
  110390. res.Body.Close()
  110391. }
  110392. return nil, &googleapi.Error{
  110393. Code: res.StatusCode,
  110394. Header: res.Header,
  110395. }
  110396. }
  110397. if err != nil {
  110398. return nil, err
  110399. }
  110400. defer googleapi.CloseBody(res)
  110401. if err := googleapi.CheckResponse(res); err != nil {
  110402. return nil, err
  110403. }
  110404. ret := &Policy{
  110405. ServerResponse: googleapi.ServerResponse{
  110406. Header: res.Header,
  110407. HTTPStatusCode: res.StatusCode,
  110408. },
  110409. }
  110410. target := &ret
  110411. if err := gensupport.DecodeResponse(target, res); err != nil {
  110412. return nil, err
  110413. }
  110414. return ret, nil
  110415. // {
  110416. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  110417. // "httpMethod": "POST",
  110418. // "id": "compute.resourcePolicies.setIamPolicy",
  110419. // "parameterOrder": [
  110420. // "project",
  110421. // "region",
  110422. // "resource"
  110423. // ],
  110424. // "parameters": {
  110425. // "project": {
  110426. // "description": "Project ID for this request.",
  110427. // "location": "path",
  110428. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110429. // "required": true,
  110430. // "type": "string"
  110431. // },
  110432. // "region": {
  110433. // "description": "The name of the region for this request.",
  110434. // "location": "path",
  110435. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110436. // "required": true,
  110437. // "type": "string"
  110438. // },
  110439. // "resource": {
  110440. // "description": "Name or id of the resource for this request.",
  110441. // "location": "path",
  110442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110443. // "required": true,
  110444. // "type": "string"
  110445. // }
  110446. // },
  110447. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
  110448. // "request": {
  110449. // "$ref": "RegionSetPolicyRequest"
  110450. // },
  110451. // "response": {
  110452. // "$ref": "Policy"
  110453. // },
  110454. // "scopes": [
  110455. // "https://www.googleapis.com/auth/cloud-platform",
  110456. // "https://www.googleapis.com/auth/compute"
  110457. // ]
  110458. // }
  110459. }
  110460. // method id "compute.resourcePolicies.testIamPermissions":
  110461. type ResourcePoliciesTestIamPermissionsCall struct {
  110462. s *Service
  110463. project string
  110464. region string
  110465. resource string
  110466. testpermissionsrequest *TestPermissionsRequest
  110467. urlParams_ gensupport.URLParams
  110468. ctx_ context.Context
  110469. header_ http.Header
  110470. }
  110471. // TestIamPermissions: Returns permissions that a caller has on the
  110472. // specified resource.
  110473. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  110474. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110475. c.project = project
  110476. c.region = region
  110477. c.resource = resource
  110478. c.testpermissionsrequest = testpermissionsrequest
  110479. return c
  110480. }
  110481. // Fields allows partial responses to be retrieved. See
  110482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110483. // for more information.
  110484. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  110485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110486. return c
  110487. }
  110488. // Context sets the context to be used in this call's Do method. Any
  110489. // pending HTTP request will be aborted if the provided context is
  110490. // canceled.
  110491. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  110492. c.ctx_ = ctx
  110493. return c
  110494. }
  110495. // Header returns an http.Header that can be modified by the caller to
  110496. // add HTTP headers to the request.
  110497. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  110498. if c.header_ == nil {
  110499. c.header_ = make(http.Header)
  110500. }
  110501. return c.header_
  110502. }
  110503. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110504. reqHeaders := make(http.Header)
  110505. for k, v := range c.header_ {
  110506. reqHeaders[k] = v
  110507. }
  110508. reqHeaders.Set("User-Agent", c.s.userAgent())
  110509. var body io.Reader = nil
  110510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110511. if err != nil {
  110512. return nil, err
  110513. }
  110514. reqHeaders.Set("Content-Type", "application/json")
  110515. c.urlParams_.Set("alt", alt)
  110516. c.urlParams_.Set("prettyPrint", "false")
  110517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  110518. urls += "?" + c.urlParams_.Encode()
  110519. req, err := http.NewRequest("POST", urls, body)
  110520. if err != nil {
  110521. return nil, err
  110522. }
  110523. req.Header = reqHeaders
  110524. googleapi.Expand(req.URL, map[string]string{
  110525. "project": c.project,
  110526. "region": c.region,
  110527. "resource": c.resource,
  110528. })
  110529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110530. }
  110531. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  110532. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110533. // non-2xx status code is an error. Response headers are in either
  110534. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110535. // returned at all) in error.(*googleapi.Error).Header. Use
  110536. // googleapi.IsNotModified to check whether the returned error was
  110537. // because http.StatusNotModified was returned.
  110538. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110539. gensupport.SetOptions(c.urlParams_, opts...)
  110540. res, err := c.doRequest("json")
  110541. if res != nil && res.StatusCode == http.StatusNotModified {
  110542. if res.Body != nil {
  110543. res.Body.Close()
  110544. }
  110545. return nil, &googleapi.Error{
  110546. Code: res.StatusCode,
  110547. Header: res.Header,
  110548. }
  110549. }
  110550. if err != nil {
  110551. return nil, err
  110552. }
  110553. defer googleapi.CloseBody(res)
  110554. if err := googleapi.CheckResponse(res); err != nil {
  110555. return nil, err
  110556. }
  110557. ret := &TestPermissionsResponse{
  110558. ServerResponse: googleapi.ServerResponse{
  110559. Header: res.Header,
  110560. HTTPStatusCode: res.StatusCode,
  110561. },
  110562. }
  110563. target := &ret
  110564. if err := gensupport.DecodeResponse(target, res); err != nil {
  110565. return nil, err
  110566. }
  110567. return ret, nil
  110568. // {
  110569. // "description": "Returns permissions that a caller has on the specified resource.",
  110570. // "httpMethod": "POST",
  110571. // "id": "compute.resourcePolicies.testIamPermissions",
  110572. // "parameterOrder": [
  110573. // "project",
  110574. // "region",
  110575. // "resource"
  110576. // ],
  110577. // "parameters": {
  110578. // "project": {
  110579. // "description": "Project ID for this request.",
  110580. // "location": "path",
  110581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110582. // "required": true,
  110583. // "type": "string"
  110584. // },
  110585. // "region": {
  110586. // "description": "The name of the region for this request.",
  110587. // "location": "path",
  110588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110589. // "required": true,
  110590. // "type": "string"
  110591. // },
  110592. // "resource": {
  110593. // "description": "Name or id of the resource for this request.",
  110594. // "location": "path",
  110595. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110596. // "required": true,
  110597. // "type": "string"
  110598. // }
  110599. // },
  110600. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  110601. // "request": {
  110602. // "$ref": "TestPermissionsRequest"
  110603. // },
  110604. // "response": {
  110605. // "$ref": "TestPermissionsResponse"
  110606. // },
  110607. // "scopes": [
  110608. // "https://www.googleapis.com/auth/cloud-platform",
  110609. // "https://www.googleapis.com/auth/compute",
  110610. // "https://www.googleapis.com/auth/compute.readonly"
  110611. // ]
  110612. // }
  110613. }
  110614. // method id "compute.routers.aggregatedList":
  110615. type RoutersAggregatedListCall struct {
  110616. s *Service
  110617. project string
  110618. urlParams_ gensupport.URLParams
  110619. ifNoneMatch_ string
  110620. ctx_ context.Context
  110621. header_ http.Header
  110622. }
  110623. // AggregatedList: Retrieves an aggregated list of routers.
  110624. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  110625. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110626. c.project = project
  110627. return c
  110628. }
  110629. // Filter sets the optional parameter "filter": A filter expression that
  110630. // filters resources listed in the response. The expression must specify
  110631. // the field name, a comparison operator, and the value that you want to
  110632. // use for filtering. The value must be a string, a number, or a
  110633. // boolean. The comparison operator must be either =, !=, >, or <.
  110634. //
  110635. // For example, if you are filtering Compute Engine instances, you can
  110636. // exclude instances named example-instance by specifying name !=
  110637. // example-instance.
  110638. //
  110639. // You can also filter nested fields. For example, you could specify
  110640. // scheduling.automaticRestart = false to include instances only if they
  110641. // are not scheduled for automatic restarts. You can use filtering on
  110642. // nested fields to filter based on resource labels.
  110643. //
  110644. // To filter on multiple expressions, provide each separate expression
  110645. // within parentheses. For example, (scheduling.automaticRestart = true)
  110646. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110647. // AND expression. However, you can include AND and OR expressions
  110648. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110649. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110650. // true).
  110651. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  110652. c.urlParams_.Set("filter", filter)
  110653. return c
  110654. }
  110655. // MaxResults sets the optional parameter "maxResults": The maximum
  110656. // number of results per page that should be returned. If the number of
  110657. // available results is larger than maxResults, Compute Engine returns a
  110658. // nextPageToken that can be used to get the next page of results in
  110659. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110660. // (Default: 500)
  110661. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  110662. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110663. return c
  110664. }
  110665. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110666. // a certain order. By default, results are returned in alphanumerical
  110667. // order based on the resource name.
  110668. //
  110669. // You can also sort results in descending order based on the creation
  110670. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110671. // based on the creationTimestamp field in reverse chronological order
  110672. // (newest result first). Use this to sort resources like operations so
  110673. // that the newest operation is returned first.
  110674. //
  110675. // Currently, only sorting by name or creationTimestamp desc is
  110676. // supported.
  110677. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  110678. c.urlParams_.Set("orderBy", orderBy)
  110679. return c
  110680. }
  110681. // PageToken sets the optional parameter "pageToken": Specifies a page
  110682. // token to use. Set pageToken to the nextPageToken returned by a
  110683. // previous list request to get the next page of results.
  110684. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  110685. c.urlParams_.Set("pageToken", pageToken)
  110686. return c
  110687. }
  110688. // Fields allows partial responses to be retrieved. See
  110689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110690. // for more information.
  110691. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  110692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110693. return c
  110694. }
  110695. // IfNoneMatch sets the optional parameter which makes the operation
  110696. // fail if the object's ETag matches the given value. This is useful for
  110697. // getting updates only after the object has changed since the last
  110698. // request. Use googleapi.IsNotModified to check whether the response
  110699. // error from Do is the result of In-None-Match.
  110700. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  110701. c.ifNoneMatch_ = entityTag
  110702. return c
  110703. }
  110704. // Context sets the context to be used in this call's Do method. Any
  110705. // pending HTTP request will be aborted if the provided context is
  110706. // canceled.
  110707. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  110708. c.ctx_ = ctx
  110709. return c
  110710. }
  110711. // Header returns an http.Header that can be modified by the caller to
  110712. // add HTTP headers to the request.
  110713. func (c *RoutersAggregatedListCall) Header() http.Header {
  110714. if c.header_ == nil {
  110715. c.header_ = make(http.Header)
  110716. }
  110717. return c.header_
  110718. }
  110719. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  110720. reqHeaders := make(http.Header)
  110721. for k, v := range c.header_ {
  110722. reqHeaders[k] = v
  110723. }
  110724. reqHeaders.Set("User-Agent", c.s.userAgent())
  110725. if c.ifNoneMatch_ != "" {
  110726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110727. }
  110728. var body io.Reader = nil
  110729. c.urlParams_.Set("alt", alt)
  110730. c.urlParams_.Set("prettyPrint", "false")
  110731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  110732. urls += "?" + c.urlParams_.Encode()
  110733. req, err := http.NewRequest("GET", urls, body)
  110734. if err != nil {
  110735. return nil, err
  110736. }
  110737. req.Header = reqHeaders
  110738. googleapi.Expand(req.URL, map[string]string{
  110739. "project": c.project,
  110740. })
  110741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110742. }
  110743. // Do executes the "compute.routers.aggregatedList" call.
  110744. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  110745. // non-2xx status code is an error. Response headers are in either
  110746. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  110747. // returned at all) in error.(*googleapi.Error).Header. Use
  110748. // googleapi.IsNotModified to check whether the returned error was
  110749. // because http.StatusNotModified was returned.
  110750. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  110751. gensupport.SetOptions(c.urlParams_, opts...)
  110752. res, err := c.doRequest("json")
  110753. if res != nil && res.StatusCode == http.StatusNotModified {
  110754. if res.Body != nil {
  110755. res.Body.Close()
  110756. }
  110757. return nil, &googleapi.Error{
  110758. Code: res.StatusCode,
  110759. Header: res.Header,
  110760. }
  110761. }
  110762. if err != nil {
  110763. return nil, err
  110764. }
  110765. defer googleapi.CloseBody(res)
  110766. if err := googleapi.CheckResponse(res); err != nil {
  110767. return nil, err
  110768. }
  110769. ret := &RouterAggregatedList{
  110770. ServerResponse: googleapi.ServerResponse{
  110771. Header: res.Header,
  110772. HTTPStatusCode: res.StatusCode,
  110773. },
  110774. }
  110775. target := &ret
  110776. if err := gensupport.DecodeResponse(target, res); err != nil {
  110777. return nil, err
  110778. }
  110779. return ret, nil
  110780. // {
  110781. // "description": "Retrieves an aggregated list of routers.",
  110782. // "httpMethod": "GET",
  110783. // "id": "compute.routers.aggregatedList",
  110784. // "parameterOrder": [
  110785. // "project"
  110786. // ],
  110787. // "parameters": {
  110788. // "filter": {
  110789. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  110790. // "location": "query",
  110791. // "type": "string"
  110792. // },
  110793. // "maxResults": {
  110794. // "default": "500",
  110795. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  110796. // "format": "uint32",
  110797. // "location": "query",
  110798. // "minimum": "0",
  110799. // "type": "integer"
  110800. // },
  110801. // "orderBy": {
  110802. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  110803. // "location": "query",
  110804. // "type": "string"
  110805. // },
  110806. // "pageToken": {
  110807. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  110808. // "location": "query",
  110809. // "type": "string"
  110810. // },
  110811. // "project": {
  110812. // "description": "Project ID for this request.",
  110813. // "location": "path",
  110814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110815. // "required": true,
  110816. // "type": "string"
  110817. // }
  110818. // },
  110819. // "path": "{project}/aggregated/routers",
  110820. // "response": {
  110821. // "$ref": "RouterAggregatedList"
  110822. // },
  110823. // "scopes": [
  110824. // "https://www.googleapis.com/auth/cloud-platform",
  110825. // "https://www.googleapis.com/auth/compute",
  110826. // "https://www.googleapis.com/auth/compute.readonly"
  110827. // ]
  110828. // }
  110829. }
  110830. // Pages invokes f for each page of results.
  110831. // A non-nil error returned from f will halt the iteration.
  110832. // The provided context supersedes any context provided to the Context method.
  110833. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  110834. c.ctx_ = ctx
  110835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  110836. for {
  110837. x, err := c.Do()
  110838. if err != nil {
  110839. return err
  110840. }
  110841. if err := f(x); err != nil {
  110842. return err
  110843. }
  110844. if x.NextPageToken == "" {
  110845. return nil
  110846. }
  110847. c.PageToken(x.NextPageToken)
  110848. }
  110849. }
  110850. // method id "compute.routers.delete":
  110851. type RoutersDeleteCall struct {
  110852. s *Service
  110853. project string
  110854. region string
  110855. router string
  110856. urlParams_ gensupport.URLParams
  110857. ctx_ context.Context
  110858. header_ http.Header
  110859. }
  110860. // Delete: Deletes the specified Router resource.
  110861. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  110862. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110863. c.project = project
  110864. c.region = region
  110865. c.router = router
  110866. return c
  110867. }
  110868. // RequestId sets the optional parameter "requestId": An optional
  110869. // request ID to identify requests. Specify a unique request ID so that
  110870. // if you must retry your request, the server will know to ignore the
  110871. // request if it has already been completed.
  110872. //
  110873. // For example, consider a situation where you make an initial request
  110874. // and the request times out. If you make the request again with the
  110875. // same request ID, the server can check if original operation with the
  110876. // same request ID was received, and if so, will ignore the second
  110877. // request. This prevents clients from accidentally creating duplicate
  110878. // commitments.
  110879. //
  110880. // The request ID must be a valid UUID with the exception that zero UUID
  110881. // is not supported (00000000-0000-0000-0000-000000000000).
  110882. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  110883. c.urlParams_.Set("requestId", requestId)
  110884. return c
  110885. }
  110886. // Fields allows partial responses to be retrieved. See
  110887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110888. // for more information.
  110889. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  110890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110891. return c
  110892. }
  110893. // Context sets the context to be used in this call's Do method. Any
  110894. // pending HTTP request will be aborted if the provided context is
  110895. // canceled.
  110896. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  110897. c.ctx_ = ctx
  110898. return c
  110899. }
  110900. // Header returns an http.Header that can be modified by the caller to
  110901. // add HTTP headers to the request.
  110902. func (c *RoutersDeleteCall) Header() http.Header {
  110903. if c.header_ == nil {
  110904. c.header_ = make(http.Header)
  110905. }
  110906. return c.header_
  110907. }
  110908. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  110909. reqHeaders := make(http.Header)
  110910. for k, v := range c.header_ {
  110911. reqHeaders[k] = v
  110912. }
  110913. reqHeaders.Set("User-Agent", c.s.userAgent())
  110914. var body io.Reader = nil
  110915. c.urlParams_.Set("alt", alt)
  110916. c.urlParams_.Set("prettyPrint", "false")
  110917. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  110918. urls += "?" + c.urlParams_.Encode()
  110919. req, err := http.NewRequest("DELETE", urls, body)
  110920. if err != nil {
  110921. return nil, err
  110922. }
  110923. req.Header = reqHeaders
  110924. googleapi.Expand(req.URL, map[string]string{
  110925. "project": c.project,
  110926. "region": c.region,
  110927. "router": c.router,
  110928. })
  110929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110930. }
  110931. // Do executes the "compute.routers.delete" call.
  110932. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110933. // status code is an error. Response headers are in either
  110934. // *Operation.ServerResponse.Header or (if a response was returned at
  110935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110936. // to check whether the returned error was because
  110937. // http.StatusNotModified was returned.
  110938. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110939. gensupport.SetOptions(c.urlParams_, opts...)
  110940. res, err := c.doRequest("json")
  110941. if res != nil && res.StatusCode == http.StatusNotModified {
  110942. if res.Body != nil {
  110943. res.Body.Close()
  110944. }
  110945. return nil, &googleapi.Error{
  110946. Code: res.StatusCode,
  110947. Header: res.Header,
  110948. }
  110949. }
  110950. if err != nil {
  110951. return nil, err
  110952. }
  110953. defer googleapi.CloseBody(res)
  110954. if err := googleapi.CheckResponse(res); err != nil {
  110955. return nil, err
  110956. }
  110957. ret := &Operation{
  110958. ServerResponse: googleapi.ServerResponse{
  110959. Header: res.Header,
  110960. HTTPStatusCode: res.StatusCode,
  110961. },
  110962. }
  110963. target := &ret
  110964. if err := gensupport.DecodeResponse(target, res); err != nil {
  110965. return nil, err
  110966. }
  110967. return ret, nil
  110968. // {
  110969. // "description": "Deletes the specified Router resource.",
  110970. // "httpMethod": "DELETE",
  110971. // "id": "compute.routers.delete",
  110972. // "parameterOrder": [
  110973. // "project",
  110974. // "region",
  110975. // "router"
  110976. // ],
  110977. // "parameters": {
  110978. // "project": {
  110979. // "description": "Project ID for this request.",
  110980. // "location": "path",
  110981. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110982. // "required": true,
  110983. // "type": "string"
  110984. // },
  110985. // "region": {
  110986. // "description": "Name of the region for this request.",
  110987. // "location": "path",
  110988. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110989. // "required": true,
  110990. // "type": "string"
  110991. // },
  110992. // "requestId": {
  110993. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110994. // "location": "query",
  110995. // "type": "string"
  110996. // },
  110997. // "router": {
  110998. // "description": "Name of the Router resource to delete.",
  110999. // "location": "path",
  111000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111001. // "required": true,
  111002. // "type": "string"
  111003. // }
  111004. // },
  111005. // "path": "{project}/regions/{region}/routers/{router}",
  111006. // "response": {
  111007. // "$ref": "Operation"
  111008. // },
  111009. // "scopes": [
  111010. // "https://www.googleapis.com/auth/cloud-platform",
  111011. // "https://www.googleapis.com/auth/compute"
  111012. // ]
  111013. // }
  111014. }
  111015. // method id "compute.routers.get":
  111016. type RoutersGetCall struct {
  111017. s *Service
  111018. project string
  111019. region string
  111020. router string
  111021. urlParams_ gensupport.URLParams
  111022. ifNoneMatch_ string
  111023. ctx_ context.Context
  111024. header_ http.Header
  111025. }
  111026. // Get: Returns the specified Router resource. Gets a list of available
  111027. // routers by making a list() request.
  111028. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  111029. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111030. c.project = project
  111031. c.region = region
  111032. c.router = router
  111033. return c
  111034. }
  111035. // Fields allows partial responses to be retrieved. See
  111036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111037. // for more information.
  111038. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  111039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111040. return c
  111041. }
  111042. // IfNoneMatch sets the optional parameter which makes the operation
  111043. // fail if the object's ETag matches the given value. This is useful for
  111044. // getting updates only after the object has changed since the last
  111045. // request. Use googleapi.IsNotModified to check whether the response
  111046. // error from Do is the result of In-None-Match.
  111047. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  111048. c.ifNoneMatch_ = entityTag
  111049. return c
  111050. }
  111051. // Context sets the context to be used in this call's Do method. Any
  111052. // pending HTTP request will be aborted if the provided context is
  111053. // canceled.
  111054. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  111055. c.ctx_ = ctx
  111056. return c
  111057. }
  111058. // Header returns an http.Header that can be modified by the caller to
  111059. // add HTTP headers to the request.
  111060. func (c *RoutersGetCall) Header() http.Header {
  111061. if c.header_ == nil {
  111062. c.header_ = make(http.Header)
  111063. }
  111064. return c.header_
  111065. }
  111066. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  111067. reqHeaders := make(http.Header)
  111068. for k, v := range c.header_ {
  111069. reqHeaders[k] = v
  111070. }
  111071. reqHeaders.Set("User-Agent", c.s.userAgent())
  111072. if c.ifNoneMatch_ != "" {
  111073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111074. }
  111075. var body io.Reader = nil
  111076. c.urlParams_.Set("alt", alt)
  111077. c.urlParams_.Set("prettyPrint", "false")
  111078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  111079. urls += "?" + c.urlParams_.Encode()
  111080. req, err := http.NewRequest("GET", urls, body)
  111081. if err != nil {
  111082. return nil, err
  111083. }
  111084. req.Header = reqHeaders
  111085. googleapi.Expand(req.URL, map[string]string{
  111086. "project": c.project,
  111087. "region": c.region,
  111088. "router": c.router,
  111089. })
  111090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111091. }
  111092. // Do executes the "compute.routers.get" call.
  111093. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  111094. // code is an error. Response headers are in either
  111095. // *Router.ServerResponse.Header or (if a response was returned at all)
  111096. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  111097. // check whether the returned error was because http.StatusNotModified
  111098. // was returned.
  111099. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  111100. gensupport.SetOptions(c.urlParams_, opts...)
  111101. res, err := c.doRequest("json")
  111102. if res != nil && res.StatusCode == http.StatusNotModified {
  111103. if res.Body != nil {
  111104. res.Body.Close()
  111105. }
  111106. return nil, &googleapi.Error{
  111107. Code: res.StatusCode,
  111108. Header: res.Header,
  111109. }
  111110. }
  111111. if err != nil {
  111112. return nil, err
  111113. }
  111114. defer googleapi.CloseBody(res)
  111115. if err := googleapi.CheckResponse(res); err != nil {
  111116. return nil, err
  111117. }
  111118. ret := &Router{
  111119. ServerResponse: googleapi.ServerResponse{
  111120. Header: res.Header,
  111121. HTTPStatusCode: res.StatusCode,
  111122. },
  111123. }
  111124. target := &ret
  111125. if err := gensupport.DecodeResponse(target, res); err != nil {
  111126. return nil, err
  111127. }
  111128. return ret, nil
  111129. // {
  111130. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  111131. // "httpMethod": "GET",
  111132. // "id": "compute.routers.get",
  111133. // "parameterOrder": [
  111134. // "project",
  111135. // "region",
  111136. // "router"
  111137. // ],
  111138. // "parameters": {
  111139. // "project": {
  111140. // "description": "Project ID for this request.",
  111141. // "location": "path",
  111142. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111143. // "required": true,
  111144. // "type": "string"
  111145. // },
  111146. // "region": {
  111147. // "description": "Name of the region for this request.",
  111148. // "location": "path",
  111149. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111150. // "required": true,
  111151. // "type": "string"
  111152. // },
  111153. // "router": {
  111154. // "description": "Name of the Router resource to return.",
  111155. // "location": "path",
  111156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111157. // "required": true,
  111158. // "type": "string"
  111159. // }
  111160. // },
  111161. // "path": "{project}/regions/{region}/routers/{router}",
  111162. // "response": {
  111163. // "$ref": "Router"
  111164. // },
  111165. // "scopes": [
  111166. // "https://www.googleapis.com/auth/cloud-platform",
  111167. // "https://www.googleapis.com/auth/compute",
  111168. // "https://www.googleapis.com/auth/compute.readonly"
  111169. // ]
  111170. // }
  111171. }
  111172. // method id "compute.routers.getNatMappingInfo":
  111173. type RoutersGetNatMappingInfoCall struct {
  111174. s *Service
  111175. project string
  111176. region string
  111177. router string
  111178. urlParams_ gensupport.URLParams
  111179. ifNoneMatch_ string
  111180. ctx_ context.Context
  111181. header_ http.Header
  111182. }
  111183. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  111184. // endpoints.
  111185. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  111186. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111187. c.project = project
  111188. c.region = region
  111189. c.router = router
  111190. return c
  111191. }
  111192. // Filter sets the optional parameter "filter": A filter expression that
  111193. // filters resources listed in the response. The expression must specify
  111194. // the field name, a comparison operator, and the value that you want to
  111195. // use for filtering. The value must be a string, a number, or a
  111196. // boolean. The comparison operator must be either =, !=, >, or <.
  111197. //
  111198. // For example, if you are filtering Compute Engine instances, you can
  111199. // exclude instances named example-instance by specifying name !=
  111200. // example-instance.
  111201. //
  111202. // You can also filter nested fields. For example, you could specify
  111203. // scheduling.automaticRestart = false to include instances only if they
  111204. // are not scheduled for automatic restarts. You can use filtering on
  111205. // nested fields to filter based on resource labels.
  111206. //
  111207. // To filter on multiple expressions, provide each separate expression
  111208. // within parentheses. For example, (scheduling.automaticRestart = true)
  111209. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111210. // AND expression. However, you can include AND and OR expressions
  111211. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111212. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111213. // true).
  111214. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  111215. c.urlParams_.Set("filter", filter)
  111216. return c
  111217. }
  111218. // MaxResults sets the optional parameter "maxResults": The maximum
  111219. // number of results per page that should be returned. If the number of
  111220. // available results is larger than maxResults, Compute Engine returns a
  111221. // nextPageToken that can be used to get the next page of results in
  111222. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111223. // (Default: 500)
  111224. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  111225. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111226. return c
  111227. }
  111228. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111229. // a certain order. By default, results are returned in alphanumerical
  111230. // order based on the resource name.
  111231. //
  111232. // You can also sort results in descending order based on the creation
  111233. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111234. // based on the creationTimestamp field in reverse chronological order
  111235. // (newest result first). Use this to sort resources like operations so
  111236. // that the newest operation is returned first.
  111237. //
  111238. // Currently, only sorting by name or creationTimestamp desc is
  111239. // supported.
  111240. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  111241. c.urlParams_.Set("orderBy", orderBy)
  111242. return c
  111243. }
  111244. // PageToken sets the optional parameter "pageToken": Specifies a page
  111245. // token to use. Set pageToken to the nextPageToken returned by a
  111246. // previous list request to get the next page of results.
  111247. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  111248. c.urlParams_.Set("pageToken", pageToken)
  111249. return c
  111250. }
  111251. // Fields allows partial responses to be retrieved. See
  111252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111253. // for more information.
  111254. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  111255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111256. return c
  111257. }
  111258. // IfNoneMatch sets the optional parameter which makes the operation
  111259. // fail if the object's ETag matches the given value. This is useful for
  111260. // getting updates only after the object has changed since the last
  111261. // request. Use googleapi.IsNotModified to check whether the response
  111262. // error from Do is the result of In-None-Match.
  111263. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  111264. c.ifNoneMatch_ = entityTag
  111265. return c
  111266. }
  111267. // Context sets the context to be used in this call's Do method. Any
  111268. // pending HTTP request will be aborted if the provided context is
  111269. // canceled.
  111270. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  111271. c.ctx_ = ctx
  111272. return c
  111273. }
  111274. // Header returns an http.Header that can be modified by the caller to
  111275. // add HTTP headers to the request.
  111276. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  111277. if c.header_ == nil {
  111278. c.header_ = make(http.Header)
  111279. }
  111280. return c.header_
  111281. }
  111282. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  111283. reqHeaders := make(http.Header)
  111284. for k, v := range c.header_ {
  111285. reqHeaders[k] = v
  111286. }
  111287. reqHeaders.Set("User-Agent", c.s.userAgent())
  111288. if c.ifNoneMatch_ != "" {
  111289. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111290. }
  111291. var body io.Reader = nil
  111292. c.urlParams_.Set("alt", alt)
  111293. c.urlParams_.Set("prettyPrint", "false")
  111294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  111295. urls += "?" + c.urlParams_.Encode()
  111296. req, err := http.NewRequest("GET", urls, body)
  111297. if err != nil {
  111298. return nil, err
  111299. }
  111300. req.Header = reqHeaders
  111301. googleapi.Expand(req.URL, map[string]string{
  111302. "project": c.project,
  111303. "region": c.region,
  111304. "router": c.router,
  111305. })
  111306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111307. }
  111308. // Do executes the "compute.routers.getNatMappingInfo" call.
  111309. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  111310. // Any non-2xx status code is an error. Response headers are in either
  111311. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  111312. // was returned at all) in error.(*googleapi.Error).Header. Use
  111313. // googleapi.IsNotModified to check whether the returned error was
  111314. // because http.StatusNotModified was returned.
  111315. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  111316. gensupport.SetOptions(c.urlParams_, opts...)
  111317. res, err := c.doRequest("json")
  111318. if res != nil && res.StatusCode == http.StatusNotModified {
  111319. if res.Body != nil {
  111320. res.Body.Close()
  111321. }
  111322. return nil, &googleapi.Error{
  111323. Code: res.StatusCode,
  111324. Header: res.Header,
  111325. }
  111326. }
  111327. if err != nil {
  111328. return nil, err
  111329. }
  111330. defer googleapi.CloseBody(res)
  111331. if err := googleapi.CheckResponse(res); err != nil {
  111332. return nil, err
  111333. }
  111334. ret := &VmEndpointNatMappingsList{
  111335. ServerResponse: googleapi.ServerResponse{
  111336. Header: res.Header,
  111337. HTTPStatusCode: res.StatusCode,
  111338. },
  111339. }
  111340. target := &ret
  111341. if err := gensupport.DecodeResponse(target, res); err != nil {
  111342. return nil, err
  111343. }
  111344. return ret, nil
  111345. // {
  111346. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  111347. // "httpMethod": "GET",
  111348. // "id": "compute.routers.getNatMappingInfo",
  111349. // "parameterOrder": [
  111350. // "project",
  111351. // "region",
  111352. // "router"
  111353. // ],
  111354. // "parameters": {
  111355. // "filter": {
  111356. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  111357. // "location": "query",
  111358. // "type": "string"
  111359. // },
  111360. // "maxResults": {
  111361. // "default": "500",
  111362. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  111363. // "format": "uint32",
  111364. // "location": "query",
  111365. // "minimum": "0",
  111366. // "type": "integer"
  111367. // },
  111368. // "orderBy": {
  111369. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  111370. // "location": "query",
  111371. // "type": "string"
  111372. // },
  111373. // "pageToken": {
  111374. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  111375. // "location": "query",
  111376. // "type": "string"
  111377. // },
  111378. // "project": {
  111379. // "description": "Project ID for this request.",
  111380. // "location": "path",
  111381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111382. // "required": true,
  111383. // "type": "string"
  111384. // },
  111385. // "region": {
  111386. // "description": "Name of the region for this request.",
  111387. // "location": "path",
  111388. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111389. // "required": true,
  111390. // "type": "string"
  111391. // },
  111392. // "router": {
  111393. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  111394. // "location": "path",
  111395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111396. // "required": true,
  111397. // "type": "string"
  111398. // }
  111399. // },
  111400. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  111401. // "response": {
  111402. // "$ref": "VmEndpointNatMappingsList"
  111403. // },
  111404. // "scopes": [
  111405. // "https://www.googleapis.com/auth/cloud-platform",
  111406. // "https://www.googleapis.com/auth/compute",
  111407. // "https://www.googleapis.com/auth/compute.readonly"
  111408. // ]
  111409. // }
  111410. }
  111411. // Pages invokes f for each page of results.
  111412. // A non-nil error returned from f will halt the iteration.
  111413. // The provided context supersedes any context provided to the Context method.
  111414. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  111415. c.ctx_ = ctx
  111416. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111417. for {
  111418. x, err := c.Do()
  111419. if err != nil {
  111420. return err
  111421. }
  111422. if err := f(x); err != nil {
  111423. return err
  111424. }
  111425. if x.NextPageToken == "" {
  111426. return nil
  111427. }
  111428. c.PageToken(x.NextPageToken)
  111429. }
  111430. }
  111431. // method id "compute.routers.getRouterStatus":
  111432. type RoutersGetRouterStatusCall struct {
  111433. s *Service
  111434. project string
  111435. region string
  111436. router string
  111437. urlParams_ gensupport.URLParams
  111438. ifNoneMatch_ string
  111439. ctx_ context.Context
  111440. header_ http.Header
  111441. }
  111442. // GetRouterStatus: Retrieves runtime information of the specified
  111443. // router.
  111444. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  111445. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111446. c.project = project
  111447. c.region = region
  111448. c.router = router
  111449. return c
  111450. }
  111451. // Fields allows partial responses to be retrieved. See
  111452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111453. // for more information.
  111454. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  111455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111456. return c
  111457. }
  111458. // IfNoneMatch sets the optional parameter which makes the operation
  111459. // fail if the object's ETag matches the given value. This is useful for
  111460. // getting updates only after the object has changed since the last
  111461. // request. Use googleapi.IsNotModified to check whether the response
  111462. // error from Do is the result of In-None-Match.
  111463. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  111464. c.ifNoneMatch_ = entityTag
  111465. return c
  111466. }
  111467. // Context sets the context to be used in this call's Do method. Any
  111468. // pending HTTP request will be aborted if the provided context is
  111469. // canceled.
  111470. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  111471. c.ctx_ = ctx
  111472. return c
  111473. }
  111474. // Header returns an http.Header that can be modified by the caller to
  111475. // add HTTP headers to the request.
  111476. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  111477. if c.header_ == nil {
  111478. c.header_ = make(http.Header)
  111479. }
  111480. return c.header_
  111481. }
  111482. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  111483. reqHeaders := make(http.Header)
  111484. for k, v := range c.header_ {
  111485. reqHeaders[k] = v
  111486. }
  111487. reqHeaders.Set("User-Agent", c.s.userAgent())
  111488. if c.ifNoneMatch_ != "" {
  111489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111490. }
  111491. var body io.Reader = nil
  111492. c.urlParams_.Set("alt", alt)
  111493. c.urlParams_.Set("prettyPrint", "false")
  111494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  111495. urls += "?" + c.urlParams_.Encode()
  111496. req, err := http.NewRequest("GET", urls, body)
  111497. if err != nil {
  111498. return nil, err
  111499. }
  111500. req.Header = reqHeaders
  111501. googleapi.Expand(req.URL, map[string]string{
  111502. "project": c.project,
  111503. "region": c.region,
  111504. "router": c.router,
  111505. })
  111506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111507. }
  111508. // Do executes the "compute.routers.getRouterStatus" call.
  111509. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  111510. // non-2xx status code is an error. Response headers are in either
  111511. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  111512. // returned at all) in error.(*googleapi.Error).Header. Use
  111513. // googleapi.IsNotModified to check whether the returned error was
  111514. // because http.StatusNotModified was returned.
  111515. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  111516. gensupport.SetOptions(c.urlParams_, opts...)
  111517. res, err := c.doRequest("json")
  111518. if res != nil && res.StatusCode == http.StatusNotModified {
  111519. if res.Body != nil {
  111520. res.Body.Close()
  111521. }
  111522. return nil, &googleapi.Error{
  111523. Code: res.StatusCode,
  111524. Header: res.Header,
  111525. }
  111526. }
  111527. if err != nil {
  111528. return nil, err
  111529. }
  111530. defer googleapi.CloseBody(res)
  111531. if err := googleapi.CheckResponse(res); err != nil {
  111532. return nil, err
  111533. }
  111534. ret := &RouterStatusResponse{
  111535. ServerResponse: googleapi.ServerResponse{
  111536. Header: res.Header,
  111537. HTTPStatusCode: res.StatusCode,
  111538. },
  111539. }
  111540. target := &ret
  111541. if err := gensupport.DecodeResponse(target, res); err != nil {
  111542. return nil, err
  111543. }
  111544. return ret, nil
  111545. // {
  111546. // "description": "Retrieves runtime information of the specified router.",
  111547. // "httpMethod": "GET",
  111548. // "id": "compute.routers.getRouterStatus",
  111549. // "parameterOrder": [
  111550. // "project",
  111551. // "region",
  111552. // "router"
  111553. // ],
  111554. // "parameters": {
  111555. // "project": {
  111556. // "description": "Project ID for this request.",
  111557. // "location": "path",
  111558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111559. // "required": true,
  111560. // "type": "string"
  111561. // },
  111562. // "region": {
  111563. // "description": "Name of the region for this request.",
  111564. // "location": "path",
  111565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111566. // "required": true,
  111567. // "type": "string"
  111568. // },
  111569. // "router": {
  111570. // "description": "Name of the Router resource to query.",
  111571. // "location": "path",
  111572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111573. // "required": true,
  111574. // "type": "string"
  111575. // }
  111576. // },
  111577. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  111578. // "response": {
  111579. // "$ref": "RouterStatusResponse"
  111580. // },
  111581. // "scopes": [
  111582. // "https://www.googleapis.com/auth/cloud-platform",
  111583. // "https://www.googleapis.com/auth/compute",
  111584. // "https://www.googleapis.com/auth/compute.readonly"
  111585. // ]
  111586. // }
  111587. }
  111588. // method id "compute.routers.insert":
  111589. type RoutersInsertCall struct {
  111590. s *Service
  111591. project string
  111592. region string
  111593. router *Router
  111594. urlParams_ gensupport.URLParams
  111595. ctx_ context.Context
  111596. header_ http.Header
  111597. }
  111598. // Insert: Creates a Router resource in the specified project and region
  111599. // using the data included in the request.
  111600. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  111601. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111602. c.project = project
  111603. c.region = region
  111604. c.router = router
  111605. return c
  111606. }
  111607. // RequestId sets the optional parameter "requestId": An optional
  111608. // request ID to identify requests. Specify a unique request ID so that
  111609. // if you must retry your request, the server will know to ignore the
  111610. // request if it has already been completed.
  111611. //
  111612. // For example, consider a situation where you make an initial request
  111613. // and the request times out. If you make the request again with the
  111614. // same request ID, the server can check if original operation with the
  111615. // same request ID was received, and if so, will ignore the second
  111616. // request. This prevents clients from accidentally creating duplicate
  111617. // commitments.
  111618. //
  111619. // The request ID must be a valid UUID with the exception that zero UUID
  111620. // is not supported (00000000-0000-0000-0000-000000000000).
  111621. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  111622. c.urlParams_.Set("requestId", requestId)
  111623. return c
  111624. }
  111625. // Fields allows partial responses to be retrieved. See
  111626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111627. // for more information.
  111628. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  111629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111630. return c
  111631. }
  111632. // Context sets the context to be used in this call's Do method. Any
  111633. // pending HTTP request will be aborted if the provided context is
  111634. // canceled.
  111635. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  111636. c.ctx_ = ctx
  111637. return c
  111638. }
  111639. // Header returns an http.Header that can be modified by the caller to
  111640. // add HTTP headers to the request.
  111641. func (c *RoutersInsertCall) Header() http.Header {
  111642. if c.header_ == nil {
  111643. c.header_ = make(http.Header)
  111644. }
  111645. return c.header_
  111646. }
  111647. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  111648. reqHeaders := make(http.Header)
  111649. for k, v := range c.header_ {
  111650. reqHeaders[k] = v
  111651. }
  111652. reqHeaders.Set("User-Agent", c.s.userAgent())
  111653. var body io.Reader = nil
  111654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  111655. if err != nil {
  111656. return nil, err
  111657. }
  111658. reqHeaders.Set("Content-Type", "application/json")
  111659. c.urlParams_.Set("alt", alt)
  111660. c.urlParams_.Set("prettyPrint", "false")
  111661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  111662. urls += "?" + c.urlParams_.Encode()
  111663. req, err := http.NewRequest("POST", urls, body)
  111664. if err != nil {
  111665. return nil, err
  111666. }
  111667. req.Header = reqHeaders
  111668. googleapi.Expand(req.URL, map[string]string{
  111669. "project": c.project,
  111670. "region": c.region,
  111671. })
  111672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111673. }
  111674. // Do executes the "compute.routers.insert" call.
  111675. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111676. // status code is an error. Response headers are in either
  111677. // *Operation.ServerResponse.Header or (if a response was returned at
  111678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111679. // to check whether the returned error was because
  111680. // http.StatusNotModified was returned.
  111681. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111682. gensupport.SetOptions(c.urlParams_, opts...)
  111683. res, err := c.doRequest("json")
  111684. if res != nil && res.StatusCode == http.StatusNotModified {
  111685. if res.Body != nil {
  111686. res.Body.Close()
  111687. }
  111688. return nil, &googleapi.Error{
  111689. Code: res.StatusCode,
  111690. Header: res.Header,
  111691. }
  111692. }
  111693. if err != nil {
  111694. return nil, err
  111695. }
  111696. defer googleapi.CloseBody(res)
  111697. if err := googleapi.CheckResponse(res); err != nil {
  111698. return nil, err
  111699. }
  111700. ret := &Operation{
  111701. ServerResponse: googleapi.ServerResponse{
  111702. Header: res.Header,
  111703. HTTPStatusCode: res.StatusCode,
  111704. },
  111705. }
  111706. target := &ret
  111707. if err := gensupport.DecodeResponse(target, res); err != nil {
  111708. return nil, err
  111709. }
  111710. return ret, nil
  111711. // {
  111712. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  111713. // "httpMethod": "POST",
  111714. // "id": "compute.routers.insert",
  111715. // "parameterOrder": [
  111716. // "project",
  111717. // "region"
  111718. // ],
  111719. // "parameters": {
  111720. // "project": {
  111721. // "description": "Project ID for this request.",
  111722. // "location": "path",
  111723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111724. // "required": true,
  111725. // "type": "string"
  111726. // },
  111727. // "region": {
  111728. // "description": "Name of the region for this request.",
  111729. // "location": "path",
  111730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111731. // "required": true,
  111732. // "type": "string"
  111733. // },
  111734. // "requestId": {
  111735. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111736. // "location": "query",
  111737. // "type": "string"
  111738. // }
  111739. // },
  111740. // "path": "{project}/regions/{region}/routers",
  111741. // "request": {
  111742. // "$ref": "Router"
  111743. // },
  111744. // "response": {
  111745. // "$ref": "Operation"
  111746. // },
  111747. // "scopes": [
  111748. // "https://www.googleapis.com/auth/cloud-platform",
  111749. // "https://www.googleapis.com/auth/compute"
  111750. // ]
  111751. // }
  111752. }
  111753. // method id "compute.routers.list":
  111754. type RoutersListCall struct {
  111755. s *Service
  111756. project string
  111757. region string
  111758. urlParams_ gensupport.URLParams
  111759. ifNoneMatch_ string
  111760. ctx_ context.Context
  111761. header_ http.Header
  111762. }
  111763. // List: Retrieves a list of Router resources available to the specified
  111764. // project.
  111765. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  111766. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111767. c.project = project
  111768. c.region = region
  111769. return c
  111770. }
  111771. // Filter sets the optional parameter "filter": A filter expression that
  111772. // filters resources listed in the response. The expression must specify
  111773. // the field name, a comparison operator, and the value that you want to
  111774. // use for filtering. The value must be a string, a number, or a
  111775. // boolean. The comparison operator must be either =, !=, >, or <.
  111776. //
  111777. // For example, if you are filtering Compute Engine instances, you can
  111778. // exclude instances named example-instance by specifying name !=
  111779. // example-instance.
  111780. //
  111781. // You can also filter nested fields. For example, you could specify
  111782. // scheduling.automaticRestart = false to include instances only if they
  111783. // are not scheduled for automatic restarts. You can use filtering on
  111784. // nested fields to filter based on resource labels.
  111785. //
  111786. // To filter on multiple expressions, provide each separate expression
  111787. // within parentheses. For example, (scheduling.automaticRestart = true)
  111788. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111789. // AND expression. However, you can include AND and OR expressions
  111790. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111791. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111792. // true).
  111793. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  111794. c.urlParams_.Set("filter", filter)
  111795. return c
  111796. }
  111797. // MaxResults sets the optional parameter "maxResults": The maximum
  111798. // number of results per page that should be returned. If the number of
  111799. // available results is larger than maxResults, Compute Engine returns a
  111800. // nextPageToken that can be used to get the next page of results in
  111801. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111802. // (Default: 500)
  111803. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  111804. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111805. return c
  111806. }
  111807. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111808. // a certain order. By default, results are returned in alphanumerical
  111809. // order based on the resource name.
  111810. //
  111811. // You can also sort results in descending order based on the creation
  111812. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111813. // based on the creationTimestamp field in reverse chronological order
  111814. // (newest result first). Use this to sort resources like operations so
  111815. // that the newest operation is returned first.
  111816. //
  111817. // Currently, only sorting by name or creationTimestamp desc is
  111818. // supported.
  111819. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  111820. c.urlParams_.Set("orderBy", orderBy)
  111821. return c
  111822. }
  111823. // PageToken sets the optional parameter "pageToken": Specifies a page
  111824. // token to use. Set pageToken to the nextPageToken returned by a
  111825. // previous list request to get the next page of results.
  111826. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  111827. c.urlParams_.Set("pageToken", pageToken)
  111828. return c
  111829. }
  111830. // Fields allows partial responses to be retrieved. See
  111831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111832. // for more information.
  111833. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  111834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111835. return c
  111836. }
  111837. // IfNoneMatch sets the optional parameter which makes the operation
  111838. // fail if the object's ETag matches the given value. This is useful for
  111839. // getting updates only after the object has changed since the last
  111840. // request. Use googleapi.IsNotModified to check whether the response
  111841. // error from Do is the result of In-None-Match.
  111842. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  111843. c.ifNoneMatch_ = entityTag
  111844. return c
  111845. }
  111846. // Context sets the context to be used in this call's Do method. Any
  111847. // pending HTTP request will be aborted if the provided context is
  111848. // canceled.
  111849. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  111850. c.ctx_ = ctx
  111851. return c
  111852. }
  111853. // Header returns an http.Header that can be modified by the caller to
  111854. // add HTTP headers to the request.
  111855. func (c *RoutersListCall) Header() http.Header {
  111856. if c.header_ == nil {
  111857. c.header_ = make(http.Header)
  111858. }
  111859. return c.header_
  111860. }
  111861. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  111862. reqHeaders := make(http.Header)
  111863. for k, v := range c.header_ {
  111864. reqHeaders[k] = v
  111865. }
  111866. reqHeaders.Set("User-Agent", c.s.userAgent())
  111867. if c.ifNoneMatch_ != "" {
  111868. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111869. }
  111870. var body io.Reader = nil
  111871. c.urlParams_.Set("alt", alt)
  111872. c.urlParams_.Set("prettyPrint", "false")
  111873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  111874. urls += "?" + c.urlParams_.Encode()
  111875. req, err := http.NewRequest("GET", urls, body)
  111876. if err != nil {
  111877. return nil, err
  111878. }
  111879. req.Header = reqHeaders
  111880. googleapi.Expand(req.URL, map[string]string{
  111881. "project": c.project,
  111882. "region": c.region,
  111883. })
  111884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111885. }
  111886. // Do executes the "compute.routers.list" call.
  111887. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  111888. // status code is an error. Response headers are in either
  111889. // *RouterList.ServerResponse.Header or (if a response was returned at
  111890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111891. // to check whether the returned error was because
  111892. // http.StatusNotModified was returned.
  111893. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  111894. gensupport.SetOptions(c.urlParams_, opts...)
  111895. res, err := c.doRequest("json")
  111896. if res != nil && res.StatusCode == http.StatusNotModified {
  111897. if res.Body != nil {
  111898. res.Body.Close()
  111899. }
  111900. return nil, &googleapi.Error{
  111901. Code: res.StatusCode,
  111902. Header: res.Header,
  111903. }
  111904. }
  111905. if err != nil {
  111906. return nil, err
  111907. }
  111908. defer googleapi.CloseBody(res)
  111909. if err := googleapi.CheckResponse(res); err != nil {
  111910. return nil, err
  111911. }
  111912. ret := &RouterList{
  111913. ServerResponse: googleapi.ServerResponse{
  111914. Header: res.Header,
  111915. HTTPStatusCode: res.StatusCode,
  111916. },
  111917. }
  111918. target := &ret
  111919. if err := gensupport.DecodeResponse(target, res); err != nil {
  111920. return nil, err
  111921. }
  111922. return ret, nil
  111923. // {
  111924. // "description": "Retrieves a list of Router resources available to the specified project.",
  111925. // "httpMethod": "GET",
  111926. // "id": "compute.routers.list",
  111927. // "parameterOrder": [
  111928. // "project",
  111929. // "region"
  111930. // ],
  111931. // "parameters": {
  111932. // "filter": {
  111933. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  111934. // "location": "query",
  111935. // "type": "string"
  111936. // },
  111937. // "maxResults": {
  111938. // "default": "500",
  111939. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  111940. // "format": "uint32",
  111941. // "location": "query",
  111942. // "minimum": "0",
  111943. // "type": "integer"
  111944. // },
  111945. // "orderBy": {
  111946. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  111947. // "location": "query",
  111948. // "type": "string"
  111949. // },
  111950. // "pageToken": {
  111951. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  111952. // "location": "query",
  111953. // "type": "string"
  111954. // },
  111955. // "project": {
  111956. // "description": "Project ID for this request.",
  111957. // "location": "path",
  111958. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111959. // "required": true,
  111960. // "type": "string"
  111961. // },
  111962. // "region": {
  111963. // "description": "Name of the region for this request.",
  111964. // "location": "path",
  111965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111966. // "required": true,
  111967. // "type": "string"
  111968. // }
  111969. // },
  111970. // "path": "{project}/regions/{region}/routers",
  111971. // "response": {
  111972. // "$ref": "RouterList"
  111973. // },
  111974. // "scopes": [
  111975. // "https://www.googleapis.com/auth/cloud-platform",
  111976. // "https://www.googleapis.com/auth/compute",
  111977. // "https://www.googleapis.com/auth/compute.readonly"
  111978. // ]
  111979. // }
  111980. }
  111981. // Pages invokes f for each page of results.
  111982. // A non-nil error returned from f will halt the iteration.
  111983. // The provided context supersedes any context provided to the Context method.
  111984. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  111985. c.ctx_ = ctx
  111986. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111987. for {
  111988. x, err := c.Do()
  111989. if err != nil {
  111990. return err
  111991. }
  111992. if err := f(x); err != nil {
  111993. return err
  111994. }
  111995. if x.NextPageToken == "" {
  111996. return nil
  111997. }
  111998. c.PageToken(x.NextPageToken)
  111999. }
  112000. }
  112001. // method id "compute.routers.patch":
  112002. type RoutersPatchCall struct {
  112003. s *Service
  112004. project string
  112005. region string
  112006. router string
  112007. router2 *Router
  112008. urlParams_ gensupport.URLParams
  112009. ctx_ context.Context
  112010. header_ http.Header
  112011. }
  112012. // Patch: Patches the specified Router resource with the data included
  112013. // in the request. This method supports PATCH semantics and uses JSON
  112014. // merge patch format and processing rules.
  112015. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  112016. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112017. c.project = project
  112018. c.region = region
  112019. c.router = router
  112020. c.router2 = router2
  112021. return c
  112022. }
  112023. // RequestId sets the optional parameter "requestId": An optional
  112024. // request ID to identify requests. Specify a unique request ID so that
  112025. // if you must retry your request, the server will know to ignore the
  112026. // request if it has already been completed.
  112027. //
  112028. // For example, consider a situation where you make an initial request
  112029. // and the request times out. If you make the request again with the
  112030. // same request ID, the server can check if original operation with the
  112031. // same request ID was received, and if so, will ignore the second
  112032. // request. This prevents clients from accidentally creating duplicate
  112033. // commitments.
  112034. //
  112035. // The request ID must be a valid UUID with the exception that zero UUID
  112036. // is not supported (00000000-0000-0000-0000-000000000000).
  112037. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  112038. c.urlParams_.Set("requestId", requestId)
  112039. return c
  112040. }
  112041. // Fields allows partial responses to be retrieved. See
  112042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112043. // for more information.
  112044. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  112045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112046. return c
  112047. }
  112048. // Context sets the context to be used in this call's Do method. Any
  112049. // pending HTTP request will be aborted if the provided context is
  112050. // canceled.
  112051. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  112052. c.ctx_ = ctx
  112053. return c
  112054. }
  112055. // Header returns an http.Header that can be modified by the caller to
  112056. // add HTTP headers to the request.
  112057. func (c *RoutersPatchCall) Header() http.Header {
  112058. if c.header_ == nil {
  112059. c.header_ = make(http.Header)
  112060. }
  112061. return c.header_
  112062. }
  112063. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  112064. reqHeaders := make(http.Header)
  112065. for k, v := range c.header_ {
  112066. reqHeaders[k] = v
  112067. }
  112068. reqHeaders.Set("User-Agent", c.s.userAgent())
  112069. var body io.Reader = nil
  112070. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  112071. if err != nil {
  112072. return nil, err
  112073. }
  112074. reqHeaders.Set("Content-Type", "application/json")
  112075. c.urlParams_.Set("alt", alt)
  112076. c.urlParams_.Set("prettyPrint", "false")
  112077. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  112078. urls += "?" + c.urlParams_.Encode()
  112079. req, err := http.NewRequest("PATCH", urls, body)
  112080. if err != nil {
  112081. return nil, err
  112082. }
  112083. req.Header = reqHeaders
  112084. googleapi.Expand(req.URL, map[string]string{
  112085. "project": c.project,
  112086. "region": c.region,
  112087. "router": c.router,
  112088. })
  112089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112090. }
  112091. // Do executes the "compute.routers.patch" call.
  112092. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112093. // status code is an error. Response headers are in either
  112094. // *Operation.ServerResponse.Header or (if a response was returned at
  112095. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112096. // to check whether the returned error was because
  112097. // http.StatusNotModified was returned.
  112098. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112099. gensupport.SetOptions(c.urlParams_, opts...)
  112100. res, err := c.doRequest("json")
  112101. if res != nil && res.StatusCode == http.StatusNotModified {
  112102. if res.Body != nil {
  112103. res.Body.Close()
  112104. }
  112105. return nil, &googleapi.Error{
  112106. Code: res.StatusCode,
  112107. Header: res.Header,
  112108. }
  112109. }
  112110. if err != nil {
  112111. return nil, err
  112112. }
  112113. defer googleapi.CloseBody(res)
  112114. if err := googleapi.CheckResponse(res); err != nil {
  112115. return nil, err
  112116. }
  112117. ret := &Operation{
  112118. ServerResponse: googleapi.ServerResponse{
  112119. Header: res.Header,
  112120. HTTPStatusCode: res.StatusCode,
  112121. },
  112122. }
  112123. target := &ret
  112124. if err := gensupport.DecodeResponse(target, res); err != nil {
  112125. return nil, err
  112126. }
  112127. return ret, nil
  112128. // {
  112129. // "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.",
  112130. // "httpMethod": "PATCH",
  112131. // "id": "compute.routers.patch",
  112132. // "parameterOrder": [
  112133. // "project",
  112134. // "region",
  112135. // "router"
  112136. // ],
  112137. // "parameters": {
  112138. // "project": {
  112139. // "description": "Project ID for this request.",
  112140. // "location": "path",
  112141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112142. // "required": true,
  112143. // "type": "string"
  112144. // },
  112145. // "region": {
  112146. // "description": "Name of the region for this request.",
  112147. // "location": "path",
  112148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112149. // "required": true,
  112150. // "type": "string"
  112151. // },
  112152. // "requestId": {
  112153. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112154. // "location": "query",
  112155. // "type": "string"
  112156. // },
  112157. // "router": {
  112158. // "description": "Name of the Router resource to patch.",
  112159. // "location": "path",
  112160. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112161. // "required": true,
  112162. // "type": "string"
  112163. // }
  112164. // },
  112165. // "path": "{project}/regions/{region}/routers/{router}",
  112166. // "request": {
  112167. // "$ref": "Router"
  112168. // },
  112169. // "response": {
  112170. // "$ref": "Operation"
  112171. // },
  112172. // "scopes": [
  112173. // "https://www.googleapis.com/auth/cloud-platform",
  112174. // "https://www.googleapis.com/auth/compute"
  112175. // ]
  112176. // }
  112177. }
  112178. // method id "compute.routers.preview":
  112179. type RoutersPreviewCall struct {
  112180. s *Service
  112181. project string
  112182. region string
  112183. router string
  112184. router2 *Router
  112185. urlParams_ gensupport.URLParams
  112186. ctx_ context.Context
  112187. header_ http.Header
  112188. }
  112189. // Preview: Preview fields auto-generated during router create and
  112190. // update operations. Calling this method does NOT create or update the
  112191. // router.
  112192. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  112193. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112194. c.project = project
  112195. c.region = region
  112196. c.router = router
  112197. c.router2 = router2
  112198. return c
  112199. }
  112200. // Fields allows partial responses to be retrieved. See
  112201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112202. // for more information.
  112203. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  112204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112205. return c
  112206. }
  112207. // Context sets the context to be used in this call's Do method. Any
  112208. // pending HTTP request will be aborted if the provided context is
  112209. // canceled.
  112210. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  112211. c.ctx_ = ctx
  112212. return c
  112213. }
  112214. // Header returns an http.Header that can be modified by the caller to
  112215. // add HTTP headers to the request.
  112216. func (c *RoutersPreviewCall) Header() http.Header {
  112217. if c.header_ == nil {
  112218. c.header_ = make(http.Header)
  112219. }
  112220. return c.header_
  112221. }
  112222. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  112223. reqHeaders := make(http.Header)
  112224. for k, v := range c.header_ {
  112225. reqHeaders[k] = v
  112226. }
  112227. reqHeaders.Set("User-Agent", c.s.userAgent())
  112228. var body io.Reader = nil
  112229. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  112230. if err != nil {
  112231. return nil, err
  112232. }
  112233. reqHeaders.Set("Content-Type", "application/json")
  112234. c.urlParams_.Set("alt", alt)
  112235. c.urlParams_.Set("prettyPrint", "false")
  112236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  112237. urls += "?" + c.urlParams_.Encode()
  112238. req, err := http.NewRequest("POST", urls, body)
  112239. if err != nil {
  112240. return nil, err
  112241. }
  112242. req.Header = reqHeaders
  112243. googleapi.Expand(req.URL, map[string]string{
  112244. "project": c.project,
  112245. "region": c.region,
  112246. "router": c.router,
  112247. })
  112248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112249. }
  112250. // Do executes the "compute.routers.preview" call.
  112251. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  112252. // non-2xx status code is an error. Response headers are in either
  112253. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  112254. // returned at all) in error.(*googleapi.Error).Header. Use
  112255. // googleapi.IsNotModified to check whether the returned error was
  112256. // because http.StatusNotModified was returned.
  112257. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  112258. gensupport.SetOptions(c.urlParams_, opts...)
  112259. res, err := c.doRequest("json")
  112260. if res != nil && res.StatusCode == http.StatusNotModified {
  112261. if res.Body != nil {
  112262. res.Body.Close()
  112263. }
  112264. return nil, &googleapi.Error{
  112265. Code: res.StatusCode,
  112266. Header: res.Header,
  112267. }
  112268. }
  112269. if err != nil {
  112270. return nil, err
  112271. }
  112272. defer googleapi.CloseBody(res)
  112273. if err := googleapi.CheckResponse(res); err != nil {
  112274. return nil, err
  112275. }
  112276. ret := &RoutersPreviewResponse{
  112277. ServerResponse: googleapi.ServerResponse{
  112278. Header: res.Header,
  112279. HTTPStatusCode: res.StatusCode,
  112280. },
  112281. }
  112282. target := &ret
  112283. if err := gensupport.DecodeResponse(target, res); err != nil {
  112284. return nil, err
  112285. }
  112286. return ret, nil
  112287. // {
  112288. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  112289. // "httpMethod": "POST",
  112290. // "id": "compute.routers.preview",
  112291. // "parameterOrder": [
  112292. // "project",
  112293. // "region",
  112294. // "router"
  112295. // ],
  112296. // "parameters": {
  112297. // "project": {
  112298. // "description": "Project ID for this request.",
  112299. // "location": "path",
  112300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112301. // "required": true,
  112302. // "type": "string"
  112303. // },
  112304. // "region": {
  112305. // "description": "Name of the region for this request.",
  112306. // "location": "path",
  112307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112308. // "required": true,
  112309. // "type": "string"
  112310. // },
  112311. // "router": {
  112312. // "description": "Name of the Router resource to query.",
  112313. // "location": "path",
  112314. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112315. // "required": true,
  112316. // "type": "string"
  112317. // }
  112318. // },
  112319. // "path": "{project}/regions/{region}/routers/{router}/preview",
  112320. // "request": {
  112321. // "$ref": "Router"
  112322. // },
  112323. // "response": {
  112324. // "$ref": "RoutersPreviewResponse"
  112325. // },
  112326. // "scopes": [
  112327. // "https://www.googleapis.com/auth/cloud-platform",
  112328. // "https://www.googleapis.com/auth/compute",
  112329. // "https://www.googleapis.com/auth/compute.readonly"
  112330. // ]
  112331. // }
  112332. }
  112333. // method id "compute.routers.testIamPermissions":
  112334. type RoutersTestIamPermissionsCall struct {
  112335. s *Service
  112336. project string
  112337. region string
  112338. resource string
  112339. testpermissionsrequest *TestPermissionsRequest
  112340. urlParams_ gensupport.URLParams
  112341. ctx_ context.Context
  112342. header_ http.Header
  112343. }
  112344. // TestIamPermissions: Returns permissions that a caller has on the
  112345. // specified resource.
  112346. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  112347. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112348. c.project = project
  112349. c.region = region
  112350. c.resource = resource
  112351. c.testpermissionsrequest = testpermissionsrequest
  112352. return c
  112353. }
  112354. // Fields allows partial responses to be retrieved. See
  112355. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112356. // for more information.
  112357. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  112358. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112359. return c
  112360. }
  112361. // Context sets the context to be used in this call's Do method. Any
  112362. // pending HTTP request will be aborted if the provided context is
  112363. // canceled.
  112364. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  112365. c.ctx_ = ctx
  112366. return c
  112367. }
  112368. // Header returns an http.Header that can be modified by the caller to
  112369. // add HTTP headers to the request.
  112370. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  112371. if c.header_ == nil {
  112372. c.header_ = make(http.Header)
  112373. }
  112374. return c.header_
  112375. }
  112376. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  112377. reqHeaders := make(http.Header)
  112378. for k, v := range c.header_ {
  112379. reqHeaders[k] = v
  112380. }
  112381. reqHeaders.Set("User-Agent", c.s.userAgent())
  112382. var body io.Reader = nil
  112383. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  112384. if err != nil {
  112385. return nil, err
  112386. }
  112387. reqHeaders.Set("Content-Type", "application/json")
  112388. c.urlParams_.Set("alt", alt)
  112389. c.urlParams_.Set("prettyPrint", "false")
  112390. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  112391. urls += "?" + c.urlParams_.Encode()
  112392. req, err := http.NewRequest("POST", urls, body)
  112393. if err != nil {
  112394. return nil, err
  112395. }
  112396. req.Header = reqHeaders
  112397. googleapi.Expand(req.URL, map[string]string{
  112398. "project": c.project,
  112399. "region": c.region,
  112400. "resource": c.resource,
  112401. })
  112402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112403. }
  112404. // Do executes the "compute.routers.testIamPermissions" call.
  112405. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  112406. // non-2xx status code is an error. Response headers are in either
  112407. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  112408. // returned at all) in error.(*googleapi.Error).Header. Use
  112409. // googleapi.IsNotModified to check whether the returned error was
  112410. // because http.StatusNotModified was returned.
  112411. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  112412. gensupport.SetOptions(c.urlParams_, opts...)
  112413. res, err := c.doRequest("json")
  112414. if res != nil && res.StatusCode == http.StatusNotModified {
  112415. if res.Body != nil {
  112416. res.Body.Close()
  112417. }
  112418. return nil, &googleapi.Error{
  112419. Code: res.StatusCode,
  112420. Header: res.Header,
  112421. }
  112422. }
  112423. if err != nil {
  112424. return nil, err
  112425. }
  112426. defer googleapi.CloseBody(res)
  112427. if err := googleapi.CheckResponse(res); err != nil {
  112428. return nil, err
  112429. }
  112430. ret := &TestPermissionsResponse{
  112431. ServerResponse: googleapi.ServerResponse{
  112432. Header: res.Header,
  112433. HTTPStatusCode: res.StatusCode,
  112434. },
  112435. }
  112436. target := &ret
  112437. if err := gensupport.DecodeResponse(target, res); err != nil {
  112438. return nil, err
  112439. }
  112440. return ret, nil
  112441. // {
  112442. // "description": "Returns permissions that a caller has on the specified resource.",
  112443. // "httpMethod": "POST",
  112444. // "id": "compute.routers.testIamPermissions",
  112445. // "parameterOrder": [
  112446. // "project",
  112447. // "region",
  112448. // "resource"
  112449. // ],
  112450. // "parameters": {
  112451. // "project": {
  112452. // "description": "Project ID for this request.",
  112453. // "location": "path",
  112454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112455. // "required": true,
  112456. // "type": "string"
  112457. // },
  112458. // "region": {
  112459. // "description": "The name of the region for this request.",
  112460. // "location": "path",
  112461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112462. // "required": true,
  112463. // "type": "string"
  112464. // },
  112465. // "resource": {
  112466. // "description": "Name or id of the resource for this request.",
  112467. // "location": "path",
  112468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112469. // "required": true,
  112470. // "type": "string"
  112471. // }
  112472. // },
  112473. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  112474. // "request": {
  112475. // "$ref": "TestPermissionsRequest"
  112476. // },
  112477. // "response": {
  112478. // "$ref": "TestPermissionsResponse"
  112479. // },
  112480. // "scopes": [
  112481. // "https://www.googleapis.com/auth/cloud-platform",
  112482. // "https://www.googleapis.com/auth/compute",
  112483. // "https://www.googleapis.com/auth/compute.readonly"
  112484. // ]
  112485. // }
  112486. }
  112487. // method id "compute.routers.update":
  112488. type RoutersUpdateCall struct {
  112489. s *Service
  112490. project string
  112491. region string
  112492. router string
  112493. router2 *Router
  112494. urlParams_ gensupport.URLParams
  112495. ctx_ context.Context
  112496. header_ http.Header
  112497. }
  112498. // Update: Updates the specified Router resource with the data included
  112499. // in the request.
  112500. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  112501. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112502. c.project = project
  112503. c.region = region
  112504. c.router = router
  112505. c.router2 = router2
  112506. return c
  112507. }
  112508. // RequestId sets the optional parameter "requestId": An optional
  112509. // request ID to identify requests. Specify a unique request ID so that
  112510. // if you must retry your request, the server will know to ignore the
  112511. // request if it has already been completed.
  112512. //
  112513. // For example, consider a situation where you make an initial request
  112514. // and the request times out. If you make the request again with the
  112515. // same request ID, the server can check if original operation with the
  112516. // same request ID was received, and if so, will ignore the second
  112517. // request. This prevents clients from accidentally creating duplicate
  112518. // commitments.
  112519. //
  112520. // The request ID must be a valid UUID with the exception that zero UUID
  112521. // is not supported (00000000-0000-0000-0000-000000000000).
  112522. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  112523. c.urlParams_.Set("requestId", requestId)
  112524. return c
  112525. }
  112526. // Fields allows partial responses to be retrieved. See
  112527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112528. // for more information.
  112529. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  112530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112531. return c
  112532. }
  112533. // Context sets the context to be used in this call's Do method. Any
  112534. // pending HTTP request will be aborted if the provided context is
  112535. // canceled.
  112536. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  112537. c.ctx_ = ctx
  112538. return c
  112539. }
  112540. // Header returns an http.Header that can be modified by the caller to
  112541. // add HTTP headers to the request.
  112542. func (c *RoutersUpdateCall) Header() http.Header {
  112543. if c.header_ == nil {
  112544. c.header_ = make(http.Header)
  112545. }
  112546. return c.header_
  112547. }
  112548. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  112549. reqHeaders := make(http.Header)
  112550. for k, v := range c.header_ {
  112551. reqHeaders[k] = v
  112552. }
  112553. reqHeaders.Set("User-Agent", c.s.userAgent())
  112554. var body io.Reader = nil
  112555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  112556. if err != nil {
  112557. return nil, err
  112558. }
  112559. reqHeaders.Set("Content-Type", "application/json")
  112560. c.urlParams_.Set("alt", alt)
  112561. c.urlParams_.Set("prettyPrint", "false")
  112562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  112563. urls += "?" + c.urlParams_.Encode()
  112564. req, err := http.NewRequest("PUT", urls, body)
  112565. if err != nil {
  112566. return nil, err
  112567. }
  112568. req.Header = reqHeaders
  112569. googleapi.Expand(req.URL, map[string]string{
  112570. "project": c.project,
  112571. "region": c.region,
  112572. "router": c.router,
  112573. })
  112574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112575. }
  112576. // Do executes the "compute.routers.update" call.
  112577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112578. // status code is an error. Response headers are in either
  112579. // *Operation.ServerResponse.Header or (if a response was returned at
  112580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112581. // to check whether the returned error was because
  112582. // http.StatusNotModified was returned.
  112583. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112584. gensupport.SetOptions(c.urlParams_, opts...)
  112585. res, err := c.doRequest("json")
  112586. if res != nil && res.StatusCode == http.StatusNotModified {
  112587. if res.Body != nil {
  112588. res.Body.Close()
  112589. }
  112590. return nil, &googleapi.Error{
  112591. Code: res.StatusCode,
  112592. Header: res.Header,
  112593. }
  112594. }
  112595. if err != nil {
  112596. return nil, err
  112597. }
  112598. defer googleapi.CloseBody(res)
  112599. if err := googleapi.CheckResponse(res); err != nil {
  112600. return nil, err
  112601. }
  112602. ret := &Operation{
  112603. ServerResponse: googleapi.ServerResponse{
  112604. Header: res.Header,
  112605. HTTPStatusCode: res.StatusCode,
  112606. },
  112607. }
  112608. target := &ret
  112609. if err := gensupport.DecodeResponse(target, res); err != nil {
  112610. return nil, err
  112611. }
  112612. return ret, nil
  112613. // {
  112614. // "description": "Updates the specified Router resource with the data included in the request.",
  112615. // "httpMethod": "PUT",
  112616. // "id": "compute.routers.update",
  112617. // "parameterOrder": [
  112618. // "project",
  112619. // "region",
  112620. // "router"
  112621. // ],
  112622. // "parameters": {
  112623. // "project": {
  112624. // "description": "Project ID for this request.",
  112625. // "location": "path",
  112626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112627. // "required": true,
  112628. // "type": "string"
  112629. // },
  112630. // "region": {
  112631. // "description": "Name of the region for this request.",
  112632. // "location": "path",
  112633. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112634. // "required": true,
  112635. // "type": "string"
  112636. // },
  112637. // "requestId": {
  112638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112639. // "location": "query",
  112640. // "type": "string"
  112641. // },
  112642. // "router": {
  112643. // "description": "Name of the Router resource to update.",
  112644. // "location": "path",
  112645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112646. // "required": true,
  112647. // "type": "string"
  112648. // }
  112649. // },
  112650. // "path": "{project}/regions/{region}/routers/{router}",
  112651. // "request": {
  112652. // "$ref": "Router"
  112653. // },
  112654. // "response": {
  112655. // "$ref": "Operation"
  112656. // },
  112657. // "scopes": [
  112658. // "https://www.googleapis.com/auth/cloud-platform",
  112659. // "https://www.googleapis.com/auth/compute"
  112660. // ]
  112661. // }
  112662. }
  112663. // method id "compute.routes.delete":
  112664. type RoutesDeleteCall struct {
  112665. s *Service
  112666. project string
  112667. route string
  112668. urlParams_ gensupport.URLParams
  112669. ctx_ context.Context
  112670. header_ http.Header
  112671. }
  112672. // Delete: Deletes the specified Route resource.
  112673. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  112674. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  112675. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112676. c.project = project
  112677. c.route = route
  112678. return c
  112679. }
  112680. // RequestId sets the optional parameter "requestId": An optional
  112681. // request ID to identify requests. Specify a unique request ID so that
  112682. // if you must retry your request, the server will know to ignore the
  112683. // request if it has already been completed.
  112684. //
  112685. // For example, consider a situation where you make an initial request
  112686. // and the request times out. If you make the request again with the
  112687. // same request ID, the server can check if original operation with the
  112688. // same request ID was received, and if so, will ignore the second
  112689. // request. This prevents clients from accidentally creating duplicate
  112690. // commitments.
  112691. //
  112692. // The request ID must be a valid UUID with the exception that zero UUID
  112693. // is not supported (00000000-0000-0000-0000-000000000000).
  112694. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  112695. c.urlParams_.Set("requestId", requestId)
  112696. return c
  112697. }
  112698. // Fields allows partial responses to be retrieved. See
  112699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112700. // for more information.
  112701. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  112702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112703. return c
  112704. }
  112705. // Context sets the context to be used in this call's Do method. Any
  112706. // pending HTTP request will be aborted if the provided context is
  112707. // canceled.
  112708. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  112709. c.ctx_ = ctx
  112710. return c
  112711. }
  112712. // Header returns an http.Header that can be modified by the caller to
  112713. // add HTTP headers to the request.
  112714. func (c *RoutesDeleteCall) Header() http.Header {
  112715. if c.header_ == nil {
  112716. c.header_ = make(http.Header)
  112717. }
  112718. return c.header_
  112719. }
  112720. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  112721. reqHeaders := make(http.Header)
  112722. for k, v := range c.header_ {
  112723. reqHeaders[k] = v
  112724. }
  112725. reqHeaders.Set("User-Agent", c.s.userAgent())
  112726. var body io.Reader = nil
  112727. c.urlParams_.Set("alt", alt)
  112728. c.urlParams_.Set("prettyPrint", "false")
  112729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  112730. urls += "?" + c.urlParams_.Encode()
  112731. req, err := http.NewRequest("DELETE", urls, body)
  112732. if err != nil {
  112733. return nil, err
  112734. }
  112735. req.Header = reqHeaders
  112736. googleapi.Expand(req.URL, map[string]string{
  112737. "project": c.project,
  112738. "route": c.route,
  112739. })
  112740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112741. }
  112742. // Do executes the "compute.routes.delete" call.
  112743. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112744. // status code is an error. Response headers are in either
  112745. // *Operation.ServerResponse.Header or (if a response was returned at
  112746. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112747. // to check whether the returned error was because
  112748. // http.StatusNotModified was returned.
  112749. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112750. gensupport.SetOptions(c.urlParams_, opts...)
  112751. res, err := c.doRequest("json")
  112752. if res != nil && res.StatusCode == http.StatusNotModified {
  112753. if res.Body != nil {
  112754. res.Body.Close()
  112755. }
  112756. return nil, &googleapi.Error{
  112757. Code: res.StatusCode,
  112758. Header: res.Header,
  112759. }
  112760. }
  112761. if err != nil {
  112762. return nil, err
  112763. }
  112764. defer googleapi.CloseBody(res)
  112765. if err := googleapi.CheckResponse(res); err != nil {
  112766. return nil, err
  112767. }
  112768. ret := &Operation{
  112769. ServerResponse: googleapi.ServerResponse{
  112770. Header: res.Header,
  112771. HTTPStatusCode: res.StatusCode,
  112772. },
  112773. }
  112774. target := &ret
  112775. if err := gensupport.DecodeResponse(target, res); err != nil {
  112776. return nil, err
  112777. }
  112778. return ret, nil
  112779. // {
  112780. // "description": "Deletes the specified Route resource.",
  112781. // "httpMethod": "DELETE",
  112782. // "id": "compute.routes.delete",
  112783. // "parameterOrder": [
  112784. // "project",
  112785. // "route"
  112786. // ],
  112787. // "parameters": {
  112788. // "project": {
  112789. // "description": "Project ID for this request.",
  112790. // "location": "path",
  112791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112792. // "required": true,
  112793. // "type": "string"
  112794. // },
  112795. // "requestId": {
  112796. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112797. // "location": "query",
  112798. // "type": "string"
  112799. // },
  112800. // "route": {
  112801. // "description": "Name of the Route resource to delete.",
  112802. // "location": "path",
  112803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112804. // "required": true,
  112805. // "type": "string"
  112806. // }
  112807. // },
  112808. // "path": "{project}/global/routes/{route}",
  112809. // "response": {
  112810. // "$ref": "Operation"
  112811. // },
  112812. // "scopes": [
  112813. // "https://www.googleapis.com/auth/cloud-platform",
  112814. // "https://www.googleapis.com/auth/compute"
  112815. // ]
  112816. // }
  112817. }
  112818. // method id "compute.routes.get":
  112819. type RoutesGetCall struct {
  112820. s *Service
  112821. project string
  112822. route string
  112823. urlParams_ gensupport.URLParams
  112824. ifNoneMatch_ string
  112825. ctx_ context.Context
  112826. header_ http.Header
  112827. }
  112828. // Get: Returns the specified Route resource. Gets a list of available
  112829. // routes by making a list() request.
  112830. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  112831. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  112832. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112833. c.project = project
  112834. c.route = route
  112835. return c
  112836. }
  112837. // Fields allows partial responses to be retrieved. See
  112838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112839. // for more information.
  112840. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  112841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112842. return c
  112843. }
  112844. // IfNoneMatch sets the optional parameter which makes the operation
  112845. // fail if the object's ETag matches the given value. This is useful for
  112846. // getting updates only after the object has changed since the last
  112847. // request. Use googleapi.IsNotModified to check whether the response
  112848. // error from Do is the result of In-None-Match.
  112849. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  112850. c.ifNoneMatch_ = entityTag
  112851. return c
  112852. }
  112853. // Context sets the context to be used in this call's Do method. Any
  112854. // pending HTTP request will be aborted if the provided context is
  112855. // canceled.
  112856. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  112857. c.ctx_ = ctx
  112858. return c
  112859. }
  112860. // Header returns an http.Header that can be modified by the caller to
  112861. // add HTTP headers to the request.
  112862. func (c *RoutesGetCall) Header() http.Header {
  112863. if c.header_ == nil {
  112864. c.header_ = make(http.Header)
  112865. }
  112866. return c.header_
  112867. }
  112868. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  112869. reqHeaders := make(http.Header)
  112870. for k, v := range c.header_ {
  112871. reqHeaders[k] = v
  112872. }
  112873. reqHeaders.Set("User-Agent", c.s.userAgent())
  112874. if c.ifNoneMatch_ != "" {
  112875. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112876. }
  112877. var body io.Reader = nil
  112878. c.urlParams_.Set("alt", alt)
  112879. c.urlParams_.Set("prettyPrint", "false")
  112880. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  112881. urls += "?" + c.urlParams_.Encode()
  112882. req, err := http.NewRequest("GET", urls, body)
  112883. if err != nil {
  112884. return nil, err
  112885. }
  112886. req.Header = reqHeaders
  112887. googleapi.Expand(req.URL, map[string]string{
  112888. "project": c.project,
  112889. "route": c.route,
  112890. })
  112891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112892. }
  112893. // Do executes the "compute.routes.get" call.
  112894. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  112895. // code is an error. Response headers are in either
  112896. // *Route.ServerResponse.Header or (if a response was returned at all)
  112897. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  112898. // check whether the returned error was because http.StatusNotModified
  112899. // was returned.
  112900. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  112901. gensupport.SetOptions(c.urlParams_, opts...)
  112902. res, err := c.doRequest("json")
  112903. if res != nil && res.StatusCode == http.StatusNotModified {
  112904. if res.Body != nil {
  112905. res.Body.Close()
  112906. }
  112907. return nil, &googleapi.Error{
  112908. Code: res.StatusCode,
  112909. Header: res.Header,
  112910. }
  112911. }
  112912. if err != nil {
  112913. return nil, err
  112914. }
  112915. defer googleapi.CloseBody(res)
  112916. if err := googleapi.CheckResponse(res); err != nil {
  112917. return nil, err
  112918. }
  112919. ret := &Route{
  112920. ServerResponse: googleapi.ServerResponse{
  112921. Header: res.Header,
  112922. HTTPStatusCode: res.StatusCode,
  112923. },
  112924. }
  112925. target := &ret
  112926. if err := gensupport.DecodeResponse(target, res); err != nil {
  112927. return nil, err
  112928. }
  112929. return ret, nil
  112930. // {
  112931. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  112932. // "httpMethod": "GET",
  112933. // "id": "compute.routes.get",
  112934. // "parameterOrder": [
  112935. // "project",
  112936. // "route"
  112937. // ],
  112938. // "parameters": {
  112939. // "project": {
  112940. // "description": "Project ID for this request.",
  112941. // "location": "path",
  112942. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112943. // "required": true,
  112944. // "type": "string"
  112945. // },
  112946. // "route": {
  112947. // "description": "Name of the Route resource to return.",
  112948. // "location": "path",
  112949. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112950. // "required": true,
  112951. // "type": "string"
  112952. // }
  112953. // },
  112954. // "path": "{project}/global/routes/{route}",
  112955. // "response": {
  112956. // "$ref": "Route"
  112957. // },
  112958. // "scopes": [
  112959. // "https://www.googleapis.com/auth/cloud-platform",
  112960. // "https://www.googleapis.com/auth/compute",
  112961. // "https://www.googleapis.com/auth/compute.readonly"
  112962. // ]
  112963. // }
  112964. }
  112965. // method id "compute.routes.insert":
  112966. type RoutesInsertCall struct {
  112967. s *Service
  112968. project string
  112969. route *Route
  112970. urlParams_ gensupport.URLParams
  112971. ctx_ context.Context
  112972. header_ http.Header
  112973. }
  112974. // Insert: Creates a Route resource in the specified project using the
  112975. // data included in the request.
  112976. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  112977. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  112978. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112979. c.project = project
  112980. c.route = route
  112981. return c
  112982. }
  112983. // RequestId sets the optional parameter "requestId": An optional
  112984. // request ID to identify requests. Specify a unique request ID so that
  112985. // if you must retry your request, the server will know to ignore the
  112986. // request if it has already been completed.
  112987. //
  112988. // For example, consider a situation where you make an initial request
  112989. // and the request times out. If you make the request again with the
  112990. // same request ID, the server can check if original operation with the
  112991. // same request ID was received, and if so, will ignore the second
  112992. // request. This prevents clients from accidentally creating duplicate
  112993. // commitments.
  112994. //
  112995. // The request ID must be a valid UUID with the exception that zero UUID
  112996. // is not supported (00000000-0000-0000-0000-000000000000).
  112997. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  112998. c.urlParams_.Set("requestId", requestId)
  112999. return c
  113000. }
  113001. // Fields allows partial responses to be retrieved. See
  113002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113003. // for more information.
  113004. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  113005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113006. return c
  113007. }
  113008. // Context sets the context to be used in this call's Do method. Any
  113009. // pending HTTP request will be aborted if the provided context is
  113010. // canceled.
  113011. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  113012. c.ctx_ = ctx
  113013. return c
  113014. }
  113015. // Header returns an http.Header that can be modified by the caller to
  113016. // add HTTP headers to the request.
  113017. func (c *RoutesInsertCall) Header() http.Header {
  113018. if c.header_ == nil {
  113019. c.header_ = make(http.Header)
  113020. }
  113021. return c.header_
  113022. }
  113023. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  113024. reqHeaders := make(http.Header)
  113025. for k, v := range c.header_ {
  113026. reqHeaders[k] = v
  113027. }
  113028. reqHeaders.Set("User-Agent", c.s.userAgent())
  113029. var body io.Reader = nil
  113030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  113031. if err != nil {
  113032. return nil, err
  113033. }
  113034. reqHeaders.Set("Content-Type", "application/json")
  113035. c.urlParams_.Set("alt", alt)
  113036. c.urlParams_.Set("prettyPrint", "false")
  113037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  113038. urls += "?" + c.urlParams_.Encode()
  113039. req, err := http.NewRequest("POST", urls, body)
  113040. if err != nil {
  113041. return nil, err
  113042. }
  113043. req.Header = reqHeaders
  113044. googleapi.Expand(req.URL, map[string]string{
  113045. "project": c.project,
  113046. })
  113047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113048. }
  113049. // Do executes the "compute.routes.insert" call.
  113050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113051. // status code is an error. Response headers are in either
  113052. // *Operation.ServerResponse.Header or (if a response was returned at
  113053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113054. // to check whether the returned error was because
  113055. // http.StatusNotModified was returned.
  113056. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113057. gensupport.SetOptions(c.urlParams_, opts...)
  113058. res, err := c.doRequest("json")
  113059. if res != nil && res.StatusCode == http.StatusNotModified {
  113060. if res.Body != nil {
  113061. res.Body.Close()
  113062. }
  113063. return nil, &googleapi.Error{
  113064. Code: res.StatusCode,
  113065. Header: res.Header,
  113066. }
  113067. }
  113068. if err != nil {
  113069. return nil, err
  113070. }
  113071. defer googleapi.CloseBody(res)
  113072. if err := googleapi.CheckResponse(res); err != nil {
  113073. return nil, err
  113074. }
  113075. ret := &Operation{
  113076. ServerResponse: googleapi.ServerResponse{
  113077. Header: res.Header,
  113078. HTTPStatusCode: res.StatusCode,
  113079. },
  113080. }
  113081. target := &ret
  113082. if err := gensupport.DecodeResponse(target, res); err != nil {
  113083. return nil, err
  113084. }
  113085. return ret, nil
  113086. // {
  113087. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  113088. // "httpMethod": "POST",
  113089. // "id": "compute.routes.insert",
  113090. // "parameterOrder": [
  113091. // "project"
  113092. // ],
  113093. // "parameters": {
  113094. // "project": {
  113095. // "description": "Project ID for this request.",
  113096. // "location": "path",
  113097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113098. // "required": true,
  113099. // "type": "string"
  113100. // },
  113101. // "requestId": {
  113102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113103. // "location": "query",
  113104. // "type": "string"
  113105. // }
  113106. // },
  113107. // "path": "{project}/global/routes",
  113108. // "request": {
  113109. // "$ref": "Route"
  113110. // },
  113111. // "response": {
  113112. // "$ref": "Operation"
  113113. // },
  113114. // "scopes": [
  113115. // "https://www.googleapis.com/auth/cloud-platform",
  113116. // "https://www.googleapis.com/auth/compute"
  113117. // ]
  113118. // }
  113119. }
  113120. // method id "compute.routes.list":
  113121. type RoutesListCall struct {
  113122. s *Service
  113123. project string
  113124. urlParams_ gensupport.URLParams
  113125. ifNoneMatch_ string
  113126. ctx_ context.Context
  113127. header_ http.Header
  113128. }
  113129. // List: Retrieves the list of Route resources available to the
  113130. // specified project.
  113131. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  113132. func (r *RoutesService) List(project string) *RoutesListCall {
  113133. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113134. c.project = project
  113135. return c
  113136. }
  113137. // Filter sets the optional parameter "filter": A filter expression that
  113138. // filters resources listed in the response. The expression must specify
  113139. // the field name, a comparison operator, and the value that you want to
  113140. // use for filtering. The value must be a string, a number, or a
  113141. // boolean. The comparison operator must be either =, !=, >, or <.
  113142. //
  113143. // For example, if you are filtering Compute Engine instances, you can
  113144. // exclude instances named example-instance by specifying name !=
  113145. // example-instance.
  113146. //
  113147. // You can also filter nested fields. For example, you could specify
  113148. // scheduling.automaticRestart = false to include instances only if they
  113149. // are not scheduled for automatic restarts. You can use filtering on
  113150. // nested fields to filter based on resource labels.
  113151. //
  113152. // To filter on multiple expressions, provide each separate expression
  113153. // within parentheses. For example, (scheduling.automaticRestart = true)
  113154. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113155. // AND expression. However, you can include AND and OR expressions
  113156. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113157. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113158. // true).
  113159. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  113160. c.urlParams_.Set("filter", filter)
  113161. return c
  113162. }
  113163. // MaxResults sets the optional parameter "maxResults": The maximum
  113164. // number of results per page that should be returned. If the number of
  113165. // available results is larger than maxResults, Compute Engine returns a
  113166. // nextPageToken that can be used to get the next page of results in
  113167. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113168. // (Default: 500)
  113169. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  113170. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113171. return c
  113172. }
  113173. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113174. // a certain order. By default, results are returned in alphanumerical
  113175. // order based on the resource name.
  113176. //
  113177. // You can also sort results in descending order based on the creation
  113178. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113179. // based on the creationTimestamp field in reverse chronological order
  113180. // (newest result first). Use this to sort resources like operations so
  113181. // that the newest operation is returned first.
  113182. //
  113183. // Currently, only sorting by name or creationTimestamp desc is
  113184. // supported.
  113185. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  113186. c.urlParams_.Set("orderBy", orderBy)
  113187. return c
  113188. }
  113189. // PageToken sets the optional parameter "pageToken": Specifies a page
  113190. // token to use. Set pageToken to the nextPageToken returned by a
  113191. // previous list request to get the next page of results.
  113192. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  113193. c.urlParams_.Set("pageToken", pageToken)
  113194. return c
  113195. }
  113196. // Fields allows partial responses to be retrieved. See
  113197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113198. // for more information.
  113199. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  113200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113201. return c
  113202. }
  113203. // IfNoneMatch sets the optional parameter which makes the operation
  113204. // fail if the object's ETag matches the given value. This is useful for
  113205. // getting updates only after the object has changed since the last
  113206. // request. Use googleapi.IsNotModified to check whether the response
  113207. // error from Do is the result of In-None-Match.
  113208. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  113209. c.ifNoneMatch_ = entityTag
  113210. return c
  113211. }
  113212. // Context sets the context to be used in this call's Do method. Any
  113213. // pending HTTP request will be aborted if the provided context is
  113214. // canceled.
  113215. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  113216. c.ctx_ = ctx
  113217. return c
  113218. }
  113219. // Header returns an http.Header that can be modified by the caller to
  113220. // add HTTP headers to the request.
  113221. func (c *RoutesListCall) Header() http.Header {
  113222. if c.header_ == nil {
  113223. c.header_ = make(http.Header)
  113224. }
  113225. return c.header_
  113226. }
  113227. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  113228. reqHeaders := make(http.Header)
  113229. for k, v := range c.header_ {
  113230. reqHeaders[k] = v
  113231. }
  113232. reqHeaders.Set("User-Agent", c.s.userAgent())
  113233. if c.ifNoneMatch_ != "" {
  113234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113235. }
  113236. var body io.Reader = nil
  113237. c.urlParams_.Set("alt", alt)
  113238. c.urlParams_.Set("prettyPrint", "false")
  113239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  113240. urls += "?" + c.urlParams_.Encode()
  113241. req, err := http.NewRequest("GET", urls, body)
  113242. if err != nil {
  113243. return nil, err
  113244. }
  113245. req.Header = reqHeaders
  113246. googleapi.Expand(req.URL, map[string]string{
  113247. "project": c.project,
  113248. })
  113249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113250. }
  113251. // Do executes the "compute.routes.list" call.
  113252. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  113253. // status code is an error. Response headers are in either
  113254. // *RouteList.ServerResponse.Header or (if a response was returned at
  113255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113256. // to check whether the returned error was because
  113257. // http.StatusNotModified was returned.
  113258. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  113259. gensupport.SetOptions(c.urlParams_, opts...)
  113260. res, err := c.doRequest("json")
  113261. if res != nil && res.StatusCode == http.StatusNotModified {
  113262. if res.Body != nil {
  113263. res.Body.Close()
  113264. }
  113265. return nil, &googleapi.Error{
  113266. Code: res.StatusCode,
  113267. Header: res.Header,
  113268. }
  113269. }
  113270. if err != nil {
  113271. return nil, err
  113272. }
  113273. defer googleapi.CloseBody(res)
  113274. if err := googleapi.CheckResponse(res); err != nil {
  113275. return nil, err
  113276. }
  113277. ret := &RouteList{
  113278. ServerResponse: googleapi.ServerResponse{
  113279. Header: res.Header,
  113280. HTTPStatusCode: res.StatusCode,
  113281. },
  113282. }
  113283. target := &ret
  113284. if err := gensupport.DecodeResponse(target, res); err != nil {
  113285. return nil, err
  113286. }
  113287. return ret, nil
  113288. // {
  113289. // "description": "Retrieves the list of Route resources available to the specified project.",
  113290. // "httpMethod": "GET",
  113291. // "id": "compute.routes.list",
  113292. // "parameterOrder": [
  113293. // "project"
  113294. // ],
  113295. // "parameters": {
  113296. // "filter": {
  113297. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  113298. // "location": "query",
  113299. // "type": "string"
  113300. // },
  113301. // "maxResults": {
  113302. // "default": "500",
  113303. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  113304. // "format": "uint32",
  113305. // "location": "query",
  113306. // "minimum": "0",
  113307. // "type": "integer"
  113308. // },
  113309. // "orderBy": {
  113310. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  113311. // "location": "query",
  113312. // "type": "string"
  113313. // },
  113314. // "pageToken": {
  113315. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  113316. // "location": "query",
  113317. // "type": "string"
  113318. // },
  113319. // "project": {
  113320. // "description": "Project ID for this request.",
  113321. // "location": "path",
  113322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113323. // "required": true,
  113324. // "type": "string"
  113325. // }
  113326. // },
  113327. // "path": "{project}/global/routes",
  113328. // "response": {
  113329. // "$ref": "RouteList"
  113330. // },
  113331. // "scopes": [
  113332. // "https://www.googleapis.com/auth/cloud-platform",
  113333. // "https://www.googleapis.com/auth/compute",
  113334. // "https://www.googleapis.com/auth/compute.readonly"
  113335. // ]
  113336. // }
  113337. }
  113338. // Pages invokes f for each page of results.
  113339. // A non-nil error returned from f will halt the iteration.
  113340. // The provided context supersedes any context provided to the Context method.
  113341. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  113342. c.ctx_ = ctx
  113343. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113344. for {
  113345. x, err := c.Do()
  113346. if err != nil {
  113347. return err
  113348. }
  113349. if err := f(x); err != nil {
  113350. return err
  113351. }
  113352. if x.NextPageToken == "" {
  113353. return nil
  113354. }
  113355. c.PageToken(x.NextPageToken)
  113356. }
  113357. }
  113358. // method id "compute.routes.testIamPermissions":
  113359. type RoutesTestIamPermissionsCall struct {
  113360. s *Service
  113361. project string
  113362. resource string
  113363. testpermissionsrequest *TestPermissionsRequest
  113364. urlParams_ gensupport.URLParams
  113365. ctx_ context.Context
  113366. header_ http.Header
  113367. }
  113368. // TestIamPermissions: Returns permissions that a caller has on the
  113369. // specified resource.
  113370. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  113371. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113372. c.project = project
  113373. c.resource = resource
  113374. c.testpermissionsrequest = testpermissionsrequest
  113375. return c
  113376. }
  113377. // Fields allows partial responses to be retrieved. See
  113378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113379. // for more information.
  113380. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  113381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113382. return c
  113383. }
  113384. // Context sets the context to be used in this call's Do method. Any
  113385. // pending HTTP request will be aborted if the provided context is
  113386. // canceled.
  113387. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  113388. c.ctx_ = ctx
  113389. return c
  113390. }
  113391. // Header returns an http.Header that can be modified by the caller to
  113392. // add HTTP headers to the request.
  113393. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  113394. if c.header_ == nil {
  113395. c.header_ = make(http.Header)
  113396. }
  113397. return c.header_
  113398. }
  113399. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  113400. reqHeaders := make(http.Header)
  113401. for k, v := range c.header_ {
  113402. reqHeaders[k] = v
  113403. }
  113404. reqHeaders.Set("User-Agent", c.s.userAgent())
  113405. var body io.Reader = nil
  113406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  113407. if err != nil {
  113408. return nil, err
  113409. }
  113410. reqHeaders.Set("Content-Type", "application/json")
  113411. c.urlParams_.Set("alt", alt)
  113412. c.urlParams_.Set("prettyPrint", "false")
  113413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  113414. urls += "?" + c.urlParams_.Encode()
  113415. req, err := http.NewRequest("POST", urls, body)
  113416. if err != nil {
  113417. return nil, err
  113418. }
  113419. req.Header = reqHeaders
  113420. googleapi.Expand(req.URL, map[string]string{
  113421. "project": c.project,
  113422. "resource": c.resource,
  113423. })
  113424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113425. }
  113426. // Do executes the "compute.routes.testIamPermissions" call.
  113427. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  113428. // non-2xx status code is an error. Response headers are in either
  113429. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  113430. // returned at all) in error.(*googleapi.Error).Header. Use
  113431. // googleapi.IsNotModified to check whether the returned error was
  113432. // because http.StatusNotModified was returned.
  113433. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  113434. gensupport.SetOptions(c.urlParams_, opts...)
  113435. res, err := c.doRequest("json")
  113436. if res != nil && res.StatusCode == http.StatusNotModified {
  113437. if res.Body != nil {
  113438. res.Body.Close()
  113439. }
  113440. return nil, &googleapi.Error{
  113441. Code: res.StatusCode,
  113442. Header: res.Header,
  113443. }
  113444. }
  113445. if err != nil {
  113446. return nil, err
  113447. }
  113448. defer googleapi.CloseBody(res)
  113449. if err := googleapi.CheckResponse(res); err != nil {
  113450. return nil, err
  113451. }
  113452. ret := &TestPermissionsResponse{
  113453. ServerResponse: googleapi.ServerResponse{
  113454. Header: res.Header,
  113455. HTTPStatusCode: res.StatusCode,
  113456. },
  113457. }
  113458. target := &ret
  113459. if err := gensupport.DecodeResponse(target, res); err != nil {
  113460. return nil, err
  113461. }
  113462. return ret, nil
  113463. // {
  113464. // "description": "Returns permissions that a caller has on the specified resource.",
  113465. // "httpMethod": "POST",
  113466. // "id": "compute.routes.testIamPermissions",
  113467. // "parameterOrder": [
  113468. // "project",
  113469. // "resource"
  113470. // ],
  113471. // "parameters": {
  113472. // "project": {
  113473. // "description": "Project ID for this request.",
  113474. // "location": "path",
  113475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113476. // "required": true,
  113477. // "type": "string"
  113478. // },
  113479. // "resource": {
  113480. // "description": "Name or id of the resource for this request.",
  113481. // "location": "path",
  113482. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113483. // "required": true,
  113484. // "type": "string"
  113485. // }
  113486. // },
  113487. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  113488. // "request": {
  113489. // "$ref": "TestPermissionsRequest"
  113490. // },
  113491. // "response": {
  113492. // "$ref": "TestPermissionsResponse"
  113493. // },
  113494. // "scopes": [
  113495. // "https://www.googleapis.com/auth/cloud-platform",
  113496. // "https://www.googleapis.com/auth/compute",
  113497. // "https://www.googleapis.com/auth/compute.readonly"
  113498. // ]
  113499. // }
  113500. }
  113501. // method id "compute.securityPolicies.addRule":
  113502. type SecurityPoliciesAddRuleCall struct {
  113503. s *Service
  113504. project string
  113505. securityPolicy string
  113506. securitypolicyrule *SecurityPolicyRule
  113507. urlParams_ gensupport.URLParams
  113508. ctx_ context.Context
  113509. header_ http.Header
  113510. }
  113511. // AddRule: Inserts a rule into a security policy.
  113512. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  113513. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113514. c.project = project
  113515. c.securityPolicy = securityPolicy
  113516. c.securitypolicyrule = securitypolicyrule
  113517. return c
  113518. }
  113519. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  113520. // request will not be committed.
  113521. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  113522. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  113523. return c
  113524. }
  113525. // Fields allows partial responses to be retrieved. See
  113526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113527. // for more information.
  113528. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  113529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113530. return c
  113531. }
  113532. // Context sets the context to be used in this call's Do method. Any
  113533. // pending HTTP request will be aborted if the provided context is
  113534. // canceled.
  113535. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  113536. c.ctx_ = ctx
  113537. return c
  113538. }
  113539. // Header returns an http.Header that can be modified by the caller to
  113540. // add HTTP headers to the request.
  113541. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  113542. if c.header_ == nil {
  113543. c.header_ = make(http.Header)
  113544. }
  113545. return c.header_
  113546. }
  113547. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  113548. reqHeaders := make(http.Header)
  113549. for k, v := range c.header_ {
  113550. reqHeaders[k] = v
  113551. }
  113552. reqHeaders.Set("User-Agent", c.s.userAgent())
  113553. var body io.Reader = nil
  113554. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  113555. if err != nil {
  113556. return nil, err
  113557. }
  113558. reqHeaders.Set("Content-Type", "application/json")
  113559. c.urlParams_.Set("alt", alt)
  113560. c.urlParams_.Set("prettyPrint", "false")
  113561. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  113562. urls += "?" + c.urlParams_.Encode()
  113563. req, err := http.NewRequest("POST", urls, body)
  113564. if err != nil {
  113565. return nil, err
  113566. }
  113567. req.Header = reqHeaders
  113568. googleapi.Expand(req.URL, map[string]string{
  113569. "project": c.project,
  113570. "securityPolicy": c.securityPolicy,
  113571. })
  113572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113573. }
  113574. // Do executes the "compute.securityPolicies.addRule" call.
  113575. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113576. // status code is an error. Response headers are in either
  113577. // *Operation.ServerResponse.Header or (if a response was returned at
  113578. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113579. // to check whether the returned error was because
  113580. // http.StatusNotModified was returned.
  113581. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113582. gensupport.SetOptions(c.urlParams_, opts...)
  113583. res, err := c.doRequest("json")
  113584. if res != nil && res.StatusCode == http.StatusNotModified {
  113585. if res.Body != nil {
  113586. res.Body.Close()
  113587. }
  113588. return nil, &googleapi.Error{
  113589. Code: res.StatusCode,
  113590. Header: res.Header,
  113591. }
  113592. }
  113593. if err != nil {
  113594. return nil, err
  113595. }
  113596. defer googleapi.CloseBody(res)
  113597. if err := googleapi.CheckResponse(res); err != nil {
  113598. return nil, err
  113599. }
  113600. ret := &Operation{
  113601. ServerResponse: googleapi.ServerResponse{
  113602. Header: res.Header,
  113603. HTTPStatusCode: res.StatusCode,
  113604. },
  113605. }
  113606. target := &ret
  113607. if err := gensupport.DecodeResponse(target, res); err != nil {
  113608. return nil, err
  113609. }
  113610. return ret, nil
  113611. // {
  113612. // "description": "Inserts a rule into a security policy.",
  113613. // "httpMethod": "POST",
  113614. // "id": "compute.securityPolicies.addRule",
  113615. // "parameterOrder": [
  113616. // "project",
  113617. // "securityPolicy"
  113618. // ],
  113619. // "parameters": {
  113620. // "project": {
  113621. // "description": "Project ID for this request.",
  113622. // "location": "path",
  113623. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113624. // "required": true,
  113625. // "type": "string"
  113626. // },
  113627. // "securityPolicy": {
  113628. // "description": "Name of the security policy to update.",
  113629. // "location": "path",
  113630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113631. // "required": true,
  113632. // "type": "string"
  113633. // },
  113634. // "validateOnly": {
  113635. // "description": "If true, the request will not be committed.",
  113636. // "location": "query",
  113637. // "type": "boolean"
  113638. // }
  113639. // },
  113640. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  113641. // "request": {
  113642. // "$ref": "SecurityPolicyRule"
  113643. // },
  113644. // "response": {
  113645. // "$ref": "Operation"
  113646. // },
  113647. // "scopes": [
  113648. // "https://www.googleapis.com/auth/cloud-platform",
  113649. // "https://www.googleapis.com/auth/compute"
  113650. // ]
  113651. // }
  113652. }
  113653. // method id "compute.securityPolicies.delete":
  113654. type SecurityPoliciesDeleteCall struct {
  113655. s *Service
  113656. project string
  113657. securityPolicy string
  113658. urlParams_ gensupport.URLParams
  113659. ctx_ context.Context
  113660. header_ http.Header
  113661. }
  113662. // Delete: Deletes the specified policy.
  113663. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  113664. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113665. c.project = project
  113666. c.securityPolicy = securityPolicy
  113667. return c
  113668. }
  113669. // RequestId sets the optional parameter "requestId": An optional
  113670. // request ID to identify requests. Specify a unique request ID so that
  113671. // if you must retry your request, the server will know to ignore the
  113672. // request if it has already been completed.
  113673. //
  113674. // For example, consider a situation where you make an initial request
  113675. // and the request times out. If you make the request again with the
  113676. // same request ID, the server can check if original operation with the
  113677. // same request ID was received, and if so, will ignore the second
  113678. // request. This prevents clients from accidentally creating duplicate
  113679. // commitments.
  113680. //
  113681. // The request ID must be a valid UUID with the exception that zero UUID
  113682. // is not supported (00000000-0000-0000-0000-000000000000).
  113683. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  113684. c.urlParams_.Set("requestId", requestId)
  113685. return c
  113686. }
  113687. // Fields allows partial responses to be retrieved. See
  113688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113689. // for more information.
  113690. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  113691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113692. return c
  113693. }
  113694. // Context sets the context to be used in this call's Do method. Any
  113695. // pending HTTP request will be aborted if the provided context is
  113696. // canceled.
  113697. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  113698. c.ctx_ = ctx
  113699. return c
  113700. }
  113701. // Header returns an http.Header that can be modified by the caller to
  113702. // add HTTP headers to the request.
  113703. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  113704. if c.header_ == nil {
  113705. c.header_ = make(http.Header)
  113706. }
  113707. return c.header_
  113708. }
  113709. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  113710. reqHeaders := make(http.Header)
  113711. for k, v := range c.header_ {
  113712. reqHeaders[k] = v
  113713. }
  113714. reqHeaders.Set("User-Agent", c.s.userAgent())
  113715. var body io.Reader = nil
  113716. c.urlParams_.Set("alt", alt)
  113717. c.urlParams_.Set("prettyPrint", "false")
  113718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  113719. urls += "?" + c.urlParams_.Encode()
  113720. req, err := http.NewRequest("DELETE", urls, body)
  113721. if err != nil {
  113722. return nil, err
  113723. }
  113724. req.Header = reqHeaders
  113725. googleapi.Expand(req.URL, map[string]string{
  113726. "project": c.project,
  113727. "securityPolicy": c.securityPolicy,
  113728. })
  113729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113730. }
  113731. // Do executes the "compute.securityPolicies.delete" call.
  113732. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113733. // status code is an error. Response headers are in either
  113734. // *Operation.ServerResponse.Header or (if a response was returned at
  113735. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113736. // to check whether the returned error was because
  113737. // http.StatusNotModified was returned.
  113738. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113739. gensupport.SetOptions(c.urlParams_, opts...)
  113740. res, err := c.doRequest("json")
  113741. if res != nil && res.StatusCode == http.StatusNotModified {
  113742. if res.Body != nil {
  113743. res.Body.Close()
  113744. }
  113745. return nil, &googleapi.Error{
  113746. Code: res.StatusCode,
  113747. Header: res.Header,
  113748. }
  113749. }
  113750. if err != nil {
  113751. return nil, err
  113752. }
  113753. defer googleapi.CloseBody(res)
  113754. if err := googleapi.CheckResponse(res); err != nil {
  113755. return nil, err
  113756. }
  113757. ret := &Operation{
  113758. ServerResponse: googleapi.ServerResponse{
  113759. Header: res.Header,
  113760. HTTPStatusCode: res.StatusCode,
  113761. },
  113762. }
  113763. target := &ret
  113764. if err := gensupport.DecodeResponse(target, res); err != nil {
  113765. return nil, err
  113766. }
  113767. return ret, nil
  113768. // {
  113769. // "description": "Deletes the specified policy.",
  113770. // "httpMethod": "DELETE",
  113771. // "id": "compute.securityPolicies.delete",
  113772. // "parameterOrder": [
  113773. // "project",
  113774. // "securityPolicy"
  113775. // ],
  113776. // "parameters": {
  113777. // "project": {
  113778. // "description": "Project ID for this request.",
  113779. // "location": "path",
  113780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113781. // "required": true,
  113782. // "type": "string"
  113783. // },
  113784. // "requestId": {
  113785. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113786. // "location": "query",
  113787. // "type": "string"
  113788. // },
  113789. // "securityPolicy": {
  113790. // "description": "Name of the security policy to delete.",
  113791. // "location": "path",
  113792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113793. // "required": true,
  113794. // "type": "string"
  113795. // }
  113796. // },
  113797. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  113798. // "response": {
  113799. // "$ref": "Operation"
  113800. // },
  113801. // "scopes": [
  113802. // "https://www.googleapis.com/auth/cloud-platform",
  113803. // "https://www.googleapis.com/auth/compute"
  113804. // ]
  113805. // }
  113806. }
  113807. // method id "compute.securityPolicies.get":
  113808. type SecurityPoliciesGetCall struct {
  113809. s *Service
  113810. project string
  113811. securityPolicy string
  113812. urlParams_ gensupport.URLParams
  113813. ifNoneMatch_ string
  113814. ctx_ context.Context
  113815. header_ http.Header
  113816. }
  113817. // Get: List all of the ordered rules present in a single specified
  113818. // policy.
  113819. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  113820. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113821. c.project = project
  113822. c.securityPolicy = securityPolicy
  113823. return c
  113824. }
  113825. // Fields allows partial responses to be retrieved. See
  113826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113827. // for more information.
  113828. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  113829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113830. return c
  113831. }
  113832. // IfNoneMatch sets the optional parameter which makes the operation
  113833. // fail if the object's ETag matches the given value. This is useful for
  113834. // getting updates only after the object has changed since the last
  113835. // request. Use googleapi.IsNotModified to check whether the response
  113836. // error from Do is the result of In-None-Match.
  113837. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  113838. c.ifNoneMatch_ = entityTag
  113839. return c
  113840. }
  113841. // Context sets the context to be used in this call's Do method. Any
  113842. // pending HTTP request will be aborted if the provided context is
  113843. // canceled.
  113844. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  113845. c.ctx_ = ctx
  113846. return c
  113847. }
  113848. // Header returns an http.Header that can be modified by the caller to
  113849. // add HTTP headers to the request.
  113850. func (c *SecurityPoliciesGetCall) Header() http.Header {
  113851. if c.header_ == nil {
  113852. c.header_ = make(http.Header)
  113853. }
  113854. return c.header_
  113855. }
  113856. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  113857. reqHeaders := make(http.Header)
  113858. for k, v := range c.header_ {
  113859. reqHeaders[k] = v
  113860. }
  113861. reqHeaders.Set("User-Agent", c.s.userAgent())
  113862. if c.ifNoneMatch_ != "" {
  113863. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113864. }
  113865. var body io.Reader = nil
  113866. c.urlParams_.Set("alt", alt)
  113867. c.urlParams_.Set("prettyPrint", "false")
  113868. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  113869. urls += "?" + c.urlParams_.Encode()
  113870. req, err := http.NewRequest("GET", urls, body)
  113871. if err != nil {
  113872. return nil, err
  113873. }
  113874. req.Header = reqHeaders
  113875. googleapi.Expand(req.URL, map[string]string{
  113876. "project": c.project,
  113877. "securityPolicy": c.securityPolicy,
  113878. })
  113879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113880. }
  113881. // Do executes the "compute.securityPolicies.get" call.
  113882. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  113883. // status code is an error. Response headers are in either
  113884. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  113885. // at all) in error.(*googleapi.Error).Header. Use
  113886. // googleapi.IsNotModified to check whether the returned error was
  113887. // because http.StatusNotModified was returned.
  113888. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  113889. gensupport.SetOptions(c.urlParams_, opts...)
  113890. res, err := c.doRequest("json")
  113891. if res != nil && res.StatusCode == http.StatusNotModified {
  113892. if res.Body != nil {
  113893. res.Body.Close()
  113894. }
  113895. return nil, &googleapi.Error{
  113896. Code: res.StatusCode,
  113897. Header: res.Header,
  113898. }
  113899. }
  113900. if err != nil {
  113901. return nil, err
  113902. }
  113903. defer googleapi.CloseBody(res)
  113904. if err := googleapi.CheckResponse(res); err != nil {
  113905. return nil, err
  113906. }
  113907. ret := &SecurityPolicy{
  113908. ServerResponse: googleapi.ServerResponse{
  113909. Header: res.Header,
  113910. HTTPStatusCode: res.StatusCode,
  113911. },
  113912. }
  113913. target := &ret
  113914. if err := gensupport.DecodeResponse(target, res); err != nil {
  113915. return nil, err
  113916. }
  113917. return ret, nil
  113918. // {
  113919. // "description": "List all of the ordered rules present in a single specified policy.",
  113920. // "httpMethod": "GET",
  113921. // "id": "compute.securityPolicies.get",
  113922. // "parameterOrder": [
  113923. // "project",
  113924. // "securityPolicy"
  113925. // ],
  113926. // "parameters": {
  113927. // "project": {
  113928. // "description": "Project ID for this request.",
  113929. // "location": "path",
  113930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113931. // "required": true,
  113932. // "type": "string"
  113933. // },
  113934. // "securityPolicy": {
  113935. // "description": "Name of the security policy to get.",
  113936. // "location": "path",
  113937. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113938. // "required": true,
  113939. // "type": "string"
  113940. // }
  113941. // },
  113942. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  113943. // "response": {
  113944. // "$ref": "SecurityPolicy"
  113945. // },
  113946. // "scopes": [
  113947. // "https://www.googleapis.com/auth/cloud-platform",
  113948. // "https://www.googleapis.com/auth/compute",
  113949. // "https://www.googleapis.com/auth/compute.readonly"
  113950. // ]
  113951. // }
  113952. }
  113953. // method id "compute.securityPolicies.getRule":
  113954. type SecurityPoliciesGetRuleCall struct {
  113955. s *Service
  113956. project string
  113957. securityPolicy string
  113958. urlParams_ gensupport.URLParams
  113959. ifNoneMatch_ string
  113960. ctx_ context.Context
  113961. header_ http.Header
  113962. }
  113963. // GetRule: Gets a rule at the specified priority.
  113964. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  113965. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113966. c.project = project
  113967. c.securityPolicy = securityPolicy
  113968. return c
  113969. }
  113970. // Priority sets the optional parameter "priority": The priority of the
  113971. // rule to get from the security policy.
  113972. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  113973. c.urlParams_.Set("priority", fmt.Sprint(priority))
  113974. return c
  113975. }
  113976. // Fields allows partial responses to be retrieved. See
  113977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113978. // for more information.
  113979. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  113980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113981. return c
  113982. }
  113983. // IfNoneMatch sets the optional parameter which makes the operation
  113984. // fail if the object's ETag matches the given value. This is useful for
  113985. // getting updates only after the object has changed since the last
  113986. // request. Use googleapi.IsNotModified to check whether the response
  113987. // error from Do is the result of In-None-Match.
  113988. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  113989. c.ifNoneMatch_ = entityTag
  113990. return c
  113991. }
  113992. // Context sets the context to be used in this call's Do method. Any
  113993. // pending HTTP request will be aborted if the provided context is
  113994. // canceled.
  113995. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  113996. c.ctx_ = ctx
  113997. return c
  113998. }
  113999. // Header returns an http.Header that can be modified by the caller to
  114000. // add HTTP headers to the request.
  114001. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  114002. if c.header_ == nil {
  114003. c.header_ = make(http.Header)
  114004. }
  114005. return c.header_
  114006. }
  114007. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  114008. reqHeaders := make(http.Header)
  114009. for k, v := range c.header_ {
  114010. reqHeaders[k] = v
  114011. }
  114012. reqHeaders.Set("User-Agent", c.s.userAgent())
  114013. if c.ifNoneMatch_ != "" {
  114014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114015. }
  114016. var body io.Reader = nil
  114017. c.urlParams_.Set("alt", alt)
  114018. c.urlParams_.Set("prettyPrint", "false")
  114019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  114020. urls += "?" + c.urlParams_.Encode()
  114021. req, err := http.NewRequest("GET", urls, body)
  114022. if err != nil {
  114023. return nil, err
  114024. }
  114025. req.Header = reqHeaders
  114026. googleapi.Expand(req.URL, map[string]string{
  114027. "project": c.project,
  114028. "securityPolicy": c.securityPolicy,
  114029. })
  114030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114031. }
  114032. // Do executes the "compute.securityPolicies.getRule" call.
  114033. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  114034. // non-2xx status code is an error. Response headers are in either
  114035. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  114036. // returned at all) in error.(*googleapi.Error).Header. Use
  114037. // googleapi.IsNotModified to check whether the returned error was
  114038. // because http.StatusNotModified was returned.
  114039. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  114040. gensupport.SetOptions(c.urlParams_, opts...)
  114041. res, err := c.doRequest("json")
  114042. if res != nil && res.StatusCode == http.StatusNotModified {
  114043. if res.Body != nil {
  114044. res.Body.Close()
  114045. }
  114046. return nil, &googleapi.Error{
  114047. Code: res.StatusCode,
  114048. Header: res.Header,
  114049. }
  114050. }
  114051. if err != nil {
  114052. return nil, err
  114053. }
  114054. defer googleapi.CloseBody(res)
  114055. if err := googleapi.CheckResponse(res); err != nil {
  114056. return nil, err
  114057. }
  114058. ret := &SecurityPolicyRule{
  114059. ServerResponse: googleapi.ServerResponse{
  114060. Header: res.Header,
  114061. HTTPStatusCode: res.StatusCode,
  114062. },
  114063. }
  114064. target := &ret
  114065. if err := gensupport.DecodeResponse(target, res); err != nil {
  114066. return nil, err
  114067. }
  114068. return ret, nil
  114069. // {
  114070. // "description": "Gets a rule at the specified priority.",
  114071. // "httpMethod": "GET",
  114072. // "id": "compute.securityPolicies.getRule",
  114073. // "parameterOrder": [
  114074. // "project",
  114075. // "securityPolicy"
  114076. // ],
  114077. // "parameters": {
  114078. // "priority": {
  114079. // "description": "The priority of the rule to get from the security policy.",
  114080. // "format": "int32",
  114081. // "location": "query",
  114082. // "type": "integer"
  114083. // },
  114084. // "project": {
  114085. // "description": "Project ID for this request.",
  114086. // "location": "path",
  114087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114088. // "required": true,
  114089. // "type": "string"
  114090. // },
  114091. // "securityPolicy": {
  114092. // "description": "Name of the security policy to which the queried rule belongs.",
  114093. // "location": "path",
  114094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114095. // "required": true,
  114096. // "type": "string"
  114097. // }
  114098. // },
  114099. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  114100. // "response": {
  114101. // "$ref": "SecurityPolicyRule"
  114102. // },
  114103. // "scopes": [
  114104. // "https://www.googleapis.com/auth/cloud-platform",
  114105. // "https://www.googleapis.com/auth/compute",
  114106. // "https://www.googleapis.com/auth/compute.readonly"
  114107. // ]
  114108. // }
  114109. }
  114110. // method id "compute.securityPolicies.insert":
  114111. type SecurityPoliciesInsertCall struct {
  114112. s *Service
  114113. project string
  114114. securitypolicy *SecurityPolicy
  114115. urlParams_ gensupport.URLParams
  114116. ctx_ context.Context
  114117. header_ http.Header
  114118. }
  114119. // Insert: Creates a new policy in the specified project using the data
  114120. // included in the request.
  114121. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  114122. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114123. c.project = project
  114124. c.securitypolicy = securitypolicy
  114125. return c
  114126. }
  114127. // RequestId sets the optional parameter "requestId": An optional
  114128. // request ID to identify requests. Specify a unique request ID so that
  114129. // if you must retry your request, the server will know to ignore the
  114130. // request if it has already been completed.
  114131. //
  114132. // For example, consider a situation where you make an initial request
  114133. // and the request times out. If you make the request again with the
  114134. // same request ID, the server can check if original operation with the
  114135. // same request ID was received, and if so, will ignore the second
  114136. // request. This prevents clients from accidentally creating duplicate
  114137. // commitments.
  114138. //
  114139. // The request ID must be a valid UUID with the exception that zero UUID
  114140. // is not supported (00000000-0000-0000-0000-000000000000).
  114141. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  114142. c.urlParams_.Set("requestId", requestId)
  114143. return c
  114144. }
  114145. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  114146. // request will not be committed.
  114147. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  114148. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  114149. return c
  114150. }
  114151. // Fields allows partial responses to be retrieved. See
  114152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114153. // for more information.
  114154. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  114155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114156. return c
  114157. }
  114158. // Context sets the context to be used in this call's Do method. Any
  114159. // pending HTTP request will be aborted if the provided context is
  114160. // canceled.
  114161. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  114162. c.ctx_ = ctx
  114163. return c
  114164. }
  114165. // Header returns an http.Header that can be modified by the caller to
  114166. // add HTTP headers to the request.
  114167. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  114168. if c.header_ == nil {
  114169. c.header_ = make(http.Header)
  114170. }
  114171. return c.header_
  114172. }
  114173. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  114174. reqHeaders := make(http.Header)
  114175. for k, v := range c.header_ {
  114176. reqHeaders[k] = v
  114177. }
  114178. reqHeaders.Set("User-Agent", c.s.userAgent())
  114179. var body io.Reader = nil
  114180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  114181. if err != nil {
  114182. return nil, err
  114183. }
  114184. reqHeaders.Set("Content-Type", "application/json")
  114185. c.urlParams_.Set("alt", alt)
  114186. c.urlParams_.Set("prettyPrint", "false")
  114187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  114188. urls += "?" + c.urlParams_.Encode()
  114189. req, err := http.NewRequest("POST", urls, body)
  114190. if err != nil {
  114191. return nil, err
  114192. }
  114193. req.Header = reqHeaders
  114194. googleapi.Expand(req.URL, map[string]string{
  114195. "project": c.project,
  114196. })
  114197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114198. }
  114199. // Do executes the "compute.securityPolicies.insert" call.
  114200. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114201. // status code is an error. Response headers are in either
  114202. // *Operation.ServerResponse.Header or (if a response was returned at
  114203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114204. // to check whether the returned error was because
  114205. // http.StatusNotModified was returned.
  114206. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114207. gensupport.SetOptions(c.urlParams_, opts...)
  114208. res, err := c.doRequest("json")
  114209. if res != nil && res.StatusCode == http.StatusNotModified {
  114210. if res.Body != nil {
  114211. res.Body.Close()
  114212. }
  114213. return nil, &googleapi.Error{
  114214. Code: res.StatusCode,
  114215. Header: res.Header,
  114216. }
  114217. }
  114218. if err != nil {
  114219. return nil, err
  114220. }
  114221. defer googleapi.CloseBody(res)
  114222. if err := googleapi.CheckResponse(res); err != nil {
  114223. return nil, err
  114224. }
  114225. ret := &Operation{
  114226. ServerResponse: googleapi.ServerResponse{
  114227. Header: res.Header,
  114228. HTTPStatusCode: res.StatusCode,
  114229. },
  114230. }
  114231. target := &ret
  114232. if err := gensupport.DecodeResponse(target, res); err != nil {
  114233. return nil, err
  114234. }
  114235. return ret, nil
  114236. // {
  114237. // "description": "Creates a new policy in the specified project using the data included in the request.",
  114238. // "httpMethod": "POST",
  114239. // "id": "compute.securityPolicies.insert",
  114240. // "parameterOrder": [
  114241. // "project"
  114242. // ],
  114243. // "parameters": {
  114244. // "project": {
  114245. // "description": "Project ID for this request.",
  114246. // "location": "path",
  114247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114248. // "required": true,
  114249. // "type": "string"
  114250. // },
  114251. // "requestId": {
  114252. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114253. // "location": "query",
  114254. // "type": "string"
  114255. // },
  114256. // "validateOnly": {
  114257. // "description": "If true, the request will not be committed.",
  114258. // "location": "query",
  114259. // "type": "boolean"
  114260. // }
  114261. // },
  114262. // "path": "{project}/global/securityPolicies",
  114263. // "request": {
  114264. // "$ref": "SecurityPolicy"
  114265. // },
  114266. // "response": {
  114267. // "$ref": "Operation"
  114268. // },
  114269. // "scopes": [
  114270. // "https://www.googleapis.com/auth/cloud-platform",
  114271. // "https://www.googleapis.com/auth/compute"
  114272. // ]
  114273. // }
  114274. }
  114275. // method id "compute.securityPolicies.list":
  114276. type SecurityPoliciesListCall struct {
  114277. s *Service
  114278. project string
  114279. urlParams_ gensupport.URLParams
  114280. ifNoneMatch_ string
  114281. ctx_ context.Context
  114282. header_ http.Header
  114283. }
  114284. // List: List all the policies that have been configured for the
  114285. // specified project.
  114286. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  114287. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114288. c.project = project
  114289. return c
  114290. }
  114291. // Filter sets the optional parameter "filter": A filter expression that
  114292. // filters resources listed in the response. The expression must specify
  114293. // the field name, a comparison operator, and the value that you want to
  114294. // use for filtering. The value must be a string, a number, or a
  114295. // boolean. The comparison operator must be either =, !=, >, or <.
  114296. //
  114297. // For example, if you are filtering Compute Engine instances, you can
  114298. // exclude instances named example-instance by specifying name !=
  114299. // example-instance.
  114300. //
  114301. // You can also filter nested fields. For example, you could specify
  114302. // scheduling.automaticRestart = false to include instances only if they
  114303. // are not scheduled for automatic restarts. You can use filtering on
  114304. // nested fields to filter based on resource labels.
  114305. //
  114306. // To filter on multiple expressions, provide each separate expression
  114307. // within parentheses. For example, (scheduling.automaticRestart = true)
  114308. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114309. // AND expression. However, you can include AND and OR expressions
  114310. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114311. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114312. // true).
  114313. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  114314. c.urlParams_.Set("filter", filter)
  114315. return c
  114316. }
  114317. // MaxResults sets the optional parameter "maxResults": The maximum
  114318. // number of results per page that should be returned. If the number of
  114319. // available results is larger than maxResults, Compute Engine returns a
  114320. // nextPageToken that can be used to get the next page of results in
  114321. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114322. // (Default: 500)
  114323. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  114324. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114325. return c
  114326. }
  114327. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114328. // a certain order. By default, results are returned in alphanumerical
  114329. // order based on the resource name.
  114330. //
  114331. // You can also sort results in descending order based on the creation
  114332. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114333. // based on the creationTimestamp field in reverse chronological order
  114334. // (newest result first). Use this to sort resources like operations so
  114335. // that the newest operation is returned first.
  114336. //
  114337. // Currently, only sorting by name or creationTimestamp desc is
  114338. // supported.
  114339. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  114340. c.urlParams_.Set("orderBy", orderBy)
  114341. return c
  114342. }
  114343. // PageToken sets the optional parameter "pageToken": Specifies a page
  114344. // token to use. Set pageToken to the nextPageToken returned by a
  114345. // previous list request to get the next page of results.
  114346. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  114347. c.urlParams_.Set("pageToken", pageToken)
  114348. return c
  114349. }
  114350. // Fields allows partial responses to be retrieved. See
  114351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114352. // for more information.
  114353. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  114354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114355. return c
  114356. }
  114357. // IfNoneMatch sets the optional parameter which makes the operation
  114358. // fail if the object's ETag matches the given value. This is useful for
  114359. // getting updates only after the object has changed since the last
  114360. // request. Use googleapi.IsNotModified to check whether the response
  114361. // error from Do is the result of In-None-Match.
  114362. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  114363. c.ifNoneMatch_ = entityTag
  114364. return c
  114365. }
  114366. // Context sets the context to be used in this call's Do method. Any
  114367. // pending HTTP request will be aborted if the provided context is
  114368. // canceled.
  114369. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  114370. c.ctx_ = ctx
  114371. return c
  114372. }
  114373. // Header returns an http.Header that can be modified by the caller to
  114374. // add HTTP headers to the request.
  114375. func (c *SecurityPoliciesListCall) Header() http.Header {
  114376. if c.header_ == nil {
  114377. c.header_ = make(http.Header)
  114378. }
  114379. return c.header_
  114380. }
  114381. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  114382. reqHeaders := make(http.Header)
  114383. for k, v := range c.header_ {
  114384. reqHeaders[k] = v
  114385. }
  114386. reqHeaders.Set("User-Agent", c.s.userAgent())
  114387. if c.ifNoneMatch_ != "" {
  114388. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114389. }
  114390. var body io.Reader = nil
  114391. c.urlParams_.Set("alt", alt)
  114392. c.urlParams_.Set("prettyPrint", "false")
  114393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  114394. urls += "?" + c.urlParams_.Encode()
  114395. req, err := http.NewRequest("GET", urls, body)
  114396. if err != nil {
  114397. return nil, err
  114398. }
  114399. req.Header = reqHeaders
  114400. googleapi.Expand(req.URL, map[string]string{
  114401. "project": c.project,
  114402. })
  114403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114404. }
  114405. // Do executes the "compute.securityPolicies.list" call.
  114406. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  114407. // non-2xx status code is an error. Response headers are in either
  114408. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  114409. // returned at all) in error.(*googleapi.Error).Header. Use
  114410. // googleapi.IsNotModified to check whether the returned error was
  114411. // because http.StatusNotModified was returned.
  114412. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  114413. gensupport.SetOptions(c.urlParams_, opts...)
  114414. res, err := c.doRequest("json")
  114415. if res != nil && res.StatusCode == http.StatusNotModified {
  114416. if res.Body != nil {
  114417. res.Body.Close()
  114418. }
  114419. return nil, &googleapi.Error{
  114420. Code: res.StatusCode,
  114421. Header: res.Header,
  114422. }
  114423. }
  114424. if err != nil {
  114425. return nil, err
  114426. }
  114427. defer googleapi.CloseBody(res)
  114428. if err := googleapi.CheckResponse(res); err != nil {
  114429. return nil, err
  114430. }
  114431. ret := &SecurityPolicyList{
  114432. ServerResponse: googleapi.ServerResponse{
  114433. Header: res.Header,
  114434. HTTPStatusCode: res.StatusCode,
  114435. },
  114436. }
  114437. target := &ret
  114438. if err := gensupport.DecodeResponse(target, res); err != nil {
  114439. return nil, err
  114440. }
  114441. return ret, nil
  114442. // {
  114443. // "description": "List all the policies that have been configured for the specified project.",
  114444. // "httpMethod": "GET",
  114445. // "id": "compute.securityPolicies.list",
  114446. // "parameterOrder": [
  114447. // "project"
  114448. // ],
  114449. // "parameters": {
  114450. // "filter": {
  114451. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  114452. // "location": "query",
  114453. // "type": "string"
  114454. // },
  114455. // "maxResults": {
  114456. // "default": "500",
  114457. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  114458. // "format": "uint32",
  114459. // "location": "query",
  114460. // "minimum": "0",
  114461. // "type": "integer"
  114462. // },
  114463. // "orderBy": {
  114464. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  114465. // "location": "query",
  114466. // "type": "string"
  114467. // },
  114468. // "pageToken": {
  114469. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  114470. // "location": "query",
  114471. // "type": "string"
  114472. // },
  114473. // "project": {
  114474. // "description": "Project ID for this request.",
  114475. // "location": "path",
  114476. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114477. // "required": true,
  114478. // "type": "string"
  114479. // }
  114480. // },
  114481. // "path": "{project}/global/securityPolicies",
  114482. // "response": {
  114483. // "$ref": "SecurityPolicyList"
  114484. // },
  114485. // "scopes": [
  114486. // "https://www.googleapis.com/auth/cloud-platform",
  114487. // "https://www.googleapis.com/auth/compute",
  114488. // "https://www.googleapis.com/auth/compute.readonly"
  114489. // ]
  114490. // }
  114491. }
  114492. // Pages invokes f for each page of results.
  114493. // A non-nil error returned from f will halt the iteration.
  114494. // The provided context supersedes any context provided to the Context method.
  114495. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  114496. c.ctx_ = ctx
  114497. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  114498. for {
  114499. x, err := c.Do()
  114500. if err != nil {
  114501. return err
  114502. }
  114503. if err := f(x); err != nil {
  114504. return err
  114505. }
  114506. if x.NextPageToken == "" {
  114507. return nil
  114508. }
  114509. c.PageToken(x.NextPageToken)
  114510. }
  114511. }
  114512. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  114513. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  114514. s *Service
  114515. project string
  114516. urlParams_ gensupport.URLParams
  114517. ifNoneMatch_ string
  114518. ctx_ context.Context
  114519. header_ http.Header
  114520. }
  114521. // ListPreconfiguredExpressionSets: Gets the current list of
  114522. // preconfigured Web Application Firewall (WAF) expressions.
  114523. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114524. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114525. c.project = project
  114526. return c
  114527. }
  114528. // Filter sets the optional parameter "filter": A filter expression that
  114529. // filters resources listed in the response. The expression must specify
  114530. // the field name, a comparison operator, and the value that you want to
  114531. // use for filtering. The value must be a string, a number, or a
  114532. // boolean. The comparison operator must be either =, !=, >, or <.
  114533. //
  114534. // For example, if you are filtering Compute Engine instances, you can
  114535. // exclude instances named example-instance by specifying name !=
  114536. // example-instance.
  114537. //
  114538. // You can also filter nested fields. For example, you could specify
  114539. // scheduling.automaticRestart = false to include instances only if they
  114540. // are not scheduled for automatic restarts. You can use filtering on
  114541. // nested fields to filter based on resource labels.
  114542. //
  114543. // To filter on multiple expressions, provide each separate expression
  114544. // within parentheses. For example, (scheduling.automaticRestart = true)
  114545. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114546. // AND expression. However, you can include AND and OR expressions
  114547. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114548. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114549. // true).
  114550. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114551. c.urlParams_.Set("filter", filter)
  114552. return c
  114553. }
  114554. // MaxResults sets the optional parameter "maxResults": The maximum
  114555. // number of results per page that should be returned. If the number of
  114556. // available results is larger than maxResults, Compute Engine returns a
  114557. // nextPageToken that can be used to get the next page of results in
  114558. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114559. // (Default: 500)
  114560. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114561. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114562. return c
  114563. }
  114564. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114565. // a certain order. By default, results are returned in alphanumerical
  114566. // order based on the resource name.
  114567. //
  114568. // You can also sort results in descending order based on the creation
  114569. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114570. // based on the creationTimestamp field in reverse chronological order
  114571. // (newest result first). Use this to sort resources like operations so
  114572. // that the newest operation is returned first.
  114573. //
  114574. // Currently, only sorting by name or creationTimestamp desc is
  114575. // supported.
  114576. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114577. c.urlParams_.Set("orderBy", orderBy)
  114578. return c
  114579. }
  114580. // PageToken sets the optional parameter "pageToken": Specifies a page
  114581. // token to use. Set pageToken to the nextPageToken returned by a
  114582. // previous list request to get the next page of results.
  114583. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114584. c.urlParams_.Set("pageToken", pageToken)
  114585. return c
  114586. }
  114587. // Fields allows partial responses to be retrieved. See
  114588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114589. // for more information.
  114590. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114592. return c
  114593. }
  114594. // IfNoneMatch sets the optional parameter which makes the operation
  114595. // fail if the object's ETag matches the given value. This is useful for
  114596. // getting updates only after the object has changed since the last
  114597. // request. Use googleapi.IsNotModified to check whether the response
  114598. // error from Do is the result of In-None-Match.
  114599. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114600. c.ifNoneMatch_ = entityTag
  114601. return c
  114602. }
  114603. // Context sets the context to be used in this call's Do method. Any
  114604. // pending HTTP request will be aborted if the provided context is
  114605. // canceled.
  114606. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  114607. c.ctx_ = ctx
  114608. return c
  114609. }
  114610. // Header returns an http.Header that can be modified by the caller to
  114611. // add HTTP headers to the request.
  114612. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  114613. if c.header_ == nil {
  114614. c.header_ = make(http.Header)
  114615. }
  114616. return c.header_
  114617. }
  114618. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  114619. reqHeaders := make(http.Header)
  114620. for k, v := range c.header_ {
  114621. reqHeaders[k] = v
  114622. }
  114623. reqHeaders.Set("User-Agent", c.s.userAgent())
  114624. if c.ifNoneMatch_ != "" {
  114625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114626. }
  114627. var body io.Reader = nil
  114628. c.urlParams_.Set("alt", alt)
  114629. c.urlParams_.Set("prettyPrint", "false")
  114630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  114631. urls += "?" + c.urlParams_.Encode()
  114632. req, err := http.NewRequest("GET", urls, body)
  114633. if err != nil {
  114634. return nil, err
  114635. }
  114636. req.Header = reqHeaders
  114637. googleapi.Expand(req.URL, map[string]string{
  114638. "project": c.project,
  114639. })
  114640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114641. }
  114642. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  114643. // Exactly one of
  114644. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  114645. // will be non-nil. Any non-2xx status code is an error. Response
  114646. // headers are in either
  114647. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  114648. // e.Header or (if a response was returned at all) in
  114649. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  114650. // whether the returned error was because http.StatusNotModified was
  114651. // returned.
  114652. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  114653. gensupport.SetOptions(c.urlParams_, opts...)
  114654. res, err := c.doRequest("json")
  114655. if res != nil && res.StatusCode == http.StatusNotModified {
  114656. if res.Body != nil {
  114657. res.Body.Close()
  114658. }
  114659. return nil, &googleapi.Error{
  114660. Code: res.StatusCode,
  114661. Header: res.Header,
  114662. }
  114663. }
  114664. if err != nil {
  114665. return nil, err
  114666. }
  114667. defer googleapi.CloseBody(res)
  114668. if err := googleapi.CheckResponse(res); err != nil {
  114669. return nil, err
  114670. }
  114671. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  114672. ServerResponse: googleapi.ServerResponse{
  114673. Header: res.Header,
  114674. HTTPStatusCode: res.StatusCode,
  114675. },
  114676. }
  114677. target := &ret
  114678. if err := gensupport.DecodeResponse(target, res); err != nil {
  114679. return nil, err
  114680. }
  114681. return ret, nil
  114682. // {
  114683. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  114684. // "httpMethod": "GET",
  114685. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  114686. // "parameterOrder": [
  114687. // "project"
  114688. // ],
  114689. // "parameters": {
  114690. // "filter": {
  114691. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  114692. // "location": "query",
  114693. // "type": "string"
  114694. // },
  114695. // "maxResults": {
  114696. // "default": "500",
  114697. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  114698. // "format": "uint32",
  114699. // "location": "query",
  114700. // "minimum": "0",
  114701. // "type": "integer"
  114702. // },
  114703. // "orderBy": {
  114704. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  114705. // "location": "query",
  114706. // "type": "string"
  114707. // },
  114708. // "pageToken": {
  114709. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  114710. // "location": "query",
  114711. // "type": "string"
  114712. // },
  114713. // "project": {
  114714. // "description": "Project ID for this request.",
  114715. // "location": "path",
  114716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114717. // "required": true,
  114718. // "type": "string"
  114719. // }
  114720. // },
  114721. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  114722. // "response": {
  114723. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  114724. // },
  114725. // "scopes": [
  114726. // "https://www.googleapis.com/auth/cloud-platform",
  114727. // "https://www.googleapis.com/auth/compute"
  114728. // ]
  114729. // }
  114730. }
  114731. // method id "compute.securityPolicies.patch":
  114732. type SecurityPoliciesPatchCall struct {
  114733. s *Service
  114734. project string
  114735. securityPolicy string
  114736. securitypolicy *SecurityPolicy
  114737. urlParams_ gensupport.URLParams
  114738. ctx_ context.Context
  114739. header_ http.Header
  114740. }
  114741. // Patch: Patches the specified policy with the data included in the
  114742. // request.
  114743. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  114744. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114745. c.project = project
  114746. c.securityPolicy = securityPolicy
  114747. c.securitypolicy = securitypolicy
  114748. return c
  114749. }
  114750. // RequestId sets the optional parameter "requestId": An optional
  114751. // request ID to identify requests. Specify a unique request ID so that
  114752. // if you must retry your request, the server will know to ignore the
  114753. // request if it has already been completed.
  114754. //
  114755. // For example, consider a situation where you make an initial request
  114756. // and the request times out. If you make the request again with the
  114757. // same request ID, the server can check if original operation with the
  114758. // same request ID was received, and if so, will ignore the second
  114759. // request. This prevents clients from accidentally creating duplicate
  114760. // commitments.
  114761. //
  114762. // The request ID must be a valid UUID with the exception that zero UUID
  114763. // is not supported (00000000-0000-0000-0000-000000000000).
  114764. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  114765. c.urlParams_.Set("requestId", requestId)
  114766. return c
  114767. }
  114768. // Fields allows partial responses to be retrieved. See
  114769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114770. // for more information.
  114771. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  114772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114773. return c
  114774. }
  114775. // Context sets the context to be used in this call's Do method. Any
  114776. // pending HTTP request will be aborted if the provided context is
  114777. // canceled.
  114778. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  114779. c.ctx_ = ctx
  114780. return c
  114781. }
  114782. // Header returns an http.Header that can be modified by the caller to
  114783. // add HTTP headers to the request.
  114784. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  114785. if c.header_ == nil {
  114786. c.header_ = make(http.Header)
  114787. }
  114788. return c.header_
  114789. }
  114790. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  114791. reqHeaders := make(http.Header)
  114792. for k, v := range c.header_ {
  114793. reqHeaders[k] = v
  114794. }
  114795. reqHeaders.Set("User-Agent", c.s.userAgent())
  114796. var body io.Reader = nil
  114797. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  114798. if err != nil {
  114799. return nil, err
  114800. }
  114801. reqHeaders.Set("Content-Type", "application/json")
  114802. c.urlParams_.Set("alt", alt)
  114803. c.urlParams_.Set("prettyPrint", "false")
  114804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  114805. urls += "?" + c.urlParams_.Encode()
  114806. req, err := http.NewRequest("PATCH", urls, body)
  114807. if err != nil {
  114808. return nil, err
  114809. }
  114810. req.Header = reqHeaders
  114811. googleapi.Expand(req.URL, map[string]string{
  114812. "project": c.project,
  114813. "securityPolicy": c.securityPolicy,
  114814. })
  114815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114816. }
  114817. // Do executes the "compute.securityPolicies.patch" call.
  114818. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114819. // status code is an error. Response headers are in either
  114820. // *Operation.ServerResponse.Header or (if a response was returned at
  114821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114822. // to check whether the returned error was because
  114823. // http.StatusNotModified was returned.
  114824. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114825. gensupport.SetOptions(c.urlParams_, opts...)
  114826. res, err := c.doRequest("json")
  114827. if res != nil && res.StatusCode == http.StatusNotModified {
  114828. if res.Body != nil {
  114829. res.Body.Close()
  114830. }
  114831. return nil, &googleapi.Error{
  114832. Code: res.StatusCode,
  114833. Header: res.Header,
  114834. }
  114835. }
  114836. if err != nil {
  114837. return nil, err
  114838. }
  114839. defer googleapi.CloseBody(res)
  114840. if err := googleapi.CheckResponse(res); err != nil {
  114841. return nil, err
  114842. }
  114843. ret := &Operation{
  114844. ServerResponse: googleapi.ServerResponse{
  114845. Header: res.Header,
  114846. HTTPStatusCode: res.StatusCode,
  114847. },
  114848. }
  114849. target := &ret
  114850. if err := gensupport.DecodeResponse(target, res); err != nil {
  114851. return nil, err
  114852. }
  114853. return ret, nil
  114854. // {
  114855. // "description": "Patches the specified policy with the data included in the request.",
  114856. // "httpMethod": "PATCH",
  114857. // "id": "compute.securityPolicies.patch",
  114858. // "parameterOrder": [
  114859. // "project",
  114860. // "securityPolicy"
  114861. // ],
  114862. // "parameters": {
  114863. // "project": {
  114864. // "description": "Project ID for this request.",
  114865. // "location": "path",
  114866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114867. // "required": true,
  114868. // "type": "string"
  114869. // },
  114870. // "requestId": {
  114871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114872. // "location": "query",
  114873. // "type": "string"
  114874. // },
  114875. // "securityPolicy": {
  114876. // "description": "Name of the security policy to update.",
  114877. // "location": "path",
  114878. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114879. // "required": true,
  114880. // "type": "string"
  114881. // }
  114882. // },
  114883. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  114884. // "request": {
  114885. // "$ref": "SecurityPolicy"
  114886. // },
  114887. // "response": {
  114888. // "$ref": "Operation"
  114889. // },
  114890. // "scopes": [
  114891. // "https://www.googleapis.com/auth/cloud-platform",
  114892. // "https://www.googleapis.com/auth/compute"
  114893. // ]
  114894. // }
  114895. }
  114896. // method id "compute.securityPolicies.patchRule":
  114897. type SecurityPoliciesPatchRuleCall struct {
  114898. s *Service
  114899. project string
  114900. securityPolicy string
  114901. securitypolicyrule *SecurityPolicyRule
  114902. urlParams_ gensupport.URLParams
  114903. ctx_ context.Context
  114904. header_ http.Header
  114905. }
  114906. // PatchRule: Patches a rule at the specified priority.
  114907. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  114908. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114909. c.project = project
  114910. c.securityPolicy = securityPolicy
  114911. c.securitypolicyrule = securitypolicyrule
  114912. return c
  114913. }
  114914. // Priority sets the optional parameter "priority": The priority of the
  114915. // rule to patch.
  114916. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  114917. c.urlParams_.Set("priority", fmt.Sprint(priority))
  114918. return c
  114919. }
  114920. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  114921. // request will not be committed.
  114922. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  114923. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  114924. return c
  114925. }
  114926. // Fields allows partial responses to be retrieved. See
  114927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114928. // for more information.
  114929. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  114930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114931. return c
  114932. }
  114933. // Context sets the context to be used in this call's Do method. Any
  114934. // pending HTTP request will be aborted if the provided context is
  114935. // canceled.
  114936. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  114937. c.ctx_ = ctx
  114938. return c
  114939. }
  114940. // Header returns an http.Header that can be modified by the caller to
  114941. // add HTTP headers to the request.
  114942. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  114943. if c.header_ == nil {
  114944. c.header_ = make(http.Header)
  114945. }
  114946. return c.header_
  114947. }
  114948. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  114949. reqHeaders := make(http.Header)
  114950. for k, v := range c.header_ {
  114951. reqHeaders[k] = v
  114952. }
  114953. reqHeaders.Set("User-Agent", c.s.userAgent())
  114954. var body io.Reader = nil
  114955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  114956. if err != nil {
  114957. return nil, err
  114958. }
  114959. reqHeaders.Set("Content-Type", "application/json")
  114960. c.urlParams_.Set("alt", alt)
  114961. c.urlParams_.Set("prettyPrint", "false")
  114962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  114963. urls += "?" + c.urlParams_.Encode()
  114964. req, err := http.NewRequest("POST", urls, body)
  114965. if err != nil {
  114966. return nil, err
  114967. }
  114968. req.Header = reqHeaders
  114969. googleapi.Expand(req.URL, map[string]string{
  114970. "project": c.project,
  114971. "securityPolicy": c.securityPolicy,
  114972. })
  114973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114974. }
  114975. // Do executes the "compute.securityPolicies.patchRule" call.
  114976. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114977. // status code is an error. Response headers are in either
  114978. // *Operation.ServerResponse.Header or (if a response was returned at
  114979. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114980. // to check whether the returned error was because
  114981. // http.StatusNotModified was returned.
  114982. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114983. gensupport.SetOptions(c.urlParams_, opts...)
  114984. res, err := c.doRequest("json")
  114985. if res != nil && res.StatusCode == http.StatusNotModified {
  114986. if res.Body != nil {
  114987. res.Body.Close()
  114988. }
  114989. return nil, &googleapi.Error{
  114990. Code: res.StatusCode,
  114991. Header: res.Header,
  114992. }
  114993. }
  114994. if err != nil {
  114995. return nil, err
  114996. }
  114997. defer googleapi.CloseBody(res)
  114998. if err := googleapi.CheckResponse(res); err != nil {
  114999. return nil, err
  115000. }
  115001. ret := &Operation{
  115002. ServerResponse: googleapi.ServerResponse{
  115003. Header: res.Header,
  115004. HTTPStatusCode: res.StatusCode,
  115005. },
  115006. }
  115007. target := &ret
  115008. if err := gensupport.DecodeResponse(target, res); err != nil {
  115009. return nil, err
  115010. }
  115011. return ret, nil
  115012. // {
  115013. // "description": "Patches a rule at the specified priority.",
  115014. // "httpMethod": "POST",
  115015. // "id": "compute.securityPolicies.patchRule",
  115016. // "parameterOrder": [
  115017. // "project",
  115018. // "securityPolicy"
  115019. // ],
  115020. // "parameters": {
  115021. // "priority": {
  115022. // "description": "The priority of the rule to patch.",
  115023. // "format": "int32",
  115024. // "location": "query",
  115025. // "type": "integer"
  115026. // },
  115027. // "project": {
  115028. // "description": "Project ID for this request.",
  115029. // "location": "path",
  115030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115031. // "required": true,
  115032. // "type": "string"
  115033. // },
  115034. // "securityPolicy": {
  115035. // "description": "Name of the security policy to update.",
  115036. // "location": "path",
  115037. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115038. // "required": true,
  115039. // "type": "string"
  115040. // },
  115041. // "validateOnly": {
  115042. // "description": "If true, the request will not be committed.",
  115043. // "location": "query",
  115044. // "type": "boolean"
  115045. // }
  115046. // },
  115047. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  115048. // "request": {
  115049. // "$ref": "SecurityPolicyRule"
  115050. // },
  115051. // "response": {
  115052. // "$ref": "Operation"
  115053. // },
  115054. // "scopes": [
  115055. // "https://www.googleapis.com/auth/cloud-platform",
  115056. // "https://www.googleapis.com/auth/compute"
  115057. // ]
  115058. // }
  115059. }
  115060. // method id "compute.securityPolicies.removeRule":
  115061. type SecurityPoliciesRemoveRuleCall struct {
  115062. s *Service
  115063. project string
  115064. securityPolicy string
  115065. urlParams_ gensupport.URLParams
  115066. ctx_ context.Context
  115067. header_ http.Header
  115068. }
  115069. // RemoveRule: Deletes a rule at the specified priority.
  115070. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  115071. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115072. c.project = project
  115073. c.securityPolicy = securityPolicy
  115074. return c
  115075. }
  115076. // Priority sets the optional parameter "priority": The priority of the
  115077. // rule to remove from the security policy.
  115078. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  115079. c.urlParams_.Set("priority", fmt.Sprint(priority))
  115080. return c
  115081. }
  115082. // Fields allows partial responses to be retrieved. See
  115083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115084. // for more information.
  115085. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  115086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115087. return c
  115088. }
  115089. // Context sets the context to be used in this call's Do method. Any
  115090. // pending HTTP request will be aborted if the provided context is
  115091. // canceled.
  115092. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  115093. c.ctx_ = ctx
  115094. return c
  115095. }
  115096. // Header returns an http.Header that can be modified by the caller to
  115097. // add HTTP headers to the request.
  115098. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  115099. if c.header_ == nil {
  115100. c.header_ = make(http.Header)
  115101. }
  115102. return c.header_
  115103. }
  115104. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  115105. reqHeaders := make(http.Header)
  115106. for k, v := range c.header_ {
  115107. reqHeaders[k] = v
  115108. }
  115109. reqHeaders.Set("User-Agent", c.s.userAgent())
  115110. var body io.Reader = nil
  115111. c.urlParams_.Set("alt", alt)
  115112. c.urlParams_.Set("prettyPrint", "false")
  115113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  115114. urls += "?" + c.urlParams_.Encode()
  115115. req, err := http.NewRequest("POST", urls, body)
  115116. if err != nil {
  115117. return nil, err
  115118. }
  115119. req.Header = reqHeaders
  115120. googleapi.Expand(req.URL, map[string]string{
  115121. "project": c.project,
  115122. "securityPolicy": c.securityPolicy,
  115123. })
  115124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115125. }
  115126. // Do executes the "compute.securityPolicies.removeRule" call.
  115127. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115128. // status code is an error. Response headers are in either
  115129. // *Operation.ServerResponse.Header or (if a response was returned at
  115130. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115131. // to check whether the returned error was because
  115132. // http.StatusNotModified was returned.
  115133. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115134. gensupport.SetOptions(c.urlParams_, opts...)
  115135. res, err := c.doRequest("json")
  115136. if res != nil && res.StatusCode == http.StatusNotModified {
  115137. if res.Body != nil {
  115138. res.Body.Close()
  115139. }
  115140. return nil, &googleapi.Error{
  115141. Code: res.StatusCode,
  115142. Header: res.Header,
  115143. }
  115144. }
  115145. if err != nil {
  115146. return nil, err
  115147. }
  115148. defer googleapi.CloseBody(res)
  115149. if err := googleapi.CheckResponse(res); err != nil {
  115150. return nil, err
  115151. }
  115152. ret := &Operation{
  115153. ServerResponse: googleapi.ServerResponse{
  115154. Header: res.Header,
  115155. HTTPStatusCode: res.StatusCode,
  115156. },
  115157. }
  115158. target := &ret
  115159. if err := gensupport.DecodeResponse(target, res); err != nil {
  115160. return nil, err
  115161. }
  115162. return ret, nil
  115163. // {
  115164. // "description": "Deletes a rule at the specified priority.",
  115165. // "httpMethod": "POST",
  115166. // "id": "compute.securityPolicies.removeRule",
  115167. // "parameterOrder": [
  115168. // "project",
  115169. // "securityPolicy"
  115170. // ],
  115171. // "parameters": {
  115172. // "priority": {
  115173. // "description": "The priority of the rule to remove from the security policy.",
  115174. // "format": "int32",
  115175. // "location": "query",
  115176. // "type": "integer"
  115177. // },
  115178. // "project": {
  115179. // "description": "Project ID for this request.",
  115180. // "location": "path",
  115181. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115182. // "required": true,
  115183. // "type": "string"
  115184. // },
  115185. // "securityPolicy": {
  115186. // "description": "Name of the security policy to update.",
  115187. // "location": "path",
  115188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115189. // "required": true,
  115190. // "type": "string"
  115191. // }
  115192. // },
  115193. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  115194. // "response": {
  115195. // "$ref": "Operation"
  115196. // },
  115197. // "scopes": [
  115198. // "https://www.googleapis.com/auth/cloud-platform",
  115199. // "https://www.googleapis.com/auth/compute"
  115200. // ]
  115201. // }
  115202. }
  115203. // method id "compute.securityPolicies.setLabels":
  115204. type SecurityPoliciesSetLabelsCall struct {
  115205. s *Service
  115206. project string
  115207. resource string
  115208. globalsetlabelsrequest *GlobalSetLabelsRequest
  115209. urlParams_ gensupport.URLParams
  115210. ctx_ context.Context
  115211. header_ http.Header
  115212. }
  115213. // SetLabels: Sets the labels on a security policy. To learn more about
  115214. // labels, read the Labeling Resources documentation.
  115215. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  115216. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115217. c.project = project
  115218. c.resource = resource
  115219. c.globalsetlabelsrequest = globalsetlabelsrequest
  115220. return c
  115221. }
  115222. // Fields allows partial responses to be retrieved. See
  115223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115224. // for more information.
  115225. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  115226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115227. return c
  115228. }
  115229. // Context sets the context to be used in this call's Do method. Any
  115230. // pending HTTP request will be aborted if the provided context is
  115231. // canceled.
  115232. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  115233. c.ctx_ = ctx
  115234. return c
  115235. }
  115236. // Header returns an http.Header that can be modified by the caller to
  115237. // add HTTP headers to the request.
  115238. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  115239. if c.header_ == nil {
  115240. c.header_ = make(http.Header)
  115241. }
  115242. return c.header_
  115243. }
  115244. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  115245. reqHeaders := make(http.Header)
  115246. for k, v := range c.header_ {
  115247. reqHeaders[k] = v
  115248. }
  115249. reqHeaders.Set("User-Agent", c.s.userAgent())
  115250. var body io.Reader = nil
  115251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  115252. if err != nil {
  115253. return nil, err
  115254. }
  115255. reqHeaders.Set("Content-Type", "application/json")
  115256. c.urlParams_.Set("alt", alt)
  115257. c.urlParams_.Set("prettyPrint", "false")
  115258. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  115259. urls += "?" + c.urlParams_.Encode()
  115260. req, err := http.NewRequest("POST", urls, body)
  115261. if err != nil {
  115262. return nil, err
  115263. }
  115264. req.Header = reqHeaders
  115265. googleapi.Expand(req.URL, map[string]string{
  115266. "project": c.project,
  115267. "resource": c.resource,
  115268. })
  115269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115270. }
  115271. // Do executes the "compute.securityPolicies.setLabels" call.
  115272. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115273. // status code is an error. Response headers are in either
  115274. // *Operation.ServerResponse.Header or (if a response was returned at
  115275. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115276. // to check whether the returned error was because
  115277. // http.StatusNotModified was returned.
  115278. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115279. gensupport.SetOptions(c.urlParams_, opts...)
  115280. res, err := c.doRequest("json")
  115281. if res != nil && res.StatusCode == http.StatusNotModified {
  115282. if res.Body != nil {
  115283. res.Body.Close()
  115284. }
  115285. return nil, &googleapi.Error{
  115286. Code: res.StatusCode,
  115287. Header: res.Header,
  115288. }
  115289. }
  115290. if err != nil {
  115291. return nil, err
  115292. }
  115293. defer googleapi.CloseBody(res)
  115294. if err := googleapi.CheckResponse(res); err != nil {
  115295. return nil, err
  115296. }
  115297. ret := &Operation{
  115298. ServerResponse: googleapi.ServerResponse{
  115299. Header: res.Header,
  115300. HTTPStatusCode: res.StatusCode,
  115301. },
  115302. }
  115303. target := &ret
  115304. if err := gensupport.DecodeResponse(target, res); err != nil {
  115305. return nil, err
  115306. }
  115307. return ret, nil
  115308. // {
  115309. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  115310. // "httpMethod": "POST",
  115311. // "id": "compute.securityPolicies.setLabels",
  115312. // "parameterOrder": [
  115313. // "project",
  115314. // "resource"
  115315. // ],
  115316. // "parameters": {
  115317. // "project": {
  115318. // "description": "Project ID for this request.",
  115319. // "location": "path",
  115320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115321. // "required": true,
  115322. // "type": "string"
  115323. // },
  115324. // "resource": {
  115325. // "description": "Name or id of the resource for this request.",
  115326. // "location": "path",
  115327. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115328. // "required": true,
  115329. // "type": "string"
  115330. // }
  115331. // },
  115332. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  115333. // "request": {
  115334. // "$ref": "GlobalSetLabelsRequest"
  115335. // },
  115336. // "response": {
  115337. // "$ref": "Operation"
  115338. // },
  115339. // "scopes": [
  115340. // "https://www.googleapis.com/auth/cloud-platform",
  115341. // "https://www.googleapis.com/auth/compute"
  115342. // ]
  115343. // }
  115344. }
  115345. // method id "compute.securityPolicies.testIamPermissions":
  115346. type SecurityPoliciesTestIamPermissionsCall struct {
  115347. s *Service
  115348. project string
  115349. resource string
  115350. testpermissionsrequest *TestPermissionsRequest
  115351. urlParams_ gensupport.URLParams
  115352. ctx_ context.Context
  115353. header_ http.Header
  115354. }
  115355. // TestIamPermissions: Returns permissions that a caller has on the
  115356. // specified resource.
  115357. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  115358. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115359. c.project = project
  115360. c.resource = resource
  115361. c.testpermissionsrequest = testpermissionsrequest
  115362. return c
  115363. }
  115364. // Fields allows partial responses to be retrieved. See
  115365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115366. // for more information.
  115367. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  115368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115369. return c
  115370. }
  115371. // Context sets the context to be used in this call's Do method. Any
  115372. // pending HTTP request will be aborted if the provided context is
  115373. // canceled.
  115374. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  115375. c.ctx_ = ctx
  115376. return c
  115377. }
  115378. // Header returns an http.Header that can be modified by the caller to
  115379. // add HTTP headers to the request.
  115380. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  115381. if c.header_ == nil {
  115382. c.header_ = make(http.Header)
  115383. }
  115384. return c.header_
  115385. }
  115386. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  115387. reqHeaders := make(http.Header)
  115388. for k, v := range c.header_ {
  115389. reqHeaders[k] = v
  115390. }
  115391. reqHeaders.Set("User-Agent", c.s.userAgent())
  115392. var body io.Reader = nil
  115393. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  115394. if err != nil {
  115395. return nil, err
  115396. }
  115397. reqHeaders.Set("Content-Type", "application/json")
  115398. c.urlParams_.Set("alt", alt)
  115399. c.urlParams_.Set("prettyPrint", "false")
  115400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  115401. urls += "?" + c.urlParams_.Encode()
  115402. req, err := http.NewRequest("POST", urls, body)
  115403. if err != nil {
  115404. return nil, err
  115405. }
  115406. req.Header = reqHeaders
  115407. googleapi.Expand(req.URL, map[string]string{
  115408. "project": c.project,
  115409. "resource": c.resource,
  115410. })
  115411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115412. }
  115413. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  115414. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  115415. // non-2xx status code is an error. Response headers are in either
  115416. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  115417. // returned at all) in error.(*googleapi.Error).Header. Use
  115418. // googleapi.IsNotModified to check whether the returned error was
  115419. // because http.StatusNotModified was returned.
  115420. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  115421. gensupport.SetOptions(c.urlParams_, opts...)
  115422. res, err := c.doRequest("json")
  115423. if res != nil && res.StatusCode == http.StatusNotModified {
  115424. if res.Body != nil {
  115425. res.Body.Close()
  115426. }
  115427. return nil, &googleapi.Error{
  115428. Code: res.StatusCode,
  115429. Header: res.Header,
  115430. }
  115431. }
  115432. if err != nil {
  115433. return nil, err
  115434. }
  115435. defer googleapi.CloseBody(res)
  115436. if err := googleapi.CheckResponse(res); err != nil {
  115437. return nil, err
  115438. }
  115439. ret := &TestPermissionsResponse{
  115440. ServerResponse: googleapi.ServerResponse{
  115441. Header: res.Header,
  115442. HTTPStatusCode: res.StatusCode,
  115443. },
  115444. }
  115445. target := &ret
  115446. if err := gensupport.DecodeResponse(target, res); err != nil {
  115447. return nil, err
  115448. }
  115449. return ret, nil
  115450. // {
  115451. // "description": "Returns permissions that a caller has on the specified resource.",
  115452. // "httpMethod": "POST",
  115453. // "id": "compute.securityPolicies.testIamPermissions",
  115454. // "parameterOrder": [
  115455. // "project",
  115456. // "resource"
  115457. // ],
  115458. // "parameters": {
  115459. // "project": {
  115460. // "description": "Project ID for this request.",
  115461. // "location": "path",
  115462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115463. // "required": true,
  115464. // "type": "string"
  115465. // },
  115466. // "resource": {
  115467. // "description": "Name or id of the resource for this request.",
  115468. // "location": "path",
  115469. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115470. // "required": true,
  115471. // "type": "string"
  115472. // }
  115473. // },
  115474. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  115475. // "request": {
  115476. // "$ref": "TestPermissionsRequest"
  115477. // },
  115478. // "response": {
  115479. // "$ref": "TestPermissionsResponse"
  115480. // },
  115481. // "scopes": [
  115482. // "https://www.googleapis.com/auth/cloud-platform",
  115483. // "https://www.googleapis.com/auth/compute",
  115484. // "https://www.googleapis.com/auth/compute.readonly"
  115485. // ]
  115486. // }
  115487. }
  115488. // method id "compute.snapshots.delete":
  115489. type SnapshotsDeleteCall struct {
  115490. s *Service
  115491. project string
  115492. snapshot string
  115493. urlParams_ gensupport.URLParams
  115494. ctx_ context.Context
  115495. header_ http.Header
  115496. }
  115497. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  115498. // deleting a single snapshot might not necessarily delete all the data
  115499. // on that snapshot. If any data on the snapshot that is marked for
  115500. // deletion is needed for subsequent snapshots, the data will be moved
  115501. // to the next corresponding snapshot.
  115502. //
  115503. // For more information, see Deleting snapshots.
  115504. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  115505. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  115506. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115507. c.project = project
  115508. c.snapshot = snapshot
  115509. return c
  115510. }
  115511. // RequestId sets the optional parameter "requestId": An optional
  115512. // request ID to identify requests. Specify a unique request ID so that
  115513. // if you must retry your request, the server will know to ignore the
  115514. // request if it has already been completed.
  115515. //
  115516. // For example, consider a situation where you make an initial request
  115517. // and the request times out. If you make the request again with the
  115518. // same request ID, the server can check if original operation with the
  115519. // same request ID was received, and if so, will ignore the second
  115520. // request. This prevents clients from accidentally creating duplicate
  115521. // commitments.
  115522. //
  115523. // The request ID must be a valid UUID with the exception that zero UUID
  115524. // is not supported (00000000-0000-0000-0000-000000000000).
  115525. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  115526. c.urlParams_.Set("requestId", requestId)
  115527. return c
  115528. }
  115529. // Fields allows partial responses to be retrieved. See
  115530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115531. // for more information.
  115532. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  115533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115534. return c
  115535. }
  115536. // Context sets the context to be used in this call's Do method. Any
  115537. // pending HTTP request will be aborted if the provided context is
  115538. // canceled.
  115539. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  115540. c.ctx_ = ctx
  115541. return c
  115542. }
  115543. // Header returns an http.Header that can be modified by the caller to
  115544. // add HTTP headers to the request.
  115545. func (c *SnapshotsDeleteCall) Header() http.Header {
  115546. if c.header_ == nil {
  115547. c.header_ = make(http.Header)
  115548. }
  115549. return c.header_
  115550. }
  115551. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  115552. reqHeaders := make(http.Header)
  115553. for k, v := range c.header_ {
  115554. reqHeaders[k] = v
  115555. }
  115556. reqHeaders.Set("User-Agent", c.s.userAgent())
  115557. var body io.Reader = nil
  115558. c.urlParams_.Set("alt", alt)
  115559. c.urlParams_.Set("prettyPrint", "false")
  115560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  115561. urls += "?" + c.urlParams_.Encode()
  115562. req, err := http.NewRequest("DELETE", urls, body)
  115563. if err != nil {
  115564. return nil, err
  115565. }
  115566. req.Header = reqHeaders
  115567. googleapi.Expand(req.URL, map[string]string{
  115568. "project": c.project,
  115569. "snapshot": c.snapshot,
  115570. })
  115571. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115572. }
  115573. // Do executes the "compute.snapshots.delete" call.
  115574. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115575. // status code is an error. Response headers are in either
  115576. // *Operation.ServerResponse.Header or (if a response was returned at
  115577. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115578. // to check whether the returned error was because
  115579. // http.StatusNotModified was returned.
  115580. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115581. gensupport.SetOptions(c.urlParams_, opts...)
  115582. res, err := c.doRequest("json")
  115583. if res != nil && res.StatusCode == http.StatusNotModified {
  115584. if res.Body != nil {
  115585. res.Body.Close()
  115586. }
  115587. return nil, &googleapi.Error{
  115588. Code: res.StatusCode,
  115589. Header: res.Header,
  115590. }
  115591. }
  115592. if err != nil {
  115593. return nil, err
  115594. }
  115595. defer googleapi.CloseBody(res)
  115596. if err := googleapi.CheckResponse(res); err != nil {
  115597. return nil, err
  115598. }
  115599. ret := &Operation{
  115600. ServerResponse: googleapi.ServerResponse{
  115601. Header: res.Header,
  115602. HTTPStatusCode: res.StatusCode,
  115603. },
  115604. }
  115605. target := &ret
  115606. if err := gensupport.DecodeResponse(target, res); err != nil {
  115607. return nil, err
  115608. }
  115609. return ret, nil
  115610. // {
  115611. // "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.",
  115612. // "httpMethod": "DELETE",
  115613. // "id": "compute.snapshots.delete",
  115614. // "parameterOrder": [
  115615. // "project",
  115616. // "snapshot"
  115617. // ],
  115618. // "parameters": {
  115619. // "project": {
  115620. // "description": "Project ID for this request.",
  115621. // "location": "path",
  115622. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115623. // "required": true,
  115624. // "type": "string"
  115625. // },
  115626. // "requestId": {
  115627. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115628. // "location": "query",
  115629. // "type": "string"
  115630. // },
  115631. // "snapshot": {
  115632. // "description": "Name of the Snapshot resource to delete.",
  115633. // "location": "path",
  115634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115635. // "required": true,
  115636. // "type": "string"
  115637. // }
  115638. // },
  115639. // "path": "{project}/global/snapshots/{snapshot}",
  115640. // "response": {
  115641. // "$ref": "Operation"
  115642. // },
  115643. // "scopes": [
  115644. // "https://www.googleapis.com/auth/cloud-platform",
  115645. // "https://www.googleapis.com/auth/compute"
  115646. // ]
  115647. // }
  115648. }
  115649. // method id "compute.snapshots.get":
  115650. type SnapshotsGetCall struct {
  115651. s *Service
  115652. project string
  115653. snapshot string
  115654. urlParams_ gensupport.URLParams
  115655. ifNoneMatch_ string
  115656. ctx_ context.Context
  115657. header_ http.Header
  115658. }
  115659. // Get: Returns the specified Snapshot resource. Gets a list of
  115660. // available snapshots by making a list() request.
  115661. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  115662. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  115663. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115664. c.project = project
  115665. c.snapshot = snapshot
  115666. return c
  115667. }
  115668. // Fields allows partial responses to be retrieved. See
  115669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115670. // for more information.
  115671. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  115672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115673. return c
  115674. }
  115675. // IfNoneMatch sets the optional parameter which makes the operation
  115676. // fail if the object's ETag matches the given value. This is useful for
  115677. // getting updates only after the object has changed since the last
  115678. // request. Use googleapi.IsNotModified to check whether the response
  115679. // error from Do is the result of In-None-Match.
  115680. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  115681. c.ifNoneMatch_ = entityTag
  115682. return c
  115683. }
  115684. // Context sets the context to be used in this call's Do method. Any
  115685. // pending HTTP request will be aborted if the provided context is
  115686. // canceled.
  115687. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  115688. c.ctx_ = ctx
  115689. return c
  115690. }
  115691. // Header returns an http.Header that can be modified by the caller to
  115692. // add HTTP headers to the request.
  115693. func (c *SnapshotsGetCall) Header() http.Header {
  115694. if c.header_ == nil {
  115695. c.header_ = make(http.Header)
  115696. }
  115697. return c.header_
  115698. }
  115699. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  115700. reqHeaders := make(http.Header)
  115701. for k, v := range c.header_ {
  115702. reqHeaders[k] = v
  115703. }
  115704. reqHeaders.Set("User-Agent", c.s.userAgent())
  115705. if c.ifNoneMatch_ != "" {
  115706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115707. }
  115708. var body io.Reader = nil
  115709. c.urlParams_.Set("alt", alt)
  115710. c.urlParams_.Set("prettyPrint", "false")
  115711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  115712. urls += "?" + c.urlParams_.Encode()
  115713. req, err := http.NewRequest("GET", urls, body)
  115714. if err != nil {
  115715. return nil, err
  115716. }
  115717. req.Header = reqHeaders
  115718. googleapi.Expand(req.URL, map[string]string{
  115719. "project": c.project,
  115720. "snapshot": c.snapshot,
  115721. })
  115722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115723. }
  115724. // Do executes the "compute.snapshots.get" call.
  115725. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  115726. // code is an error. Response headers are in either
  115727. // *Snapshot.ServerResponse.Header or (if a response was returned at
  115728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115729. // to check whether the returned error was because
  115730. // http.StatusNotModified was returned.
  115731. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  115732. gensupport.SetOptions(c.urlParams_, opts...)
  115733. res, err := c.doRequest("json")
  115734. if res != nil && res.StatusCode == http.StatusNotModified {
  115735. if res.Body != nil {
  115736. res.Body.Close()
  115737. }
  115738. return nil, &googleapi.Error{
  115739. Code: res.StatusCode,
  115740. Header: res.Header,
  115741. }
  115742. }
  115743. if err != nil {
  115744. return nil, err
  115745. }
  115746. defer googleapi.CloseBody(res)
  115747. if err := googleapi.CheckResponse(res); err != nil {
  115748. return nil, err
  115749. }
  115750. ret := &Snapshot{
  115751. ServerResponse: googleapi.ServerResponse{
  115752. Header: res.Header,
  115753. HTTPStatusCode: res.StatusCode,
  115754. },
  115755. }
  115756. target := &ret
  115757. if err := gensupport.DecodeResponse(target, res); err != nil {
  115758. return nil, err
  115759. }
  115760. return ret, nil
  115761. // {
  115762. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  115763. // "httpMethod": "GET",
  115764. // "id": "compute.snapshots.get",
  115765. // "parameterOrder": [
  115766. // "project",
  115767. // "snapshot"
  115768. // ],
  115769. // "parameters": {
  115770. // "project": {
  115771. // "description": "Project ID for this request.",
  115772. // "location": "path",
  115773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115774. // "required": true,
  115775. // "type": "string"
  115776. // },
  115777. // "snapshot": {
  115778. // "description": "Name of the Snapshot resource to return.",
  115779. // "location": "path",
  115780. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115781. // "required": true,
  115782. // "type": "string"
  115783. // }
  115784. // },
  115785. // "path": "{project}/global/snapshots/{snapshot}",
  115786. // "response": {
  115787. // "$ref": "Snapshot"
  115788. // },
  115789. // "scopes": [
  115790. // "https://www.googleapis.com/auth/cloud-platform",
  115791. // "https://www.googleapis.com/auth/compute",
  115792. // "https://www.googleapis.com/auth/compute.readonly"
  115793. // ]
  115794. // }
  115795. }
  115796. // method id "compute.snapshots.getIamPolicy":
  115797. type SnapshotsGetIamPolicyCall struct {
  115798. s *Service
  115799. project string
  115800. resource string
  115801. urlParams_ gensupport.URLParams
  115802. ifNoneMatch_ string
  115803. ctx_ context.Context
  115804. header_ http.Header
  115805. }
  115806. // GetIamPolicy: Gets the access control policy for a resource. May be
  115807. // empty if no such policy or resource exists.
  115808. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  115809. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115810. c.project = project
  115811. c.resource = resource
  115812. return c
  115813. }
  115814. // Fields allows partial responses to be retrieved. See
  115815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115816. // for more information.
  115817. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  115818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115819. return c
  115820. }
  115821. // IfNoneMatch sets the optional parameter which makes the operation
  115822. // fail if the object's ETag matches the given value. This is useful for
  115823. // getting updates only after the object has changed since the last
  115824. // request. Use googleapi.IsNotModified to check whether the response
  115825. // error from Do is the result of In-None-Match.
  115826. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  115827. c.ifNoneMatch_ = entityTag
  115828. return c
  115829. }
  115830. // Context sets the context to be used in this call's Do method. Any
  115831. // pending HTTP request will be aborted if the provided context is
  115832. // canceled.
  115833. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  115834. c.ctx_ = ctx
  115835. return c
  115836. }
  115837. // Header returns an http.Header that can be modified by the caller to
  115838. // add HTTP headers to the request.
  115839. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  115840. if c.header_ == nil {
  115841. c.header_ = make(http.Header)
  115842. }
  115843. return c.header_
  115844. }
  115845. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  115846. reqHeaders := make(http.Header)
  115847. for k, v := range c.header_ {
  115848. reqHeaders[k] = v
  115849. }
  115850. reqHeaders.Set("User-Agent", c.s.userAgent())
  115851. if c.ifNoneMatch_ != "" {
  115852. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115853. }
  115854. var body io.Reader = nil
  115855. c.urlParams_.Set("alt", alt)
  115856. c.urlParams_.Set("prettyPrint", "false")
  115857. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  115858. urls += "?" + c.urlParams_.Encode()
  115859. req, err := http.NewRequest("GET", urls, body)
  115860. if err != nil {
  115861. return nil, err
  115862. }
  115863. req.Header = reqHeaders
  115864. googleapi.Expand(req.URL, map[string]string{
  115865. "project": c.project,
  115866. "resource": c.resource,
  115867. })
  115868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115869. }
  115870. // Do executes the "compute.snapshots.getIamPolicy" call.
  115871. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  115872. // code is an error. Response headers are in either
  115873. // *Policy.ServerResponse.Header or (if a response was returned at all)
  115874. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  115875. // check whether the returned error was because http.StatusNotModified
  115876. // was returned.
  115877. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  115878. gensupport.SetOptions(c.urlParams_, opts...)
  115879. res, err := c.doRequest("json")
  115880. if res != nil && res.StatusCode == http.StatusNotModified {
  115881. if res.Body != nil {
  115882. res.Body.Close()
  115883. }
  115884. return nil, &googleapi.Error{
  115885. Code: res.StatusCode,
  115886. Header: res.Header,
  115887. }
  115888. }
  115889. if err != nil {
  115890. return nil, err
  115891. }
  115892. defer googleapi.CloseBody(res)
  115893. if err := googleapi.CheckResponse(res); err != nil {
  115894. return nil, err
  115895. }
  115896. ret := &Policy{
  115897. ServerResponse: googleapi.ServerResponse{
  115898. Header: res.Header,
  115899. HTTPStatusCode: res.StatusCode,
  115900. },
  115901. }
  115902. target := &ret
  115903. if err := gensupport.DecodeResponse(target, res); err != nil {
  115904. return nil, err
  115905. }
  115906. return ret, nil
  115907. // {
  115908. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  115909. // "httpMethod": "GET",
  115910. // "id": "compute.snapshots.getIamPolicy",
  115911. // "parameterOrder": [
  115912. // "project",
  115913. // "resource"
  115914. // ],
  115915. // "parameters": {
  115916. // "project": {
  115917. // "description": "Project ID for this request.",
  115918. // "location": "path",
  115919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115920. // "required": true,
  115921. // "type": "string"
  115922. // },
  115923. // "resource": {
  115924. // "description": "Name or id of the resource for this request.",
  115925. // "location": "path",
  115926. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115927. // "required": true,
  115928. // "type": "string"
  115929. // }
  115930. // },
  115931. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  115932. // "response": {
  115933. // "$ref": "Policy"
  115934. // },
  115935. // "scopes": [
  115936. // "https://www.googleapis.com/auth/cloud-platform",
  115937. // "https://www.googleapis.com/auth/compute",
  115938. // "https://www.googleapis.com/auth/compute.readonly"
  115939. // ]
  115940. // }
  115941. }
  115942. // method id "compute.snapshots.list":
  115943. type SnapshotsListCall struct {
  115944. s *Service
  115945. project string
  115946. urlParams_ gensupport.URLParams
  115947. ifNoneMatch_ string
  115948. ctx_ context.Context
  115949. header_ http.Header
  115950. }
  115951. // List: Retrieves the list of Snapshot resources contained within the
  115952. // specified project.
  115953. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  115954. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  115955. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115956. c.project = project
  115957. return c
  115958. }
  115959. // Filter sets the optional parameter "filter": A filter expression that
  115960. // filters resources listed in the response. The expression must specify
  115961. // the field name, a comparison operator, and the value that you want to
  115962. // use for filtering. The value must be a string, a number, or a
  115963. // boolean. The comparison operator must be either =, !=, >, or <.
  115964. //
  115965. // For example, if you are filtering Compute Engine instances, you can
  115966. // exclude instances named example-instance by specifying name !=
  115967. // example-instance.
  115968. //
  115969. // You can also filter nested fields. For example, you could specify
  115970. // scheduling.automaticRestart = false to include instances only if they
  115971. // are not scheduled for automatic restarts. You can use filtering on
  115972. // nested fields to filter based on resource labels.
  115973. //
  115974. // To filter on multiple expressions, provide each separate expression
  115975. // within parentheses. For example, (scheduling.automaticRestart = true)
  115976. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  115977. // AND expression. However, you can include AND and OR expressions
  115978. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  115979. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  115980. // true).
  115981. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  115982. c.urlParams_.Set("filter", filter)
  115983. return c
  115984. }
  115985. // MaxResults sets the optional parameter "maxResults": The maximum
  115986. // number of results per page that should be returned. If the number of
  115987. // available results is larger than maxResults, Compute Engine returns a
  115988. // nextPageToken that can be used to get the next page of results in
  115989. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  115990. // (Default: 500)
  115991. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  115992. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  115993. return c
  115994. }
  115995. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  115996. // a certain order. By default, results are returned in alphanumerical
  115997. // order based on the resource name.
  115998. //
  115999. // You can also sort results in descending order based on the creation
  116000. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116001. // based on the creationTimestamp field in reverse chronological order
  116002. // (newest result first). Use this to sort resources like operations so
  116003. // that the newest operation is returned first.
  116004. //
  116005. // Currently, only sorting by name or creationTimestamp desc is
  116006. // supported.
  116007. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  116008. c.urlParams_.Set("orderBy", orderBy)
  116009. return c
  116010. }
  116011. // PageToken sets the optional parameter "pageToken": Specifies a page
  116012. // token to use. Set pageToken to the nextPageToken returned by a
  116013. // previous list request to get the next page of results.
  116014. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  116015. c.urlParams_.Set("pageToken", pageToken)
  116016. return c
  116017. }
  116018. // Fields allows partial responses to be retrieved. See
  116019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116020. // for more information.
  116021. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  116022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116023. return c
  116024. }
  116025. // IfNoneMatch sets the optional parameter which makes the operation
  116026. // fail if the object's ETag matches the given value. This is useful for
  116027. // getting updates only after the object has changed since the last
  116028. // request. Use googleapi.IsNotModified to check whether the response
  116029. // error from Do is the result of In-None-Match.
  116030. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  116031. c.ifNoneMatch_ = entityTag
  116032. return c
  116033. }
  116034. // Context sets the context to be used in this call's Do method. Any
  116035. // pending HTTP request will be aborted if the provided context is
  116036. // canceled.
  116037. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  116038. c.ctx_ = ctx
  116039. return c
  116040. }
  116041. // Header returns an http.Header that can be modified by the caller to
  116042. // add HTTP headers to the request.
  116043. func (c *SnapshotsListCall) Header() http.Header {
  116044. if c.header_ == nil {
  116045. c.header_ = make(http.Header)
  116046. }
  116047. return c.header_
  116048. }
  116049. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  116050. reqHeaders := make(http.Header)
  116051. for k, v := range c.header_ {
  116052. reqHeaders[k] = v
  116053. }
  116054. reqHeaders.Set("User-Agent", c.s.userAgent())
  116055. if c.ifNoneMatch_ != "" {
  116056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116057. }
  116058. var body io.Reader = nil
  116059. c.urlParams_.Set("alt", alt)
  116060. c.urlParams_.Set("prettyPrint", "false")
  116061. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  116062. urls += "?" + c.urlParams_.Encode()
  116063. req, err := http.NewRequest("GET", urls, body)
  116064. if err != nil {
  116065. return nil, err
  116066. }
  116067. req.Header = reqHeaders
  116068. googleapi.Expand(req.URL, map[string]string{
  116069. "project": c.project,
  116070. })
  116071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116072. }
  116073. // Do executes the "compute.snapshots.list" call.
  116074. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  116075. // status code is an error. Response headers are in either
  116076. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  116077. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116078. // to check whether the returned error was because
  116079. // http.StatusNotModified was returned.
  116080. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  116081. gensupport.SetOptions(c.urlParams_, opts...)
  116082. res, err := c.doRequest("json")
  116083. if res != nil && res.StatusCode == http.StatusNotModified {
  116084. if res.Body != nil {
  116085. res.Body.Close()
  116086. }
  116087. return nil, &googleapi.Error{
  116088. Code: res.StatusCode,
  116089. Header: res.Header,
  116090. }
  116091. }
  116092. if err != nil {
  116093. return nil, err
  116094. }
  116095. defer googleapi.CloseBody(res)
  116096. if err := googleapi.CheckResponse(res); err != nil {
  116097. return nil, err
  116098. }
  116099. ret := &SnapshotList{
  116100. ServerResponse: googleapi.ServerResponse{
  116101. Header: res.Header,
  116102. HTTPStatusCode: res.StatusCode,
  116103. },
  116104. }
  116105. target := &ret
  116106. if err := gensupport.DecodeResponse(target, res); err != nil {
  116107. return nil, err
  116108. }
  116109. return ret, nil
  116110. // {
  116111. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  116112. // "httpMethod": "GET",
  116113. // "id": "compute.snapshots.list",
  116114. // "parameterOrder": [
  116115. // "project"
  116116. // ],
  116117. // "parameters": {
  116118. // "filter": {
  116119. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  116120. // "location": "query",
  116121. // "type": "string"
  116122. // },
  116123. // "maxResults": {
  116124. // "default": "500",
  116125. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  116126. // "format": "uint32",
  116127. // "location": "query",
  116128. // "minimum": "0",
  116129. // "type": "integer"
  116130. // },
  116131. // "orderBy": {
  116132. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  116133. // "location": "query",
  116134. // "type": "string"
  116135. // },
  116136. // "pageToken": {
  116137. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  116138. // "location": "query",
  116139. // "type": "string"
  116140. // },
  116141. // "project": {
  116142. // "description": "Project ID for this request.",
  116143. // "location": "path",
  116144. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116145. // "required": true,
  116146. // "type": "string"
  116147. // }
  116148. // },
  116149. // "path": "{project}/global/snapshots",
  116150. // "response": {
  116151. // "$ref": "SnapshotList"
  116152. // },
  116153. // "scopes": [
  116154. // "https://www.googleapis.com/auth/cloud-platform",
  116155. // "https://www.googleapis.com/auth/compute",
  116156. // "https://www.googleapis.com/auth/compute.readonly"
  116157. // ]
  116158. // }
  116159. }
  116160. // Pages invokes f for each page of results.
  116161. // A non-nil error returned from f will halt the iteration.
  116162. // The provided context supersedes any context provided to the Context method.
  116163. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  116164. c.ctx_ = ctx
  116165. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116166. for {
  116167. x, err := c.Do()
  116168. if err != nil {
  116169. return err
  116170. }
  116171. if err := f(x); err != nil {
  116172. return err
  116173. }
  116174. if x.NextPageToken == "" {
  116175. return nil
  116176. }
  116177. c.PageToken(x.NextPageToken)
  116178. }
  116179. }
  116180. // method id "compute.snapshots.setIamPolicy":
  116181. type SnapshotsSetIamPolicyCall struct {
  116182. s *Service
  116183. project string
  116184. resource string
  116185. globalsetpolicyrequest *GlobalSetPolicyRequest
  116186. urlParams_ gensupport.URLParams
  116187. ctx_ context.Context
  116188. header_ http.Header
  116189. }
  116190. // SetIamPolicy: Sets the access control policy on the specified
  116191. // resource. Replaces any existing policy.
  116192. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  116193. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116194. c.project = project
  116195. c.resource = resource
  116196. c.globalsetpolicyrequest = globalsetpolicyrequest
  116197. return c
  116198. }
  116199. // Fields allows partial responses to be retrieved. See
  116200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116201. // for more information.
  116202. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  116203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116204. return c
  116205. }
  116206. // Context sets the context to be used in this call's Do method. Any
  116207. // pending HTTP request will be aborted if the provided context is
  116208. // canceled.
  116209. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  116210. c.ctx_ = ctx
  116211. return c
  116212. }
  116213. // Header returns an http.Header that can be modified by the caller to
  116214. // add HTTP headers to the request.
  116215. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  116216. if c.header_ == nil {
  116217. c.header_ = make(http.Header)
  116218. }
  116219. return c.header_
  116220. }
  116221. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  116222. reqHeaders := make(http.Header)
  116223. for k, v := range c.header_ {
  116224. reqHeaders[k] = v
  116225. }
  116226. reqHeaders.Set("User-Agent", c.s.userAgent())
  116227. var body io.Reader = nil
  116228. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  116229. if err != nil {
  116230. return nil, err
  116231. }
  116232. reqHeaders.Set("Content-Type", "application/json")
  116233. c.urlParams_.Set("alt", alt)
  116234. c.urlParams_.Set("prettyPrint", "false")
  116235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  116236. urls += "?" + c.urlParams_.Encode()
  116237. req, err := http.NewRequest("POST", urls, body)
  116238. if err != nil {
  116239. return nil, err
  116240. }
  116241. req.Header = reqHeaders
  116242. googleapi.Expand(req.URL, map[string]string{
  116243. "project": c.project,
  116244. "resource": c.resource,
  116245. })
  116246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116247. }
  116248. // Do executes the "compute.snapshots.setIamPolicy" call.
  116249. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  116250. // code is an error. Response headers are in either
  116251. // *Policy.ServerResponse.Header or (if a response was returned at all)
  116252. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  116253. // check whether the returned error was because http.StatusNotModified
  116254. // was returned.
  116255. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  116256. gensupport.SetOptions(c.urlParams_, opts...)
  116257. res, err := c.doRequest("json")
  116258. if res != nil && res.StatusCode == http.StatusNotModified {
  116259. if res.Body != nil {
  116260. res.Body.Close()
  116261. }
  116262. return nil, &googleapi.Error{
  116263. Code: res.StatusCode,
  116264. Header: res.Header,
  116265. }
  116266. }
  116267. if err != nil {
  116268. return nil, err
  116269. }
  116270. defer googleapi.CloseBody(res)
  116271. if err := googleapi.CheckResponse(res); err != nil {
  116272. return nil, err
  116273. }
  116274. ret := &Policy{
  116275. ServerResponse: googleapi.ServerResponse{
  116276. Header: res.Header,
  116277. HTTPStatusCode: res.StatusCode,
  116278. },
  116279. }
  116280. target := &ret
  116281. if err := gensupport.DecodeResponse(target, res); err != nil {
  116282. return nil, err
  116283. }
  116284. return ret, nil
  116285. // {
  116286. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  116287. // "httpMethod": "POST",
  116288. // "id": "compute.snapshots.setIamPolicy",
  116289. // "parameterOrder": [
  116290. // "project",
  116291. // "resource"
  116292. // ],
  116293. // "parameters": {
  116294. // "project": {
  116295. // "description": "Project ID for this request.",
  116296. // "location": "path",
  116297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116298. // "required": true,
  116299. // "type": "string"
  116300. // },
  116301. // "resource": {
  116302. // "description": "Name or id of the resource for this request.",
  116303. // "location": "path",
  116304. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116305. // "required": true,
  116306. // "type": "string"
  116307. // }
  116308. // },
  116309. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  116310. // "request": {
  116311. // "$ref": "GlobalSetPolicyRequest"
  116312. // },
  116313. // "response": {
  116314. // "$ref": "Policy"
  116315. // },
  116316. // "scopes": [
  116317. // "https://www.googleapis.com/auth/cloud-platform",
  116318. // "https://www.googleapis.com/auth/compute"
  116319. // ]
  116320. // }
  116321. }
  116322. // method id "compute.snapshots.setLabels":
  116323. type SnapshotsSetLabelsCall struct {
  116324. s *Service
  116325. project string
  116326. resource string
  116327. globalsetlabelsrequest *GlobalSetLabelsRequest
  116328. urlParams_ gensupport.URLParams
  116329. ctx_ context.Context
  116330. header_ http.Header
  116331. }
  116332. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  116333. // read the Labeling Resources documentation.
  116334. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  116335. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116336. c.project = project
  116337. c.resource = resource
  116338. c.globalsetlabelsrequest = globalsetlabelsrequest
  116339. return c
  116340. }
  116341. // Fields allows partial responses to be retrieved. See
  116342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116343. // for more information.
  116344. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  116345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116346. return c
  116347. }
  116348. // Context sets the context to be used in this call's Do method. Any
  116349. // pending HTTP request will be aborted if the provided context is
  116350. // canceled.
  116351. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  116352. c.ctx_ = ctx
  116353. return c
  116354. }
  116355. // Header returns an http.Header that can be modified by the caller to
  116356. // add HTTP headers to the request.
  116357. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  116358. if c.header_ == nil {
  116359. c.header_ = make(http.Header)
  116360. }
  116361. return c.header_
  116362. }
  116363. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  116364. reqHeaders := make(http.Header)
  116365. for k, v := range c.header_ {
  116366. reqHeaders[k] = v
  116367. }
  116368. reqHeaders.Set("User-Agent", c.s.userAgent())
  116369. var body io.Reader = nil
  116370. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  116371. if err != nil {
  116372. return nil, err
  116373. }
  116374. reqHeaders.Set("Content-Type", "application/json")
  116375. c.urlParams_.Set("alt", alt)
  116376. c.urlParams_.Set("prettyPrint", "false")
  116377. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  116378. urls += "?" + c.urlParams_.Encode()
  116379. req, err := http.NewRequest("POST", urls, body)
  116380. if err != nil {
  116381. return nil, err
  116382. }
  116383. req.Header = reqHeaders
  116384. googleapi.Expand(req.URL, map[string]string{
  116385. "project": c.project,
  116386. "resource": c.resource,
  116387. })
  116388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116389. }
  116390. // Do executes the "compute.snapshots.setLabels" call.
  116391. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116392. // status code is an error. Response headers are in either
  116393. // *Operation.ServerResponse.Header or (if a response was returned at
  116394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116395. // to check whether the returned error was because
  116396. // http.StatusNotModified was returned.
  116397. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116398. gensupport.SetOptions(c.urlParams_, opts...)
  116399. res, err := c.doRequest("json")
  116400. if res != nil && res.StatusCode == http.StatusNotModified {
  116401. if res.Body != nil {
  116402. res.Body.Close()
  116403. }
  116404. return nil, &googleapi.Error{
  116405. Code: res.StatusCode,
  116406. Header: res.Header,
  116407. }
  116408. }
  116409. if err != nil {
  116410. return nil, err
  116411. }
  116412. defer googleapi.CloseBody(res)
  116413. if err := googleapi.CheckResponse(res); err != nil {
  116414. return nil, err
  116415. }
  116416. ret := &Operation{
  116417. ServerResponse: googleapi.ServerResponse{
  116418. Header: res.Header,
  116419. HTTPStatusCode: res.StatusCode,
  116420. },
  116421. }
  116422. target := &ret
  116423. if err := gensupport.DecodeResponse(target, res); err != nil {
  116424. return nil, err
  116425. }
  116426. return ret, nil
  116427. // {
  116428. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  116429. // "httpMethod": "POST",
  116430. // "id": "compute.snapshots.setLabels",
  116431. // "parameterOrder": [
  116432. // "project",
  116433. // "resource"
  116434. // ],
  116435. // "parameters": {
  116436. // "project": {
  116437. // "description": "Project ID for this request.",
  116438. // "location": "path",
  116439. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116440. // "required": true,
  116441. // "type": "string"
  116442. // },
  116443. // "resource": {
  116444. // "description": "Name or id of the resource for this request.",
  116445. // "location": "path",
  116446. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116447. // "required": true,
  116448. // "type": "string"
  116449. // }
  116450. // },
  116451. // "path": "{project}/global/snapshots/{resource}/setLabels",
  116452. // "request": {
  116453. // "$ref": "GlobalSetLabelsRequest"
  116454. // },
  116455. // "response": {
  116456. // "$ref": "Operation"
  116457. // },
  116458. // "scopes": [
  116459. // "https://www.googleapis.com/auth/cloud-platform",
  116460. // "https://www.googleapis.com/auth/compute"
  116461. // ]
  116462. // }
  116463. }
  116464. // method id "compute.snapshots.testIamPermissions":
  116465. type SnapshotsTestIamPermissionsCall struct {
  116466. s *Service
  116467. project string
  116468. resource string
  116469. testpermissionsrequest *TestPermissionsRequest
  116470. urlParams_ gensupport.URLParams
  116471. ctx_ context.Context
  116472. header_ http.Header
  116473. }
  116474. // TestIamPermissions: Returns permissions that a caller has on the
  116475. // specified resource.
  116476. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  116477. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116478. c.project = project
  116479. c.resource = resource
  116480. c.testpermissionsrequest = testpermissionsrequest
  116481. return c
  116482. }
  116483. // Fields allows partial responses to be retrieved. See
  116484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116485. // for more information.
  116486. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  116487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116488. return c
  116489. }
  116490. // Context sets the context to be used in this call's Do method. Any
  116491. // pending HTTP request will be aborted if the provided context is
  116492. // canceled.
  116493. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  116494. c.ctx_ = ctx
  116495. return c
  116496. }
  116497. // Header returns an http.Header that can be modified by the caller to
  116498. // add HTTP headers to the request.
  116499. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  116500. if c.header_ == nil {
  116501. c.header_ = make(http.Header)
  116502. }
  116503. return c.header_
  116504. }
  116505. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  116506. reqHeaders := make(http.Header)
  116507. for k, v := range c.header_ {
  116508. reqHeaders[k] = v
  116509. }
  116510. reqHeaders.Set("User-Agent", c.s.userAgent())
  116511. var body io.Reader = nil
  116512. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  116513. if err != nil {
  116514. return nil, err
  116515. }
  116516. reqHeaders.Set("Content-Type", "application/json")
  116517. c.urlParams_.Set("alt", alt)
  116518. c.urlParams_.Set("prettyPrint", "false")
  116519. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  116520. urls += "?" + c.urlParams_.Encode()
  116521. req, err := http.NewRequest("POST", urls, body)
  116522. if err != nil {
  116523. return nil, err
  116524. }
  116525. req.Header = reqHeaders
  116526. googleapi.Expand(req.URL, map[string]string{
  116527. "project": c.project,
  116528. "resource": c.resource,
  116529. })
  116530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116531. }
  116532. // Do executes the "compute.snapshots.testIamPermissions" call.
  116533. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  116534. // non-2xx status code is an error. Response headers are in either
  116535. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  116536. // returned at all) in error.(*googleapi.Error).Header. Use
  116537. // googleapi.IsNotModified to check whether the returned error was
  116538. // because http.StatusNotModified was returned.
  116539. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  116540. gensupport.SetOptions(c.urlParams_, opts...)
  116541. res, err := c.doRequest("json")
  116542. if res != nil && res.StatusCode == http.StatusNotModified {
  116543. if res.Body != nil {
  116544. res.Body.Close()
  116545. }
  116546. return nil, &googleapi.Error{
  116547. Code: res.StatusCode,
  116548. Header: res.Header,
  116549. }
  116550. }
  116551. if err != nil {
  116552. return nil, err
  116553. }
  116554. defer googleapi.CloseBody(res)
  116555. if err := googleapi.CheckResponse(res); err != nil {
  116556. return nil, err
  116557. }
  116558. ret := &TestPermissionsResponse{
  116559. ServerResponse: googleapi.ServerResponse{
  116560. Header: res.Header,
  116561. HTTPStatusCode: res.StatusCode,
  116562. },
  116563. }
  116564. target := &ret
  116565. if err := gensupport.DecodeResponse(target, res); err != nil {
  116566. return nil, err
  116567. }
  116568. return ret, nil
  116569. // {
  116570. // "description": "Returns permissions that a caller has on the specified resource.",
  116571. // "httpMethod": "POST",
  116572. // "id": "compute.snapshots.testIamPermissions",
  116573. // "parameterOrder": [
  116574. // "project",
  116575. // "resource"
  116576. // ],
  116577. // "parameters": {
  116578. // "project": {
  116579. // "description": "Project ID for this request.",
  116580. // "location": "path",
  116581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116582. // "required": true,
  116583. // "type": "string"
  116584. // },
  116585. // "resource": {
  116586. // "description": "Name or id of the resource for this request.",
  116587. // "location": "path",
  116588. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116589. // "required": true,
  116590. // "type": "string"
  116591. // }
  116592. // },
  116593. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  116594. // "request": {
  116595. // "$ref": "TestPermissionsRequest"
  116596. // },
  116597. // "response": {
  116598. // "$ref": "TestPermissionsResponse"
  116599. // },
  116600. // "scopes": [
  116601. // "https://www.googleapis.com/auth/cloud-platform",
  116602. // "https://www.googleapis.com/auth/compute",
  116603. // "https://www.googleapis.com/auth/compute.readonly"
  116604. // ]
  116605. // }
  116606. }
  116607. // method id "compute.sslCertificates.aggregatedList":
  116608. type SslCertificatesAggregatedListCall struct {
  116609. s *Service
  116610. project string
  116611. urlParams_ gensupport.URLParams
  116612. ifNoneMatch_ string
  116613. ctx_ context.Context
  116614. header_ http.Header
  116615. }
  116616. // AggregatedList: Retrieves the list of all SslCertificate resources,
  116617. // regional and global, available to the specified project.
  116618. func (r *SslCertificatesService) AggregatedList(project string) *SslCertificatesAggregatedListCall {
  116619. c := &SslCertificatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116620. c.project = project
  116621. return c
  116622. }
  116623. // Filter sets the optional parameter "filter": A filter expression that
  116624. // filters resources listed in the response. The expression must specify
  116625. // the field name, a comparison operator, and the value that you want to
  116626. // use for filtering. The value must be a string, a number, or a
  116627. // boolean. The comparison operator must be either =, !=, >, or <.
  116628. //
  116629. // For example, if you are filtering Compute Engine instances, you can
  116630. // exclude instances named example-instance by specifying name !=
  116631. // example-instance.
  116632. //
  116633. // You can also filter nested fields. For example, you could specify
  116634. // scheduling.automaticRestart = false to include instances only if they
  116635. // are not scheduled for automatic restarts. You can use filtering on
  116636. // nested fields to filter based on resource labels.
  116637. //
  116638. // To filter on multiple expressions, provide each separate expression
  116639. // within parentheses. For example, (scheduling.automaticRestart = true)
  116640. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116641. // AND expression. However, you can include AND and OR expressions
  116642. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116643. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116644. // true).
  116645. func (c *SslCertificatesAggregatedListCall) Filter(filter string) *SslCertificatesAggregatedListCall {
  116646. c.urlParams_.Set("filter", filter)
  116647. return c
  116648. }
  116649. // MaxResults sets the optional parameter "maxResults": The maximum
  116650. // number of results per page that should be returned. If the number of
  116651. // available results is larger than maxResults, Compute Engine returns a
  116652. // nextPageToken that can be used to get the next page of results in
  116653. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116654. // (Default: 500)
  116655. func (c *SslCertificatesAggregatedListCall) MaxResults(maxResults int64) *SslCertificatesAggregatedListCall {
  116656. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116657. return c
  116658. }
  116659. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116660. // a certain order. By default, results are returned in alphanumerical
  116661. // order based on the resource name.
  116662. //
  116663. // You can also sort results in descending order based on the creation
  116664. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116665. // based on the creationTimestamp field in reverse chronological order
  116666. // (newest result first). Use this to sort resources like operations so
  116667. // that the newest operation is returned first.
  116668. //
  116669. // Currently, only sorting by name or creationTimestamp desc is
  116670. // supported.
  116671. func (c *SslCertificatesAggregatedListCall) OrderBy(orderBy string) *SslCertificatesAggregatedListCall {
  116672. c.urlParams_.Set("orderBy", orderBy)
  116673. return c
  116674. }
  116675. // PageToken sets the optional parameter "pageToken": Specifies a page
  116676. // token to use. Set pageToken to the nextPageToken returned by a
  116677. // previous list request to get the next page of results.
  116678. func (c *SslCertificatesAggregatedListCall) PageToken(pageToken string) *SslCertificatesAggregatedListCall {
  116679. c.urlParams_.Set("pageToken", pageToken)
  116680. return c
  116681. }
  116682. // Fields allows partial responses to be retrieved. See
  116683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116684. // for more information.
  116685. func (c *SslCertificatesAggregatedListCall) Fields(s ...googleapi.Field) *SslCertificatesAggregatedListCall {
  116686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116687. return c
  116688. }
  116689. // IfNoneMatch sets the optional parameter which makes the operation
  116690. // fail if the object's ETag matches the given value. This is useful for
  116691. // getting updates only after the object has changed since the last
  116692. // request. Use googleapi.IsNotModified to check whether the response
  116693. // error from Do is the result of In-None-Match.
  116694. func (c *SslCertificatesAggregatedListCall) IfNoneMatch(entityTag string) *SslCertificatesAggregatedListCall {
  116695. c.ifNoneMatch_ = entityTag
  116696. return c
  116697. }
  116698. // Context sets the context to be used in this call's Do method. Any
  116699. // pending HTTP request will be aborted if the provided context is
  116700. // canceled.
  116701. func (c *SslCertificatesAggregatedListCall) Context(ctx context.Context) *SslCertificatesAggregatedListCall {
  116702. c.ctx_ = ctx
  116703. return c
  116704. }
  116705. // Header returns an http.Header that can be modified by the caller to
  116706. // add HTTP headers to the request.
  116707. func (c *SslCertificatesAggregatedListCall) Header() http.Header {
  116708. if c.header_ == nil {
  116709. c.header_ = make(http.Header)
  116710. }
  116711. return c.header_
  116712. }
  116713. func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  116714. reqHeaders := make(http.Header)
  116715. for k, v := range c.header_ {
  116716. reqHeaders[k] = v
  116717. }
  116718. reqHeaders.Set("User-Agent", c.s.userAgent())
  116719. if c.ifNoneMatch_ != "" {
  116720. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116721. }
  116722. var body io.Reader = nil
  116723. c.urlParams_.Set("alt", alt)
  116724. c.urlParams_.Set("prettyPrint", "false")
  116725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/sslCertificates")
  116726. urls += "?" + c.urlParams_.Encode()
  116727. req, err := http.NewRequest("GET", urls, body)
  116728. if err != nil {
  116729. return nil, err
  116730. }
  116731. req.Header = reqHeaders
  116732. googleapi.Expand(req.URL, map[string]string{
  116733. "project": c.project,
  116734. })
  116735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116736. }
  116737. // Do executes the "compute.sslCertificates.aggregatedList" call.
  116738. // Exactly one of *SslCertificateAggregatedList or error will be
  116739. // non-nil. Any non-2xx status code is an error. Response headers are in
  116740. // either *SslCertificateAggregatedList.ServerResponse.Header or (if a
  116741. // response was returned at all) in error.(*googleapi.Error).Header. Use
  116742. // googleapi.IsNotModified to check whether the returned error was
  116743. // because http.StatusNotModified was returned.
  116744. func (c *SslCertificatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslCertificateAggregatedList, error) {
  116745. gensupport.SetOptions(c.urlParams_, opts...)
  116746. res, err := c.doRequest("json")
  116747. if res != nil && res.StatusCode == http.StatusNotModified {
  116748. if res.Body != nil {
  116749. res.Body.Close()
  116750. }
  116751. return nil, &googleapi.Error{
  116752. Code: res.StatusCode,
  116753. Header: res.Header,
  116754. }
  116755. }
  116756. if err != nil {
  116757. return nil, err
  116758. }
  116759. defer googleapi.CloseBody(res)
  116760. if err := googleapi.CheckResponse(res); err != nil {
  116761. return nil, err
  116762. }
  116763. ret := &SslCertificateAggregatedList{
  116764. ServerResponse: googleapi.ServerResponse{
  116765. Header: res.Header,
  116766. HTTPStatusCode: res.StatusCode,
  116767. },
  116768. }
  116769. target := &ret
  116770. if err := gensupport.DecodeResponse(target, res); err != nil {
  116771. return nil, err
  116772. }
  116773. return ret, nil
  116774. // {
  116775. // "description": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project.",
  116776. // "httpMethod": "GET",
  116777. // "id": "compute.sslCertificates.aggregatedList",
  116778. // "parameterOrder": [
  116779. // "project"
  116780. // ],
  116781. // "parameters": {
  116782. // "filter": {
  116783. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  116784. // "location": "query",
  116785. // "type": "string"
  116786. // },
  116787. // "maxResults": {
  116788. // "default": "500",
  116789. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  116790. // "format": "uint32",
  116791. // "location": "query",
  116792. // "minimum": "0",
  116793. // "type": "integer"
  116794. // },
  116795. // "orderBy": {
  116796. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  116797. // "location": "query",
  116798. // "type": "string"
  116799. // },
  116800. // "pageToken": {
  116801. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  116802. // "location": "query",
  116803. // "type": "string"
  116804. // },
  116805. // "project": {
  116806. // "description": "Name of the project scoping this request.",
  116807. // "location": "path",
  116808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116809. // "required": true,
  116810. // "type": "string"
  116811. // }
  116812. // },
  116813. // "path": "{project}/aggregated/sslCertificates",
  116814. // "response": {
  116815. // "$ref": "SslCertificateAggregatedList"
  116816. // },
  116817. // "scopes": [
  116818. // "https://www.googleapis.com/auth/cloud-platform",
  116819. // "https://www.googleapis.com/auth/compute",
  116820. // "https://www.googleapis.com/auth/compute.readonly"
  116821. // ]
  116822. // }
  116823. }
  116824. // Pages invokes f for each page of results.
  116825. // A non-nil error returned from f will halt the iteration.
  116826. // The provided context supersedes any context provided to the Context method.
  116827. func (c *SslCertificatesAggregatedListCall) Pages(ctx context.Context, f func(*SslCertificateAggregatedList) error) error {
  116828. c.ctx_ = ctx
  116829. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116830. for {
  116831. x, err := c.Do()
  116832. if err != nil {
  116833. return err
  116834. }
  116835. if err := f(x); err != nil {
  116836. return err
  116837. }
  116838. if x.NextPageToken == "" {
  116839. return nil
  116840. }
  116841. c.PageToken(x.NextPageToken)
  116842. }
  116843. }
  116844. // method id "compute.sslCertificates.delete":
  116845. type SslCertificatesDeleteCall struct {
  116846. s *Service
  116847. project string
  116848. sslCertificate string
  116849. urlParams_ gensupport.URLParams
  116850. ctx_ context.Context
  116851. header_ http.Header
  116852. }
  116853. // Delete: Deletes the specified SslCertificate resource.
  116854. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  116855. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116856. c.project = project
  116857. c.sslCertificate = sslCertificate
  116858. return c
  116859. }
  116860. // RequestId sets the optional parameter "requestId": An optional
  116861. // request ID to identify requests. Specify a unique request ID so that
  116862. // if you must retry your request, the server will know to ignore the
  116863. // request if it has already been completed.
  116864. //
  116865. // For example, consider a situation where you make an initial request
  116866. // and the request times out. If you make the request again with the
  116867. // same request ID, the server can check if original operation with the
  116868. // same request ID was received, and if so, will ignore the second
  116869. // request. This prevents clients from accidentally creating duplicate
  116870. // commitments.
  116871. //
  116872. // The request ID must be a valid UUID with the exception that zero UUID
  116873. // is not supported (00000000-0000-0000-0000-000000000000).
  116874. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  116875. c.urlParams_.Set("requestId", requestId)
  116876. return c
  116877. }
  116878. // Fields allows partial responses to be retrieved. See
  116879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116880. // for more information.
  116881. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  116882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116883. return c
  116884. }
  116885. // Context sets the context to be used in this call's Do method. Any
  116886. // pending HTTP request will be aborted if the provided context is
  116887. // canceled.
  116888. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  116889. c.ctx_ = ctx
  116890. return c
  116891. }
  116892. // Header returns an http.Header that can be modified by the caller to
  116893. // add HTTP headers to the request.
  116894. func (c *SslCertificatesDeleteCall) Header() http.Header {
  116895. if c.header_ == nil {
  116896. c.header_ = make(http.Header)
  116897. }
  116898. return c.header_
  116899. }
  116900. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  116901. reqHeaders := make(http.Header)
  116902. for k, v := range c.header_ {
  116903. reqHeaders[k] = v
  116904. }
  116905. reqHeaders.Set("User-Agent", c.s.userAgent())
  116906. var body io.Reader = nil
  116907. c.urlParams_.Set("alt", alt)
  116908. c.urlParams_.Set("prettyPrint", "false")
  116909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  116910. urls += "?" + c.urlParams_.Encode()
  116911. req, err := http.NewRequest("DELETE", urls, body)
  116912. if err != nil {
  116913. return nil, err
  116914. }
  116915. req.Header = reqHeaders
  116916. googleapi.Expand(req.URL, map[string]string{
  116917. "project": c.project,
  116918. "sslCertificate": c.sslCertificate,
  116919. })
  116920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116921. }
  116922. // Do executes the "compute.sslCertificates.delete" call.
  116923. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116924. // status code is an error. Response headers are in either
  116925. // *Operation.ServerResponse.Header or (if a response was returned at
  116926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116927. // to check whether the returned error was because
  116928. // http.StatusNotModified was returned.
  116929. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116930. gensupport.SetOptions(c.urlParams_, opts...)
  116931. res, err := c.doRequest("json")
  116932. if res != nil && res.StatusCode == http.StatusNotModified {
  116933. if res.Body != nil {
  116934. res.Body.Close()
  116935. }
  116936. return nil, &googleapi.Error{
  116937. Code: res.StatusCode,
  116938. Header: res.Header,
  116939. }
  116940. }
  116941. if err != nil {
  116942. return nil, err
  116943. }
  116944. defer googleapi.CloseBody(res)
  116945. if err := googleapi.CheckResponse(res); err != nil {
  116946. return nil, err
  116947. }
  116948. ret := &Operation{
  116949. ServerResponse: googleapi.ServerResponse{
  116950. Header: res.Header,
  116951. HTTPStatusCode: res.StatusCode,
  116952. },
  116953. }
  116954. target := &ret
  116955. if err := gensupport.DecodeResponse(target, res); err != nil {
  116956. return nil, err
  116957. }
  116958. return ret, nil
  116959. // {
  116960. // "description": "Deletes the specified SslCertificate resource.",
  116961. // "httpMethod": "DELETE",
  116962. // "id": "compute.sslCertificates.delete",
  116963. // "parameterOrder": [
  116964. // "project",
  116965. // "sslCertificate"
  116966. // ],
  116967. // "parameters": {
  116968. // "project": {
  116969. // "description": "Project ID for this request.",
  116970. // "location": "path",
  116971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116972. // "required": true,
  116973. // "type": "string"
  116974. // },
  116975. // "requestId": {
  116976. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116977. // "location": "query",
  116978. // "type": "string"
  116979. // },
  116980. // "sslCertificate": {
  116981. // "description": "Name of the SslCertificate resource to delete.",
  116982. // "location": "path",
  116983. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116984. // "required": true,
  116985. // "type": "string"
  116986. // }
  116987. // },
  116988. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  116989. // "response": {
  116990. // "$ref": "Operation"
  116991. // },
  116992. // "scopes": [
  116993. // "https://www.googleapis.com/auth/cloud-platform",
  116994. // "https://www.googleapis.com/auth/compute"
  116995. // ]
  116996. // }
  116997. }
  116998. // method id "compute.sslCertificates.get":
  116999. type SslCertificatesGetCall struct {
  117000. s *Service
  117001. project string
  117002. sslCertificate string
  117003. urlParams_ gensupport.URLParams
  117004. ifNoneMatch_ string
  117005. ctx_ context.Context
  117006. header_ http.Header
  117007. }
  117008. // Get: Returns the specified SslCertificate resource. Gets a list of
  117009. // available SSL certificates by making a list() request.
  117010. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  117011. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117012. c.project = project
  117013. c.sslCertificate = sslCertificate
  117014. return c
  117015. }
  117016. // Fields allows partial responses to be retrieved. See
  117017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117018. // for more information.
  117019. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  117020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117021. return c
  117022. }
  117023. // IfNoneMatch sets the optional parameter which makes the operation
  117024. // fail if the object's ETag matches the given value. This is useful for
  117025. // getting updates only after the object has changed since the last
  117026. // request. Use googleapi.IsNotModified to check whether the response
  117027. // error from Do is the result of In-None-Match.
  117028. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  117029. c.ifNoneMatch_ = entityTag
  117030. return c
  117031. }
  117032. // Context sets the context to be used in this call's Do method. Any
  117033. // pending HTTP request will be aborted if the provided context is
  117034. // canceled.
  117035. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  117036. c.ctx_ = ctx
  117037. return c
  117038. }
  117039. // Header returns an http.Header that can be modified by the caller to
  117040. // add HTTP headers to the request.
  117041. func (c *SslCertificatesGetCall) Header() http.Header {
  117042. if c.header_ == nil {
  117043. c.header_ = make(http.Header)
  117044. }
  117045. return c.header_
  117046. }
  117047. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  117048. reqHeaders := make(http.Header)
  117049. for k, v := range c.header_ {
  117050. reqHeaders[k] = v
  117051. }
  117052. reqHeaders.Set("User-Agent", c.s.userAgent())
  117053. if c.ifNoneMatch_ != "" {
  117054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117055. }
  117056. var body io.Reader = nil
  117057. c.urlParams_.Set("alt", alt)
  117058. c.urlParams_.Set("prettyPrint", "false")
  117059. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  117060. urls += "?" + c.urlParams_.Encode()
  117061. req, err := http.NewRequest("GET", urls, body)
  117062. if err != nil {
  117063. return nil, err
  117064. }
  117065. req.Header = reqHeaders
  117066. googleapi.Expand(req.URL, map[string]string{
  117067. "project": c.project,
  117068. "sslCertificate": c.sslCertificate,
  117069. })
  117070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117071. }
  117072. // Do executes the "compute.sslCertificates.get" call.
  117073. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  117074. // status code is an error. Response headers are in either
  117075. // *SslCertificate.ServerResponse.Header or (if a response was returned
  117076. // at all) in error.(*googleapi.Error).Header. Use
  117077. // googleapi.IsNotModified to check whether the returned error was
  117078. // because http.StatusNotModified was returned.
  117079. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  117080. gensupport.SetOptions(c.urlParams_, opts...)
  117081. res, err := c.doRequest("json")
  117082. if res != nil && res.StatusCode == http.StatusNotModified {
  117083. if res.Body != nil {
  117084. res.Body.Close()
  117085. }
  117086. return nil, &googleapi.Error{
  117087. Code: res.StatusCode,
  117088. Header: res.Header,
  117089. }
  117090. }
  117091. if err != nil {
  117092. return nil, err
  117093. }
  117094. defer googleapi.CloseBody(res)
  117095. if err := googleapi.CheckResponse(res); err != nil {
  117096. return nil, err
  117097. }
  117098. ret := &SslCertificate{
  117099. ServerResponse: googleapi.ServerResponse{
  117100. Header: res.Header,
  117101. HTTPStatusCode: res.StatusCode,
  117102. },
  117103. }
  117104. target := &ret
  117105. if err := gensupport.DecodeResponse(target, res); err != nil {
  117106. return nil, err
  117107. }
  117108. return ret, nil
  117109. // {
  117110. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  117111. // "httpMethod": "GET",
  117112. // "id": "compute.sslCertificates.get",
  117113. // "parameterOrder": [
  117114. // "project",
  117115. // "sslCertificate"
  117116. // ],
  117117. // "parameters": {
  117118. // "project": {
  117119. // "description": "Project ID for this request.",
  117120. // "location": "path",
  117121. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117122. // "required": true,
  117123. // "type": "string"
  117124. // },
  117125. // "sslCertificate": {
  117126. // "description": "Name of the SslCertificate resource to return.",
  117127. // "location": "path",
  117128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117129. // "required": true,
  117130. // "type": "string"
  117131. // }
  117132. // },
  117133. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  117134. // "response": {
  117135. // "$ref": "SslCertificate"
  117136. // },
  117137. // "scopes": [
  117138. // "https://www.googleapis.com/auth/cloud-platform",
  117139. // "https://www.googleapis.com/auth/compute",
  117140. // "https://www.googleapis.com/auth/compute.readonly"
  117141. // ]
  117142. // }
  117143. }
  117144. // method id "compute.sslCertificates.insert":
  117145. type SslCertificatesInsertCall struct {
  117146. s *Service
  117147. project string
  117148. sslcertificate *SslCertificate
  117149. urlParams_ gensupport.URLParams
  117150. ctx_ context.Context
  117151. header_ http.Header
  117152. }
  117153. // Insert: Creates a SslCertificate resource in the specified project
  117154. // using the data included in the request.
  117155. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  117156. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117157. c.project = project
  117158. c.sslcertificate = sslcertificate
  117159. return c
  117160. }
  117161. // RequestId sets the optional parameter "requestId": An optional
  117162. // request ID to identify requests. Specify a unique request ID so that
  117163. // if you must retry your request, the server will know to ignore the
  117164. // request if it has already been completed.
  117165. //
  117166. // For example, consider a situation where you make an initial request
  117167. // and the request times out. If you make the request again with the
  117168. // same request ID, the server can check if original operation with the
  117169. // same request ID was received, and if so, will ignore the second
  117170. // request. This prevents clients from accidentally creating duplicate
  117171. // commitments.
  117172. //
  117173. // The request ID must be a valid UUID with the exception that zero UUID
  117174. // is not supported (00000000-0000-0000-0000-000000000000).
  117175. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  117176. c.urlParams_.Set("requestId", requestId)
  117177. return c
  117178. }
  117179. // Fields allows partial responses to be retrieved. See
  117180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117181. // for more information.
  117182. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  117183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117184. return c
  117185. }
  117186. // Context sets the context to be used in this call's Do method. Any
  117187. // pending HTTP request will be aborted if the provided context is
  117188. // canceled.
  117189. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  117190. c.ctx_ = ctx
  117191. return c
  117192. }
  117193. // Header returns an http.Header that can be modified by the caller to
  117194. // add HTTP headers to the request.
  117195. func (c *SslCertificatesInsertCall) Header() http.Header {
  117196. if c.header_ == nil {
  117197. c.header_ = make(http.Header)
  117198. }
  117199. return c.header_
  117200. }
  117201. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  117202. reqHeaders := make(http.Header)
  117203. for k, v := range c.header_ {
  117204. reqHeaders[k] = v
  117205. }
  117206. reqHeaders.Set("User-Agent", c.s.userAgent())
  117207. var body io.Reader = nil
  117208. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  117209. if err != nil {
  117210. return nil, err
  117211. }
  117212. reqHeaders.Set("Content-Type", "application/json")
  117213. c.urlParams_.Set("alt", alt)
  117214. c.urlParams_.Set("prettyPrint", "false")
  117215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  117216. urls += "?" + c.urlParams_.Encode()
  117217. req, err := http.NewRequest("POST", urls, body)
  117218. if err != nil {
  117219. return nil, err
  117220. }
  117221. req.Header = reqHeaders
  117222. googleapi.Expand(req.URL, map[string]string{
  117223. "project": c.project,
  117224. })
  117225. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117226. }
  117227. // Do executes the "compute.sslCertificates.insert" call.
  117228. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117229. // status code is an error. Response headers are in either
  117230. // *Operation.ServerResponse.Header or (if a response was returned at
  117231. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117232. // to check whether the returned error was because
  117233. // http.StatusNotModified was returned.
  117234. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117235. gensupport.SetOptions(c.urlParams_, opts...)
  117236. res, err := c.doRequest("json")
  117237. if res != nil && res.StatusCode == http.StatusNotModified {
  117238. if res.Body != nil {
  117239. res.Body.Close()
  117240. }
  117241. return nil, &googleapi.Error{
  117242. Code: res.StatusCode,
  117243. Header: res.Header,
  117244. }
  117245. }
  117246. if err != nil {
  117247. return nil, err
  117248. }
  117249. defer googleapi.CloseBody(res)
  117250. if err := googleapi.CheckResponse(res); err != nil {
  117251. return nil, err
  117252. }
  117253. ret := &Operation{
  117254. ServerResponse: googleapi.ServerResponse{
  117255. Header: res.Header,
  117256. HTTPStatusCode: res.StatusCode,
  117257. },
  117258. }
  117259. target := &ret
  117260. if err := gensupport.DecodeResponse(target, res); err != nil {
  117261. return nil, err
  117262. }
  117263. return ret, nil
  117264. // {
  117265. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  117266. // "httpMethod": "POST",
  117267. // "id": "compute.sslCertificates.insert",
  117268. // "parameterOrder": [
  117269. // "project"
  117270. // ],
  117271. // "parameters": {
  117272. // "project": {
  117273. // "description": "Project ID for this request.",
  117274. // "location": "path",
  117275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117276. // "required": true,
  117277. // "type": "string"
  117278. // },
  117279. // "requestId": {
  117280. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117281. // "location": "query",
  117282. // "type": "string"
  117283. // }
  117284. // },
  117285. // "path": "{project}/global/sslCertificates",
  117286. // "request": {
  117287. // "$ref": "SslCertificate"
  117288. // },
  117289. // "response": {
  117290. // "$ref": "Operation"
  117291. // },
  117292. // "scopes": [
  117293. // "https://www.googleapis.com/auth/cloud-platform",
  117294. // "https://www.googleapis.com/auth/compute"
  117295. // ]
  117296. // }
  117297. }
  117298. // method id "compute.sslCertificates.list":
  117299. type SslCertificatesListCall struct {
  117300. s *Service
  117301. project string
  117302. urlParams_ gensupport.URLParams
  117303. ifNoneMatch_ string
  117304. ctx_ context.Context
  117305. header_ http.Header
  117306. }
  117307. // List: Retrieves the list of SslCertificate resources available to the
  117308. // specified project.
  117309. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  117310. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117311. c.project = project
  117312. return c
  117313. }
  117314. // Filter sets the optional parameter "filter": A filter expression that
  117315. // filters resources listed in the response. The expression must specify
  117316. // the field name, a comparison operator, and the value that you want to
  117317. // use for filtering. The value must be a string, a number, or a
  117318. // boolean. The comparison operator must be either =, !=, >, or <.
  117319. //
  117320. // For example, if you are filtering Compute Engine instances, you can
  117321. // exclude instances named example-instance by specifying name !=
  117322. // example-instance.
  117323. //
  117324. // You can also filter nested fields. For example, you could specify
  117325. // scheduling.automaticRestart = false to include instances only if they
  117326. // are not scheduled for automatic restarts. You can use filtering on
  117327. // nested fields to filter based on resource labels.
  117328. //
  117329. // To filter on multiple expressions, provide each separate expression
  117330. // within parentheses. For example, (scheduling.automaticRestart = true)
  117331. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117332. // AND expression. However, you can include AND and OR expressions
  117333. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117334. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117335. // true).
  117336. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  117337. c.urlParams_.Set("filter", filter)
  117338. return c
  117339. }
  117340. // MaxResults sets the optional parameter "maxResults": The maximum
  117341. // number of results per page that should be returned. If the number of
  117342. // available results is larger than maxResults, Compute Engine returns a
  117343. // nextPageToken that can be used to get the next page of results in
  117344. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117345. // (Default: 500)
  117346. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  117347. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117348. return c
  117349. }
  117350. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117351. // a certain order. By default, results are returned in alphanumerical
  117352. // order based on the resource name.
  117353. //
  117354. // You can also sort results in descending order based on the creation
  117355. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117356. // based on the creationTimestamp field in reverse chronological order
  117357. // (newest result first). Use this to sort resources like operations so
  117358. // that the newest operation is returned first.
  117359. //
  117360. // Currently, only sorting by name or creationTimestamp desc is
  117361. // supported.
  117362. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  117363. c.urlParams_.Set("orderBy", orderBy)
  117364. return c
  117365. }
  117366. // PageToken sets the optional parameter "pageToken": Specifies a page
  117367. // token to use. Set pageToken to the nextPageToken returned by a
  117368. // previous list request to get the next page of results.
  117369. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  117370. c.urlParams_.Set("pageToken", pageToken)
  117371. return c
  117372. }
  117373. // Fields allows partial responses to be retrieved. See
  117374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117375. // for more information.
  117376. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  117377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117378. return c
  117379. }
  117380. // IfNoneMatch sets the optional parameter which makes the operation
  117381. // fail if the object's ETag matches the given value. This is useful for
  117382. // getting updates only after the object has changed since the last
  117383. // request. Use googleapi.IsNotModified to check whether the response
  117384. // error from Do is the result of In-None-Match.
  117385. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  117386. c.ifNoneMatch_ = entityTag
  117387. return c
  117388. }
  117389. // Context sets the context to be used in this call's Do method. Any
  117390. // pending HTTP request will be aborted if the provided context is
  117391. // canceled.
  117392. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  117393. c.ctx_ = ctx
  117394. return c
  117395. }
  117396. // Header returns an http.Header that can be modified by the caller to
  117397. // add HTTP headers to the request.
  117398. func (c *SslCertificatesListCall) Header() http.Header {
  117399. if c.header_ == nil {
  117400. c.header_ = make(http.Header)
  117401. }
  117402. return c.header_
  117403. }
  117404. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  117405. reqHeaders := make(http.Header)
  117406. for k, v := range c.header_ {
  117407. reqHeaders[k] = v
  117408. }
  117409. reqHeaders.Set("User-Agent", c.s.userAgent())
  117410. if c.ifNoneMatch_ != "" {
  117411. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117412. }
  117413. var body io.Reader = nil
  117414. c.urlParams_.Set("alt", alt)
  117415. c.urlParams_.Set("prettyPrint", "false")
  117416. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  117417. urls += "?" + c.urlParams_.Encode()
  117418. req, err := http.NewRequest("GET", urls, body)
  117419. if err != nil {
  117420. return nil, err
  117421. }
  117422. req.Header = reqHeaders
  117423. googleapi.Expand(req.URL, map[string]string{
  117424. "project": c.project,
  117425. })
  117426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117427. }
  117428. // Do executes the "compute.sslCertificates.list" call.
  117429. // Exactly one of *SslCertificateList or error will be non-nil. Any
  117430. // non-2xx status code is an error. Response headers are in either
  117431. // *SslCertificateList.ServerResponse.Header or (if a response was
  117432. // returned at all) in error.(*googleapi.Error).Header. Use
  117433. // googleapi.IsNotModified to check whether the returned error was
  117434. // because http.StatusNotModified was returned.
  117435. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  117436. gensupport.SetOptions(c.urlParams_, opts...)
  117437. res, err := c.doRequest("json")
  117438. if res != nil && res.StatusCode == http.StatusNotModified {
  117439. if res.Body != nil {
  117440. res.Body.Close()
  117441. }
  117442. return nil, &googleapi.Error{
  117443. Code: res.StatusCode,
  117444. Header: res.Header,
  117445. }
  117446. }
  117447. if err != nil {
  117448. return nil, err
  117449. }
  117450. defer googleapi.CloseBody(res)
  117451. if err := googleapi.CheckResponse(res); err != nil {
  117452. return nil, err
  117453. }
  117454. ret := &SslCertificateList{
  117455. ServerResponse: googleapi.ServerResponse{
  117456. Header: res.Header,
  117457. HTTPStatusCode: res.StatusCode,
  117458. },
  117459. }
  117460. target := &ret
  117461. if err := gensupport.DecodeResponse(target, res); err != nil {
  117462. return nil, err
  117463. }
  117464. return ret, nil
  117465. // {
  117466. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  117467. // "httpMethod": "GET",
  117468. // "id": "compute.sslCertificates.list",
  117469. // "parameterOrder": [
  117470. // "project"
  117471. // ],
  117472. // "parameters": {
  117473. // "filter": {
  117474. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  117475. // "location": "query",
  117476. // "type": "string"
  117477. // },
  117478. // "maxResults": {
  117479. // "default": "500",
  117480. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  117481. // "format": "uint32",
  117482. // "location": "query",
  117483. // "minimum": "0",
  117484. // "type": "integer"
  117485. // },
  117486. // "orderBy": {
  117487. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  117488. // "location": "query",
  117489. // "type": "string"
  117490. // },
  117491. // "pageToken": {
  117492. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  117493. // "location": "query",
  117494. // "type": "string"
  117495. // },
  117496. // "project": {
  117497. // "description": "Project ID for this request.",
  117498. // "location": "path",
  117499. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117500. // "required": true,
  117501. // "type": "string"
  117502. // }
  117503. // },
  117504. // "path": "{project}/global/sslCertificates",
  117505. // "response": {
  117506. // "$ref": "SslCertificateList"
  117507. // },
  117508. // "scopes": [
  117509. // "https://www.googleapis.com/auth/cloud-platform",
  117510. // "https://www.googleapis.com/auth/compute",
  117511. // "https://www.googleapis.com/auth/compute.readonly"
  117512. // ]
  117513. // }
  117514. }
  117515. // Pages invokes f for each page of results.
  117516. // A non-nil error returned from f will halt the iteration.
  117517. // The provided context supersedes any context provided to the Context method.
  117518. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  117519. c.ctx_ = ctx
  117520. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117521. for {
  117522. x, err := c.Do()
  117523. if err != nil {
  117524. return err
  117525. }
  117526. if err := f(x); err != nil {
  117527. return err
  117528. }
  117529. if x.NextPageToken == "" {
  117530. return nil
  117531. }
  117532. c.PageToken(x.NextPageToken)
  117533. }
  117534. }
  117535. // method id "compute.sslCertificates.testIamPermissions":
  117536. type SslCertificatesTestIamPermissionsCall struct {
  117537. s *Service
  117538. project string
  117539. resource string
  117540. testpermissionsrequest *TestPermissionsRequest
  117541. urlParams_ gensupport.URLParams
  117542. ctx_ context.Context
  117543. header_ http.Header
  117544. }
  117545. // TestIamPermissions: Returns permissions that a caller has on the
  117546. // specified resource.
  117547. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  117548. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117549. c.project = project
  117550. c.resource = resource
  117551. c.testpermissionsrequest = testpermissionsrequest
  117552. return c
  117553. }
  117554. // Fields allows partial responses to be retrieved. See
  117555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117556. // for more information.
  117557. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  117558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117559. return c
  117560. }
  117561. // Context sets the context to be used in this call's Do method. Any
  117562. // pending HTTP request will be aborted if the provided context is
  117563. // canceled.
  117564. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  117565. c.ctx_ = ctx
  117566. return c
  117567. }
  117568. // Header returns an http.Header that can be modified by the caller to
  117569. // add HTTP headers to the request.
  117570. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  117571. if c.header_ == nil {
  117572. c.header_ = make(http.Header)
  117573. }
  117574. return c.header_
  117575. }
  117576. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  117577. reqHeaders := make(http.Header)
  117578. for k, v := range c.header_ {
  117579. reqHeaders[k] = v
  117580. }
  117581. reqHeaders.Set("User-Agent", c.s.userAgent())
  117582. var body io.Reader = nil
  117583. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  117584. if err != nil {
  117585. return nil, err
  117586. }
  117587. reqHeaders.Set("Content-Type", "application/json")
  117588. c.urlParams_.Set("alt", alt)
  117589. c.urlParams_.Set("prettyPrint", "false")
  117590. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  117591. urls += "?" + c.urlParams_.Encode()
  117592. req, err := http.NewRequest("POST", urls, body)
  117593. if err != nil {
  117594. return nil, err
  117595. }
  117596. req.Header = reqHeaders
  117597. googleapi.Expand(req.URL, map[string]string{
  117598. "project": c.project,
  117599. "resource": c.resource,
  117600. })
  117601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117602. }
  117603. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  117604. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  117605. // non-2xx status code is an error. Response headers are in either
  117606. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  117607. // returned at all) in error.(*googleapi.Error).Header. Use
  117608. // googleapi.IsNotModified to check whether the returned error was
  117609. // because http.StatusNotModified was returned.
  117610. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  117611. gensupport.SetOptions(c.urlParams_, opts...)
  117612. res, err := c.doRequest("json")
  117613. if res != nil && res.StatusCode == http.StatusNotModified {
  117614. if res.Body != nil {
  117615. res.Body.Close()
  117616. }
  117617. return nil, &googleapi.Error{
  117618. Code: res.StatusCode,
  117619. Header: res.Header,
  117620. }
  117621. }
  117622. if err != nil {
  117623. return nil, err
  117624. }
  117625. defer googleapi.CloseBody(res)
  117626. if err := googleapi.CheckResponse(res); err != nil {
  117627. return nil, err
  117628. }
  117629. ret := &TestPermissionsResponse{
  117630. ServerResponse: googleapi.ServerResponse{
  117631. Header: res.Header,
  117632. HTTPStatusCode: res.StatusCode,
  117633. },
  117634. }
  117635. target := &ret
  117636. if err := gensupport.DecodeResponse(target, res); err != nil {
  117637. return nil, err
  117638. }
  117639. return ret, nil
  117640. // {
  117641. // "description": "Returns permissions that a caller has on the specified resource.",
  117642. // "httpMethod": "POST",
  117643. // "id": "compute.sslCertificates.testIamPermissions",
  117644. // "parameterOrder": [
  117645. // "project",
  117646. // "resource"
  117647. // ],
  117648. // "parameters": {
  117649. // "project": {
  117650. // "description": "Project ID for this request.",
  117651. // "location": "path",
  117652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117653. // "required": true,
  117654. // "type": "string"
  117655. // },
  117656. // "resource": {
  117657. // "description": "Name or id of the resource for this request.",
  117658. // "location": "path",
  117659. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117660. // "required": true,
  117661. // "type": "string"
  117662. // }
  117663. // },
  117664. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  117665. // "request": {
  117666. // "$ref": "TestPermissionsRequest"
  117667. // },
  117668. // "response": {
  117669. // "$ref": "TestPermissionsResponse"
  117670. // },
  117671. // "scopes": [
  117672. // "https://www.googleapis.com/auth/cloud-platform",
  117673. // "https://www.googleapis.com/auth/compute",
  117674. // "https://www.googleapis.com/auth/compute.readonly"
  117675. // ]
  117676. // }
  117677. }
  117678. // method id "compute.sslPolicies.delete":
  117679. type SslPoliciesDeleteCall struct {
  117680. s *Service
  117681. project string
  117682. sslPolicy string
  117683. urlParams_ gensupport.URLParams
  117684. ctx_ context.Context
  117685. header_ http.Header
  117686. }
  117687. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  117688. // be deleted only if it is not in use by any TargetHttpsProxy or
  117689. // TargetSslProxy resources.
  117690. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  117691. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117692. c.project = project
  117693. c.sslPolicy = sslPolicy
  117694. return c
  117695. }
  117696. // RequestId sets the optional parameter "requestId": An optional
  117697. // request ID to identify requests. Specify a unique request ID so that
  117698. // if you must retry your request, the server will know to ignore the
  117699. // request if it has already been completed.
  117700. //
  117701. // For example, consider a situation where you make an initial request
  117702. // and the request times out. If you make the request again with the
  117703. // same request ID, the server can check if original operation with the
  117704. // same request ID was received, and if so, will ignore the second
  117705. // request. This prevents clients from accidentally creating duplicate
  117706. // commitments.
  117707. //
  117708. // The request ID must be a valid UUID with the exception that zero UUID
  117709. // is not supported (00000000-0000-0000-0000-000000000000).
  117710. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  117711. c.urlParams_.Set("requestId", requestId)
  117712. return c
  117713. }
  117714. // Fields allows partial responses to be retrieved. See
  117715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117716. // for more information.
  117717. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  117718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117719. return c
  117720. }
  117721. // Context sets the context to be used in this call's Do method. Any
  117722. // pending HTTP request will be aborted if the provided context is
  117723. // canceled.
  117724. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  117725. c.ctx_ = ctx
  117726. return c
  117727. }
  117728. // Header returns an http.Header that can be modified by the caller to
  117729. // add HTTP headers to the request.
  117730. func (c *SslPoliciesDeleteCall) Header() http.Header {
  117731. if c.header_ == nil {
  117732. c.header_ = make(http.Header)
  117733. }
  117734. return c.header_
  117735. }
  117736. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  117737. reqHeaders := make(http.Header)
  117738. for k, v := range c.header_ {
  117739. reqHeaders[k] = v
  117740. }
  117741. reqHeaders.Set("User-Agent", c.s.userAgent())
  117742. var body io.Reader = nil
  117743. c.urlParams_.Set("alt", alt)
  117744. c.urlParams_.Set("prettyPrint", "false")
  117745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  117746. urls += "?" + c.urlParams_.Encode()
  117747. req, err := http.NewRequest("DELETE", urls, body)
  117748. if err != nil {
  117749. return nil, err
  117750. }
  117751. req.Header = reqHeaders
  117752. googleapi.Expand(req.URL, map[string]string{
  117753. "project": c.project,
  117754. "sslPolicy": c.sslPolicy,
  117755. })
  117756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117757. }
  117758. // Do executes the "compute.sslPolicies.delete" call.
  117759. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117760. // status code is an error. Response headers are in either
  117761. // *Operation.ServerResponse.Header or (if a response was returned at
  117762. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117763. // to check whether the returned error was because
  117764. // http.StatusNotModified was returned.
  117765. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117766. gensupport.SetOptions(c.urlParams_, opts...)
  117767. res, err := c.doRequest("json")
  117768. if res != nil && res.StatusCode == http.StatusNotModified {
  117769. if res.Body != nil {
  117770. res.Body.Close()
  117771. }
  117772. return nil, &googleapi.Error{
  117773. Code: res.StatusCode,
  117774. Header: res.Header,
  117775. }
  117776. }
  117777. if err != nil {
  117778. return nil, err
  117779. }
  117780. defer googleapi.CloseBody(res)
  117781. if err := googleapi.CheckResponse(res); err != nil {
  117782. return nil, err
  117783. }
  117784. ret := &Operation{
  117785. ServerResponse: googleapi.ServerResponse{
  117786. Header: res.Header,
  117787. HTTPStatusCode: res.StatusCode,
  117788. },
  117789. }
  117790. target := &ret
  117791. if err := gensupport.DecodeResponse(target, res); err != nil {
  117792. return nil, err
  117793. }
  117794. return ret, nil
  117795. // {
  117796. // "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.",
  117797. // "httpMethod": "DELETE",
  117798. // "id": "compute.sslPolicies.delete",
  117799. // "parameterOrder": [
  117800. // "project",
  117801. // "sslPolicy"
  117802. // ],
  117803. // "parameters": {
  117804. // "project": {
  117805. // "description": "Project ID for this request.",
  117806. // "location": "path",
  117807. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117808. // "required": true,
  117809. // "type": "string"
  117810. // },
  117811. // "requestId": {
  117812. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117813. // "location": "query",
  117814. // "type": "string"
  117815. // },
  117816. // "sslPolicy": {
  117817. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  117818. // "location": "path",
  117819. // "required": true,
  117820. // "type": "string"
  117821. // }
  117822. // },
  117823. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  117824. // "response": {
  117825. // "$ref": "Operation"
  117826. // },
  117827. // "scopes": [
  117828. // "https://www.googleapis.com/auth/cloud-platform",
  117829. // "https://www.googleapis.com/auth/compute"
  117830. // ]
  117831. // }
  117832. }
  117833. // method id "compute.sslPolicies.get":
  117834. type SslPoliciesGetCall struct {
  117835. s *Service
  117836. project string
  117837. sslPolicy string
  117838. urlParams_ gensupport.URLParams
  117839. ifNoneMatch_ string
  117840. ctx_ context.Context
  117841. header_ http.Header
  117842. }
  117843. // Get: Lists all of the ordered rules present in a single specified
  117844. // policy.
  117845. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  117846. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117847. c.project = project
  117848. c.sslPolicy = sslPolicy
  117849. return c
  117850. }
  117851. // Fields allows partial responses to be retrieved. See
  117852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117853. // for more information.
  117854. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  117855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117856. return c
  117857. }
  117858. // IfNoneMatch sets the optional parameter which makes the operation
  117859. // fail if the object's ETag matches the given value. This is useful for
  117860. // getting updates only after the object has changed since the last
  117861. // request. Use googleapi.IsNotModified to check whether the response
  117862. // error from Do is the result of In-None-Match.
  117863. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  117864. c.ifNoneMatch_ = entityTag
  117865. return c
  117866. }
  117867. // Context sets the context to be used in this call's Do method. Any
  117868. // pending HTTP request will be aborted if the provided context is
  117869. // canceled.
  117870. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  117871. c.ctx_ = ctx
  117872. return c
  117873. }
  117874. // Header returns an http.Header that can be modified by the caller to
  117875. // add HTTP headers to the request.
  117876. func (c *SslPoliciesGetCall) Header() http.Header {
  117877. if c.header_ == nil {
  117878. c.header_ = make(http.Header)
  117879. }
  117880. return c.header_
  117881. }
  117882. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  117883. reqHeaders := make(http.Header)
  117884. for k, v := range c.header_ {
  117885. reqHeaders[k] = v
  117886. }
  117887. reqHeaders.Set("User-Agent", c.s.userAgent())
  117888. if c.ifNoneMatch_ != "" {
  117889. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117890. }
  117891. var body io.Reader = nil
  117892. c.urlParams_.Set("alt", alt)
  117893. c.urlParams_.Set("prettyPrint", "false")
  117894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  117895. urls += "?" + c.urlParams_.Encode()
  117896. req, err := http.NewRequest("GET", urls, body)
  117897. if err != nil {
  117898. return nil, err
  117899. }
  117900. req.Header = reqHeaders
  117901. googleapi.Expand(req.URL, map[string]string{
  117902. "project": c.project,
  117903. "sslPolicy": c.sslPolicy,
  117904. })
  117905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117906. }
  117907. // Do executes the "compute.sslPolicies.get" call.
  117908. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  117909. // status code is an error. Response headers are in either
  117910. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  117911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117912. // to check whether the returned error was because
  117913. // http.StatusNotModified was returned.
  117914. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  117915. gensupport.SetOptions(c.urlParams_, opts...)
  117916. res, err := c.doRequest("json")
  117917. if res != nil && res.StatusCode == http.StatusNotModified {
  117918. if res.Body != nil {
  117919. res.Body.Close()
  117920. }
  117921. return nil, &googleapi.Error{
  117922. Code: res.StatusCode,
  117923. Header: res.Header,
  117924. }
  117925. }
  117926. if err != nil {
  117927. return nil, err
  117928. }
  117929. defer googleapi.CloseBody(res)
  117930. if err := googleapi.CheckResponse(res); err != nil {
  117931. return nil, err
  117932. }
  117933. ret := &SslPolicy{
  117934. ServerResponse: googleapi.ServerResponse{
  117935. Header: res.Header,
  117936. HTTPStatusCode: res.StatusCode,
  117937. },
  117938. }
  117939. target := &ret
  117940. if err := gensupport.DecodeResponse(target, res); err != nil {
  117941. return nil, err
  117942. }
  117943. return ret, nil
  117944. // {
  117945. // "description": "Lists all of the ordered rules present in a single specified policy.",
  117946. // "httpMethod": "GET",
  117947. // "id": "compute.sslPolicies.get",
  117948. // "parameterOrder": [
  117949. // "project",
  117950. // "sslPolicy"
  117951. // ],
  117952. // "parameters": {
  117953. // "project": {
  117954. // "description": "Project ID for this request.",
  117955. // "location": "path",
  117956. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117957. // "required": true,
  117958. // "type": "string"
  117959. // },
  117960. // "sslPolicy": {
  117961. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  117962. // "location": "path",
  117963. // "required": true,
  117964. // "type": "string"
  117965. // }
  117966. // },
  117967. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  117968. // "response": {
  117969. // "$ref": "SslPolicy"
  117970. // },
  117971. // "scopes": [
  117972. // "https://www.googleapis.com/auth/cloud-platform",
  117973. // "https://www.googleapis.com/auth/compute",
  117974. // "https://www.googleapis.com/auth/compute.readonly"
  117975. // ]
  117976. // }
  117977. }
  117978. // method id "compute.sslPolicies.insert":
  117979. type SslPoliciesInsertCall struct {
  117980. s *Service
  117981. project string
  117982. sslpolicy *SslPolicy
  117983. urlParams_ gensupport.URLParams
  117984. ctx_ context.Context
  117985. header_ http.Header
  117986. }
  117987. // Insert: Returns the specified SSL policy resource. Gets a list of
  117988. // available SSL policies by making a list() request.
  117989. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  117990. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117991. c.project = project
  117992. c.sslpolicy = sslpolicy
  117993. return c
  117994. }
  117995. // RequestId sets the optional parameter "requestId": An optional
  117996. // request ID to identify requests. Specify a unique request ID so that
  117997. // if you must retry your request, the server will know to ignore the
  117998. // request if it has already been completed.
  117999. //
  118000. // For example, consider a situation where you make an initial request
  118001. // and the request times out. If you make the request again with the
  118002. // same request ID, the server can check if original operation with the
  118003. // same request ID was received, and if so, will ignore the second
  118004. // request. This prevents clients from accidentally creating duplicate
  118005. // commitments.
  118006. //
  118007. // The request ID must be a valid UUID with the exception that zero UUID
  118008. // is not supported (00000000-0000-0000-0000-000000000000).
  118009. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  118010. c.urlParams_.Set("requestId", requestId)
  118011. return c
  118012. }
  118013. // Fields allows partial responses to be retrieved. See
  118014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118015. // for more information.
  118016. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  118017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118018. return c
  118019. }
  118020. // Context sets the context to be used in this call's Do method. Any
  118021. // pending HTTP request will be aborted if the provided context is
  118022. // canceled.
  118023. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  118024. c.ctx_ = ctx
  118025. return c
  118026. }
  118027. // Header returns an http.Header that can be modified by the caller to
  118028. // add HTTP headers to the request.
  118029. func (c *SslPoliciesInsertCall) Header() http.Header {
  118030. if c.header_ == nil {
  118031. c.header_ = make(http.Header)
  118032. }
  118033. return c.header_
  118034. }
  118035. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  118036. reqHeaders := make(http.Header)
  118037. for k, v := range c.header_ {
  118038. reqHeaders[k] = v
  118039. }
  118040. reqHeaders.Set("User-Agent", c.s.userAgent())
  118041. var body io.Reader = nil
  118042. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  118043. if err != nil {
  118044. return nil, err
  118045. }
  118046. reqHeaders.Set("Content-Type", "application/json")
  118047. c.urlParams_.Set("alt", alt)
  118048. c.urlParams_.Set("prettyPrint", "false")
  118049. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  118050. urls += "?" + c.urlParams_.Encode()
  118051. req, err := http.NewRequest("POST", urls, body)
  118052. if err != nil {
  118053. return nil, err
  118054. }
  118055. req.Header = reqHeaders
  118056. googleapi.Expand(req.URL, map[string]string{
  118057. "project": c.project,
  118058. })
  118059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118060. }
  118061. // Do executes the "compute.sslPolicies.insert" call.
  118062. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118063. // status code is an error. Response headers are in either
  118064. // *Operation.ServerResponse.Header or (if a response was returned at
  118065. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118066. // to check whether the returned error was because
  118067. // http.StatusNotModified was returned.
  118068. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118069. gensupport.SetOptions(c.urlParams_, opts...)
  118070. res, err := c.doRequest("json")
  118071. if res != nil && res.StatusCode == http.StatusNotModified {
  118072. if res.Body != nil {
  118073. res.Body.Close()
  118074. }
  118075. return nil, &googleapi.Error{
  118076. Code: res.StatusCode,
  118077. Header: res.Header,
  118078. }
  118079. }
  118080. if err != nil {
  118081. return nil, err
  118082. }
  118083. defer googleapi.CloseBody(res)
  118084. if err := googleapi.CheckResponse(res); err != nil {
  118085. return nil, err
  118086. }
  118087. ret := &Operation{
  118088. ServerResponse: googleapi.ServerResponse{
  118089. Header: res.Header,
  118090. HTTPStatusCode: res.StatusCode,
  118091. },
  118092. }
  118093. target := &ret
  118094. if err := gensupport.DecodeResponse(target, res); err != nil {
  118095. return nil, err
  118096. }
  118097. return ret, nil
  118098. // {
  118099. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  118100. // "httpMethod": "POST",
  118101. // "id": "compute.sslPolicies.insert",
  118102. // "parameterOrder": [
  118103. // "project"
  118104. // ],
  118105. // "parameters": {
  118106. // "project": {
  118107. // "description": "Project ID for this request.",
  118108. // "location": "path",
  118109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118110. // "required": true,
  118111. // "type": "string"
  118112. // },
  118113. // "requestId": {
  118114. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118115. // "location": "query",
  118116. // "type": "string"
  118117. // }
  118118. // },
  118119. // "path": "{project}/global/sslPolicies",
  118120. // "request": {
  118121. // "$ref": "SslPolicy"
  118122. // },
  118123. // "response": {
  118124. // "$ref": "Operation"
  118125. // },
  118126. // "scopes": [
  118127. // "https://www.googleapis.com/auth/cloud-platform",
  118128. // "https://www.googleapis.com/auth/compute"
  118129. // ]
  118130. // }
  118131. }
  118132. // method id "compute.sslPolicies.list":
  118133. type SslPoliciesListCall struct {
  118134. s *Service
  118135. project string
  118136. urlParams_ gensupport.URLParams
  118137. ifNoneMatch_ string
  118138. ctx_ context.Context
  118139. header_ http.Header
  118140. }
  118141. // List: Lists all the SSL policies that have been configured for the
  118142. // specified project.
  118143. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  118144. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118145. c.project = project
  118146. return c
  118147. }
  118148. // Filter sets the optional parameter "filter": A filter expression that
  118149. // filters resources listed in the response. The expression must specify
  118150. // the field name, a comparison operator, and the value that you want to
  118151. // use for filtering. The value must be a string, a number, or a
  118152. // boolean. The comparison operator must be either =, !=, >, or <.
  118153. //
  118154. // For example, if you are filtering Compute Engine instances, you can
  118155. // exclude instances named example-instance by specifying name !=
  118156. // example-instance.
  118157. //
  118158. // You can also filter nested fields. For example, you could specify
  118159. // scheduling.automaticRestart = false to include instances only if they
  118160. // are not scheduled for automatic restarts. You can use filtering on
  118161. // nested fields to filter based on resource labels.
  118162. //
  118163. // To filter on multiple expressions, provide each separate expression
  118164. // within parentheses. For example, (scheduling.automaticRestart = true)
  118165. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118166. // AND expression. However, you can include AND and OR expressions
  118167. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118168. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118169. // true).
  118170. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  118171. c.urlParams_.Set("filter", filter)
  118172. return c
  118173. }
  118174. // MaxResults sets the optional parameter "maxResults": The maximum
  118175. // number of results per page that should be returned. If the number of
  118176. // available results is larger than maxResults, Compute Engine returns a
  118177. // nextPageToken that can be used to get the next page of results in
  118178. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118179. // (Default: 500)
  118180. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  118181. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118182. return c
  118183. }
  118184. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118185. // a certain order. By default, results are returned in alphanumerical
  118186. // order based on the resource name.
  118187. //
  118188. // You can also sort results in descending order based on the creation
  118189. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118190. // based on the creationTimestamp field in reverse chronological order
  118191. // (newest result first). Use this to sort resources like operations so
  118192. // that the newest operation is returned first.
  118193. //
  118194. // Currently, only sorting by name or creationTimestamp desc is
  118195. // supported.
  118196. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  118197. c.urlParams_.Set("orderBy", orderBy)
  118198. return c
  118199. }
  118200. // PageToken sets the optional parameter "pageToken": Specifies a page
  118201. // token to use. Set pageToken to the nextPageToken returned by a
  118202. // previous list request to get the next page of results.
  118203. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  118204. c.urlParams_.Set("pageToken", pageToken)
  118205. return c
  118206. }
  118207. // Fields allows partial responses to be retrieved. See
  118208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118209. // for more information.
  118210. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  118211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118212. return c
  118213. }
  118214. // IfNoneMatch sets the optional parameter which makes the operation
  118215. // fail if the object's ETag matches the given value. This is useful for
  118216. // getting updates only after the object has changed since the last
  118217. // request. Use googleapi.IsNotModified to check whether the response
  118218. // error from Do is the result of In-None-Match.
  118219. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  118220. c.ifNoneMatch_ = entityTag
  118221. return c
  118222. }
  118223. // Context sets the context to be used in this call's Do method. Any
  118224. // pending HTTP request will be aborted if the provided context is
  118225. // canceled.
  118226. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  118227. c.ctx_ = ctx
  118228. return c
  118229. }
  118230. // Header returns an http.Header that can be modified by the caller to
  118231. // add HTTP headers to the request.
  118232. func (c *SslPoliciesListCall) Header() http.Header {
  118233. if c.header_ == nil {
  118234. c.header_ = make(http.Header)
  118235. }
  118236. return c.header_
  118237. }
  118238. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  118239. reqHeaders := make(http.Header)
  118240. for k, v := range c.header_ {
  118241. reqHeaders[k] = v
  118242. }
  118243. reqHeaders.Set("User-Agent", c.s.userAgent())
  118244. if c.ifNoneMatch_ != "" {
  118245. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118246. }
  118247. var body io.Reader = nil
  118248. c.urlParams_.Set("alt", alt)
  118249. c.urlParams_.Set("prettyPrint", "false")
  118250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  118251. urls += "?" + c.urlParams_.Encode()
  118252. req, err := http.NewRequest("GET", urls, body)
  118253. if err != nil {
  118254. return nil, err
  118255. }
  118256. req.Header = reqHeaders
  118257. googleapi.Expand(req.URL, map[string]string{
  118258. "project": c.project,
  118259. })
  118260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118261. }
  118262. // Do executes the "compute.sslPolicies.list" call.
  118263. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  118264. // status code is an error. Response headers are in either
  118265. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  118266. // at all) in error.(*googleapi.Error).Header. Use
  118267. // googleapi.IsNotModified to check whether the returned error was
  118268. // because http.StatusNotModified was returned.
  118269. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  118270. gensupport.SetOptions(c.urlParams_, opts...)
  118271. res, err := c.doRequest("json")
  118272. if res != nil && res.StatusCode == http.StatusNotModified {
  118273. if res.Body != nil {
  118274. res.Body.Close()
  118275. }
  118276. return nil, &googleapi.Error{
  118277. Code: res.StatusCode,
  118278. Header: res.Header,
  118279. }
  118280. }
  118281. if err != nil {
  118282. return nil, err
  118283. }
  118284. defer googleapi.CloseBody(res)
  118285. if err := googleapi.CheckResponse(res); err != nil {
  118286. return nil, err
  118287. }
  118288. ret := &SslPoliciesList{
  118289. ServerResponse: googleapi.ServerResponse{
  118290. Header: res.Header,
  118291. HTTPStatusCode: res.StatusCode,
  118292. },
  118293. }
  118294. target := &ret
  118295. if err := gensupport.DecodeResponse(target, res); err != nil {
  118296. return nil, err
  118297. }
  118298. return ret, nil
  118299. // {
  118300. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  118301. // "httpMethod": "GET",
  118302. // "id": "compute.sslPolicies.list",
  118303. // "parameterOrder": [
  118304. // "project"
  118305. // ],
  118306. // "parameters": {
  118307. // "filter": {
  118308. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118309. // "location": "query",
  118310. // "type": "string"
  118311. // },
  118312. // "maxResults": {
  118313. // "default": "500",
  118314. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118315. // "format": "uint32",
  118316. // "location": "query",
  118317. // "minimum": "0",
  118318. // "type": "integer"
  118319. // },
  118320. // "orderBy": {
  118321. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118322. // "location": "query",
  118323. // "type": "string"
  118324. // },
  118325. // "pageToken": {
  118326. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118327. // "location": "query",
  118328. // "type": "string"
  118329. // },
  118330. // "project": {
  118331. // "description": "Project ID for this request.",
  118332. // "location": "path",
  118333. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118334. // "required": true,
  118335. // "type": "string"
  118336. // }
  118337. // },
  118338. // "path": "{project}/global/sslPolicies",
  118339. // "response": {
  118340. // "$ref": "SslPoliciesList"
  118341. // },
  118342. // "scopes": [
  118343. // "https://www.googleapis.com/auth/cloud-platform",
  118344. // "https://www.googleapis.com/auth/compute",
  118345. // "https://www.googleapis.com/auth/compute.readonly"
  118346. // ]
  118347. // }
  118348. }
  118349. // Pages invokes f for each page of results.
  118350. // A non-nil error returned from f will halt the iteration.
  118351. // The provided context supersedes any context provided to the Context method.
  118352. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  118353. c.ctx_ = ctx
  118354. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118355. for {
  118356. x, err := c.Do()
  118357. if err != nil {
  118358. return err
  118359. }
  118360. if err := f(x); err != nil {
  118361. return err
  118362. }
  118363. if x.NextPageToken == "" {
  118364. return nil
  118365. }
  118366. c.PageToken(x.NextPageToken)
  118367. }
  118368. }
  118369. // method id "compute.sslPolicies.listAvailableFeatures":
  118370. type SslPoliciesListAvailableFeaturesCall struct {
  118371. s *Service
  118372. project string
  118373. urlParams_ gensupport.URLParams
  118374. ifNoneMatch_ string
  118375. ctx_ context.Context
  118376. header_ http.Header
  118377. }
  118378. // ListAvailableFeatures: Lists all features that can be specified in
  118379. // the SSL policy when using custom profile.
  118380. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  118381. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118382. c.project = project
  118383. return c
  118384. }
  118385. // Filter sets the optional parameter "filter": A filter expression that
  118386. // filters resources listed in the response. The expression must specify
  118387. // the field name, a comparison operator, and the value that you want to
  118388. // use for filtering. The value must be a string, a number, or a
  118389. // boolean. The comparison operator must be either =, !=, >, or <.
  118390. //
  118391. // For example, if you are filtering Compute Engine instances, you can
  118392. // exclude instances named example-instance by specifying name !=
  118393. // example-instance.
  118394. //
  118395. // You can also filter nested fields. For example, you could specify
  118396. // scheduling.automaticRestart = false to include instances only if they
  118397. // are not scheduled for automatic restarts. You can use filtering on
  118398. // nested fields to filter based on resource labels.
  118399. //
  118400. // To filter on multiple expressions, provide each separate expression
  118401. // within parentheses. For example, (scheduling.automaticRestart = true)
  118402. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118403. // AND expression. However, you can include AND and OR expressions
  118404. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118405. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118406. // true).
  118407. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  118408. c.urlParams_.Set("filter", filter)
  118409. return c
  118410. }
  118411. // MaxResults sets the optional parameter "maxResults": The maximum
  118412. // number of results per page that should be returned. If the number of
  118413. // available results is larger than maxResults, Compute Engine returns a
  118414. // nextPageToken that can be used to get the next page of results in
  118415. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118416. // (Default: 500)
  118417. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  118418. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118419. return c
  118420. }
  118421. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118422. // a certain order. By default, results are returned in alphanumerical
  118423. // order based on the resource name.
  118424. //
  118425. // You can also sort results in descending order based on the creation
  118426. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118427. // based on the creationTimestamp field in reverse chronological order
  118428. // (newest result first). Use this to sort resources like operations so
  118429. // that the newest operation is returned first.
  118430. //
  118431. // Currently, only sorting by name or creationTimestamp desc is
  118432. // supported.
  118433. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  118434. c.urlParams_.Set("orderBy", orderBy)
  118435. return c
  118436. }
  118437. // PageToken sets the optional parameter "pageToken": Specifies a page
  118438. // token to use. Set pageToken to the nextPageToken returned by a
  118439. // previous list request to get the next page of results.
  118440. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  118441. c.urlParams_.Set("pageToken", pageToken)
  118442. return c
  118443. }
  118444. // Fields allows partial responses to be retrieved. See
  118445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118446. // for more information.
  118447. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  118448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118449. return c
  118450. }
  118451. // IfNoneMatch sets the optional parameter which makes the operation
  118452. // fail if the object's ETag matches the given value. This is useful for
  118453. // getting updates only after the object has changed since the last
  118454. // request. Use googleapi.IsNotModified to check whether the response
  118455. // error from Do is the result of In-None-Match.
  118456. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  118457. c.ifNoneMatch_ = entityTag
  118458. return c
  118459. }
  118460. // Context sets the context to be used in this call's Do method. Any
  118461. // pending HTTP request will be aborted if the provided context is
  118462. // canceled.
  118463. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  118464. c.ctx_ = ctx
  118465. return c
  118466. }
  118467. // Header returns an http.Header that can be modified by the caller to
  118468. // add HTTP headers to the request.
  118469. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  118470. if c.header_ == nil {
  118471. c.header_ = make(http.Header)
  118472. }
  118473. return c.header_
  118474. }
  118475. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  118476. reqHeaders := make(http.Header)
  118477. for k, v := range c.header_ {
  118478. reqHeaders[k] = v
  118479. }
  118480. reqHeaders.Set("User-Agent", c.s.userAgent())
  118481. if c.ifNoneMatch_ != "" {
  118482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118483. }
  118484. var body io.Reader = nil
  118485. c.urlParams_.Set("alt", alt)
  118486. c.urlParams_.Set("prettyPrint", "false")
  118487. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  118488. urls += "?" + c.urlParams_.Encode()
  118489. req, err := http.NewRequest("GET", urls, body)
  118490. if err != nil {
  118491. return nil, err
  118492. }
  118493. req.Header = reqHeaders
  118494. googleapi.Expand(req.URL, map[string]string{
  118495. "project": c.project,
  118496. })
  118497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118498. }
  118499. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  118500. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  118501. // will be non-nil. Any non-2xx status code is an error. Response
  118502. // headers are in either
  118503. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  118504. // (if a response was returned at all) in
  118505. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  118506. // whether the returned error was because http.StatusNotModified was
  118507. // returned.
  118508. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  118509. gensupport.SetOptions(c.urlParams_, opts...)
  118510. res, err := c.doRequest("json")
  118511. if res != nil && res.StatusCode == http.StatusNotModified {
  118512. if res.Body != nil {
  118513. res.Body.Close()
  118514. }
  118515. return nil, &googleapi.Error{
  118516. Code: res.StatusCode,
  118517. Header: res.Header,
  118518. }
  118519. }
  118520. if err != nil {
  118521. return nil, err
  118522. }
  118523. defer googleapi.CloseBody(res)
  118524. if err := googleapi.CheckResponse(res); err != nil {
  118525. return nil, err
  118526. }
  118527. ret := &SslPoliciesListAvailableFeaturesResponse{
  118528. ServerResponse: googleapi.ServerResponse{
  118529. Header: res.Header,
  118530. HTTPStatusCode: res.StatusCode,
  118531. },
  118532. }
  118533. target := &ret
  118534. if err := gensupport.DecodeResponse(target, res); err != nil {
  118535. return nil, err
  118536. }
  118537. return ret, nil
  118538. // {
  118539. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  118540. // "httpMethod": "GET",
  118541. // "id": "compute.sslPolicies.listAvailableFeatures",
  118542. // "parameterOrder": [
  118543. // "project"
  118544. // ],
  118545. // "parameters": {
  118546. // "filter": {
  118547. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118548. // "location": "query",
  118549. // "type": "string"
  118550. // },
  118551. // "maxResults": {
  118552. // "default": "500",
  118553. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118554. // "format": "uint32",
  118555. // "location": "query",
  118556. // "minimum": "0",
  118557. // "type": "integer"
  118558. // },
  118559. // "orderBy": {
  118560. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118561. // "location": "query",
  118562. // "type": "string"
  118563. // },
  118564. // "pageToken": {
  118565. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118566. // "location": "query",
  118567. // "type": "string"
  118568. // },
  118569. // "project": {
  118570. // "description": "Project ID for this request.",
  118571. // "location": "path",
  118572. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118573. // "required": true,
  118574. // "type": "string"
  118575. // }
  118576. // },
  118577. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  118578. // "response": {
  118579. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  118580. // },
  118581. // "scopes": [
  118582. // "https://www.googleapis.com/auth/cloud-platform",
  118583. // "https://www.googleapis.com/auth/compute",
  118584. // "https://www.googleapis.com/auth/compute.readonly"
  118585. // ]
  118586. // }
  118587. }
  118588. // method id "compute.sslPolicies.patch":
  118589. type SslPoliciesPatchCall struct {
  118590. s *Service
  118591. project string
  118592. sslPolicy string
  118593. sslpolicy *SslPolicy
  118594. urlParams_ gensupport.URLParams
  118595. ctx_ context.Context
  118596. header_ http.Header
  118597. }
  118598. // Patch: Patches the specified SSL policy with the data included in the
  118599. // request.
  118600. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  118601. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118602. c.project = project
  118603. c.sslPolicy = sslPolicy
  118604. c.sslpolicy = sslpolicy
  118605. return c
  118606. }
  118607. // RequestId sets the optional parameter "requestId": An optional
  118608. // request ID to identify requests. Specify a unique request ID so that
  118609. // if you must retry your request, the server will know to ignore the
  118610. // request if it has already been completed.
  118611. //
  118612. // For example, consider a situation where you make an initial request
  118613. // and the request times out. If you make the request again with the
  118614. // same request ID, the server can check if original operation with the
  118615. // same request ID was received, and if so, will ignore the second
  118616. // request. This prevents clients from accidentally creating duplicate
  118617. // commitments.
  118618. //
  118619. // The request ID must be a valid UUID with the exception that zero UUID
  118620. // is not supported (00000000-0000-0000-0000-000000000000).
  118621. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  118622. c.urlParams_.Set("requestId", requestId)
  118623. return c
  118624. }
  118625. // Fields allows partial responses to be retrieved. See
  118626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118627. // for more information.
  118628. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  118629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118630. return c
  118631. }
  118632. // Context sets the context to be used in this call's Do method. Any
  118633. // pending HTTP request will be aborted if the provided context is
  118634. // canceled.
  118635. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  118636. c.ctx_ = ctx
  118637. return c
  118638. }
  118639. // Header returns an http.Header that can be modified by the caller to
  118640. // add HTTP headers to the request.
  118641. func (c *SslPoliciesPatchCall) Header() http.Header {
  118642. if c.header_ == nil {
  118643. c.header_ = make(http.Header)
  118644. }
  118645. return c.header_
  118646. }
  118647. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  118648. reqHeaders := make(http.Header)
  118649. for k, v := range c.header_ {
  118650. reqHeaders[k] = v
  118651. }
  118652. reqHeaders.Set("User-Agent", c.s.userAgent())
  118653. var body io.Reader = nil
  118654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  118655. if err != nil {
  118656. return nil, err
  118657. }
  118658. reqHeaders.Set("Content-Type", "application/json")
  118659. c.urlParams_.Set("alt", alt)
  118660. c.urlParams_.Set("prettyPrint", "false")
  118661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  118662. urls += "?" + c.urlParams_.Encode()
  118663. req, err := http.NewRequest("PATCH", urls, body)
  118664. if err != nil {
  118665. return nil, err
  118666. }
  118667. req.Header = reqHeaders
  118668. googleapi.Expand(req.URL, map[string]string{
  118669. "project": c.project,
  118670. "sslPolicy": c.sslPolicy,
  118671. })
  118672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118673. }
  118674. // Do executes the "compute.sslPolicies.patch" call.
  118675. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118676. // status code is an error. Response headers are in either
  118677. // *Operation.ServerResponse.Header or (if a response was returned at
  118678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118679. // to check whether the returned error was because
  118680. // http.StatusNotModified was returned.
  118681. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118682. gensupport.SetOptions(c.urlParams_, opts...)
  118683. res, err := c.doRequest("json")
  118684. if res != nil && res.StatusCode == http.StatusNotModified {
  118685. if res.Body != nil {
  118686. res.Body.Close()
  118687. }
  118688. return nil, &googleapi.Error{
  118689. Code: res.StatusCode,
  118690. Header: res.Header,
  118691. }
  118692. }
  118693. if err != nil {
  118694. return nil, err
  118695. }
  118696. defer googleapi.CloseBody(res)
  118697. if err := googleapi.CheckResponse(res); err != nil {
  118698. return nil, err
  118699. }
  118700. ret := &Operation{
  118701. ServerResponse: googleapi.ServerResponse{
  118702. Header: res.Header,
  118703. HTTPStatusCode: res.StatusCode,
  118704. },
  118705. }
  118706. target := &ret
  118707. if err := gensupport.DecodeResponse(target, res); err != nil {
  118708. return nil, err
  118709. }
  118710. return ret, nil
  118711. // {
  118712. // "description": "Patches the specified SSL policy with the data included in the request.",
  118713. // "httpMethod": "PATCH",
  118714. // "id": "compute.sslPolicies.patch",
  118715. // "parameterOrder": [
  118716. // "project",
  118717. // "sslPolicy"
  118718. // ],
  118719. // "parameters": {
  118720. // "project": {
  118721. // "description": "Project ID for this request.",
  118722. // "location": "path",
  118723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118724. // "required": true,
  118725. // "type": "string"
  118726. // },
  118727. // "requestId": {
  118728. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118729. // "location": "query",
  118730. // "type": "string"
  118731. // },
  118732. // "sslPolicy": {
  118733. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  118734. // "location": "path",
  118735. // "required": true,
  118736. // "type": "string"
  118737. // }
  118738. // },
  118739. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  118740. // "request": {
  118741. // "$ref": "SslPolicy"
  118742. // },
  118743. // "response": {
  118744. // "$ref": "Operation"
  118745. // },
  118746. // "scopes": [
  118747. // "https://www.googleapis.com/auth/cloud-platform",
  118748. // "https://www.googleapis.com/auth/compute"
  118749. // ]
  118750. // }
  118751. }
  118752. // method id "compute.sslPolicies.testIamPermissions":
  118753. type SslPoliciesTestIamPermissionsCall struct {
  118754. s *Service
  118755. project string
  118756. resource string
  118757. testpermissionsrequest *TestPermissionsRequest
  118758. urlParams_ gensupport.URLParams
  118759. ctx_ context.Context
  118760. header_ http.Header
  118761. }
  118762. // TestIamPermissions: Returns permissions that a caller has on the
  118763. // specified resource.
  118764. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  118765. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118766. c.project = project
  118767. c.resource = resource
  118768. c.testpermissionsrequest = testpermissionsrequest
  118769. return c
  118770. }
  118771. // Fields allows partial responses to be retrieved. See
  118772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118773. // for more information.
  118774. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  118775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118776. return c
  118777. }
  118778. // Context sets the context to be used in this call's Do method. Any
  118779. // pending HTTP request will be aborted if the provided context is
  118780. // canceled.
  118781. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  118782. c.ctx_ = ctx
  118783. return c
  118784. }
  118785. // Header returns an http.Header that can be modified by the caller to
  118786. // add HTTP headers to the request.
  118787. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  118788. if c.header_ == nil {
  118789. c.header_ = make(http.Header)
  118790. }
  118791. return c.header_
  118792. }
  118793. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  118794. reqHeaders := make(http.Header)
  118795. for k, v := range c.header_ {
  118796. reqHeaders[k] = v
  118797. }
  118798. reqHeaders.Set("User-Agent", c.s.userAgent())
  118799. var body io.Reader = nil
  118800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  118801. if err != nil {
  118802. return nil, err
  118803. }
  118804. reqHeaders.Set("Content-Type", "application/json")
  118805. c.urlParams_.Set("alt", alt)
  118806. c.urlParams_.Set("prettyPrint", "false")
  118807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  118808. urls += "?" + c.urlParams_.Encode()
  118809. req, err := http.NewRequest("POST", urls, body)
  118810. if err != nil {
  118811. return nil, err
  118812. }
  118813. req.Header = reqHeaders
  118814. googleapi.Expand(req.URL, map[string]string{
  118815. "project": c.project,
  118816. "resource": c.resource,
  118817. })
  118818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118819. }
  118820. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  118821. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  118822. // non-2xx status code is an error. Response headers are in either
  118823. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  118824. // returned at all) in error.(*googleapi.Error).Header. Use
  118825. // googleapi.IsNotModified to check whether the returned error was
  118826. // because http.StatusNotModified was returned.
  118827. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  118828. gensupport.SetOptions(c.urlParams_, opts...)
  118829. res, err := c.doRequest("json")
  118830. if res != nil && res.StatusCode == http.StatusNotModified {
  118831. if res.Body != nil {
  118832. res.Body.Close()
  118833. }
  118834. return nil, &googleapi.Error{
  118835. Code: res.StatusCode,
  118836. Header: res.Header,
  118837. }
  118838. }
  118839. if err != nil {
  118840. return nil, err
  118841. }
  118842. defer googleapi.CloseBody(res)
  118843. if err := googleapi.CheckResponse(res); err != nil {
  118844. return nil, err
  118845. }
  118846. ret := &TestPermissionsResponse{
  118847. ServerResponse: googleapi.ServerResponse{
  118848. Header: res.Header,
  118849. HTTPStatusCode: res.StatusCode,
  118850. },
  118851. }
  118852. target := &ret
  118853. if err := gensupport.DecodeResponse(target, res); err != nil {
  118854. return nil, err
  118855. }
  118856. return ret, nil
  118857. // {
  118858. // "description": "Returns permissions that a caller has on the specified resource.",
  118859. // "httpMethod": "POST",
  118860. // "id": "compute.sslPolicies.testIamPermissions",
  118861. // "parameterOrder": [
  118862. // "project",
  118863. // "resource"
  118864. // ],
  118865. // "parameters": {
  118866. // "project": {
  118867. // "description": "Project ID for this request.",
  118868. // "location": "path",
  118869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118870. // "required": true,
  118871. // "type": "string"
  118872. // },
  118873. // "resource": {
  118874. // "description": "Name or id of the resource for this request.",
  118875. // "location": "path",
  118876. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118877. // "required": true,
  118878. // "type": "string"
  118879. // }
  118880. // },
  118881. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  118882. // "request": {
  118883. // "$ref": "TestPermissionsRequest"
  118884. // },
  118885. // "response": {
  118886. // "$ref": "TestPermissionsResponse"
  118887. // },
  118888. // "scopes": [
  118889. // "https://www.googleapis.com/auth/cloud-platform",
  118890. // "https://www.googleapis.com/auth/compute",
  118891. // "https://www.googleapis.com/auth/compute.readonly"
  118892. // ]
  118893. // }
  118894. }
  118895. // method id "compute.subnetworks.aggregatedList":
  118896. type SubnetworksAggregatedListCall struct {
  118897. s *Service
  118898. project string
  118899. urlParams_ gensupport.URLParams
  118900. ifNoneMatch_ string
  118901. ctx_ context.Context
  118902. header_ http.Header
  118903. }
  118904. // AggregatedList: Retrieves an aggregated list of subnetworks.
  118905. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  118906. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118907. c.project = project
  118908. return c
  118909. }
  118910. // Filter sets the optional parameter "filter": A filter expression that
  118911. // filters resources listed in the response. The expression must specify
  118912. // the field name, a comparison operator, and the value that you want to
  118913. // use for filtering. The value must be a string, a number, or a
  118914. // boolean. The comparison operator must be either =, !=, >, or <.
  118915. //
  118916. // For example, if you are filtering Compute Engine instances, you can
  118917. // exclude instances named example-instance by specifying name !=
  118918. // example-instance.
  118919. //
  118920. // You can also filter nested fields. For example, you could specify
  118921. // scheduling.automaticRestart = false to include instances only if they
  118922. // are not scheduled for automatic restarts. You can use filtering on
  118923. // nested fields to filter based on resource labels.
  118924. //
  118925. // To filter on multiple expressions, provide each separate expression
  118926. // within parentheses. For example, (scheduling.automaticRestart = true)
  118927. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118928. // AND expression. However, you can include AND and OR expressions
  118929. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118930. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118931. // true).
  118932. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  118933. c.urlParams_.Set("filter", filter)
  118934. return c
  118935. }
  118936. // MaxResults sets the optional parameter "maxResults": The maximum
  118937. // number of results per page that should be returned. If the number of
  118938. // available results is larger than maxResults, Compute Engine returns a
  118939. // nextPageToken that can be used to get the next page of results in
  118940. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118941. // (Default: 500)
  118942. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  118943. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118944. return c
  118945. }
  118946. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118947. // a certain order. By default, results are returned in alphanumerical
  118948. // order based on the resource name.
  118949. //
  118950. // You can also sort results in descending order based on the creation
  118951. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118952. // based on the creationTimestamp field in reverse chronological order
  118953. // (newest result first). Use this to sort resources like operations so
  118954. // that the newest operation is returned first.
  118955. //
  118956. // Currently, only sorting by name or creationTimestamp desc is
  118957. // supported.
  118958. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  118959. c.urlParams_.Set("orderBy", orderBy)
  118960. return c
  118961. }
  118962. // PageToken sets the optional parameter "pageToken": Specifies a page
  118963. // token to use. Set pageToken to the nextPageToken returned by a
  118964. // previous list request to get the next page of results.
  118965. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  118966. c.urlParams_.Set("pageToken", pageToken)
  118967. return c
  118968. }
  118969. // Fields allows partial responses to be retrieved. See
  118970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118971. // for more information.
  118972. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  118973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118974. return c
  118975. }
  118976. // IfNoneMatch sets the optional parameter which makes the operation
  118977. // fail if the object's ETag matches the given value. This is useful for
  118978. // getting updates only after the object has changed since the last
  118979. // request. Use googleapi.IsNotModified to check whether the response
  118980. // error from Do is the result of In-None-Match.
  118981. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  118982. c.ifNoneMatch_ = entityTag
  118983. return c
  118984. }
  118985. // Context sets the context to be used in this call's Do method. Any
  118986. // pending HTTP request will be aborted if the provided context is
  118987. // canceled.
  118988. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  118989. c.ctx_ = ctx
  118990. return c
  118991. }
  118992. // Header returns an http.Header that can be modified by the caller to
  118993. // add HTTP headers to the request.
  118994. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  118995. if c.header_ == nil {
  118996. c.header_ = make(http.Header)
  118997. }
  118998. return c.header_
  118999. }
  119000. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  119001. reqHeaders := make(http.Header)
  119002. for k, v := range c.header_ {
  119003. reqHeaders[k] = v
  119004. }
  119005. reqHeaders.Set("User-Agent", c.s.userAgent())
  119006. if c.ifNoneMatch_ != "" {
  119007. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119008. }
  119009. var body io.Reader = nil
  119010. c.urlParams_.Set("alt", alt)
  119011. c.urlParams_.Set("prettyPrint", "false")
  119012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  119013. urls += "?" + c.urlParams_.Encode()
  119014. req, err := http.NewRequest("GET", urls, body)
  119015. if err != nil {
  119016. return nil, err
  119017. }
  119018. req.Header = reqHeaders
  119019. googleapi.Expand(req.URL, map[string]string{
  119020. "project": c.project,
  119021. })
  119022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119023. }
  119024. // Do executes the "compute.subnetworks.aggregatedList" call.
  119025. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  119026. // Any non-2xx status code is an error. Response headers are in either
  119027. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  119028. // returned at all) in error.(*googleapi.Error).Header. Use
  119029. // googleapi.IsNotModified to check whether the returned error was
  119030. // because http.StatusNotModified was returned.
  119031. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  119032. gensupport.SetOptions(c.urlParams_, opts...)
  119033. res, err := c.doRequest("json")
  119034. if res != nil && res.StatusCode == http.StatusNotModified {
  119035. if res.Body != nil {
  119036. res.Body.Close()
  119037. }
  119038. return nil, &googleapi.Error{
  119039. Code: res.StatusCode,
  119040. Header: res.Header,
  119041. }
  119042. }
  119043. if err != nil {
  119044. return nil, err
  119045. }
  119046. defer googleapi.CloseBody(res)
  119047. if err := googleapi.CheckResponse(res); err != nil {
  119048. return nil, err
  119049. }
  119050. ret := &SubnetworkAggregatedList{
  119051. ServerResponse: googleapi.ServerResponse{
  119052. Header: res.Header,
  119053. HTTPStatusCode: res.StatusCode,
  119054. },
  119055. }
  119056. target := &ret
  119057. if err := gensupport.DecodeResponse(target, res); err != nil {
  119058. return nil, err
  119059. }
  119060. return ret, nil
  119061. // {
  119062. // "description": "Retrieves an aggregated list of subnetworks.",
  119063. // "httpMethod": "GET",
  119064. // "id": "compute.subnetworks.aggregatedList",
  119065. // "parameterOrder": [
  119066. // "project"
  119067. // ],
  119068. // "parameters": {
  119069. // "filter": {
  119070. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  119071. // "location": "query",
  119072. // "type": "string"
  119073. // },
  119074. // "maxResults": {
  119075. // "default": "500",
  119076. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  119077. // "format": "uint32",
  119078. // "location": "query",
  119079. // "minimum": "0",
  119080. // "type": "integer"
  119081. // },
  119082. // "orderBy": {
  119083. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  119084. // "location": "query",
  119085. // "type": "string"
  119086. // },
  119087. // "pageToken": {
  119088. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  119089. // "location": "query",
  119090. // "type": "string"
  119091. // },
  119092. // "project": {
  119093. // "description": "Project ID for this request.",
  119094. // "location": "path",
  119095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119096. // "required": true,
  119097. // "type": "string"
  119098. // }
  119099. // },
  119100. // "path": "{project}/aggregated/subnetworks",
  119101. // "response": {
  119102. // "$ref": "SubnetworkAggregatedList"
  119103. // },
  119104. // "scopes": [
  119105. // "https://www.googleapis.com/auth/cloud-platform",
  119106. // "https://www.googleapis.com/auth/compute",
  119107. // "https://www.googleapis.com/auth/compute.readonly"
  119108. // ]
  119109. // }
  119110. }
  119111. // Pages invokes f for each page of results.
  119112. // A non-nil error returned from f will halt the iteration.
  119113. // The provided context supersedes any context provided to the Context method.
  119114. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  119115. c.ctx_ = ctx
  119116. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  119117. for {
  119118. x, err := c.Do()
  119119. if err != nil {
  119120. return err
  119121. }
  119122. if err := f(x); err != nil {
  119123. return err
  119124. }
  119125. if x.NextPageToken == "" {
  119126. return nil
  119127. }
  119128. c.PageToken(x.NextPageToken)
  119129. }
  119130. }
  119131. // method id "compute.subnetworks.delete":
  119132. type SubnetworksDeleteCall struct {
  119133. s *Service
  119134. project string
  119135. region string
  119136. subnetwork string
  119137. urlParams_ gensupport.URLParams
  119138. ctx_ context.Context
  119139. header_ http.Header
  119140. }
  119141. // Delete: Deletes the specified subnetwork.
  119142. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  119143. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119144. c.project = project
  119145. c.region = region
  119146. c.subnetwork = subnetwork
  119147. return c
  119148. }
  119149. // RequestId sets the optional parameter "requestId": An optional
  119150. // request ID to identify requests. Specify a unique request ID so that
  119151. // if you must retry your request, the server will know to ignore the
  119152. // request if it has already been completed.
  119153. //
  119154. // For example, consider a situation where you make an initial request
  119155. // and the request times out. If you make the request again with the
  119156. // same request ID, the server can check if original operation with the
  119157. // same request ID was received, and if so, will ignore the second
  119158. // request. This prevents clients from accidentally creating duplicate
  119159. // commitments.
  119160. //
  119161. // The request ID must be a valid UUID with the exception that zero UUID
  119162. // is not supported (00000000-0000-0000-0000-000000000000).
  119163. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  119164. c.urlParams_.Set("requestId", requestId)
  119165. return c
  119166. }
  119167. // Fields allows partial responses to be retrieved. See
  119168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119169. // for more information.
  119170. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  119171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119172. return c
  119173. }
  119174. // Context sets the context to be used in this call's Do method. Any
  119175. // pending HTTP request will be aborted if the provided context is
  119176. // canceled.
  119177. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  119178. c.ctx_ = ctx
  119179. return c
  119180. }
  119181. // Header returns an http.Header that can be modified by the caller to
  119182. // add HTTP headers to the request.
  119183. func (c *SubnetworksDeleteCall) Header() http.Header {
  119184. if c.header_ == nil {
  119185. c.header_ = make(http.Header)
  119186. }
  119187. return c.header_
  119188. }
  119189. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  119190. reqHeaders := make(http.Header)
  119191. for k, v := range c.header_ {
  119192. reqHeaders[k] = v
  119193. }
  119194. reqHeaders.Set("User-Agent", c.s.userAgent())
  119195. var body io.Reader = nil
  119196. c.urlParams_.Set("alt", alt)
  119197. c.urlParams_.Set("prettyPrint", "false")
  119198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  119199. urls += "?" + c.urlParams_.Encode()
  119200. req, err := http.NewRequest("DELETE", urls, body)
  119201. if err != nil {
  119202. return nil, err
  119203. }
  119204. req.Header = reqHeaders
  119205. googleapi.Expand(req.URL, map[string]string{
  119206. "project": c.project,
  119207. "region": c.region,
  119208. "subnetwork": c.subnetwork,
  119209. })
  119210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119211. }
  119212. // Do executes the "compute.subnetworks.delete" call.
  119213. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119214. // status code is an error. Response headers are in either
  119215. // *Operation.ServerResponse.Header or (if a response was returned at
  119216. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119217. // to check whether the returned error was because
  119218. // http.StatusNotModified was returned.
  119219. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119220. gensupport.SetOptions(c.urlParams_, opts...)
  119221. res, err := c.doRequest("json")
  119222. if res != nil && res.StatusCode == http.StatusNotModified {
  119223. if res.Body != nil {
  119224. res.Body.Close()
  119225. }
  119226. return nil, &googleapi.Error{
  119227. Code: res.StatusCode,
  119228. Header: res.Header,
  119229. }
  119230. }
  119231. if err != nil {
  119232. return nil, err
  119233. }
  119234. defer googleapi.CloseBody(res)
  119235. if err := googleapi.CheckResponse(res); err != nil {
  119236. return nil, err
  119237. }
  119238. ret := &Operation{
  119239. ServerResponse: googleapi.ServerResponse{
  119240. Header: res.Header,
  119241. HTTPStatusCode: res.StatusCode,
  119242. },
  119243. }
  119244. target := &ret
  119245. if err := gensupport.DecodeResponse(target, res); err != nil {
  119246. return nil, err
  119247. }
  119248. return ret, nil
  119249. // {
  119250. // "description": "Deletes the specified subnetwork.",
  119251. // "httpMethod": "DELETE",
  119252. // "id": "compute.subnetworks.delete",
  119253. // "parameterOrder": [
  119254. // "project",
  119255. // "region",
  119256. // "subnetwork"
  119257. // ],
  119258. // "parameters": {
  119259. // "project": {
  119260. // "description": "Project ID for this request.",
  119261. // "location": "path",
  119262. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119263. // "required": true,
  119264. // "type": "string"
  119265. // },
  119266. // "region": {
  119267. // "description": "Name of the region scoping this request.",
  119268. // "location": "path",
  119269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119270. // "required": true,
  119271. // "type": "string"
  119272. // },
  119273. // "requestId": {
  119274. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119275. // "location": "query",
  119276. // "type": "string"
  119277. // },
  119278. // "subnetwork": {
  119279. // "description": "Name of the Subnetwork resource to delete.",
  119280. // "location": "path",
  119281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119282. // "required": true,
  119283. // "type": "string"
  119284. // }
  119285. // },
  119286. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  119287. // "response": {
  119288. // "$ref": "Operation"
  119289. // },
  119290. // "scopes": [
  119291. // "https://www.googleapis.com/auth/cloud-platform",
  119292. // "https://www.googleapis.com/auth/compute"
  119293. // ]
  119294. // }
  119295. }
  119296. // method id "compute.subnetworks.expandIpCidrRange":
  119297. type SubnetworksExpandIpCidrRangeCall struct {
  119298. s *Service
  119299. project string
  119300. region string
  119301. subnetwork string
  119302. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  119303. urlParams_ gensupport.URLParams
  119304. ctx_ context.Context
  119305. header_ http.Header
  119306. }
  119307. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  119308. // specified value.
  119309. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  119310. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119311. c.project = project
  119312. c.region = region
  119313. c.subnetwork = subnetwork
  119314. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  119315. return c
  119316. }
  119317. // RequestId sets the optional parameter "requestId": An optional
  119318. // request ID to identify requests. Specify a unique request ID so that
  119319. // if you must retry your request, the server will know to ignore the
  119320. // request if it has already been completed.
  119321. //
  119322. // For example, consider a situation where you make an initial request
  119323. // and the request times out. If you make the request again with the
  119324. // same request ID, the server can check if original operation with the
  119325. // same request ID was received, and if so, will ignore the second
  119326. // request. This prevents clients from accidentally creating duplicate
  119327. // commitments.
  119328. //
  119329. // The request ID must be a valid UUID with the exception that zero UUID
  119330. // is not supported (00000000-0000-0000-0000-000000000000).
  119331. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  119332. c.urlParams_.Set("requestId", requestId)
  119333. return c
  119334. }
  119335. // Fields allows partial responses to be retrieved. See
  119336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119337. // for more information.
  119338. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  119339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119340. return c
  119341. }
  119342. // Context sets the context to be used in this call's Do method. Any
  119343. // pending HTTP request will be aborted if the provided context is
  119344. // canceled.
  119345. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  119346. c.ctx_ = ctx
  119347. return c
  119348. }
  119349. // Header returns an http.Header that can be modified by the caller to
  119350. // add HTTP headers to the request.
  119351. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  119352. if c.header_ == nil {
  119353. c.header_ = make(http.Header)
  119354. }
  119355. return c.header_
  119356. }
  119357. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  119358. reqHeaders := make(http.Header)
  119359. for k, v := range c.header_ {
  119360. reqHeaders[k] = v
  119361. }
  119362. reqHeaders.Set("User-Agent", c.s.userAgent())
  119363. var body io.Reader = nil
  119364. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  119365. if err != nil {
  119366. return nil, err
  119367. }
  119368. reqHeaders.Set("Content-Type", "application/json")
  119369. c.urlParams_.Set("alt", alt)
  119370. c.urlParams_.Set("prettyPrint", "false")
  119371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  119372. urls += "?" + c.urlParams_.Encode()
  119373. req, err := http.NewRequest("POST", urls, body)
  119374. if err != nil {
  119375. return nil, err
  119376. }
  119377. req.Header = reqHeaders
  119378. googleapi.Expand(req.URL, map[string]string{
  119379. "project": c.project,
  119380. "region": c.region,
  119381. "subnetwork": c.subnetwork,
  119382. })
  119383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119384. }
  119385. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  119386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119387. // status code is an error. Response headers are in either
  119388. // *Operation.ServerResponse.Header or (if a response was returned at
  119389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119390. // to check whether the returned error was because
  119391. // http.StatusNotModified was returned.
  119392. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119393. gensupport.SetOptions(c.urlParams_, opts...)
  119394. res, err := c.doRequest("json")
  119395. if res != nil && res.StatusCode == http.StatusNotModified {
  119396. if res.Body != nil {
  119397. res.Body.Close()
  119398. }
  119399. return nil, &googleapi.Error{
  119400. Code: res.StatusCode,
  119401. Header: res.Header,
  119402. }
  119403. }
  119404. if err != nil {
  119405. return nil, err
  119406. }
  119407. defer googleapi.CloseBody(res)
  119408. if err := googleapi.CheckResponse(res); err != nil {
  119409. return nil, err
  119410. }
  119411. ret := &Operation{
  119412. ServerResponse: googleapi.ServerResponse{
  119413. Header: res.Header,
  119414. HTTPStatusCode: res.StatusCode,
  119415. },
  119416. }
  119417. target := &ret
  119418. if err := gensupport.DecodeResponse(target, res); err != nil {
  119419. return nil, err
  119420. }
  119421. return ret, nil
  119422. // {
  119423. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  119424. // "httpMethod": "POST",
  119425. // "id": "compute.subnetworks.expandIpCidrRange",
  119426. // "parameterOrder": [
  119427. // "project",
  119428. // "region",
  119429. // "subnetwork"
  119430. // ],
  119431. // "parameters": {
  119432. // "project": {
  119433. // "description": "Project ID for this request.",
  119434. // "location": "path",
  119435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119436. // "required": true,
  119437. // "type": "string"
  119438. // },
  119439. // "region": {
  119440. // "description": "Name of the region scoping this request.",
  119441. // "location": "path",
  119442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119443. // "required": true,
  119444. // "type": "string"
  119445. // },
  119446. // "requestId": {
  119447. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119448. // "location": "query",
  119449. // "type": "string"
  119450. // },
  119451. // "subnetwork": {
  119452. // "description": "Name of the Subnetwork resource to update.",
  119453. // "location": "path",
  119454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119455. // "required": true,
  119456. // "type": "string"
  119457. // }
  119458. // },
  119459. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  119460. // "request": {
  119461. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  119462. // },
  119463. // "response": {
  119464. // "$ref": "Operation"
  119465. // },
  119466. // "scopes": [
  119467. // "https://www.googleapis.com/auth/cloud-platform",
  119468. // "https://www.googleapis.com/auth/compute"
  119469. // ]
  119470. // }
  119471. }
  119472. // method id "compute.subnetworks.get":
  119473. type SubnetworksGetCall struct {
  119474. s *Service
  119475. project string
  119476. region string
  119477. subnetwork string
  119478. urlParams_ gensupport.URLParams
  119479. ifNoneMatch_ string
  119480. ctx_ context.Context
  119481. header_ http.Header
  119482. }
  119483. // Get: Returns the specified subnetwork. Gets a list of available
  119484. // subnetworks list() request.
  119485. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  119486. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119487. c.project = project
  119488. c.region = region
  119489. c.subnetwork = subnetwork
  119490. return c
  119491. }
  119492. // Fields allows partial responses to be retrieved. See
  119493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119494. // for more information.
  119495. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  119496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119497. return c
  119498. }
  119499. // IfNoneMatch sets the optional parameter which makes the operation
  119500. // fail if the object's ETag matches the given value. This is useful for
  119501. // getting updates only after the object has changed since the last
  119502. // request. Use googleapi.IsNotModified to check whether the response
  119503. // error from Do is the result of In-None-Match.
  119504. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  119505. c.ifNoneMatch_ = entityTag
  119506. return c
  119507. }
  119508. // Context sets the context to be used in this call's Do method. Any
  119509. // pending HTTP request will be aborted if the provided context is
  119510. // canceled.
  119511. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  119512. c.ctx_ = ctx
  119513. return c
  119514. }
  119515. // Header returns an http.Header that can be modified by the caller to
  119516. // add HTTP headers to the request.
  119517. func (c *SubnetworksGetCall) Header() http.Header {
  119518. if c.header_ == nil {
  119519. c.header_ = make(http.Header)
  119520. }
  119521. return c.header_
  119522. }
  119523. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  119524. reqHeaders := make(http.Header)
  119525. for k, v := range c.header_ {
  119526. reqHeaders[k] = v
  119527. }
  119528. reqHeaders.Set("User-Agent", c.s.userAgent())
  119529. if c.ifNoneMatch_ != "" {
  119530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119531. }
  119532. var body io.Reader = nil
  119533. c.urlParams_.Set("alt", alt)
  119534. c.urlParams_.Set("prettyPrint", "false")
  119535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  119536. urls += "?" + c.urlParams_.Encode()
  119537. req, err := http.NewRequest("GET", urls, body)
  119538. if err != nil {
  119539. return nil, err
  119540. }
  119541. req.Header = reqHeaders
  119542. googleapi.Expand(req.URL, map[string]string{
  119543. "project": c.project,
  119544. "region": c.region,
  119545. "subnetwork": c.subnetwork,
  119546. })
  119547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119548. }
  119549. // Do executes the "compute.subnetworks.get" call.
  119550. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  119551. // status code is an error. Response headers are in either
  119552. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  119553. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119554. // to check whether the returned error was because
  119555. // http.StatusNotModified was returned.
  119556. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  119557. gensupport.SetOptions(c.urlParams_, opts...)
  119558. res, err := c.doRequest("json")
  119559. if res != nil && res.StatusCode == http.StatusNotModified {
  119560. if res.Body != nil {
  119561. res.Body.Close()
  119562. }
  119563. return nil, &googleapi.Error{
  119564. Code: res.StatusCode,
  119565. Header: res.Header,
  119566. }
  119567. }
  119568. if err != nil {
  119569. return nil, err
  119570. }
  119571. defer googleapi.CloseBody(res)
  119572. if err := googleapi.CheckResponse(res); err != nil {
  119573. return nil, err
  119574. }
  119575. ret := &Subnetwork{
  119576. ServerResponse: googleapi.ServerResponse{
  119577. Header: res.Header,
  119578. HTTPStatusCode: res.StatusCode,
  119579. },
  119580. }
  119581. target := &ret
  119582. if err := gensupport.DecodeResponse(target, res); err != nil {
  119583. return nil, err
  119584. }
  119585. return ret, nil
  119586. // {
  119587. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  119588. // "httpMethod": "GET",
  119589. // "id": "compute.subnetworks.get",
  119590. // "parameterOrder": [
  119591. // "project",
  119592. // "region",
  119593. // "subnetwork"
  119594. // ],
  119595. // "parameters": {
  119596. // "project": {
  119597. // "description": "Project ID for this request.",
  119598. // "location": "path",
  119599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119600. // "required": true,
  119601. // "type": "string"
  119602. // },
  119603. // "region": {
  119604. // "description": "Name of the region scoping this request.",
  119605. // "location": "path",
  119606. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119607. // "required": true,
  119608. // "type": "string"
  119609. // },
  119610. // "subnetwork": {
  119611. // "description": "Name of the Subnetwork resource to return.",
  119612. // "location": "path",
  119613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119614. // "required": true,
  119615. // "type": "string"
  119616. // }
  119617. // },
  119618. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  119619. // "response": {
  119620. // "$ref": "Subnetwork"
  119621. // },
  119622. // "scopes": [
  119623. // "https://www.googleapis.com/auth/cloud-platform",
  119624. // "https://www.googleapis.com/auth/compute",
  119625. // "https://www.googleapis.com/auth/compute.readonly"
  119626. // ]
  119627. // }
  119628. }
  119629. // method id "compute.subnetworks.getIamPolicy":
  119630. type SubnetworksGetIamPolicyCall struct {
  119631. s *Service
  119632. project string
  119633. region string
  119634. resource string
  119635. urlParams_ gensupport.URLParams
  119636. ifNoneMatch_ string
  119637. ctx_ context.Context
  119638. header_ http.Header
  119639. }
  119640. // GetIamPolicy: Gets the access control policy for a resource. May be
  119641. // empty if no such policy or resource exists.
  119642. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  119643. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119644. c.project = project
  119645. c.region = region
  119646. c.resource = resource
  119647. return c
  119648. }
  119649. // Fields allows partial responses to be retrieved. See
  119650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119651. // for more information.
  119652. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  119653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119654. return c
  119655. }
  119656. // IfNoneMatch sets the optional parameter which makes the operation
  119657. // fail if the object's ETag matches the given value. This is useful for
  119658. // getting updates only after the object has changed since the last
  119659. // request. Use googleapi.IsNotModified to check whether the response
  119660. // error from Do is the result of In-None-Match.
  119661. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  119662. c.ifNoneMatch_ = entityTag
  119663. return c
  119664. }
  119665. // Context sets the context to be used in this call's Do method. Any
  119666. // pending HTTP request will be aborted if the provided context is
  119667. // canceled.
  119668. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  119669. c.ctx_ = ctx
  119670. return c
  119671. }
  119672. // Header returns an http.Header that can be modified by the caller to
  119673. // add HTTP headers to the request.
  119674. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  119675. if c.header_ == nil {
  119676. c.header_ = make(http.Header)
  119677. }
  119678. return c.header_
  119679. }
  119680. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  119681. reqHeaders := make(http.Header)
  119682. for k, v := range c.header_ {
  119683. reqHeaders[k] = v
  119684. }
  119685. reqHeaders.Set("User-Agent", c.s.userAgent())
  119686. if c.ifNoneMatch_ != "" {
  119687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119688. }
  119689. var body io.Reader = nil
  119690. c.urlParams_.Set("alt", alt)
  119691. c.urlParams_.Set("prettyPrint", "false")
  119692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  119693. urls += "?" + c.urlParams_.Encode()
  119694. req, err := http.NewRequest("GET", urls, body)
  119695. if err != nil {
  119696. return nil, err
  119697. }
  119698. req.Header = reqHeaders
  119699. googleapi.Expand(req.URL, map[string]string{
  119700. "project": c.project,
  119701. "region": c.region,
  119702. "resource": c.resource,
  119703. })
  119704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119705. }
  119706. // Do executes the "compute.subnetworks.getIamPolicy" call.
  119707. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  119708. // code is an error. Response headers are in either
  119709. // *Policy.ServerResponse.Header or (if a response was returned at all)
  119710. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  119711. // check whether the returned error was because http.StatusNotModified
  119712. // was returned.
  119713. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  119714. gensupport.SetOptions(c.urlParams_, opts...)
  119715. res, err := c.doRequest("json")
  119716. if res != nil && res.StatusCode == http.StatusNotModified {
  119717. if res.Body != nil {
  119718. res.Body.Close()
  119719. }
  119720. return nil, &googleapi.Error{
  119721. Code: res.StatusCode,
  119722. Header: res.Header,
  119723. }
  119724. }
  119725. if err != nil {
  119726. return nil, err
  119727. }
  119728. defer googleapi.CloseBody(res)
  119729. if err := googleapi.CheckResponse(res); err != nil {
  119730. return nil, err
  119731. }
  119732. ret := &Policy{
  119733. ServerResponse: googleapi.ServerResponse{
  119734. Header: res.Header,
  119735. HTTPStatusCode: res.StatusCode,
  119736. },
  119737. }
  119738. target := &ret
  119739. if err := gensupport.DecodeResponse(target, res); err != nil {
  119740. return nil, err
  119741. }
  119742. return ret, nil
  119743. // {
  119744. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  119745. // "httpMethod": "GET",
  119746. // "id": "compute.subnetworks.getIamPolicy",
  119747. // "parameterOrder": [
  119748. // "project",
  119749. // "region",
  119750. // "resource"
  119751. // ],
  119752. // "parameters": {
  119753. // "project": {
  119754. // "description": "Project ID for this request.",
  119755. // "location": "path",
  119756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119757. // "required": true,
  119758. // "type": "string"
  119759. // },
  119760. // "region": {
  119761. // "description": "The name of the region for this request.",
  119762. // "location": "path",
  119763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119764. // "required": true,
  119765. // "type": "string"
  119766. // },
  119767. // "resource": {
  119768. // "description": "Name or id of the resource for this request.",
  119769. // "location": "path",
  119770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119771. // "required": true,
  119772. // "type": "string"
  119773. // }
  119774. // },
  119775. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  119776. // "response": {
  119777. // "$ref": "Policy"
  119778. // },
  119779. // "scopes": [
  119780. // "https://www.googleapis.com/auth/cloud-platform",
  119781. // "https://www.googleapis.com/auth/compute",
  119782. // "https://www.googleapis.com/auth/compute.readonly"
  119783. // ]
  119784. // }
  119785. }
  119786. // method id "compute.subnetworks.insert":
  119787. type SubnetworksInsertCall struct {
  119788. s *Service
  119789. project string
  119790. region string
  119791. subnetwork *Subnetwork
  119792. urlParams_ gensupport.URLParams
  119793. ctx_ context.Context
  119794. header_ http.Header
  119795. }
  119796. // Insert: Creates a subnetwork in the specified project using the data
  119797. // included in the request.
  119798. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  119799. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119800. c.project = project
  119801. c.region = region
  119802. c.subnetwork = subnetwork
  119803. return c
  119804. }
  119805. // RequestId sets the optional parameter "requestId": An optional
  119806. // request ID to identify requests. Specify a unique request ID so that
  119807. // if you must retry your request, the server will know to ignore the
  119808. // request if it has already been completed.
  119809. //
  119810. // For example, consider a situation where you make an initial request
  119811. // and the request times out. If you make the request again with the
  119812. // same request ID, the server can check if original operation with the
  119813. // same request ID was received, and if so, will ignore the second
  119814. // request. This prevents clients from accidentally creating duplicate
  119815. // commitments.
  119816. //
  119817. // The request ID must be a valid UUID with the exception that zero UUID
  119818. // is not supported (00000000-0000-0000-0000-000000000000).
  119819. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  119820. c.urlParams_.Set("requestId", requestId)
  119821. return c
  119822. }
  119823. // Fields allows partial responses to be retrieved. See
  119824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119825. // for more information.
  119826. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  119827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119828. return c
  119829. }
  119830. // Context sets the context to be used in this call's Do method. Any
  119831. // pending HTTP request will be aborted if the provided context is
  119832. // canceled.
  119833. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  119834. c.ctx_ = ctx
  119835. return c
  119836. }
  119837. // Header returns an http.Header that can be modified by the caller to
  119838. // add HTTP headers to the request.
  119839. func (c *SubnetworksInsertCall) Header() http.Header {
  119840. if c.header_ == nil {
  119841. c.header_ = make(http.Header)
  119842. }
  119843. return c.header_
  119844. }
  119845. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  119846. reqHeaders := make(http.Header)
  119847. for k, v := range c.header_ {
  119848. reqHeaders[k] = v
  119849. }
  119850. reqHeaders.Set("User-Agent", c.s.userAgent())
  119851. var body io.Reader = nil
  119852. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  119853. if err != nil {
  119854. return nil, err
  119855. }
  119856. reqHeaders.Set("Content-Type", "application/json")
  119857. c.urlParams_.Set("alt", alt)
  119858. c.urlParams_.Set("prettyPrint", "false")
  119859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  119860. urls += "?" + c.urlParams_.Encode()
  119861. req, err := http.NewRequest("POST", urls, body)
  119862. if err != nil {
  119863. return nil, err
  119864. }
  119865. req.Header = reqHeaders
  119866. googleapi.Expand(req.URL, map[string]string{
  119867. "project": c.project,
  119868. "region": c.region,
  119869. })
  119870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119871. }
  119872. // Do executes the "compute.subnetworks.insert" call.
  119873. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119874. // status code is an error. Response headers are in either
  119875. // *Operation.ServerResponse.Header or (if a response was returned at
  119876. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119877. // to check whether the returned error was because
  119878. // http.StatusNotModified was returned.
  119879. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119880. gensupport.SetOptions(c.urlParams_, opts...)
  119881. res, err := c.doRequest("json")
  119882. if res != nil && res.StatusCode == http.StatusNotModified {
  119883. if res.Body != nil {
  119884. res.Body.Close()
  119885. }
  119886. return nil, &googleapi.Error{
  119887. Code: res.StatusCode,
  119888. Header: res.Header,
  119889. }
  119890. }
  119891. if err != nil {
  119892. return nil, err
  119893. }
  119894. defer googleapi.CloseBody(res)
  119895. if err := googleapi.CheckResponse(res); err != nil {
  119896. return nil, err
  119897. }
  119898. ret := &Operation{
  119899. ServerResponse: googleapi.ServerResponse{
  119900. Header: res.Header,
  119901. HTTPStatusCode: res.StatusCode,
  119902. },
  119903. }
  119904. target := &ret
  119905. if err := gensupport.DecodeResponse(target, res); err != nil {
  119906. return nil, err
  119907. }
  119908. return ret, nil
  119909. // {
  119910. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  119911. // "httpMethod": "POST",
  119912. // "id": "compute.subnetworks.insert",
  119913. // "parameterOrder": [
  119914. // "project",
  119915. // "region"
  119916. // ],
  119917. // "parameters": {
  119918. // "project": {
  119919. // "description": "Project ID for this request.",
  119920. // "location": "path",
  119921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119922. // "required": true,
  119923. // "type": "string"
  119924. // },
  119925. // "region": {
  119926. // "description": "Name of the region scoping this request.",
  119927. // "location": "path",
  119928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119929. // "required": true,
  119930. // "type": "string"
  119931. // },
  119932. // "requestId": {
  119933. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119934. // "location": "query",
  119935. // "type": "string"
  119936. // }
  119937. // },
  119938. // "path": "{project}/regions/{region}/subnetworks",
  119939. // "request": {
  119940. // "$ref": "Subnetwork"
  119941. // },
  119942. // "response": {
  119943. // "$ref": "Operation"
  119944. // },
  119945. // "scopes": [
  119946. // "https://www.googleapis.com/auth/cloud-platform",
  119947. // "https://www.googleapis.com/auth/compute"
  119948. // ]
  119949. // }
  119950. }
  119951. // method id "compute.subnetworks.list":
  119952. type SubnetworksListCall struct {
  119953. s *Service
  119954. project string
  119955. region string
  119956. urlParams_ gensupport.URLParams
  119957. ifNoneMatch_ string
  119958. ctx_ context.Context
  119959. header_ http.Header
  119960. }
  119961. // List: Retrieves a list of subnetworks available to the specified
  119962. // project.
  119963. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  119964. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119965. c.project = project
  119966. c.region = region
  119967. return c
  119968. }
  119969. // Filter sets the optional parameter "filter": A filter expression that
  119970. // filters resources listed in the response. The expression must specify
  119971. // the field name, a comparison operator, and the value that you want to
  119972. // use for filtering. The value must be a string, a number, or a
  119973. // boolean. The comparison operator must be either =, !=, >, or <.
  119974. //
  119975. // For example, if you are filtering Compute Engine instances, you can
  119976. // exclude instances named example-instance by specifying name !=
  119977. // example-instance.
  119978. //
  119979. // You can also filter nested fields. For example, you could specify
  119980. // scheduling.automaticRestart = false to include instances only if they
  119981. // are not scheduled for automatic restarts. You can use filtering on
  119982. // nested fields to filter based on resource labels.
  119983. //
  119984. // To filter on multiple expressions, provide each separate expression
  119985. // within parentheses. For example, (scheduling.automaticRestart = true)
  119986. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  119987. // AND expression. However, you can include AND and OR expressions
  119988. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  119989. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  119990. // true).
  119991. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  119992. c.urlParams_.Set("filter", filter)
  119993. return c
  119994. }
  119995. // MaxResults sets the optional parameter "maxResults": The maximum
  119996. // number of results per page that should be returned. If the number of
  119997. // available results is larger than maxResults, Compute Engine returns a
  119998. // nextPageToken that can be used to get the next page of results in
  119999. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  120000. // (Default: 500)
  120001. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  120002. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  120003. return c
  120004. }
  120005. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  120006. // a certain order. By default, results are returned in alphanumerical
  120007. // order based on the resource name.
  120008. //
  120009. // You can also sort results in descending order based on the creation
  120010. // timestamp using orderBy="creationTimestamp desc". This sorts results
  120011. // based on the creationTimestamp field in reverse chronological order
  120012. // (newest result first). Use this to sort resources like operations so
  120013. // that the newest operation is returned first.
  120014. //
  120015. // Currently, only sorting by name or creationTimestamp desc is
  120016. // supported.
  120017. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  120018. c.urlParams_.Set("orderBy", orderBy)
  120019. return c
  120020. }
  120021. // PageToken sets the optional parameter "pageToken": Specifies a page
  120022. // token to use. Set pageToken to the nextPageToken returned by a
  120023. // previous list request to get the next page of results.
  120024. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  120025. c.urlParams_.Set("pageToken", pageToken)
  120026. return c
  120027. }
  120028. // Fields allows partial responses to be retrieved. See
  120029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120030. // for more information.
  120031. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  120032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120033. return c
  120034. }
  120035. // IfNoneMatch sets the optional parameter which makes the operation
  120036. // fail if the object's ETag matches the given value. This is useful for
  120037. // getting updates only after the object has changed since the last
  120038. // request. Use googleapi.IsNotModified to check whether the response
  120039. // error from Do is the result of In-None-Match.
  120040. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  120041. c.ifNoneMatch_ = entityTag
  120042. return c
  120043. }
  120044. // Context sets the context to be used in this call's Do method. Any
  120045. // pending HTTP request will be aborted if the provided context is
  120046. // canceled.
  120047. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  120048. c.ctx_ = ctx
  120049. return c
  120050. }
  120051. // Header returns an http.Header that can be modified by the caller to
  120052. // add HTTP headers to the request.
  120053. func (c *SubnetworksListCall) Header() http.Header {
  120054. if c.header_ == nil {
  120055. c.header_ = make(http.Header)
  120056. }
  120057. return c.header_
  120058. }
  120059. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  120060. reqHeaders := make(http.Header)
  120061. for k, v := range c.header_ {
  120062. reqHeaders[k] = v
  120063. }
  120064. reqHeaders.Set("User-Agent", c.s.userAgent())
  120065. if c.ifNoneMatch_ != "" {
  120066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120067. }
  120068. var body io.Reader = nil
  120069. c.urlParams_.Set("alt", alt)
  120070. c.urlParams_.Set("prettyPrint", "false")
  120071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  120072. urls += "?" + c.urlParams_.Encode()
  120073. req, err := http.NewRequest("GET", urls, body)
  120074. if err != nil {
  120075. return nil, err
  120076. }
  120077. req.Header = reqHeaders
  120078. googleapi.Expand(req.URL, map[string]string{
  120079. "project": c.project,
  120080. "region": c.region,
  120081. })
  120082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120083. }
  120084. // Do executes the "compute.subnetworks.list" call.
  120085. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  120086. // status code is an error. Response headers are in either
  120087. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  120088. // at all) in error.(*googleapi.Error).Header. Use
  120089. // googleapi.IsNotModified to check whether the returned error was
  120090. // because http.StatusNotModified was returned.
  120091. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  120092. gensupport.SetOptions(c.urlParams_, opts...)
  120093. res, err := c.doRequest("json")
  120094. if res != nil && res.StatusCode == http.StatusNotModified {
  120095. if res.Body != nil {
  120096. res.Body.Close()
  120097. }
  120098. return nil, &googleapi.Error{
  120099. Code: res.StatusCode,
  120100. Header: res.Header,
  120101. }
  120102. }
  120103. if err != nil {
  120104. return nil, err
  120105. }
  120106. defer googleapi.CloseBody(res)
  120107. if err := googleapi.CheckResponse(res); err != nil {
  120108. return nil, err
  120109. }
  120110. ret := &SubnetworkList{
  120111. ServerResponse: googleapi.ServerResponse{
  120112. Header: res.Header,
  120113. HTTPStatusCode: res.StatusCode,
  120114. },
  120115. }
  120116. target := &ret
  120117. if err := gensupport.DecodeResponse(target, res); err != nil {
  120118. return nil, err
  120119. }
  120120. return ret, nil
  120121. // {
  120122. // "description": "Retrieves a list of subnetworks available to the specified project.",
  120123. // "httpMethod": "GET",
  120124. // "id": "compute.subnetworks.list",
  120125. // "parameterOrder": [
  120126. // "project",
  120127. // "region"
  120128. // ],
  120129. // "parameters": {
  120130. // "filter": {
  120131. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  120132. // "location": "query",
  120133. // "type": "string"
  120134. // },
  120135. // "maxResults": {
  120136. // "default": "500",
  120137. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  120138. // "format": "uint32",
  120139. // "location": "query",
  120140. // "minimum": "0",
  120141. // "type": "integer"
  120142. // },
  120143. // "orderBy": {
  120144. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  120145. // "location": "query",
  120146. // "type": "string"
  120147. // },
  120148. // "pageToken": {
  120149. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  120150. // "location": "query",
  120151. // "type": "string"
  120152. // },
  120153. // "project": {
  120154. // "description": "Project ID for this request.",
  120155. // "location": "path",
  120156. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120157. // "required": true,
  120158. // "type": "string"
  120159. // },
  120160. // "region": {
  120161. // "description": "Name of the region scoping this request.",
  120162. // "location": "path",
  120163. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120164. // "required": true,
  120165. // "type": "string"
  120166. // }
  120167. // },
  120168. // "path": "{project}/regions/{region}/subnetworks",
  120169. // "response": {
  120170. // "$ref": "SubnetworkList"
  120171. // },
  120172. // "scopes": [
  120173. // "https://www.googleapis.com/auth/cloud-platform",
  120174. // "https://www.googleapis.com/auth/compute",
  120175. // "https://www.googleapis.com/auth/compute.readonly"
  120176. // ]
  120177. // }
  120178. }
  120179. // Pages invokes f for each page of results.
  120180. // A non-nil error returned from f will halt the iteration.
  120181. // The provided context supersedes any context provided to the Context method.
  120182. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  120183. c.ctx_ = ctx
  120184. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120185. for {
  120186. x, err := c.Do()
  120187. if err != nil {
  120188. return err
  120189. }
  120190. if err := f(x); err != nil {
  120191. return err
  120192. }
  120193. if x.NextPageToken == "" {
  120194. return nil
  120195. }
  120196. c.PageToken(x.NextPageToken)
  120197. }
  120198. }
  120199. // method id "compute.subnetworks.listUsable":
  120200. type SubnetworksListUsableCall struct {
  120201. s *Service
  120202. project string
  120203. urlParams_ gensupport.URLParams
  120204. ifNoneMatch_ string
  120205. ctx_ context.Context
  120206. header_ http.Header
  120207. }
  120208. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  120209. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  120210. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120211. c.project = project
  120212. return c
  120213. }
  120214. // Filter sets the optional parameter "filter": A filter expression that
  120215. // filters resources listed in the response. The expression must specify
  120216. // the field name, a comparison operator, and the value that you want to
  120217. // use for filtering. The value must be a string, a number, or a
  120218. // boolean. The comparison operator must be either =, !=, >, or <.
  120219. //
  120220. // For example, if you are filtering Compute Engine instances, you can
  120221. // exclude instances named example-instance by specifying name !=
  120222. // example-instance.
  120223. //
  120224. // You can also filter nested fields. For example, you could specify
  120225. // scheduling.automaticRestart = false to include instances only if they
  120226. // are not scheduled for automatic restarts. You can use filtering on
  120227. // nested fields to filter based on resource labels.
  120228. //
  120229. // To filter on multiple expressions, provide each separate expression
  120230. // within parentheses. For example, (scheduling.automaticRestart = true)
  120231. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  120232. // AND expression. However, you can include AND and OR expressions
  120233. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  120234. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  120235. // true).
  120236. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  120237. c.urlParams_.Set("filter", filter)
  120238. return c
  120239. }
  120240. // MaxResults sets the optional parameter "maxResults": The maximum
  120241. // number of results per page that should be returned. If the number of
  120242. // available results is larger than maxResults, Compute Engine returns a
  120243. // nextPageToken that can be used to get the next page of results in
  120244. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  120245. // (Default: 500)
  120246. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  120247. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  120248. return c
  120249. }
  120250. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  120251. // a certain order. By default, results are returned in alphanumerical
  120252. // order based on the resource name.
  120253. //
  120254. // You can also sort results in descending order based on the creation
  120255. // timestamp using orderBy="creationTimestamp desc". This sorts results
  120256. // based on the creationTimestamp field in reverse chronological order
  120257. // (newest result first). Use this to sort resources like operations so
  120258. // that the newest operation is returned first.
  120259. //
  120260. // Currently, only sorting by name or creationTimestamp desc is
  120261. // supported.
  120262. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  120263. c.urlParams_.Set("orderBy", orderBy)
  120264. return c
  120265. }
  120266. // PageToken sets the optional parameter "pageToken": Specifies a page
  120267. // token to use. Set pageToken to the nextPageToken returned by a
  120268. // previous list request to get the next page of results.
  120269. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  120270. c.urlParams_.Set("pageToken", pageToken)
  120271. return c
  120272. }
  120273. // Fields allows partial responses to be retrieved. See
  120274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120275. // for more information.
  120276. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  120277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120278. return c
  120279. }
  120280. // IfNoneMatch sets the optional parameter which makes the operation
  120281. // fail if the object's ETag matches the given value. This is useful for
  120282. // getting updates only after the object has changed since the last
  120283. // request. Use googleapi.IsNotModified to check whether the response
  120284. // error from Do is the result of In-None-Match.
  120285. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  120286. c.ifNoneMatch_ = entityTag
  120287. return c
  120288. }
  120289. // Context sets the context to be used in this call's Do method. Any
  120290. // pending HTTP request will be aborted if the provided context is
  120291. // canceled.
  120292. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  120293. c.ctx_ = ctx
  120294. return c
  120295. }
  120296. // Header returns an http.Header that can be modified by the caller to
  120297. // add HTTP headers to the request.
  120298. func (c *SubnetworksListUsableCall) Header() http.Header {
  120299. if c.header_ == nil {
  120300. c.header_ = make(http.Header)
  120301. }
  120302. return c.header_
  120303. }
  120304. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  120305. reqHeaders := make(http.Header)
  120306. for k, v := range c.header_ {
  120307. reqHeaders[k] = v
  120308. }
  120309. reqHeaders.Set("User-Agent", c.s.userAgent())
  120310. if c.ifNoneMatch_ != "" {
  120311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120312. }
  120313. var body io.Reader = nil
  120314. c.urlParams_.Set("alt", alt)
  120315. c.urlParams_.Set("prettyPrint", "false")
  120316. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  120317. urls += "?" + c.urlParams_.Encode()
  120318. req, err := http.NewRequest("GET", urls, body)
  120319. if err != nil {
  120320. return nil, err
  120321. }
  120322. req.Header = reqHeaders
  120323. googleapi.Expand(req.URL, map[string]string{
  120324. "project": c.project,
  120325. })
  120326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120327. }
  120328. // Do executes the "compute.subnetworks.listUsable" call.
  120329. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  120330. // non-nil. Any non-2xx status code is an error. Response headers are in
  120331. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  120332. // a response was returned at all) in error.(*googleapi.Error).Header.
  120333. // Use googleapi.IsNotModified to check whether the returned error was
  120334. // because http.StatusNotModified was returned.
  120335. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  120336. gensupport.SetOptions(c.urlParams_, opts...)
  120337. res, err := c.doRequest("json")
  120338. if res != nil && res.StatusCode == http.StatusNotModified {
  120339. if res.Body != nil {
  120340. res.Body.Close()
  120341. }
  120342. return nil, &googleapi.Error{
  120343. Code: res.StatusCode,
  120344. Header: res.Header,
  120345. }
  120346. }
  120347. if err != nil {
  120348. return nil, err
  120349. }
  120350. defer googleapi.CloseBody(res)
  120351. if err := googleapi.CheckResponse(res); err != nil {
  120352. return nil, err
  120353. }
  120354. ret := &UsableSubnetworksAggregatedList{
  120355. ServerResponse: googleapi.ServerResponse{
  120356. Header: res.Header,
  120357. HTTPStatusCode: res.StatusCode,
  120358. },
  120359. }
  120360. target := &ret
  120361. if err := gensupport.DecodeResponse(target, res); err != nil {
  120362. return nil, err
  120363. }
  120364. return ret, nil
  120365. // {
  120366. // "description": "Retrieves an aggregated list of usable subnetworks.",
  120367. // "httpMethod": "GET",
  120368. // "id": "compute.subnetworks.listUsable",
  120369. // "parameterOrder": [
  120370. // "project"
  120371. // ],
  120372. // "parameters": {
  120373. // "filter": {
  120374. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  120375. // "location": "query",
  120376. // "type": "string"
  120377. // },
  120378. // "maxResults": {
  120379. // "default": "500",
  120380. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  120381. // "format": "uint32",
  120382. // "location": "query",
  120383. // "minimum": "0",
  120384. // "type": "integer"
  120385. // },
  120386. // "orderBy": {
  120387. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  120388. // "location": "query",
  120389. // "type": "string"
  120390. // },
  120391. // "pageToken": {
  120392. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  120393. // "location": "query",
  120394. // "type": "string"
  120395. // },
  120396. // "project": {
  120397. // "description": "Project ID for this request.",
  120398. // "location": "path",
  120399. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120400. // "required": true,
  120401. // "type": "string"
  120402. // }
  120403. // },
  120404. // "path": "{project}/aggregated/subnetworks/listUsable",
  120405. // "response": {
  120406. // "$ref": "UsableSubnetworksAggregatedList"
  120407. // },
  120408. // "scopes": [
  120409. // "https://www.googleapis.com/auth/cloud-platform",
  120410. // "https://www.googleapis.com/auth/compute",
  120411. // "https://www.googleapis.com/auth/compute.readonly"
  120412. // ]
  120413. // }
  120414. }
  120415. // Pages invokes f for each page of results.
  120416. // A non-nil error returned from f will halt the iteration.
  120417. // The provided context supersedes any context provided to the Context method.
  120418. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  120419. c.ctx_ = ctx
  120420. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120421. for {
  120422. x, err := c.Do()
  120423. if err != nil {
  120424. return err
  120425. }
  120426. if err := f(x); err != nil {
  120427. return err
  120428. }
  120429. if x.NextPageToken == "" {
  120430. return nil
  120431. }
  120432. c.PageToken(x.NextPageToken)
  120433. }
  120434. }
  120435. // method id "compute.subnetworks.patch":
  120436. type SubnetworksPatchCall struct {
  120437. s *Service
  120438. project string
  120439. region string
  120440. subnetwork string
  120441. subnetwork2 *Subnetwork
  120442. urlParams_ gensupport.URLParams
  120443. ctx_ context.Context
  120444. header_ http.Header
  120445. }
  120446. // Patch: Patches the specified subnetwork with the data included in the
  120447. // request. Only certain fields can up updated with a patch request as
  120448. // indicated in the field descriptions. You must specify the current
  120449. // fingeprint of the subnetwork resource being patched.
  120450. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  120451. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120452. c.project = project
  120453. c.region = region
  120454. c.subnetwork = subnetwork
  120455. c.subnetwork2 = subnetwork2
  120456. return c
  120457. }
  120458. // DrainTimeoutSeconds sets the optional parameter
  120459. // "drainTimeoutSeconds": The drain timeout specifies the upper bound in
  120460. // seconds on the amount of time allowed to drain connections from the
  120461. // current ACTIVE subnetwork to the current BACKUP subnetwork. The drain
  120462. // timeout is only applicable when the following conditions are true: -
  120463. // the subnetwork being patched has purpose =
  120464. // INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role
  120465. // = BACKUP - the patch request is setting the role to ACTIVE. Note that
  120466. // after this patch operation the roles of the ACTIVE and BACKUP
  120467. // subnetworks will be swapped.
  120468. func (c *SubnetworksPatchCall) DrainTimeoutSeconds(drainTimeoutSeconds int64) *SubnetworksPatchCall {
  120469. c.urlParams_.Set("drainTimeoutSeconds", fmt.Sprint(drainTimeoutSeconds))
  120470. return c
  120471. }
  120472. // RequestId sets the optional parameter "requestId": An optional
  120473. // request ID to identify requests. Specify a unique request ID so that
  120474. // if you must retry your request, the server will know to ignore the
  120475. // request if it has already been completed.
  120476. //
  120477. // For example, consider a situation where you make an initial request
  120478. // and the request times out. If you make the request again with the
  120479. // same request ID, the server can check if original operation with the
  120480. // same request ID was received, and if so, will ignore the second
  120481. // request. This prevents clients from accidentally creating duplicate
  120482. // commitments.
  120483. //
  120484. // The request ID must be a valid UUID with the exception that zero UUID
  120485. // is not supported (00000000-0000-0000-0000-000000000000).
  120486. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  120487. c.urlParams_.Set("requestId", requestId)
  120488. return c
  120489. }
  120490. // Fields allows partial responses to be retrieved. See
  120491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120492. // for more information.
  120493. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  120494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120495. return c
  120496. }
  120497. // Context sets the context to be used in this call's Do method. Any
  120498. // pending HTTP request will be aborted if the provided context is
  120499. // canceled.
  120500. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  120501. c.ctx_ = ctx
  120502. return c
  120503. }
  120504. // Header returns an http.Header that can be modified by the caller to
  120505. // add HTTP headers to the request.
  120506. func (c *SubnetworksPatchCall) Header() http.Header {
  120507. if c.header_ == nil {
  120508. c.header_ = make(http.Header)
  120509. }
  120510. return c.header_
  120511. }
  120512. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  120513. reqHeaders := make(http.Header)
  120514. for k, v := range c.header_ {
  120515. reqHeaders[k] = v
  120516. }
  120517. reqHeaders.Set("User-Agent", c.s.userAgent())
  120518. var body io.Reader = nil
  120519. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  120520. if err != nil {
  120521. return nil, err
  120522. }
  120523. reqHeaders.Set("Content-Type", "application/json")
  120524. c.urlParams_.Set("alt", alt)
  120525. c.urlParams_.Set("prettyPrint", "false")
  120526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  120527. urls += "?" + c.urlParams_.Encode()
  120528. req, err := http.NewRequest("PATCH", urls, body)
  120529. if err != nil {
  120530. return nil, err
  120531. }
  120532. req.Header = reqHeaders
  120533. googleapi.Expand(req.URL, map[string]string{
  120534. "project": c.project,
  120535. "region": c.region,
  120536. "subnetwork": c.subnetwork,
  120537. })
  120538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120539. }
  120540. // Do executes the "compute.subnetworks.patch" call.
  120541. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120542. // status code is an error. Response headers are in either
  120543. // *Operation.ServerResponse.Header or (if a response was returned at
  120544. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120545. // to check whether the returned error was because
  120546. // http.StatusNotModified was returned.
  120547. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120548. gensupport.SetOptions(c.urlParams_, opts...)
  120549. res, err := c.doRequest("json")
  120550. if res != nil && res.StatusCode == http.StatusNotModified {
  120551. if res.Body != nil {
  120552. res.Body.Close()
  120553. }
  120554. return nil, &googleapi.Error{
  120555. Code: res.StatusCode,
  120556. Header: res.Header,
  120557. }
  120558. }
  120559. if err != nil {
  120560. return nil, err
  120561. }
  120562. defer googleapi.CloseBody(res)
  120563. if err := googleapi.CheckResponse(res); err != nil {
  120564. return nil, err
  120565. }
  120566. ret := &Operation{
  120567. ServerResponse: googleapi.ServerResponse{
  120568. Header: res.Header,
  120569. HTTPStatusCode: res.StatusCode,
  120570. },
  120571. }
  120572. target := &ret
  120573. if err := gensupport.DecodeResponse(target, res); err != nil {
  120574. return nil, err
  120575. }
  120576. return ret, nil
  120577. // {
  120578. // "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.",
  120579. // "httpMethod": "PATCH",
  120580. // "id": "compute.subnetworks.patch",
  120581. // "parameterOrder": [
  120582. // "project",
  120583. // "region",
  120584. // "subnetwork"
  120585. // ],
  120586. // "parameters": {
  120587. // "drainTimeoutSeconds": {
  120588. // "description": "The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.",
  120589. // "format": "int32",
  120590. // "location": "query",
  120591. // "type": "integer"
  120592. // },
  120593. // "project": {
  120594. // "description": "Project ID for this request.",
  120595. // "location": "path",
  120596. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120597. // "required": true,
  120598. // "type": "string"
  120599. // },
  120600. // "region": {
  120601. // "description": "Name of the region scoping this request.",
  120602. // "location": "path",
  120603. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120604. // "required": true,
  120605. // "type": "string"
  120606. // },
  120607. // "requestId": {
  120608. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120609. // "location": "query",
  120610. // "type": "string"
  120611. // },
  120612. // "subnetwork": {
  120613. // "description": "Name of the Subnetwork resource to patch.",
  120614. // "location": "path",
  120615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120616. // "required": true,
  120617. // "type": "string"
  120618. // }
  120619. // },
  120620. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  120621. // "request": {
  120622. // "$ref": "Subnetwork"
  120623. // },
  120624. // "response": {
  120625. // "$ref": "Operation"
  120626. // },
  120627. // "scopes": [
  120628. // "https://www.googleapis.com/auth/cloud-platform",
  120629. // "https://www.googleapis.com/auth/compute"
  120630. // ]
  120631. // }
  120632. }
  120633. // method id "compute.subnetworks.setIamPolicy":
  120634. type SubnetworksSetIamPolicyCall struct {
  120635. s *Service
  120636. project string
  120637. region string
  120638. resource string
  120639. regionsetpolicyrequest *RegionSetPolicyRequest
  120640. urlParams_ gensupport.URLParams
  120641. ctx_ context.Context
  120642. header_ http.Header
  120643. }
  120644. // SetIamPolicy: Sets the access control policy on the specified
  120645. // resource. Replaces any existing policy.
  120646. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  120647. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120648. c.project = project
  120649. c.region = region
  120650. c.resource = resource
  120651. c.regionsetpolicyrequest = regionsetpolicyrequest
  120652. return c
  120653. }
  120654. // Fields allows partial responses to be retrieved. See
  120655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120656. // for more information.
  120657. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  120658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120659. return c
  120660. }
  120661. // Context sets the context to be used in this call's Do method. Any
  120662. // pending HTTP request will be aborted if the provided context is
  120663. // canceled.
  120664. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  120665. c.ctx_ = ctx
  120666. return c
  120667. }
  120668. // Header returns an http.Header that can be modified by the caller to
  120669. // add HTTP headers to the request.
  120670. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  120671. if c.header_ == nil {
  120672. c.header_ = make(http.Header)
  120673. }
  120674. return c.header_
  120675. }
  120676. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  120677. reqHeaders := make(http.Header)
  120678. for k, v := range c.header_ {
  120679. reqHeaders[k] = v
  120680. }
  120681. reqHeaders.Set("User-Agent", c.s.userAgent())
  120682. var body io.Reader = nil
  120683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  120684. if err != nil {
  120685. return nil, err
  120686. }
  120687. reqHeaders.Set("Content-Type", "application/json")
  120688. c.urlParams_.Set("alt", alt)
  120689. c.urlParams_.Set("prettyPrint", "false")
  120690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  120691. urls += "?" + c.urlParams_.Encode()
  120692. req, err := http.NewRequest("POST", urls, body)
  120693. if err != nil {
  120694. return nil, err
  120695. }
  120696. req.Header = reqHeaders
  120697. googleapi.Expand(req.URL, map[string]string{
  120698. "project": c.project,
  120699. "region": c.region,
  120700. "resource": c.resource,
  120701. })
  120702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120703. }
  120704. // Do executes the "compute.subnetworks.setIamPolicy" call.
  120705. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  120706. // code is an error. Response headers are in either
  120707. // *Policy.ServerResponse.Header or (if a response was returned at all)
  120708. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  120709. // check whether the returned error was because http.StatusNotModified
  120710. // was returned.
  120711. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  120712. gensupport.SetOptions(c.urlParams_, opts...)
  120713. res, err := c.doRequest("json")
  120714. if res != nil && res.StatusCode == http.StatusNotModified {
  120715. if res.Body != nil {
  120716. res.Body.Close()
  120717. }
  120718. return nil, &googleapi.Error{
  120719. Code: res.StatusCode,
  120720. Header: res.Header,
  120721. }
  120722. }
  120723. if err != nil {
  120724. return nil, err
  120725. }
  120726. defer googleapi.CloseBody(res)
  120727. if err := googleapi.CheckResponse(res); err != nil {
  120728. return nil, err
  120729. }
  120730. ret := &Policy{
  120731. ServerResponse: googleapi.ServerResponse{
  120732. Header: res.Header,
  120733. HTTPStatusCode: res.StatusCode,
  120734. },
  120735. }
  120736. target := &ret
  120737. if err := gensupport.DecodeResponse(target, res); err != nil {
  120738. return nil, err
  120739. }
  120740. return ret, nil
  120741. // {
  120742. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  120743. // "httpMethod": "POST",
  120744. // "id": "compute.subnetworks.setIamPolicy",
  120745. // "parameterOrder": [
  120746. // "project",
  120747. // "region",
  120748. // "resource"
  120749. // ],
  120750. // "parameters": {
  120751. // "project": {
  120752. // "description": "Project ID for this request.",
  120753. // "location": "path",
  120754. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120755. // "required": true,
  120756. // "type": "string"
  120757. // },
  120758. // "region": {
  120759. // "description": "The name of the region for this request.",
  120760. // "location": "path",
  120761. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120762. // "required": true,
  120763. // "type": "string"
  120764. // },
  120765. // "resource": {
  120766. // "description": "Name or id of the resource for this request.",
  120767. // "location": "path",
  120768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120769. // "required": true,
  120770. // "type": "string"
  120771. // }
  120772. // },
  120773. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  120774. // "request": {
  120775. // "$ref": "RegionSetPolicyRequest"
  120776. // },
  120777. // "response": {
  120778. // "$ref": "Policy"
  120779. // },
  120780. // "scopes": [
  120781. // "https://www.googleapis.com/auth/cloud-platform",
  120782. // "https://www.googleapis.com/auth/compute"
  120783. // ]
  120784. // }
  120785. }
  120786. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  120787. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  120788. s *Service
  120789. project string
  120790. region string
  120791. subnetwork string
  120792. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  120793. urlParams_ gensupport.URLParams
  120794. ctx_ context.Context
  120795. header_ http.Header
  120796. }
  120797. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  120798. // Google services without assigning external IP addresses through
  120799. // Private Google Access.
  120800. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  120801. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120802. c.project = project
  120803. c.region = region
  120804. c.subnetwork = subnetwork
  120805. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  120806. return c
  120807. }
  120808. // RequestId sets the optional parameter "requestId": An optional
  120809. // request ID to identify requests. Specify a unique request ID so that
  120810. // if you must retry your request, the server will know to ignore the
  120811. // request if it has already been completed.
  120812. //
  120813. // For example, consider a situation where you make an initial request
  120814. // and the request times out. If you make the request again with the
  120815. // same request ID, the server can check if original operation with the
  120816. // same request ID was received, and if so, will ignore the second
  120817. // request. This prevents clients from accidentally creating duplicate
  120818. // commitments.
  120819. //
  120820. // The request ID must be a valid UUID with the exception that zero UUID
  120821. // is not supported (00000000-0000-0000-0000-000000000000).
  120822. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  120823. c.urlParams_.Set("requestId", requestId)
  120824. return c
  120825. }
  120826. // Fields allows partial responses to be retrieved. See
  120827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120828. // for more information.
  120829. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  120830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120831. return c
  120832. }
  120833. // Context sets the context to be used in this call's Do method. Any
  120834. // pending HTTP request will be aborted if the provided context is
  120835. // canceled.
  120836. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  120837. c.ctx_ = ctx
  120838. return c
  120839. }
  120840. // Header returns an http.Header that can be modified by the caller to
  120841. // add HTTP headers to the request.
  120842. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  120843. if c.header_ == nil {
  120844. c.header_ = make(http.Header)
  120845. }
  120846. return c.header_
  120847. }
  120848. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  120849. reqHeaders := make(http.Header)
  120850. for k, v := range c.header_ {
  120851. reqHeaders[k] = v
  120852. }
  120853. reqHeaders.Set("User-Agent", c.s.userAgent())
  120854. var body io.Reader = nil
  120855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  120856. if err != nil {
  120857. return nil, err
  120858. }
  120859. reqHeaders.Set("Content-Type", "application/json")
  120860. c.urlParams_.Set("alt", alt)
  120861. c.urlParams_.Set("prettyPrint", "false")
  120862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  120863. urls += "?" + c.urlParams_.Encode()
  120864. req, err := http.NewRequest("POST", urls, body)
  120865. if err != nil {
  120866. return nil, err
  120867. }
  120868. req.Header = reqHeaders
  120869. googleapi.Expand(req.URL, map[string]string{
  120870. "project": c.project,
  120871. "region": c.region,
  120872. "subnetwork": c.subnetwork,
  120873. })
  120874. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120875. }
  120876. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  120877. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120878. // status code is an error. Response headers are in either
  120879. // *Operation.ServerResponse.Header or (if a response was returned at
  120880. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120881. // to check whether the returned error was because
  120882. // http.StatusNotModified was returned.
  120883. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120884. gensupport.SetOptions(c.urlParams_, opts...)
  120885. res, err := c.doRequest("json")
  120886. if res != nil && res.StatusCode == http.StatusNotModified {
  120887. if res.Body != nil {
  120888. res.Body.Close()
  120889. }
  120890. return nil, &googleapi.Error{
  120891. Code: res.StatusCode,
  120892. Header: res.Header,
  120893. }
  120894. }
  120895. if err != nil {
  120896. return nil, err
  120897. }
  120898. defer googleapi.CloseBody(res)
  120899. if err := googleapi.CheckResponse(res); err != nil {
  120900. return nil, err
  120901. }
  120902. ret := &Operation{
  120903. ServerResponse: googleapi.ServerResponse{
  120904. Header: res.Header,
  120905. HTTPStatusCode: res.StatusCode,
  120906. },
  120907. }
  120908. target := &ret
  120909. if err := gensupport.DecodeResponse(target, res); err != nil {
  120910. return nil, err
  120911. }
  120912. return ret, nil
  120913. // {
  120914. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  120915. // "httpMethod": "POST",
  120916. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  120917. // "parameterOrder": [
  120918. // "project",
  120919. // "region",
  120920. // "subnetwork"
  120921. // ],
  120922. // "parameters": {
  120923. // "project": {
  120924. // "description": "Project ID for this request.",
  120925. // "location": "path",
  120926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120927. // "required": true,
  120928. // "type": "string"
  120929. // },
  120930. // "region": {
  120931. // "description": "Name of the region scoping this request.",
  120932. // "location": "path",
  120933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120934. // "required": true,
  120935. // "type": "string"
  120936. // },
  120937. // "requestId": {
  120938. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120939. // "location": "query",
  120940. // "type": "string"
  120941. // },
  120942. // "subnetwork": {
  120943. // "description": "Name of the Subnetwork resource.",
  120944. // "location": "path",
  120945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120946. // "required": true,
  120947. // "type": "string"
  120948. // }
  120949. // },
  120950. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  120951. // "request": {
  120952. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  120953. // },
  120954. // "response": {
  120955. // "$ref": "Operation"
  120956. // },
  120957. // "scopes": [
  120958. // "https://www.googleapis.com/auth/cloud-platform",
  120959. // "https://www.googleapis.com/auth/compute"
  120960. // ]
  120961. // }
  120962. }
  120963. // method id "compute.subnetworks.testIamPermissions":
  120964. type SubnetworksTestIamPermissionsCall struct {
  120965. s *Service
  120966. project string
  120967. region string
  120968. resource string
  120969. testpermissionsrequest *TestPermissionsRequest
  120970. urlParams_ gensupport.URLParams
  120971. ctx_ context.Context
  120972. header_ http.Header
  120973. }
  120974. // TestIamPermissions: Returns permissions that a caller has on the
  120975. // specified resource.
  120976. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  120977. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120978. c.project = project
  120979. c.region = region
  120980. c.resource = resource
  120981. c.testpermissionsrequest = testpermissionsrequest
  120982. return c
  120983. }
  120984. // Fields allows partial responses to be retrieved. See
  120985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120986. // for more information.
  120987. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  120988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120989. return c
  120990. }
  120991. // Context sets the context to be used in this call's Do method. Any
  120992. // pending HTTP request will be aborted if the provided context is
  120993. // canceled.
  120994. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  120995. c.ctx_ = ctx
  120996. return c
  120997. }
  120998. // Header returns an http.Header that can be modified by the caller to
  120999. // add HTTP headers to the request.
  121000. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  121001. if c.header_ == nil {
  121002. c.header_ = make(http.Header)
  121003. }
  121004. return c.header_
  121005. }
  121006. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  121007. reqHeaders := make(http.Header)
  121008. for k, v := range c.header_ {
  121009. reqHeaders[k] = v
  121010. }
  121011. reqHeaders.Set("User-Agent", c.s.userAgent())
  121012. var body io.Reader = nil
  121013. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  121014. if err != nil {
  121015. return nil, err
  121016. }
  121017. reqHeaders.Set("Content-Type", "application/json")
  121018. c.urlParams_.Set("alt", alt)
  121019. c.urlParams_.Set("prettyPrint", "false")
  121020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  121021. urls += "?" + c.urlParams_.Encode()
  121022. req, err := http.NewRequest("POST", urls, body)
  121023. if err != nil {
  121024. return nil, err
  121025. }
  121026. req.Header = reqHeaders
  121027. googleapi.Expand(req.URL, map[string]string{
  121028. "project": c.project,
  121029. "region": c.region,
  121030. "resource": c.resource,
  121031. })
  121032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121033. }
  121034. // Do executes the "compute.subnetworks.testIamPermissions" call.
  121035. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  121036. // non-2xx status code is an error. Response headers are in either
  121037. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  121038. // returned at all) in error.(*googleapi.Error).Header. Use
  121039. // googleapi.IsNotModified to check whether the returned error was
  121040. // because http.StatusNotModified was returned.
  121041. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  121042. gensupport.SetOptions(c.urlParams_, opts...)
  121043. res, err := c.doRequest("json")
  121044. if res != nil && res.StatusCode == http.StatusNotModified {
  121045. if res.Body != nil {
  121046. res.Body.Close()
  121047. }
  121048. return nil, &googleapi.Error{
  121049. Code: res.StatusCode,
  121050. Header: res.Header,
  121051. }
  121052. }
  121053. if err != nil {
  121054. return nil, err
  121055. }
  121056. defer googleapi.CloseBody(res)
  121057. if err := googleapi.CheckResponse(res); err != nil {
  121058. return nil, err
  121059. }
  121060. ret := &TestPermissionsResponse{
  121061. ServerResponse: googleapi.ServerResponse{
  121062. Header: res.Header,
  121063. HTTPStatusCode: res.StatusCode,
  121064. },
  121065. }
  121066. target := &ret
  121067. if err := gensupport.DecodeResponse(target, res); err != nil {
  121068. return nil, err
  121069. }
  121070. return ret, nil
  121071. // {
  121072. // "description": "Returns permissions that a caller has on the specified resource.",
  121073. // "httpMethod": "POST",
  121074. // "id": "compute.subnetworks.testIamPermissions",
  121075. // "parameterOrder": [
  121076. // "project",
  121077. // "region",
  121078. // "resource"
  121079. // ],
  121080. // "parameters": {
  121081. // "project": {
  121082. // "description": "Project ID for this request.",
  121083. // "location": "path",
  121084. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121085. // "required": true,
  121086. // "type": "string"
  121087. // },
  121088. // "region": {
  121089. // "description": "The name of the region for this request.",
  121090. // "location": "path",
  121091. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121092. // "required": true,
  121093. // "type": "string"
  121094. // },
  121095. // "resource": {
  121096. // "description": "Name or id of the resource for this request.",
  121097. // "location": "path",
  121098. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121099. // "required": true,
  121100. // "type": "string"
  121101. // }
  121102. // },
  121103. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  121104. // "request": {
  121105. // "$ref": "TestPermissionsRequest"
  121106. // },
  121107. // "response": {
  121108. // "$ref": "TestPermissionsResponse"
  121109. // },
  121110. // "scopes": [
  121111. // "https://www.googleapis.com/auth/cloud-platform",
  121112. // "https://www.googleapis.com/auth/compute",
  121113. // "https://www.googleapis.com/auth/compute.readonly"
  121114. // ]
  121115. // }
  121116. }
  121117. // method id "compute.targetHttpProxies.aggregatedList":
  121118. type TargetHttpProxiesAggregatedListCall struct {
  121119. s *Service
  121120. project string
  121121. urlParams_ gensupport.URLParams
  121122. ifNoneMatch_ string
  121123. ctx_ context.Context
  121124. header_ http.Header
  121125. }
  121126. // AggregatedList: Retrieves the list of all TargetHttpProxy resources,
  121127. // regional and global, available to the specified project.
  121128. func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {
  121129. c := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121130. c.project = project
  121131. return c
  121132. }
  121133. // Filter sets the optional parameter "filter": A filter expression that
  121134. // filters resources listed in the response. The expression must specify
  121135. // the field name, a comparison operator, and the value that you want to
  121136. // use for filtering. The value must be a string, a number, or a
  121137. // boolean. The comparison operator must be either =, !=, >, or <.
  121138. //
  121139. // For example, if you are filtering Compute Engine instances, you can
  121140. // exclude instances named example-instance by specifying name !=
  121141. // example-instance.
  121142. //
  121143. // You can also filter nested fields. For example, you could specify
  121144. // scheduling.automaticRestart = false to include instances only if they
  121145. // are not scheduled for automatic restarts. You can use filtering on
  121146. // nested fields to filter based on resource labels.
  121147. //
  121148. // To filter on multiple expressions, provide each separate expression
  121149. // within parentheses. For example, (scheduling.automaticRestart = true)
  121150. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121151. // AND expression. However, you can include AND and OR expressions
  121152. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121153. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121154. // true).
  121155. func (c *TargetHttpProxiesAggregatedListCall) Filter(filter string) *TargetHttpProxiesAggregatedListCall {
  121156. c.urlParams_.Set("filter", filter)
  121157. return c
  121158. }
  121159. // MaxResults sets the optional parameter "maxResults": The maximum
  121160. // number of results per page that should be returned. If the number of
  121161. // available results is larger than maxResults, Compute Engine returns a
  121162. // nextPageToken that can be used to get the next page of results in
  121163. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121164. // (Default: 500)
  121165. func (c *TargetHttpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpProxiesAggregatedListCall {
  121166. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121167. return c
  121168. }
  121169. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121170. // a certain order. By default, results are returned in alphanumerical
  121171. // order based on the resource name.
  121172. //
  121173. // You can also sort results in descending order based on the creation
  121174. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121175. // based on the creationTimestamp field in reverse chronological order
  121176. // (newest result first). Use this to sort resources like operations so
  121177. // that the newest operation is returned first.
  121178. //
  121179. // Currently, only sorting by name or creationTimestamp desc is
  121180. // supported.
  121181. func (c *TargetHttpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpProxiesAggregatedListCall {
  121182. c.urlParams_.Set("orderBy", orderBy)
  121183. return c
  121184. }
  121185. // PageToken sets the optional parameter "pageToken": Specifies a page
  121186. // token to use. Set pageToken to the nextPageToken returned by a
  121187. // previous list request to get the next page of results.
  121188. func (c *TargetHttpProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpProxiesAggregatedListCall {
  121189. c.urlParams_.Set("pageToken", pageToken)
  121190. return c
  121191. }
  121192. // Fields allows partial responses to be retrieved. See
  121193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121194. // for more information.
  121195. func (c *TargetHttpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesAggregatedListCall {
  121196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121197. return c
  121198. }
  121199. // IfNoneMatch sets the optional parameter which makes the operation
  121200. // fail if the object's ETag matches the given value. This is useful for
  121201. // getting updates only after the object has changed since the last
  121202. // request. Use googleapi.IsNotModified to check whether the response
  121203. // error from Do is the result of In-None-Match.
  121204. func (c *TargetHttpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesAggregatedListCall {
  121205. c.ifNoneMatch_ = entityTag
  121206. return c
  121207. }
  121208. // Context sets the context to be used in this call's Do method. Any
  121209. // pending HTTP request will be aborted if the provided context is
  121210. // canceled.
  121211. func (c *TargetHttpProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpProxiesAggregatedListCall {
  121212. c.ctx_ = ctx
  121213. return c
  121214. }
  121215. // Header returns an http.Header that can be modified by the caller to
  121216. // add HTTP headers to the request.
  121217. func (c *TargetHttpProxiesAggregatedListCall) Header() http.Header {
  121218. if c.header_ == nil {
  121219. c.header_ = make(http.Header)
  121220. }
  121221. return c.header_
  121222. }
  121223. func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  121224. reqHeaders := make(http.Header)
  121225. for k, v := range c.header_ {
  121226. reqHeaders[k] = v
  121227. }
  121228. reqHeaders.Set("User-Agent", c.s.userAgent())
  121229. if c.ifNoneMatch_ != "" {
  121230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121231. }
  121232. var body io.Reader = nil
  121233. c.urlParams_.Set("alt", alt)
  121234. c.urlParams_.Set("prettyPrint", "false")
  121235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpProxies")
  121236. urls += "?" + c.urlParams_.Encode()
  121237. req, err := http.NewRequest("GET", urls, body)
  121238. if err != nil {
  121239. return nil, err
  121240. }
  121241. req.Header = reqHeaders
  121242. googleapi.Expand(req.URL, map[string]string{
  121243. "project": c.project,
  121244. })
  121245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121246. }
  121247. // Do executes the "compute.targetHttpProxies.aggregatedList" call.
  121248. // Exactly one of *TargetHttpProxyAggregatedList or error will be
  121249. // non-nil. Any non-2xx status code is an error. Response headers are in
  121250. // either *TargetHttpProxyAggregatedList.ServerResponse.Header or (if a
  121251. // response was returned at all) in error.(*googleapi.Error).Header. Use
  121252. // googleapi.IsNotModified to check whether the returned error was
  121253. // because http.StatusNotModified was returned.
  121254. func (c *TargetHttpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyAggregatedList, error) {
  121255. gensupport.SetOptions(c.urlParams_, opts...)
  121256. res, err := c.doRequest("json")
  121257. if res != nil && res.StatusCode == http.StatusNotModified {
  121258. if res.Body != nil {
  121259. res.Body.Close()
  121260. }
  121261. return nil, &googleapi.Error{
  121262. Code: res.StatusCode,
  121263. Header: res.Header,
  121264. }
  121265. }
  121266. if err != nil {
  121267. return nil, err
  121268. }
  121269. defer googleapi.CloseBody(res)
  121270. if err := googleapi.CheckResponse(res); err != nil {
  121271. return nil, err
  121272. }
  121273. ret := &TargetHttpProxyAggregatedList{
  121274. ServerResponse: googleapi.ServerResponse{
  121275. Header: res.Header,
  121276. HTTPStatusCode: res.StatusCode,
  121277. },
  121278. }
  121279. target := &ret
  121280. if err := gensupport.DecodeResponse(target, res); err != nil {
  121281. return nil, err
  121282. }
  121283. return ret, nil
  121284. // {
  121285. // "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
  121286. // "httpMethod": "GET",
  121287. // "id": "compute.targetHttpProxies.aggregatedList",
  121288. // "parameterOrder": [
  121289. // "project"
  121290. // ],
  121291. // "parameters": {
  121292. // "filter": {
  121293. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  121294. // "location": "query",
  121295. // "type": "string"
  121296. // },
  121297. // "maxResults": {
  121298. // "default": "500",
  121299. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  121300. // "format": "uint32",
  121301. // "location": "query",
  121302. // "minimum": "0",
  121303. // "type": "integer"
  121304. // },
  121305. // "orderBy": {
  121306. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  121307. // "location": "query",
  121308. // "type": "string"
  121309. // },
  121310. // "pageToken": {
  121311. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  121312. // "location": "query",
  121313. // "type": "string"
  121314. // },
  121315. // "project": {
  121316. // "description": "Name of the project scoping this request.",
  121317. // "location": "path",
  121318. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121319. // "required": true,
  121320. // "type": "string"
  121321. // }
  121322. // },
  121323. // "path": "{project}/aggregated/targetHttpProxies",
  121324. // "response": {
  121325. // "$ref": "TargetHttpProxyAggregatedList"
  121326. // },
  121327. // "scopes": [
  121328. // "https://www.googleapis.com/auth/cloud-platform",
  121329. // "https://www.googleapis.com/auth/compute",
  121330. // "https://www.googleapis.com/auth/compute.readonly"
  121331. // ]
  121332. // }
  121333. }
  121334. // Pages invokes f for each page of results.
  121335. // A non-nil error returned from f will halt the iteration.
  121336. // The provided context supersedes any context provided to the Context method.
  121337. func (c *TargetHttpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpProxyAggregatedList) error) error {
  121338. c.ctx_ = ctx
  121339. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  121340. for {
  121341. x, err := c.Do()
  121342. if err != nil {
  121343. return err
  121344. }
  121345. if err := f(x); err != nil {
  121346. return err
  121347. }
  121348. if x.NextPageToken == "" {
  121349. return nil
  121350. }
  121351. c.PageToken(x.NextPageToken)
  121352. }
  121353. }
  121354. // method id "compute.targetHttpProxies.delete":
  121355. type TargetHttpProxiesDeleteCall struct {
  121356. s *Service
  121357. project string
  121358. targetHttpProxy string
  121359. urlParams_ gensupport.URLParams
  121360. ctx_ context.Context
  121361. header_ http.Header
  121362. }
  121363. // Delete: Deletes the specified TargetHttpProxy resource.
  121364. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  121365. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  121366. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121367. c.project = project
  121368. c.targetHttpProxy = targetHttpProxy
  121369. return c
  121370. }
  121371. // RequestId sets the optional parameter "requestId": An optional
  121372. // request ID to identify requests. Specify a unique request ID so that
  121373. // if you must retry your request, the server will know to ignore the
  121374. // request if it has already been completed.
  121375. //
  121376. // For example, consider a situation where you make an initial request
  121377. // and the request times out. If you make the request again with the
  121378. // same request ID, the server can check if original operation with the
  121379. // same request ID was received, and if so, will ignore the second
  121380. // request. This prevents clients from accidentally creating duplicate
  121381. // commitments.
  121382. //
  121383. // The request ID must be a valid UUID with the exception that zero UUID
  121384. // is not supported (00000000-0000-0000-0000-000000000000).
  121385. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  121386. c.urlParams_.Set("requestId", requestId)
  121387. return c
  121388. }
  121389. // Fields allows partial responses to be retrieved. See
  121390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121391. // for more information.
  121392. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  121393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121394. return c
  121395. }
  121396. // Context sets the context to be used in this call's Do method. Any
  121397. // pending HTTP request will be aborted if the provided context is
  121398. // canceled.
  121399. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  121400. c.ctx_ = ctx
  121401. return c
  121402. }
  121403. // Header returns an http.Header that can be modified by the caller to
  121404. // add HTTP headers to the request.
  121405. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  121406. if c.header_ == nil {
  121407. c.header_ = make(http.Header)
  121408. }
  121409. return c.header_
  121410. }
  121411. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  121412. reqHeaders := make(http.Header)
  121413. for k, v := range c.header_ {
  121414. reqHeaders[k] = v
  121415. }
  121416. reqHeaders.Set("User-Agent", c.s.userAgent())
  121417. var body io.Reader = nil
  121418. c.urlParams_.Set("alt", alt)
  121419. c.urlParams_.Set("prettyPrint", "false")
  121420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  121421. urls += "?" + c.urlParams_.Encode()
  121422. req, err := http.NewRequest("DELETE", urls, body)
  121423. if err != nil {
  121424. return nil, err
  121425. }
  121426. req.Header = reqHeaders
  121427. googleapi.Expand(req.URL, map[string]string{
  121428. "project": c.project,
  121429. "targetHttpProxy": c.targetHttpProxy,
  121430. })
  121431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121432. }
  121433. // Do executes the "compute.targetHttpProxies.delete" call.
  121434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121435. // status code is an error. Response headers are in either
  121436. // *Operation.ServerResponse.Header or (if a response was returned at
  121437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121438. // to check whether the returned error was because
  121439. // http.StatusNotModified was returned.
  121440. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121441. gensupport.SetOptions(c.urlParams_, opts...)
  121442. res, err := c.doRequest("json")
  121443. if res != nil && res.StatusCode == http.StatusNotModified {
  121444. if res.Body != nil {
  121445. res.Body.Close()
  121446. }
  121447. return nil, &googleapi.Error{
  121448. Code: res.StatusCode,
  121449. Header: res.Header,
  121450. }
  121451. }
  121452. if err != nil {
  121453. return nil, err
  121454. }
  121455. defer googleapi.CloseBody(res)
  121456. if err := googleapi.CheckResponse(res); err != nil {
  121457. return nil, err
  121458. }
  121459. ret := &Operation{
  121460. ServerResponse: googleapi.ServerResponse{
  121461. Header: res.Header,
  121462. HTTPStatusCode: res.StatusCode,
  121463. },
  121464. }
  121465. target := &ret
  121466. if err := gensupport.DecodeResponse(target, res); err != nil {
  121467. return nil, err
  121468. }
  121469. return ret, nil
  121470. // {
  121471. // "description": "Deletes the specified TargetHttpProxy resource.",
  121472. // "httpMethod": "DELETE",
  121473. // "id": "compute.targetHttpProxies.delete",
  121474. // "parameterOrder": [
  121475. // "project",
  121476. // "targetHttpProxy"
  121477. // ],
  121478. // "parameters": {
  121479. // "project": {
  121480. // "description": "Project ID for this request.",
  121481. // "location": "path",
  121482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121483. // "required": true,
  121484. // "type": "string"
  121485. // },
  121486. // "requestId": {
  121487. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121488. // "location": "query",
  121489. // "type": "string"
  121490. // },
  121491. // "targetHttpProxy": {
  121492. // "description": "Name of the TargetHttpProxy resource to delete.",
  121493. // "location": "path",
  121494. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121495. // "required": true,
  121496. // "type": "string"
  121497. // }
  121498. // },
  121499. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  121500. // "response": {
  121501. // "$ref": "Operation"
  121502. // },
  121503. // "scopes": [
  121504. // "https://www.googleapis.com/auth/cloud-platform",
  121505. // "https://www.googleapis.com/auth/compute"
  121506. // ]
  121507. // }
  121508. }
  121509. // method id "compute.targetHttpProxies.get":
  121510. type TargetHttpProxiesGetCall struct {
  121511. s *Service
  121512. project string
  121513. targetHttpProxy string
  121514. urlParams_ gensupport.URLParams
  121515. ifNoneMatch_ string
  121516. ctx_ context.Context
  121517. header_ http.Header
  121518. }
  121519. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  121520. // available target HTTP proxies by making a list() request.
  121521. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  121522. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  121523. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121524. c.project = project
  121525. c.targetHttpProxy = targetHttpProxy
  121526. return c
  121527. }
  121528. // Fields allows partial responses to be retrieved. See
  121529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121530. // for more information.
  121531. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  121532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121533. return c
  121534. }
  121535. // IfNoneMatch sets the optional parameter which makes the operation
  121536. // fail if the object's ETag matches the given value. This is useful for
  121537. // getting updates only after the object has changed since the last
  121538. // request. Use googleapi.IsNotModified to check whether the response
  121539. // error from Do is the result of In-None-Match.
  121540. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  121541. c.ifNoneMatch_ = entityTag
  121542. return c
  121543. }
  121544. // Context sets the context to be used in this call's Do method. Any
  121545. // pending HTTP request will be aborted if the provided context is
  121546. // canceled.
  121547. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  121548. c.ctx_ = ctx
  121549. return c
  121550. }
  121551. // Header returns an http.Header that can be modified by the caller to
  121552. // add HTTP headers to the request.
  121553. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  121554. if c.header_ == nil {
  121555. c.header_ = make(http.Header)
  121556. }
  121557. return c.header_
  121558. }
  121559. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  121560. reqHeaders := make(http.Header)
  121561. for k, v := range c.header_ {
  121562. reqHeaders[k] = v
  121563. }
  121564. reqHeaders.Set("User-Agent", c.s.userAgent())
  121565. if c.ifNoneMatch_ != "" {
  121566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121567. }
  121568. var body io.Reader = nil
  121569. c.urlParams_.Set("alt", alt)
  121570. c.urlParams_.Set("prettyPrint", "false")
  121571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  121572. urls += "?" + c.urlParams_.Encode()
  121573. req, err := http.NewRequest("GET", urls, body)
  121574. if err != nil {
  121575. return nil, err
  121576. }
  121577. req.Header = reqHeaders
  121578. googleapi.Expand(req.URL, map[string]string{
  121579. "project": c.project,
  121580. "targetHttpProxy": c.targetHttpProxy,
  121581. })
  121582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121583. }
  121584. // Do executes the "compute.targetHttpProxies.get" call.
  121585. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  121586. // status code is an error. Response headers are in either
  121587. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  121588. // at all) in error.(*googleapi.Error).Header. Use
  121589. // googleapi.IsNotModified to check whether the returned error was
  121590. // because http.StatusNotModified was returned.
  121591. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  121592. gensupport.SetOptions(c.urlParams_, opts...)
  121593. res, err := c.doRequest("json")
  121594. if res != nil && res.StatusCode == http.StatusNotModified {
  121595. if res.Body != nil {
  121596. res.Body.Close()
  121597. }
  121598. return nil, &googleapi.Error{
  121599. Code: res.StatusCode,
  121600. Header: res.Header,
  121601. }
  121602. }
  121603. if err != nil {
  121604. return nil, err
  121605. }
  121606. defer googleapi.CloseBody(res)
  121607. if err := googleapi.CheckResponse(res); err != nil {
  121608. return nil, err
  121609. }
  121610. ret := &TargetHttpProxy{
  121611. ServerResponse: googleapi.ServerResponse{
  121612. Header: res.Header,
  121613. HTTPStatusCode: res.StatusCode,
  121614. },
  121615. }
  121616. target := &ret
  121617. if err := gensupport.DecodeResponse(target, res); err != nil {
  121618. return nil, err
  121619. }
  121620. return ret, nil
  121621. // {
  121622. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  121623. // "httpMethod": "GET",
  121624. // "id": "compute.targetHttpProxies.get",
  121625. // "parameterOrder": [
  121626. // "project",
  121627. // "targetHttpProxy"
  121628. // ],
  121629. // "parameters": {
  121630. // "project": {
  121631. // "description": "Project ID for this request.",
  121632. // "location": "path",
  121633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121634. // "required": true,
  121635. // "type": "string"
  121636. // },
  121637. // "targetHttpProxy": {
  121638. // "description": "Name of the TargetHttpProxy resource to return.",
  121639. // "location": "path",
  121640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121641. // "required": true,
  121642. // "type": "string"
  121643. // }
  121644. // },
  121645. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  121646. // "response": {
  121647. // "$ref": "TargetHttpProxy"
  121648. // },
  121649. // "scopes": [
  121650. // "https://www.googleapis.com/auth/cloud-platform",
  121651. // "https://www.googleapis.com/auth/compute",
  121652. // "https://www.googleapis.com/auth/compute.readonly"
  121653. // ]
  121654. // }
  121655. }
  121656. // method id "compute.targetHttpProxies.insert":
  121657. type TargetHttpProxiesInsertCall struct {
  121658. s *Service
  121659. project string
  121660. targethttpproxy *TargetHttpProxy
  121661. urlParams_ gensupport.URLParams
  121662. ctx_ context.Context
  121663. header_ http.Header
  121664. }
  121665. // Insert: Creates a TargetHttpProxy resource in the specified project
  121666. // using the data included in the request.
  121667. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  121668. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  121669. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121670. c.project = project
  121671. c.targethttpproxy = targethttpproxy
  121672. return c
  121673. }
  121674. // RequestId sets the optional parameter "requestId": An optional
  121675. // request ID to identify requests. Specify a unique request ID so that
  121676. // if you must retry your request, the server will know to ignore the
  121677. // request if it has already been completed.
  121678. //
  121679. // For example, consider a situation where you make an initial request
  121680. // and the request times out. If you make the request again with the
  121681. // same request ID, the server can check if original operation with the
  121682. // same request ID was received, and if so, will ignore the second
  121683. // request. This prevents clients from accidentally creating duplicate
  121684. // commitments.
  121685. //
  121686. // The request ID must be a valid UUID with the exception that zero UUID
  121687. // is not supported (00000000-0000-0000-0000-000000000000).
  121688. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  121689. c.urlParams_.Set("requestId", requestId)
  121690. return c
  121691. }
  121692. // Fields allows partial responses to be retrieved. See
  121693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121694. // for more information.
  121695. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  121696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121697. return c
  121698. }
  121699. // Context sets the context to be used in this call's Do method. Any
  121700. // pending HTTP request will be aborted if the provided context is
  121701. // canceled.
  121702. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  121703. c.ctx_ = ctx
  121704. return c
  121705. }
  121706. // Header returns an http.Header that can be modified by the caller to
  121707. // add HTTP headers to the request.
  121708. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  121709. if c.header_ == nil {
  121710. c.header_ = make(http.Header)
  121711. }
  121712. return c.header_
  121713. }
  121714. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  121715. reqHeaders := make(http.Header)
  121716. for k, v := range c.header_ {
  121717. reqHeaders[k] = v
  121718. }
  121719. reqHeaders.Set("User-Agent", c.s.userAgent())
  121720. var body io.Reader = nil
  121721. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  121722. if err != nil {
  121723. return nil, err
  121724. }
  121725. reqHeaders.Set("Content-Type", "application/json")
  121726. c.urlParams_.Set("alt", alt)
  121727. c.urlParams_.Set("prettyPrint", "false")
  121728. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  121729. urls += "?" + c.urlParams_.Encode()
  121730. req, err := http.NewRequest("POST", urls, body)
  121731. if err != nil {
  121732. return nil, err
  121733. }
  121734. req.Header = reqHeaders
  121735. googleapi.Expand(req.URL, map[string]string{
  121736. "project": c.project,
  121737. })
  121738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121739. }
  121740. // Do executes the "compute.targetHttpProxies.insert" call.
  121741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121742. // status code is an error. Response headers are in either
  121743. // *Operation.ServerResponse.Header or (if a response was returned at
  121744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121745. // to check whether the returned error was because
  121746. // http.StatusNotModified was returned.
  121747. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121748. gensupport.SetOptions(c.urlParams_, opts...)
  121749. res, err := c.doRequest("json")
  121750. if res != nil && res.StatusCode == http.StatusNotModified {
  121751. if res.Body != nil {
  121752. res.Body.Close()
  121753. }
  121754. return nil, &googleapi.Error{
  121755. Code: res.StatusCode,
  121756. Header: res.Header,
  121757. }
  121758. }
  121759. if err != nil {
  121760. return nil, err
  121761. }
  121762. defer googleapi.CloseBody(res)
  121763. if err := googleapi.CheckResponse(res); err != nil {
  121764. return nil, err
  121765. }
  121766. ret := &Operation{
  121767. ServerResponse: googleapi.ServerResponse{
  121768. Header: res.Header,
  121769. HTTPStatusCode: res.StatusCode,
  121770. },
  121771. }
  121772. target := &ret
  121773. if err := gensupport.DecodeResponse(target, res); err != nil {
  121774. return nil, err
  121775. }
  121776. return ret, nil
  121777. // {
  121778. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  121779. // "httpMethod": "POST",
  121780. // "id": "compute.targetHttpProxies.insert",
  121781. // "parameterOrder": [
  121782. // "project"
  121783. // ],
  121784. // "parameters": {
  121785. // "project": {
  121786. // "description": "Project ID for this request.",
  121787. // "location": "path",
  121788. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121789. // "required": true,
  121790. // "type": "string"
  121791. // },
  121792. // "requestId": {
  121793. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121794. // "location": "query",
  121795. // "type": "string"
  121796. // }
  121797. // },
  121798. // "path": "{project}/global/targetHttpProxies",
  121799. // "request": {
  121800. // "$ref": "TargetHttpProxy"
  121801. // },
  121802. // "response": {
  121803. // "$ref": "Operation"
  121804. // },
  121805. // "scopes": [
  121806. // "https://www.googleapis.com/auth/cloud-platform",
  121807. // "https://www.googleapis.com/auth/compute"
  121808. // ]
  121809. // }
  121810. }
  121811. // method id "compute.targetHttpProxies.list":
  121812. type TargetHttpProxiesListCall struct {
  121813. s *Service
  121814. project string
  121815. urlParams_ gensupport.URLParams
  121816. ifNoneMatch_ string
  121817. ctx_ context.Context
  121818. header_ http.Header
  121819. }
  121820. // List: Retrieves the list of TargetHttpProxy resources available to
  121821. // the specified project.
  121822. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  121823. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  121824. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121825. c.project = project
  121826. return c
  121827. }
  121828. // Filter sets the optional parameter "filter": A filter expression that
  121829. // filters resources listed in the response. The expression must specify
  121830. // the field name, a comparison operator, and the value that you want to
  121831. // use for filtering. The value must be a string, a number, or a
  121832. // boolean. The comparison operator must be either =, !=, >, or <.
  121833. //
  121834. // For example, if you are filtering Compute Engine instances, you can
  121835. // exclude instances named example-instance by specifying name !=
  121836. // example-instance.
  121837. //
  121838. // You can also filter nested fields. For example, you could specify
  121839. // scheduling.automaticRestart = false to include instances only if they
  121840. // are not scheduled for automatic restarts. You can use filtering on
  121841. // nested fields to filter based on resource labels.
  121842. //
  121843. // To filter on multiple expressions, provide each separate expression
  121844. // within parentheses. For example, (scheduling.automaticRestart = true)
  121845. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121846. // AND expression. However, you can include AND and OR expressions
  121847. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121848. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121849. // true).
  121850. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  121851. c.urlParams_.Set("filter", filter)
  121852. return c
  121853. }
  121854. // MaxResults sets the optional parameter "maxResults": The maximum
  121855. // number of results per page that should be returned. If the number of
  121856. // available results is larger than maxResults, Compute Engine returns a
  121857. // nextPageToken that can be used to get the next page of results in
  121858. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121859. // (Default: 500)
  121860. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  121861. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121862. return c
  121863. }
  121864. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121865. // a certain order. By default, results are returned in alphanumerical
  121866. // order based on the resource name.
  121867. //
  121868. // You can also sort results in descending order based on the creation
  121869. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121870. // based on the creationTimestamp field in reverse chronological order
  121871. // (newest result first). Use this to sort resources like operations so
  121872. // that the newest operation is returned first.
  121873. //
  121874. // Currently, only sorting by name or creationTimestamp desc is
  121875. // supported.
  121876. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  121877. c.urlParams_.Set("orderBy", orderBy)
  121878. return c
  121879. }
  121880. // PageToken sets the optional parameter "pageToken": Specifies a page
  121881. // token to use. Set pageToken to the nextPageToken returned by a
  121882. // previous list request to get the next page of results.
  121883. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  121884. c.urlParams_.Set("pageToken", pageToken)
  121885. return c
  121886. }
  121887. // Fields allows partial responses to be retrieved. See
  121888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121889. // for more information.
  121890. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  121891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121892. return c
  121893. }
  121894. // IfNoneMatch sets the optional parameter which makes the operation
  121895. // fail if the object's ETag matches the given value. This is useful for
  121896. // getting updates only after the object has changed since the last
  121897. // request. Use googleapi.IsNotModified to check whether the response
  121898. // error from Do is the result of In-None-Match.
  121899. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  121900. c.ifNoneMatch_ = entityTag
  121901. return c
  121902. }
  121903. // Context sets the context to be used in this call's Do method. Any
  121904. // pending HTTP request will be aborted if the provided context is
  121905. // canceled.
  121906. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  121907. c.ctx_ = ctx
  121908. return c
  121909. }
  121910. // Header returns an http.Header that can be modified by the caller to
  121911. // add HTTP headers to the request.
  121912. func (c *TargetHttpProxiesListCall) Header() http.Header {
  121913. if c.header_ == nil {
  121914. c.header_ = make(http.Header)
  121915. }
  121916. return c.header_
  121917. }
  121918. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  121919. reqHeaders := make(http.Header)
  121920. for k, v := range c.header_ {
  121921. reqHeaders[k] = v
  121922. }
  121923. reqHeaders.Set("User-Agent", c.s.userAgent())
  121924. if c.ifNoneMatch_ != "" {
  121925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121926. }
  121927. var body io.Reader = nil
  121928. c.urlParams_.Set("alt", alt)
  121929. c.urlParams_.Set("prettyPrint", "false")
  121930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  121931. urls += "?" + c.urlParams_.Encode()
  121932. req, err := http.NewRequest("GET", urls, body)
  121933. if err != nil {
  121934. return nil, err
  121935. }
  121936. req.Header = reqHeaders
  121937. googleapi.Expand(req.URL, map[string]string{
  121938. "project": c.project,
  121939. })
  121940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121941. }
  121942. // Do executes the "compute.targetHttpProxies.list" call.
  121943. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  121944. // non-2xx status code is an error. Response headers are in either
  121945. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  121946. // returned at all) in error.(*googleapi.Error).Header. Use
  121947. // googleapi.IsNotModified to check whether the returned error was
  121948. // because http.StatusNotModified was returned.
  121949. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  121950. gensupport.SetOptions(c.urlParams_, opts...)
  121951. res, err := c.doRequest("json")
  121952. if res != nil && res.StatusCode == http.StatusNotModified {
  121953. if res.Body != nil {
  121954. res.Body.Close()
  121955. }
  121956. return nil, &googleapi.Error{
  121957. Code: res.StatusCode,
  121958. Header: res.Header,
  121959. }
  121960. }
  121961. if err != nil {
  121962. return nil, err
  121963. }
  121964. defer googleapi.CloseBody(res)
  121965. if err := googleapi.CheckResponse(res); err != nil {
  121966. return nil, err
  121967. }
  121968. ret := &TargetHttpProxyList{
  121969. ServerResponse: googleapi.ServerResponse{
  121970. Header: res.Header,
  121971. HTTPStatusCode: res.StatusCode,
  121972. },
  121973. }
  121974. target := &ret
  121975. if err := gensupport.DecodeResponse(target, res); err != nil {
  121976. return nil, err
  121977. }
  121978. return ret, nil
  121979. // {
  121980. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  121981. // "httpMethod": "GET",
  121982. // "id": "compute.targetHttpProxies.list",
  121983. // "parameterOrder": [
  121984. // "project"
  121985. // ],
  121986. // "parameters": {
  121987. // "filter": {
  121988. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  121989. // "location": "query",
  121990. // "type": "string"
  121991. // },
  121992. // "maxResults": {
  121993. // "default": "500",
  121994. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  121995. // "format": "uint32",
  121996. // "location": "query",
  121997. // "minimum": "0",
  121998. // "type": "integer"
  121999. // },
  122000. // "orderBy": {
  122001. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  122002. // "location": "query",
  122003. // "type": "string"
  122004. // },
  122005. // "pageToken": {
  122006. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  122007. // "location": "query",
  122008. // "type": "string"
  122009. // },
  122010. // "project": {
  122011. // "description": "Project ID for this request.",
  122012. // "location": "path",
  122013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122014. // "required": true,
  122015. // "type": "string"
  122016. // }
  122017. // },
  122018. // "path": "{project}/global/targetHttpProxies",
  122019. // "response": {
  122020. // "$ref": "TargetHttpProxyList"
  122021. // },
  122022. // "scopes": [
  122023. // "https://www.googleapis.com/auth/cloud-platform",
  122024. // "https://www.googleapis.com/auth/compute",
  122025. // "https://www.googleapis.com/auth/compute.readonly"
  122026. // ]
  122027. // }
  122028. }
  122029. // Pages invokes f for each page of results.
  122030. // A non-nil error returned from f will halt the iteration.
  122031. // The provided context supersedes any context provided to the Context method.
  122032. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  122033. c.ctx_ = ctx
  122034. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122035. for {
  122036. x, err := c.Do()
  122037. if err != nil {
  122038. return err
  122039. }
  122040. if err := f(x); err != nil {
  122041. return err
  122042. }
  122043. if x.NextPageToken == "" {
  122044. return nil
  122045. }
  122046. c.PageToken(x.NextPageToken)
  122047. }
  122048. }
  122049. // method id "compute.targetHttpProxies.setUrlMap":
  122050. type TargetHttpProxiesSetUrlMapCall struct {
  122051. s *Service
  122052. project string
  122053. targetHttpProxy string
  122054. urlmapreference *UrlMapReference
  122055. urlParams_ gensupport.URLParams
  122056. ctx_ context.Context
  122057. header_ http.Header
  122058. }
  122059. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  122060. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  122061. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  122062. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122063. c.project = project
  122064. c.targetHttpProxy = targetHttpProxy
  122065. c.urlmapreference = urlmapreference
  122066. return c
  122067. }
  122068. // RequestId sets the optional parameter "requestId": An optional
  122069. // request ID to identify requests. Specify a unique request ID so that
  122070. // if you must retry your request, the server will know to ignore the
  122071. // request if it has already been completed.
  122072. //
  122073. // For example, consider a situation where you make an initial request
  122074. // and the request times out. If you make the request again with the
  122075. // same request ID, the server can check if original operation with the
  122076. // same request ID was received, and if so, will ignore the second
  122077. // request. This prevents clients from accidentally creating duplicate
  122078. // commitments.
  122079. //
  122080. // The request ID must be a valid UUID with the exception that zero UUID
  122081. // is not supported (00000000-0000-0000-0000-000000000000).
  122082. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  122083. c.urlParams_.Set("requestId", requestId)
  122084. return c
  122085. }
  122086. // Fields allows partial responses to be retrieved. See
  122087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122088. // for more information.
  122089. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  122090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122091. return c
  122092. }
  122093. // Context sets the context to be used in this call's Do method. Any
  122094. // pending HTTP request will be aborted if the provided context is
  122095. // canceled.
  122096. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  122097. c.ctx_ = ctx
  122098. return c
  122099. }
  122100. // Header returns an http.Header that can be modified by the caller to
  122101. // add HTTP headers to the request.
  122102. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  122103. if c.header_ == nil {
  122104. c.header_ = make(http.Header)
  122105. }
  122106. return c.header_
  122107. }
  122108. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  122109. reqHeaders := make(http.Header)
  122110. for k, v := range c.header_ {
  122111. reqHeaders[k] = v
  122112. }
  122113. reqHeaders.Set("User-Agent", c.s.userAgent())
  122114. var body io.Reader = nil
  122115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  122116. if err != nil {
  122117. return nil, err
  122118. }
  122119. reqHeaders.Set("Content-Type", "application/json")
  122120. c.urlParams_.Set("alt", alt)
  122121. c.urlParams_.Set("prettyPrint", "false")
  122122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  122123. urls += "?" + c.urlParams_.Encode()
  122124. req, err := http.NewRequest("POST", urls, body)
  122125. if err != nil {
  122126. return nil, err
  122127. }
  122128. req.Header = reqHeaders
  122129. googleapi.Expand(req.URL, map[string]string{
  122130. "project": c.project,
  122131. "targetHttpProxy": c.targetHttpProxy,
  122132. })
  122133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122134. }
  122135. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  122136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122137. // status code is an error. Response headers are in either
  122138. // *Operation.ServerResponse.Header or (if a response was returned at
  122139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122140. // to check whether the returned error was because
  122141. // http.StatusNotModified was returned.
  122142. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122143. gensupport.SetOptions(c.urlParams_, opts...)
  122144. res, err := c.doRequest("json")
  122145. if res != nil && res.StatusCode == http.StatusNotModified {
  122146. if res.Body != nil {
  122147. res.Body.Close()
  122148. }
  122149. return nil, &googleapi.Error{
  122150. Code: res.StatusCode,
  122151. Header: res.Header,
  122152. }
  122153. }
  122154. if err != nil {
  122155. return nil, err
  122156. }
  122157. defer googleapi.CloseBody(res)
  122158. if err := googleapi.CheckResponse(res); err != nil {
  122159. return nil, err
  122160. }
  122161. ret := &Operation{
  122162. ServerResponse: googleapi.ServerResponse{
  122163. Header: res.Header,
  122164. HTTPStatusCode: res.StatusCode,
  122165. },
  122166. }
  122167. target := &ret
  122168. if err := gensupport.DecodeResponse(target, res); err != nil {
  122169. return nil, err
  122170. }
  122171. return ret, nil
  122172. // {
  122173. // "description": "Changes the URL map for TargetHttpProxy.",
  122174. // "httpMethod": "POST",
  122175. // "id": "compute.targetHttpProxies.setUrlMap",
  122176. // "parameterOrder": [
  122177. // "project",
  122178. // "targetHttpProxy"
  122179. // ],
  122180. // "parameters": {
  122181. // "project": {
  122182. // "description": "Project ID for this request.",
  122183. // "location": "path",
  122184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122185. // "required": true,
  122186. // "type": "string"
  122187. // },
  122188. // "requestId": {
  122189. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  122190. // "location": "query",
  122191. // "type": "string"
  122192. // },
  122193. // "targetHttpProxy": {
  122194. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  122195. // "location": "path",
  122196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122197. // "required": true,
  122198. // "type": "string"
  122199. // }
  122200. // },
  122201. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  122202. // "request": {
  122203. // "$ref": "UrlMapReference"
  122204. // },
  122205. // "response": {
  122206. // "$ref": "Operation"
  122207. // },
  122208. // "scopes": [
  122209. // "https://www.googleapis.com/auth/cloud-platform",
  122210. // "https://www.googleapis.com/auth/compute"
  122211. // ]
  122212. // }
  122213. }
  122214. // method id "compute.targetHttpProxies.testIamPermissions":
  122215. type TargetHttpProxiesTestIamPermissionsCall struct {
  122216. s *Service
  122217. project string
  122218. resource string
  122219. testpermissionsrequest *TestPermissionsRequest
  122220. urlParams_ gensupport.URLParams
  122221. ctx_ context.Context
  122222. header_ http.Header
  122223. }
  122224. // TestIamPermissions: Returns permissions that a caller has on the
  122225. // specified resource.
  122226. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  122227. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122228. c.project = project
  122229. c.resource = resource
  122230. c.testpermissionsrequest = testpermissionsrequest
  122231. return c
  122232. }
  122233. // Fields allows partial responses to be retrieved. See
  122234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122235. // for more information.
  122236. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  122237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122238. return c
  122239. }
  122240. // Context sets the context to be used in this call's Do method. Any
  122241. // pending HTTP request will be aborted if the provided context is
  122242. // canceled.
  122243. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  122244. c.ctx_ = ctx
  122245. return c
  122246. }
  122247. // Header returns an http.Header that can be modified by the caller to
  122248. // add HTTP headers to the request.
  122249. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  122250. if c.header_ == nil {
  122251. c.header_ = make(http.Header)
  122252. }
  122253. return c.header_
  122254. }
  122255. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  122256. reqHeaders := make(http.Header)
  122257. for k, v := range c.header_ {
  122258. reqHeaders[k] = v
  122259. }
  122260. reqHeaders.Set("User-Agent", c.s.userAgent())
  122261. var body io.Reader = nil
  122262. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  122263. if err != nil {
  122264. return nil, err
  122265. }
  122266. reqHeaders.Set("Content-Type", "application/json")
  122267. c.urlParams_.Set("alt", alt)
  122268. c.urlParams_.Set("prettyPrint", "false")
  122269. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  122270. urls += "?" + c.urlParams_.Encode()
  122271. req, err := http.NewRequest("POST", urls, body)
  122272. if err != nil {
  122273. return nil, err
  122274. }
  122275. req.Header = reqHeaders
  122276. googleapi.Expand(req.URL, map[string]string{
  122277. "project": c.project,
  122278. "resource": c.resource,
  122279. })
  122280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122281. }
  122282. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  122283. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  122284. // non-2xx status code is an error. Response headers are in either
  122285. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  122286. // returned at all) in error.(*googleapi.Error).Header. Use
  122287. // googleapi.IsNotModified to check whether the returned error was
  122288. // because http.StatusNotModified was returned.
  122289. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  122290. gensupport.SetOptions(c.urlParams_, opts...)
  122291. res, err := c.doRequest("json")
  122292. if res != nil && res.StatusCode == http.StatusNotModified {
  122293. if res.Body != nil {
  122294. res.Body.Close()
  122295. }
  122296. return nil, &googleapi.Error{
  122297. Code: res.StatusCode,
  122298. Header: res.Header,
  122299. }
  122300. }
  122301. if err != nil {
  122302. return nil, err
  122303. }
  122304. defer googleapi.CloseBody(res)
  122305. if err := googleapi.CheckResponse(res); err != nil {
  122306. return nil, err
  122307. }
  122308. ret := &TestPermissionsResponse{
  122309. ServerResponse: googleapi.ServerResponse{
  122310. Header: res.Header,
  122311. HTTPStatusCode: res.StatusCode,
  122312. },
  122313. }
  122314. target := &ret
  122315. if err := gensupport.DecodeResponse(target, res); err != nil {
  122316. return nil, err
  122317. }
  122318. return ret, nil
  122319. // {
  122320. // "description": "Returns permissions that a caller has on the specified resource.",
  122321. // "httpMethod": "POST",
  122322. // "id": "compute.targetHttpProxies.testIamPermissions",
  122323. // "parameterOrder": [
  122324. // "project",
  122325. // "resource"
  122326. // ],
  122327. // "parameters": {
  122328. // "project": {
  122329. // "description": "Project ID for this request.",
  122330. // "location": "path",
  122331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122332. // "required": true,
  122333. // "type": "string"
  122334. // },
  122335. // "resource": {
  122336. // "description": "Name or id of the resource for this request.",
  122337. // "location": "path",
  122338. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122339. // "required": true,
  122340. // "type": "string"
  122341. // }
  122342. // },
  122343. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  122344. // "request": {
  122345. // "$ref": "TestPermissionsRequest"
  122346. // },
  122347. // "response": {
  122348. // "$ref": "TestPermissionsResponse"
  122349. // },
  122350. // "scopes": [
  122351. // "https://www.googleapis.com/auth/cloud-platform",
  122352. // "https://www.googleapis.com/auth/compute",
  122353. // "https://www.googleapis.com/auth/compute.readonly"
  122354. // ]
  122355. // }
  122356. }
  122357. // method id "compute.targetHttpsProxies.aggregatedList":
  122358. type TargetHttpsProxiesAggregatedListCall struct {
  122359. s *Service
  122360. project string
  122361. urlParams_ gensupport.URLParams
  122362. ifNoneMatch_ string
  122363. ctx_ context.Context
  122364. header_ http.Header
  122365. }
  122366. // AggregatedList: Retrieves the list of all TargetHttpsProxy resources,
  122367. // regional and global, available to the specified project.
  122368. func (r *TargetHttpsProxiesService) AggregatedList(project string) *TargetHttpsProxiesAggregatedListCall {
  122369. c := &TargetHttpsProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122370. c.project = project
  122371. return c
  122372. }
  122373. // Filter sets the optional parameter "filter": A filter expression that
  122374. // filters resources listed in the response. The expression must specify
  122375. // the field name, a comparison operator, and the value that you want to
  122376. // use for filtering. The value must be a string, a number, or a
  122377. // boolean. The comparison operator must be either =, !=, >, or <.
  122378. //
  122379. // For example, if you are filtering Compute Engine instances, you can
  122380. // exclude instances named example-instance by specifying name !=
  122381. // example-instance.
  122382. //
  122383. // You can also filter nested fields. For example, you could specify
  122384. // scheduling.automaticRestart = false to include instances only if they
  122385. // are not scheduled for automatic restarts. You can use filtering on
  122386. // nested fields to filter based on resource labels.
  122387. //
  122388. // To filter on multiple expressions, provide each separate expression
  122389. // within parentheses. For example, (scheduling.automaticRestart = true)
  122390. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122391. // AND expression. However, you can include AND and OR expressions
  122392. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122393. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122394. // true).
  122395. func (c *TargetHttpsProxiesAggregatedListCall) Filter(filter string) *TargetHttpsProxiesAggregatedListCall {
  122396. c.urlParams_.Set("filter", filter)
  122397. return c
  122398. }
  122399. // MaxResults sets the optional parameter "maxResults": The maximum
  122400. // number of results per page that should be returned. If the number of
  122401. // available results is larger than maxResults, Compute Engine returns a
  122402. // nextPageToken that can be used to get the next page of results in
  122403. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122404. // (Default: 500)
  122405. func (c *TargetHttpsProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpsProxiesAggregatedListCall {
  122406. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122407. return c
  122408. }
  122409. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122410. // a certain order. By default, results are returned in alphanumerical
  122411. // order based on the resource name.
  122412. //
  122413. // You can also sort results in descending order based on the creation
  122414. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122415. // based on the creationTimestamp field in reverse chronological order
  122416. // (newest result first). Use this to sort resources like operations so
  122417. // that the newest operation is returned first.
  122418. //
  122419. // Currently, only sorting by name or creationTimestamp desc is
  122420. // supported.
  122421. func (c *TargetHttpsProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpsProxiesAggregatedListCall {
  122422. c.urlParams_.Set("orderBy", orderBy)
  122423. return c
  122424. }
  122425. // PageToken sets the optional parameter "pageToken": Specifies a page
  122426. // token to use. Set pageToken to the nextPageToken returned by a
  122427. // previous list request to get the next page of results.
  122428. func (c *TargetHttpsProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpsProxiesAggregatedListCall {
  122429. c.urlParams_.Set("pageToken", pageToken)
  122430. return c
  122431. }
  122432. // Fields allows partial responses to be retrieved. See
  122433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122434. // for more information.
  122435. func (c *TargetHttpsProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesAggregatedListCall {
  122436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122437. return c
  122438. }
  122439. // IfNoneMatch sets the optional parameter which makes the operation
  122440. // fail if the object's ETag matches the given value. This is useful for
  122441. // getting updates only after the object has changed since the last
  122442. // request. Use googleapi.IsNotModified to check whether the response
  122443. // error from Do is the result of In-None-Match.
  122444. func (c *TargetHttpsProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesAggregatedListCall {
  122445. c.ifNoneMatch_ = entityTag
  122446. return c
  122447. }
  122448. // Context sets the context to be used in this call's Do method. Any
  122449. // pending HTTP request will be aborted if the provided context is
  122450. // canceled.
  122451. func (c *TargetHttpsProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpsProxiesAggregatedListCall {
  122452. c.ctx_ = ctx
  122453. return c
  122454. }
  122455. // Header returns an http.Header that can be modified by the caller to
  122456. // add HTTP headers to the request.
  122457. func (c *TargetHttpsProxiesAggregatedListCall) Header() http.Header {
  122458. if c.header_ == nil {
  122459. c.header_ = make(http.Header)
  122460. }
  122461. return c.header_
  122462. }
  122463. func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  122464. reqHeaders := make(http.Header)
  122465. for k, v := range c.header_ {
  122466. reqHeaders[k] = v
  122467. }
  122468. reqHeaders.Set("User-Agent", c.s.userAgent())
  122469. if c.ifNoneMatch_ != "" {
  122470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122471. }
  122472. var body io.Reader = nil
  122473. c.urlParams_.Set("alt", alt)
  122474. c.urlParams_.Set("prettyPrint", "false")
  122475. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpsProxies")
  122476. urls += "?" + c.urlParams_.Encode()
  122477. req, err := http.NewRequest("GET", urls, body)
  122478. if err != nil {
  122479. return nil, err
  122480. }
  122481. req.Header = reqHeaders
  122482. googleapi.Expand(req.URL, map[string]string{
  122483. "project": c.project,
  122484. })
  122485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122486. }
  122487. // Do executes the "compute.targetHttpsProxies.aggregatedList" call.
  122488. // Exactly one of *TargetHttpsProxyAggregatedList or error will be
  122489. // non-nil. Any non-2xx status code is an error. Response headers are in
  122490. // either *TargetHttpsProxyAggregatedList.ServerResponse.Header or (if a
  122491. // response was returned at all) in error.(*googleapi.Error).Header. Use
  122492. // googleapi.IsNotModified to check whether the returned error was
  122493. // because http.StatusNotModified was returned.
  122494. func (c *TargetHttpsProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyAggregatedList, error) {
  122495. gensupport.SetOptions(c.urlParams_, opts...)
  122496. res, err := c.doRequest("json")
  122497. if res != nil && res.StatusCode == http.StatusNotModified {
  122498. if res.Body != nil {
  122499. res.Body.Close()
  122500. }
  122501. return nil, &googleapi.Error{
  122502. Code: res.StatusCode,
  122503. Header: res.Header,
  122504. }
  122505. }
  122506. if err != nil {
  122507. return nil, err
  122508. }
  122509. defer googleapi.CloseBody(res)
  122510. if err := googleapi.CheckResponse(res); err != nil {
  122511. return nil, err
  122512. }
  122513. ret := &TargetHttpsProxyAggregatedList{
  122514. ServerResponse: googleapi.ServerResponse{
  122515. Header: res.Header,
  122516. HTTPStatusCode: res.StatusCode,
  122517. },
  122518. }
  122519. target := &ret
  122520. if err := gensupport.DecodeResponse(target, res); err != nil {
  122521. return nil, err
  122522. }
  122523. return ret, nil
  122524. // {
  122525. // "description": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.",
  122526. // "httpMethod": "GET",
  122527. // "id": "compute.targetHttpsProxies.aggregatedList",
  122528. // "parameterOrder": [
  122529. // "project"
  122530. // ],
  122531. // "parameters": {
  122532. // "filter": {
  122533. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  122534. // "location": "query",
  122535. // "type": "string"
  122536. // },
  122537. // "maxResults": {
  122538. // "default": "500",
  122539. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  122540. // "format": "uint32",
  122541. // "location": "query",
  122542. // "minimum": "0",
  122543. // "type": "integer"
  122544. // },
  122545. // "orderBy": {
  122546. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  122547. // "location": "query",
  122548. // "type": "string"
  122549. // },
  122550. // "pageToken": {
  122551. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  122552. // "location": "query",
  122553. // "type": "string"
  122554. // },
  122555. // "project": {
  122556. // "description": "Name of the project scoping this request.",
  122557. // "location": "path",
  122558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122559. // "required": true,
  122560. // "type": "string"
  122561. // }
  122562. // },
  122563. // "path": "{project}/aggregated/targetHttpsProxies",
  122564. // "response": {
  122565. // "$ref": "TargetHttpsProxyAggregatedList"
  122566. // },
  122567. // "scopes": [
  122568. // "https://www.googleapis.com/auth/cloud-platform",
  122569. // "https://www.googleapis.com/auth/compute",
  122570. // "https://www.googleapis.com/auth/compute.readonly"
  122571. // ]
  122572. // }
  122573. }
  122574. // Pages invokes f for each page of results.
  122575. // A non-nil error returned from f will halt the iteration.
  122576. // The provided context supersedes any context provided to the Context method.
  122577. func (c *TargetHttpsProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyAggregatedList) error) error {
  122578. c.ctx_ = ctx
  122579. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122580. for {
  122581. x, err := c.Do()
  122582. if err != nil {
  122583. return err
  122584. }
  122585. if err := f(x); err != nil {
  122586. return err
  122587. }
  122588. if x.NextPageToken == "" {
  122589. return nil
  122590. }
  122591. c.PageToken(x.NextPageToken)
  122592. }
  122593. }
  122594. // method id "compute.targetHttpsProxies.delete":
  122595. type TargetHttpsProxiesDeleteCall struct {
  122596. s *Service
  122597. project string
  122598. targetHttpsProxy string
  122599. urlParams_ gensupport.URLParams
  122600. ctx_ context.Context
  122601. header_ http.Header
  122602. }
  122603. // Delete: Deletes the specified TargetHttpsProxy resource.
  122604. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  122605. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122606. c.project = project
  122607. c.targetHttpsProxy = targetHttpsProxy
  122608. return c
  122609. }
  122610. // RequestId sets the optional parameter "requestId": An optional
  122611. // request ID to identify requests. Specify a unique request ID so that
  122612. // if you must retry your request, the server will know to ignore the
  122613. // request if it has already been completed.
  122614. //
  122615. // For example, consider a situation where you make an initial request
  122616. // and the request times out. If you make the request again with the
  122617. // same request ID, the server can check if original operation with the
  122618. // same request ID was received, and if so, will ignore the second
  122619. // request. This prevents clients from accidentally creating duplicate
  122620. // commitments.
  122621. //
  122622. // The request ID must be a valid UUID with the exception that zero UUID
  122623. // is not supported (00000000-0000-0000-0000-000000000000).
  122624. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  122625. c.urlParams_.Set("requestId", requestId)
  122626. return c
  122627. }
  122628. // Fields allows partial responses to be retrieved. See
  122629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122630. // for more information.
  122631. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  122632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122633. return c
  122634. }
  122635. // Context sets the context to be used in this call's Do method. Any
  122636. // pending HTTP request will be aborted if the provided context is
  122637. // canceled.
  122638. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  122639. c.ctx_ = ctx
  122640. return c
  122641. }
  122642. // Header returns an http.Header that can be modified by the caller to
  122643. // add HTTP headers to the request.
  122644. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  122645. if c.header_ == nil {
  122646. c.header_ = make(http.Header)
  122647. }
  122648. return c.header_
  122649. }
  122650. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  122651. reqHeaders := make(http.Header)
  122652. for k, v := range c.header_ {
  122653. reqHeaders[k] = v
  122654. }
  122655. reqHeaders.Set("User-Agent", c.s.userAgent())
  122656. var body io.Reader = nil
  122657. c.urlParams_.Set("alt", alt)
  122658. c.urlParams_.Set("prettyPrint", "false")
  122659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  122660. urls += "?" + c.urlParams_.Encode()
  122661. req, err := http.NewRequest("DELETE", urls, body)
  122662. if err != nil {
  122663. return nil, err
  122664. }
  122665. req.Header = reqHeaders
  122666. googleapi.Expand(req.URL, map[string]string{
  122667. "project": c.project,
  122668. "targetHttpsProxy": c.targetHttpsProxy,
  122669. })
  122670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122671. }
  122672. // Do executes the "compute.targetHttpsProxies.delete" call.
  122673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122674. // status code is an error. Response headers are in either
  122675. // *Operation.ServerResponse.Header or (if a response was returned at
  122676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122677. // to check whether the returned error was because
  122678. // http.StatusNotModified was returned.
  122679. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122680. gensupport.SetOptions(c.urlParams_, opts...)
  122681. res, err := c.doRequest("json")
  122682. if res != nil && res.StatusCode == http.StatusNotModified {
  122683. if res.Body != nil {
  122684. res.Body.Close()
  122685. }
  122686. return nil, &googleapi.Error{
  122687. Code: res.StatusCode,
  122688. Header: res.Header,
  122689. }
  122690. }
  122691. if err != nil {
  122692. return nil, err
  122693. }
  122694. defer googleapi.CloseBody(res)
  122695. if err := googleapi.CheckResponse(res); err != nil {
  122696. return nil, err
  122697. }
  122698. ret := &Operation{
  122699. ServerResponse: googleapi.ServerResponse{
  122700. Header: res.Header,
  122701. HTTPStatusCode: res.StatusCode,
  122702. },
  122703. }
  122704. target := &ret
  122705. if err := gensupport.DecodeResponse(target, res); err != nil {
  122706. return nil, err
  122707. }
  122708. return ret, nil
  122709. // {
  122710. // "description": "Deletes the specified TargetHttpsProxy resource.",
  122711. // "httpMethod": "DELETE",
  122712. // "id": "compute.targetHttpsProxies.delete",
  122713. // "parameterOrder": [
  122714. // "project",
  122715. // "targetHttpsProxy"
  122716. // ],
  122717. // "parameters": {
  122718. // "project": {
  122719. // "description": "Project ID for this request.",
  122720. // "location": "path",
  122721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122722. // "required": true,
  122723. // "type": "string"
  122724. // },
  122725. // "requestId": {
  122726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  122727. // "location": "query",
  122728. // "type": "string"
  122729. // },
  122730. // "targetHttpsProxy": {
  122731. // "description": "Name of the TargetHttpsProxy resource to delete.",
  122732. // "location": "path",
  122733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122734. // "required": true,
  122735. // "type": "string"
  122736. // }
  122737. // },
  122738. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  122739. // "response": {
  122740. // "$ref": "Operation"
  122741. // },
  122742. // "scopes": [
  122743. // "https://www.googleapis.com/auth/cloud-platform",
  122744. // "https://www.googleapis.com/auth/compute"
  122745. // ]
  122746. // }
  122747. }
  122748. // method id "compute.targetHttpsProxies.get":
  122749. type TargetHttpsProxiesGetCall struct {
  122750. s *Service
  122751. project string
  122752. targetHttpsProxy string
  122753. urlParams_ gensupport.URLParams
  122754. ifNoneMatch_ string
  122755. ctx_ context.Context
  122756. header_ http.Header
  122757. }
  122758. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  122759. // available target HTTPS proxies by making a list() request.
  122760. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  122761. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122762. c.project = project
  122763. c.targetHttpsProxy = targetHttpsProxy
  122764. return c
  122765. }
  122766. // Fields allows partial responses to be retrieved. See
  122767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122768. // for more information.
  122769. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  122770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122771. return c
  122772. }
  122773. // IfNoneMatch sets the optional parameter which makes the operation
  122774. // fail if the object's ETag matches the given value. This is useful for
  122775. // getting updates only after the object has changed since the last
  122776. // request. Use googleapi.IsNotModified to check whether the response
  122777. // error from Do is the result of In-None-Match.
  122778. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  122779. c.ifNoneMatch_ = entityTag
  122780. return c
  122781. }
  122782. // Context sets the context to be used in this call's Do method. Any
  122783. // pending HTTP request will be aborted if the provided context is
  122784. // canceled.
  122785. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  122786. c.ctx_ = ctx
  122787. return c
  122788. }
  122789. // Header returns an http.Header that can be modified by the caller to
  122790. // add HTTP headers to the request.
  122791. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  122792. if c.header_ == nil {
  122793. c.header_ = make(http.Header)
  122794. }
  122795. return c.header_
  122796. }
  122797. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  122798. reqHeaders := make(http.Header)
  122799. for k, v := range c.header_ {
  122800. reqHeaders[k] = v
  122801. }
  122802. reqHeaders.Set("User-Agent", c.s.userAgent())
  122803. if c.ifNoneMatch_ != "" {
  122804. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122805. }
  122806. var body io.Reader = nil
  122807. c.urlParams_.Set("alt", alt)
  122808. c.urlParams_.Set("prettyPrint", "false")
  122809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  122810. urls += "?" + c.urlParams_.Encode()
  122811. req, err := http.NewRequest("GET", urls, body)
  122812. if err != nil {
  122813. return nil, err
  122814. }
  122815. req.Header = reqHeaders
  122816. googleapi.Expand(req.URL, map[string]string{
  122817. "project": c.project,
  122818. "targetHttpsProxy": c.targetHttpsProxy,
  122819. })
  122820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122821. }
  122822. // Do executes the "compute.targetHttpsProxies.get" call.
  122823. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  122824. // non-2xx status code is an error. Response headers are in either
  122825. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  122826. // returned at all) in error.(*googleapi.Error).Header. Use
  122827. // googleapi.IsNotModified to check whether the returned error was
  122828. // because http.StatusNotModified was returned.
  122829. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  122830. gensupport.SetOptions(c.urlParams_, opts...)
  122831. res, err := c.doRequest("json")
  122832. if res != nil && res.StatusCode == http.StatusNotModified {
  122833. if res.Body != nil {
  122834. res.Body.Close()
  122835. }
  122836. return nil, &googleapi.Error{
  122837. Code: res.StatusCode,
  122838. Header: res.Header,
  122839. }
  122840. }
  122841. if err != nil {
  122842. return nil, err
  122843. }
  122844. defer googleapi.CloseBody(res)
  122845. if err := googleapi.CheckResponse(res); err != nil {
  122846. return nil, err
  122847. }
  122848. ret := &TargetHttpsProxy{
  122849. ServerResponse: googleapi.ServerResponse{
  122850. Header: res.Header,
  122851. HTTPStatusCode: res.StatusCode,
  122852. },
  122853. }
  122854. target := &ret
  122855. if err := gensupport.DecodeResponse(target, res); err != nil {
  122856. return nil, err
  122857. }
  122858. return ret, nil
  122859. // {
  122860. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  122861. // "httpMethod": "GET",
  122862. // "id": "compute.targetHttpsProxies.get",
  122863. // "parameterOrder": [
  122864. // "project",
  122865. // "targetHttpsProxy"
  122866. // ],
  122867. // "parameters": {
  122868. // "project": {
  122869. // "description": "Project ID for this request.",
  122870. // "location": "path",
  122871. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122872. // "required": true,
  122873. // "type": "string"
  122874. // },
  122875. // "targetHttpsProxy": {
  122876. // "description": "Name of the TargetHttpsProxy resource to return.",
  122877. // "location": "path",
  122878. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122879. // "required": true,
  122880. // "type": "string"
  122881. // }
  122882. // },
  122883. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  122884. // "response": {
  122885. // "$ref": "TargetHttpsProxy"
  122886. // },
  122887. // "scopes": [
  122888. // "https://www.googleapis.com/auth/cloud-platform",
  122889. // "https://www.googleapis.com/auth/compute",
  122890. // "https://www.googleapis.com/auth/compute.readonly"
  122891. // ]
  122892. // }
  122893. }
  122894. // method id "compute.targetHttpsProxies.insert":
  122895. type TargetHttpsProxiesInsertCall struct {
  122896. s *Service
  122897. project string
  122898. targethttpsproxy *TargetHttpsProxy
  122899. urlParams_ gensupport.URLParams
  122900. ctx_ context.Context
  122901. header_ http.Header
  122902. }
  122903. // Insert: Creates a TargetHttpsProxy resource in the specified project
  122904. // using the data included in the request.
  122905. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  122906. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122907. c.project = project
  122908. c.targethttpsproxy = targethttpsproxy
  122909. return c
  122910. }
  122911. // RequestId sets the optional parameter "requestId": An optional
  122912. // request ID to identify requests. Specify a unique request ID so that
  122913. // if you must retry your request, the server will know to ignore the
  122914. // request if it has already been completed.
  122915. //
  122916. // For example, consider a situation where you make an initial request
  122917. // and the request times out. If you make the request again with the
  122918. // same request ID, the server can check if original operation with the
  122919. // same request ID was received, and if so, will ignore the second
  122920. // request. This prevents clients from accidentally creating duplicate
  122921. // commitments.
  122922. //
  122923. // The request ID must be a valid UUID with the exception that zero UUID
  122924. // is not supported (00000000-0000-0000-0000-000000000000).
  122925. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  122926. c.urlParams_.Set("requestId", requestId)
  122927. return c
  122928. }
  122929. // Fields allows partial responses to be retrieved. See
  122930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122931. // for more information.
  122932. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  122933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122934. return c
  122935. }
  122936. // Context sets the context to be used in this call's Do method. Any
  122937. // pending HTTP request will be aborted if the provided context is
  122938. // canceled.
  122939. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  122940. c.ctx_ = ctx
  122941. return c
  122942. }
  122943. // Header returns an http.Header that can be modified by the caller to
  122944. // add HTTP headers to the request.
  122945. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  122946. if c.header_ == nil {
  122947. c.header_ = make(http.Header)
  122948. }
  122949. return c.header_
  122950. }
  122951. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  122952. reqHeaders := make(http.Header)
  122953. for k, v := range c.header_ {
  122954. reqHeaders[k] = v
  122955. }
  122956. reqHeaders.Set("User-Agent", c.s.userAgent())
  122957. var body io.Reader = nil
  122958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  122959. if err != nil {
  122960. return nil, err
  122961. }
  122962. reqHeaders.Set("Content-Type", "application/json")
  122963. c.urlParams_.Set("alt", alt)
  122964. c.urlParams_.Set("prettyPrint", "false")
  122965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  122966. urls += "?" + c.urlParams_.Encode()
  122967. req, err := http.NewRequest("POST", urls, body)
  122968. if err != nil {
  122969. return nil, err
  122970. }
  122971. req.Header = reqHeaders
  122972. googleapi.Expand(req.URL, map[string]string{
  122973. "project": c.project,
  122974. })
  122975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122976. }
  122977. // Do executes the "compute.targetHttpsProxies.insert" call.
  122978. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122979. // status code is an error. Response headers are in either
  122980. // *Operation.ServerResponse.Header or (if a response was returned at
  122981. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122982. // to check whether the returned error was because
  122983. // http.StatusNotModified was returned.
  122984. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122985. gensupport.SetOptions(c.urlParams_, opts...)
  122986. res, err := c.doRequest("json")
  122987. if res != nil && res.StatusCode == http.StatusNotModified {
  122988. if res.Body != nil {
  122989. res.Body.Close()
  122990. }
  122991. return nil, &googleapi.Error{
  122992. Code: res.StatusCode,
  122993. Header: res.Header,
  122994. }
  122995. }
  122996. if err != nil {
  122997. return nil, err
  122998. }
  122999. defer googleapi.CloseBody(res)
  123000. if err := googleapi.CheckResponse(res); err != nil {
  123001. return nil, err
  123002. }
  123003. ret := &Operation{
  123004. ServerResponse: googleapi.ServerResponse{
  123005. Header: res.Header,
  123006. HTTPStatusCode: res.StatusCode,
  123007. },
  123008. }
  123009. target := &ret
  123010. if err := gensupport.DecodeResponse(target, res); err != nil {
  123011. return nil, err
  123012. }
  123013. return ret, nil
  123014. // {
  123015. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  123016. // "httpMethod": "POST",
  123017. // "id": "compute.targetHttpsProxies.insert",
  123018. // "parameterOrder": [
  123019. // "project"
  123020. // ],
  123021. // "parameters": {
  123022. // "project": {
  123023. // "description": "Project ID for this request.",
  123024. // "location": "path",
  123025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123026. // "required": true,
  123027. // "type": "string"
  123028. // },
  123029. // "requestId": {
  123030. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123031. // "location": "query",
  123032. // "type": "string"
  123033. // }
  123034. // },
  123035. // "path": "{project}/global/targetHttpsProxies",
  123036. // "request": {
  123037. // "$ref": "TargetHttpsProxy"
  123038. // },
  123039. // "response": {
  123040. // "$ref": "Operation"
  123041. // },
  123042. // "scopes": [
  123043. // "https://www.googleapis.com/auth/cloud-platform",
  123044. // "https://www.googleapis.com/auth/compute"
  123045. // ]
  123046. // }
  123047. }
  123048. // method id "compute.targetHttpsProxies.list":
  123049. type TargetHttpsProxiesListCall struct {
  123050. s *Service
  123051. project string
  123052. urlParams_ gensupport.URLParams
  123053. ifNoneMatch_ string
  123054. ctx_ context.Context
  123055. header_ http.Header
  123056. }
  123057. // List: Retrieves the list of TargetHttpsProxy resources available to
  123058. // the specified project.
  123059. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  123060. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123061. c.project = project
  123062. return c
  123063. }
  123064. // Filter sets the optional parameter "filter": A filter expression that
  123065. // filters resources listed in the response. The expression must specify
  123066. // the field name, a comparison operator, and the value that you want to
  123067. // use for filtering. The value must be a string, a number, or a
  123068. // boolean. The comparison operator must be either =, !=, >, or <.
  123069. //
  123070. // For example, if you are filtering Compute Engine instances, you can
  123071. // exclude instances named example-instance by specifying name !=
  123072. // example-instance.
  123073. //
  123074. // You can also filter nested fields. For example, you could specify
  123075. // scheduling.automaticRestart = false to include instances only if they
  123076. // are not scheduled for automatic restarts. You can use filtering on
  123077. // nested fields to filter based on resource labels.
  123078. //
  123079. // To filter on multiple expressions, provide each separate expression
  123080. // within parentheses. For example, (scheduling.automaticRestart = true)
  123081. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  123082. // AND expression. However, you can include AND and OR expressions
  123083. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  123084. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  123085. // true).
  123086. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  123087. c.urlParams_.Set("filter", filter)
  123088. return c
  123089. }
  123090. // MaxResults sets the optional parameter "maxResults": The maximum
  123091. // number of results per page that should be returned. If the number of
  123092. // available results is larger than maxResults, Compute Engine returns a
  123093. // nextPageToken that can be used to get the next page of results in
  123094. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  123095. // (Default: 500)
  123096. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  123097. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  123098. return c
  123099. }
  123100. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  123101. // a certain order. By default, results are returned in alphanumerical
  123102. // order based on the resource name.
  123103. //
  123104. // You can also sort results in descending order based on the creation
  123105. // timestamp using orderBy="creationTimestamp desc". This sorts results
  123106. // based on the creationTimestamp field in reverse chronological order
  123107. // (newest result first). Use this to sort resources like operations so
  123108. // that the newest operation is returned first.
  123109. //
  123110. // Currently, only sorting by name or creationTimestamp desc is
  123111. // supported.
  123112. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  123113. c.urlParams_.Set("orderBy", orderBy)
  123114. return c
  123115. }
  123116. // PageToken sets the optional parameter "pageToken": Specifies a page
  123117. // token to use. Set pageToken to the nextPageToken returned by a
  123118. // previous list request to get the next page of results.
  123119. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  123120. c.urlParams_.Set("pageToken", pageToken)
  123121. return c
  123122. }
  123123. // Fields allows partial responses to be retrieved. See
  123124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123125. // for more information.
  123126. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  123127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123128. return c
  123129. }
  123130. // IfNoneMatch sets the optional parameter which makes the operation
  123131. // fail if the object's ETag matches the given value. This is useful for
  123132. // getting updates only after the object has changed since the last
  123133. // request. Use googleapi.IsNotModified to check whether the response
  123134. // error from Do is the result of In-None-Match.
  123135. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  123136. c.ifNoneMatch_ = entityTag
  123137. return c
  123138. }
  123139. // Context sets the context to be used in this call's Do method. Any
  123140. // pending HTTP request will be aborted if the provided context is
  123141. // canceled.
  123142. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  123143. c.ctx_ = ctx
  123144. return c
  123145. }
  123146. // Header returns an http.Header that can be modified by the caller to
  123147. // add HTTP headers to the request.
  123148. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  123149. if c.header_ == nil {
  123150. c.header_ = make(http.Header)
  123151. }
  123152. return c.header_
  123153. }
  123154. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  123155. reqHeaders := make(http.Header)
  123156. for k, v := range c.header_ {
  123157. reqHeaders[k] = v
  123158. }
  123159. reqHeaders.Set("User-Agent", c.s.userAgent())
  123160. if c.ifNoneMatch_ != "" {
  123161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  123162. }
  123163. var body io.Reader = nil
  123164. c.urlParams_.Set("alt", alt)
  123165. c.urlParams_.Set("prettyPrint", "false")
  123166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  123167. urls += "?" + c.urlParams_.Encode()
  123168. req, err := http.NewRequest("GET", urls, body)
  123169. if err != nil {
  123170. return nil, err
  123171. }
  123172. req.Header = reqHeaders
  123173. googleapi.Expand(req.URL, map[string]string{
  123174. "project": c.project,
  123175. })
  123176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123177. }
  123178. // Do executes the "compute.targetHttpsProxies.list" call.
  123179. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  123180. // non-2xx status code is an error. Response headers are in either
  123181. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  123182. // returned at all) in error.(*googleapi.Error).Header. Use
  123183. // googleapi.IsNotModified to check whether the returned error was
  123184. // because http.StatusNotModified was returned.
  123185. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  123186. gensupport.SetOptions(c.urlParams_, opts...)
  123187. res, err := c.doRequest("json")
  123188. if res != nil && res.StatusCode == http.StatusNotModified {
  123189. if res.Body != nil {
  123190. res.Body.Close()
  123191. }
  123192. return nil, &googleapi.Error{
  123193. Code: res.StatusCode,
  123194. Header: res.Header,
  123195. }
  123196. }
  123197. if err != nil {
  123198. return nil, err
  123199. }
  123200. defer googleapi.CloseBody(res)
  123201. if err := googleapi.CheckResponse(res); err != nil {
  123202. return nil, err
  123203. }
  123204. ret := &TargetHttpsProxyList{
  123205. ServerResponse: googleapi.ServerResponse{
  123206. Header: res.Header,
  123207. HTTPStatusCode: res.StatusCode,
  123208. },
  123209. }
  123210. target := &ret
  123211. if err := gensupport.DecodeResponse(target, res); err != nil {
  123212. return nil, err
  123213. }
  123214. return ret, nil
  123215. // {
  123216. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  123217. // "httpMethod": "GET",
  123218. // "id": "compute.targetHttpsProxies.list",
  123219. // "parameterOrder": [
  123220. // "project"
  123221. // ],
  123222. // "parameters": {
  123223. // "filter": {
  123224. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  123225. // "location": "query",
  123226. // "type": "string"
  123227. // },
  123228. // "maxResults": {
  123229. // "default": "500",
  123230. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  123231. // "format": "uint32",
  123232. // "location": "query",
  123233. // "minimum": "0",
  123234. // "type": "integer"
  123235. // },
  123236. // "orderBy": {
  123237. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  123238. // "location": "query",
  123239. // "type": "string"
  123240. // },
  123241. // "pageToken": {
  123242. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  123243. // "location": "query",
  123244. // "type": "string"
  123245. // },
  123246. // "project": {
  123247. // "description": "Project ID for this request.",
  123248. // "location": "path",
  123249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123250. // "required": true,
  123251. // "type": "string"
  123252. // }
  123253. // },
  123254. // "path": "{project}/global/targetHttpsProxies",
  123255. // "response": {
  123256. // "$ref": "TargetHttpsProxyList"
  123257. // },
  123258. // "scopes": [
  123259. // "https://www.googleapis.com/auth/cloud-platform",
  123260. // "https://www.googleapis.com/auth/compute",
  123261. // "https://www.googleapis.com/auth/compute.readonly"
  123262. // ]
  123263. // }
  123264. }
  123265. // Pages invokes f for each page of results.
  123266. // A non-nil error returned from f will halt the iteration.
  123267. // The provided context supersedes any context provided to the Context method.
  123268. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  123269. c.ctx_ = ctx
  123270. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  123271. for {
  123272. x, err := c.Do()
  123273. if err != nil {
  123274. return err
  123275. }
  123276. if err := f(x); err != nil {
  123277. return err
  123278. }
  123279. if x.NextPageToken == "" {
  123280. return nil
  123281. }
  123282. c.PageToken(x.NextPageToken)
  123283. }
  123284. }
  123285. // method id "compute.targetHttpsProxies.setQuicOverride":
  123286. type TargetHttpsProxiesSetQuicOverrideCall struct {
  123287. s *Service
  123288. project string
  123289. targetHttpsProxy string
  123290. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  123291. urlParams_ gensupport.URLParams
  123292. ctx_ context.Context
  123293. header_ http.Header
  123294. }
  123295. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  123296. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  123297. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123298. c.project = project
  123299. c.targetHttpsProxy = targetHttpsProxy
  123300. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  123301. return c
  123302. }
  123303. // RequestId sets the optional parameter "requestId": An optional
  123304. // request ID to identify requests. Specify a unique request ID so that
  123305. // if you must retry your request, the server will know to ignore the
  123306. // request if it has already been completed.
  123307. //
  123308. // For example, consider a situation where you make an initial request
  123309. // and the request times out. If you make the request again with the
  123310. // same request ID, the server can check if original operation with the
  123311. // same request ID was received, and if so, will ignore the second
  123312. // request. This prevents clients from accidentally creating duplicate
  123313. // commitments.
  123314. //
  123315. // The request ID must be a valid UUID with the exception that zero UUID
  123316. // is not supported (00000000-0000-0000-0000-000000000000).
  123317. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  123318. c.urlParams_.Set("requestId", requestId)
  123319. return c
  123320. }
  123321. // Fields allows partial responses to be retrieved. See
  123322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123323. // for more information.
  123324. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  123325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123326. return c
  123327. }
  123328. // Context sets the context to be used in this call's Do method. Any
  123329. // pending HTTP request will be aborted if the provided context is
  123330. // canceled.
  123331. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  123332. c.ctx_ = ctx
  123333. return c
  123334. }
  123335. // Header returns an http.Header that can be modified by the caller to
  123336. // add HTTP headers to the request.
  123337. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  123338. if c.header_ == nil {
  123339. c.header_ = make(http.Header)
  123340. }
  123341. return c.header_
  123342. }
  123343. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  123344. reqHeaders := make(http.Header)
  123345. for k, v := range c.header_ {
  123346. reqHeaders[k] = v
  123347. }
  123348. reqHeaders.Set("User-Agent", c.s.userAgent())
  123349. var body io.Reader = nil
  123350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  123351. if err != nil {
  123352. return nil, err
  123353. }
  123354. reqHeaders.Set("Content-Type", "application/json")
  123355. c.urlParams_.Set("alt", alt)
  123356. c.urlParams_.Set("prettyPrint", "false")
  123357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  123358. urls += "?" + c.urlParams_.Encode()
  123359. req, err := http.NewRequest("POST", urls, body)
  123360. if err != nil {
  123361. return nil, err
  123362. }
  123363. req.Header = reqHeaders
  123364. googleapi.Expand(req.URL, map[string]string{
  123365. "project": c.project,
  123366. "targetHttpsProxy": c.targetHttpsProxy,
  123367. })
  123368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123369. }
  123370. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  123371. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123372. // status code is an error. Response headers are in either
  123373. // *Operation.ServerResponse.Header or (if a response was returned at
  123374. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123375. // to check whether the returned error was because
  123376. // http.StatusNotModified was returned.
  123377. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123378. gensupport.SetOptions(c.urlParams_, opts...)
  123379. res, err := c.doRequest("json")
  123380. if res != nil && res.StatusCode == http.StatusNotModified {
  123381. if res.Body != nil {
  123382. res.Body.Close()
  123383. }
  123384. return nil, &googleapi.Error{
  123385. Code: res.StatusCode,
  123386. Header: res.Header,
  123387. }
  123388. }
  123389. if err != nil {
  123390. return nil, err
  123391. }
  123392. defer googleapi.CloseBody(res)
  123393. if err := googleapi.CheckResponse(res); err != nil {
  123394. return nil, err
  123395. }
  123396. ret := &Operation{
  123397. ServerResponse: googleapi.ServerResponse{
  123398. Header: res.Header,
  123399. HTTPStatusCode: res.StatusCode,
  123400. },
  123401. }
  123402. target := &ret
  123403. if err := gensupport.DecodeResponse(target, res); err != nil {
  123404. return nil, err
  123405. }
  123406. return ret, nil
  123407. // {
  123408. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  123409. // "httpMethod": "POST",
  123410. // "id": "compute.targetHttpsProxies.setQuicOverride",
  123411. // "parameterOrder": [
  123412. // "project",
  123413. // "targetHttpsProxy"
  123414. // ],
  123415. // "parameters": {
  123416. // "project": {
  123417. // "description": "Project ID for this request.",
  123418. // "location": "path",
  123419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123420. // "required": true,
  123421. // "type": "string"
  123422. // },
  123423. // "requestId": {
  123424. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123425. // "location": "query",
  123426. // "type": "string"
  123427. // },
  123428. // "targetHttpsProxy": {
  123429. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  123430. // "location": "path",
  123431. // "required": true,
  123432. // "type": "string"
  123433. // }
  123434. // },
  123435. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  123436. // "request": {
  123437. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  123438. // },
  123439. // "response": {
  123440. // "$ref": "Operation"
  123441. // },
  123442. // "scopes": [
  123443. // "https://www.googleapis.com/auth/cloud-platform",
  123444. // "https://www.googleapis.com/auth/compute"
  123445. // ]
  123446. // }
  123447. }
  123448. // method id "compute.targetHttpsProxies.setSslCertificates":
  123449. type TargetHttpsProxiesSetSslCertificatesCall struct {
  123450. s *Service
  123451. project string
  123452. targetHttpsProxy string
  123453. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  123454. urlParams_ gensupport.URLParams
  123455. ctx_ context.Context
  123456. header_ http.Header
  123457. }
  123458. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  123459. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  123460. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123461. c.project = project
  123462. c.targetHttpsProxy = targetHttpsProxy
  123463. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  123464. return c
  123465. }
  123466. // RequestId sets the optional parameter "requestId": An optional
  123467. // request ID to identify requests. Specify a unique request ID so that
  123468. // if you must retry your request, the server will know to ignore the
  123469. // request if it has already been completed.
  123470. //
  123471. // For example, consider a situation where you make an initial request
  123472. // and the request times out. If you make the request again with the
  123473. // same request ID, the server can check if original operation with the
  123474. // same request ID was received, and if so, will ignore the second
  123475. // request. This prevents clients from accidentally creating duplicate
  123476. // commitments.
  123477. //
  123478. // The request ID must be a valid UUID with the exception that zero UUID
  123479. // is not supported (00000000-0000-0000-0000-000000000000).
  123480. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  123481. c.urlParams_.Set("requestId", requestId)
  123482. return c
  123483. }
  123484. // Fields allows partial responses to be retrieved. See
  123485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123486. // for more information.
  123487. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  123488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123489. return c
  123490. }
  123491. // Context sets the context to be used in this call's Do method. Any
  123492. // pending HTTP request will be aborted if the provided context is
  123493. // canceled.
  123494. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  123495. c.ctx_ = ctx
  123496. return c
  123497. }
  123498. // Header returns an http.Header that can be modified by the caller to
  123499. // add HTTP headers to the request.
  123500. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  123501. if c.header_ == nil {
  123502. c.header_ = make(http.Header)
  123503. }
  123504. return c.header_
  123505. }
  123506. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  123507. reqHeaders := make(http.Header)
  123508. for k, v := range c.header_ {
  123509. reqHeaders[k] = v
  123510. }
  123511. reqHeaders.Set("User-Agent", c.s.userAgent())
  123512. var body io.Reader = nil
  123513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  123514. if err != nil {
  123515. return nil, err
  123516. }
  123517. reqHeaders.Set("Content-Type", "application/json")
  123518. c.urlParams_.Set("alt", alt)
  123519. c.urlParams_.Set("prettyPrint", "false")
  123520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  123521. urls += "?" + c.urlParams_.Encode()
  123522. req, err := http.NewRequest("POST", urls, body)
  123523. if err != nil {
  123524. return nil, err
  123525. }
  123526. req.Header = reqHeaders
  123527. googleapi.Expand(req.URL, map[string]string{
  123528. "project": c.project,
  123529. "targetHttpsProxy": c.targetHttpsProxy,
  123530. })
  123531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123532. }
  123533. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  123534. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123535. // status code is an error. Response headers are in either
  123536. // *Operation.ServerResponse.Header or (if a response was returned at
  123537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123538. // to check whether the returned error was because
  123539. // http.StatusNotModified was returned.
  123540. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123541. gensupport.SetOptions(c.urlParams_, opts...)
  123542. res, err := c.doRequest("json")
  123543. if res != nil && res.StatusCode == http.StatusNotModified {
  123544. if res.Body != nil {
  123545. res.Body.Close()
  123546. }
  123547. return nil, &googleapi.Error{
  123548. Code: res.StatusCode,
  123549. Header: res.Header,
  123550. }
  123551. }
  123552. if err != nil {
  123553. return nil, err
  123554. }
  123555. defer googleapi.CloseBody(res)
  123556. if err := googleapi.CheckResponse(res); err != nil {
  123557. return nil, err
  123558. }
  123559. ret := &Operation{
  123560. ServerResponse: googleapi.ServerResponse{
  123561. Header: res.Header,
  123562. HTTPStatusCode: res.StatusCode,
  123563. },
  123564. }
  123565. target := &ret
  123566. if err := gensupport.DecodeResponse(target, res); err != nil {
  123567. return nil, err
  123568. }
  123569. return ret, nil
  123570. // {
  123571. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  123572. // "httpMethod": "POST",
  123573. // "id": "compute.targetHttpsProxies.setSslCertificates",
  123574. // "parameterOrder": [
  123575. // "project",
  123576. // "targetHttpsProxy"
  123577. // ],
  123578. // "parameters": {
  123579. // "project": {
  123580. // "description": "Project ID for this request.",
  123581. // "location": "path",
  123582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123583. // "required": true,
  123584. // "type": "string"
  123585. // },
  123586. // "requestId": {
  123587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123588. // "location": "query",
  123589. // "type": "string"
  123590. // },
  123591. // "targetHttpsProxy": {
  123592. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  123593. // "location": "path",
  123594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123595. // "required": true,
  123596. // "type": "string"
  123597. // }
  123598. // },
  123599. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  123600. // "request": {
  123601. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  123602. // },
  123603. // "response": {
  123604. // "$ref": "Operation"
  123605. // },
  123606. // "scopes": [
  123607. // "https://www.googleapis.com/auth/cloud-platform",
  123608. // "https://www.googleapis.com/auth/compute"
  123609. // ]
  123610. // }
  123611. }
  123612. // method id "compute.targetHttpsProxies.setSslPolicy":
  123613. type TargetHttpsProxiesSetSslPolicyCall struct {
  123614. s *Service
  123615. project string
  123616. targetHttpsProxy string
  123617. sslpolicyreference *SslPolicyReference
  123618. urlParams_ gensupport.URLParams
  123619. ctx_ context.Context
  123620. header_ http.Header
  123621. }
  123622. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  123623. // policy specifies the server-side support for SSL features. This
  123624. // affects connections between clients and the HTTPS proxy load
  123625. // balancer. They do not affect the connection between the load balancer
  123626. // and the backends.
  123627. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  123628. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123629. c.project = project
  123630. c.targetHttpsProxy = targetHttpsProxy
  123631. c.sslpolicyreference = sslpolicyreference
  123632. return c
  123633. }
  123634. // RequestId sets the optional parameter "requestId": An optional
  123635. // request ID to identify requests. Specify a unique request ID so that
  123636. // if you must retry your request, the server will know to ignore the
  123637. // request if it has already been completed.
  123638. //
  123639. // For example, consider a situation where you make an initial request
  123640. // and the request times out. If you make the request again with the
  123641. // same request ID, the server can check if original operation with the
  123642. // same request ID was received, and if so, will ignore the second
  123643. // request. This prevents clients from accidentally creating duplicate
  123644. // commitments.
  123645. //
  123646. // The request ID must be a valid UUID with the exception that zero UUID
  123647. // is not supported (00000000-0000-0000-0000-000000000000).
  123648. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  123649. c.urlParams_.Set("requestId", requestId)
  123650. return c
  123651. }
  123652. // Fields allows partial responses to be retrieved. See
  123653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123654. // for more information.
  123655. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  123656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123657. return c
  123658. }
  123659. // Context sets the context to be used in this call's Do method. Any
  123660. // pending HTTP request will be aborted if the provided context is
  123661. // canceled.
  123662. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  123663. c.ctx_ = ctx
  123664. return c
  123665. }
  123666. // Header returns an http.Header that can be modified by the caller to
  123667. // add HTTP headers to the request.
  123668. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  123669. if c.header_ == nil {
  123670. c.header_ = make(http.Header)
  123671. }
  123672. return c.header_
  123673. }
  123674. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  123675. reqHeaders := make(http.Header)
  123676. for k, v := range c.header_ {
  123677. reqHeaders[k] = v
  123678. }
  123679. reqHeaders.Set("User-Agent", c.s.userAgent())
  123680. var body io.Reader = nil
  123681. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  123682. if err != nil {
  123683. return nil, err
  123684. }
  123685. reqHeaders.Set("Content-Type", "application/json")
  123686. c.urlParams_.Set("alt", alt)
  123687. c.urlParams_.Set("prettyPrint", "false")
  123688. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  123689. urls += "?" + c.urlParams_.Encode()
  123690. req, err := http.NewRequest("POST", urls, body)
  123691. if err != nil {
  123692. return nil, err
  123693. }
  123694. req.Header = reqHeaders
  123695. googleapi.Expand(req.URL, map[string]string{
  123696. "project": c.project,
  123697. "targetHttpsProxy": c.targetHttpsProxy,
  123698. })
  123699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123700. }
  123701. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  123702. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123703. // status code is an error. Response headers are in either
  123704. // *Operation.ServerResponse.Header or (if a response was returned at
  123705. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123706. // to check whether the returned error was because
  123707. // http.StatusNotModified was returned.
  123708. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123709. gensupport.SetOptions(c.urlParams_, opts...)
  123710. res, err := c.doRequest("json")
  123711. if res != nil && res.StatusCode == http.StatusNotModified {
  123712. if res.Body != nil {
  123713. res.Body.Close()
  123714. }
  123715. return nil, &googleapi.Error{
  123716. Code: res.StatusCode,
  123717. Header: res.Header,
  123718. }
  123719. }
  123720. if err != nil {
  123721. return nil, err
  123722. }
  123723. defer googleapi.CloseBody(res)
  123724. if err := googleapi.CheckResponse(res); err != nil {
  123725. return nil, err
  123726. }
  123727. ret := &Operation{
  123728. ServerResponse: googleapi.ServerResponse{
  123729. Header: res.Header,
  123730. HTTPStatusCode: res.StatusCode,
  123731. },
  123732. }
  123733. target := &ret
  123734. if err := gensupport.DecodeResponse(target, res); err != nil {
  123735. return nil, err
  123736. }
  123737. return ret, nil
  123738. // {
  123739. // "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.",
  123740. // "httpMethod": "POST",
  123741. // "id": "compute.targetHttpsProxies.setSslPolicy",
  123742. // "parameterOrder": [
  123743. // "project",
  123744. // "targetHttpsProxy"
  123745. // ],
  123746. // "parameters": {
  123747. // "project": {
  123748. // "description": "Project ID for this request.",
  123749. // "location": "path",
  123750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123751. // "required": true,
  123752. // "type": "string"
  123753. // },
  123754. // "requestId": {
  123755. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123756. // "location": "query",
  123757. // "type": "string"
  123758. // },
  123759. // "targetHttpsProxy": {
  123760. // "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.",
  123761. // "location": "path",
  123762. // "required": true,
  123763. // "type": "string"
  123764. // }
  123765. // },
  123766. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  123767. // "request": {
  123768. // "$ref": "SslPolicyReference"
  123769. // },
  123770. // "response": {
  123771. // "$ref": "Operation"
  123772. // },
  123773. // "scopes": [
  123774. // "https://www.googleapis.com/auth/cloud-platform",
  123775. // "https://www.googleapis.com/auth/compute"
  123776. // ]
  123777. // }
  123778. }
  123779. // method id "compute.targetHttpsProxies.setUrlMap":
  123780. type TargetHttpsProxiesSetUrlMapCall struct {
  123781. s *Service
  123782. project string
  123783. targetHttpsProxy string
  123784. urlmapreference *UrlMapReference
  123785. urlParams_ gensupport.URLParams
  123786. ctx_ context.Context
  123787. header_ http.Header
  123788. }
  123789. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  123790. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  123791. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123792. c.project = project
  123793. c.targetHttpsProxy = targetHttpsProxy
  123794. c.urlmapreference = urlmapreference
  123795. return c
  123796. }
  123797. // RequestId sets the optional parameter "requestId": An optional
  123798. // request ID to identify requests. Specify a unique request ID so that
  123799. // if you must retry your request, the server will know to ignore the
  123800. // request if it has already been completed.
  123801. //
  123802. // For example, consider a situation where you make an initial request
  123803. // and the request times out. If you make the request again with the
  123804. // same request ID, the server can check if original operation with the
  123805. // same request ID was received, and if so, will ignore the second
  123806. // request. This prevents clients from accidentally creating duplicate
  123807. // commitments.
  123808. //
  123809. // The request ID must be a valid UUID with the exception that zero UUID
  123810. // is not supported (00000000-0000-0000-0000-000000000000).
  123811. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  123812. c.urlParams_.Set("requestId", requestId)
  123813. return c
  123814. }
  123815. // Fields allows partial responses to be retrieved. See
  123816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123817. // for more information.
  123818. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  123819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123820. return c
  123821. }
  123822. // Context sets the context to be used in this call's Do method. Any
  123823. // pending HTTP request will be aborted if the provided context is
  123824. // canceled.
  123825. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  123826. c.ctx_ = ctx
  123827. return c
  123828. }
  123829. // Header returns an http.Header that can be modified by the caller to
  123830. // add HTTP headers to the request.
  123831. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  123832. if c.header_ == nil {
  123833. c.header_ = make(http.Header)
  123834. }
  123835. return c.header_
  123836. }
  123837. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  123838. reqHeaders := make(http.Header)
  123839. for k, v := range c.header_ {
  123840. reqHeaders[k] = v
  123841. }
  123842. reqHeaders.Set("User-Agent", c.s.userAgent())
  123843. var body io.Reader = nil
  123844. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  123845. if err != nil {
  123846. return nil, err
  123847. }
  123848. reqHeaders.Set("Content-Type", "application/json")
  123849. c.urlParams_.Set("alt", alt)
  123850. c.urlParams_.Set("prettyPrint", "false")
  123851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  123852. urls += "?" + c.urlParams_.Encode()
  123853. req, err := http.NewRequest("POST", urls, body)
  123854. if err != nil {
  123855. return nil, err
  123856. }
  123857. req.Header = reqHeaders
  123858. googleapi.Expand(req.URL, map[string]string{
  123859. "project": c.project,
  123860. "targetHttpsProxy": c.targetHttpsProxy,
  123861. })
  123862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123863. }
  123864. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  123865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123866. // status code is an error. Response headers are in either
  123867. // *Operation.ServerResponse.Header or (if a response was returned at
  123868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123869. // to check whether the returned error was because
  123870. // http.StatusNotModified was returned.
  123871. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123872. gensupport.SetOptions(c.urlParams_, opts...)
  123873. res, err := c.doRequest("json")
  123874. if res != nil && res.StatusCode == http.StatusNotModified {
  123875. if res.Body != nil {
  123876. res.Body.Close()
  123877. }
  123878. return nil, &googleapi.Error{
  123879. Code: res.StatusCode,
  123880. Header: res.Header,
  123881. }
  123882. }
  123883. if err != nil {
  123884. return nil, err
  123885. }
  123886. defer googleapi.CloseBody(res)
  123887. if err := googleapi.CheckResponse(res); err != nil {
  123888. return nil, err
  123889. }
  123890. ret := &Operation{
  123891. ServerResponse: googleapi.ServerResponse{
  123892. Header: res.Header,
  123893. HTTPStatusCode: res.StatusCode,
  123894. },
  123895. }
  123896. target := &ret
  123897. if err := gensupport.DecodeResponse(target, res); err != nil {
  123898. return nil, err
  123899. }
  123900. return ret, nil
  123901. // {
  123902. // "description": "Changes the URL map for TargetHttpsProxy.",
  123903. // "httpMethod": "POST",
  123904. // "id": "compute.targetHttpsProxies.setUrlMap",
  123905. // "parameterOrder": [
  123906. // "project",
  123907. // "targetHttpsProxy"
  123908. // ],
  123909. // "parameters": {
  123910. // "project": {
  123911. // "description": "Project ID for this request.",
  123912. // "location": "path",
  123913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123914. // "required": true,
  123915. // "type": "string"
  123916. // },
  123917. // "requestId": {
  123918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123919. // "location": "query",
  123920. // "type": "string"
  123921. // },
  123922. // "targetHttpsProxy": {
  123923. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  123924. // "location": "path",
  123925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  123926. // "required": true,
  123927. // "type": "string"
  123928. // }
  123929. // },
  123930. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  123931. // "request": {
  123932. // "$ref": "UrlMapReference"
  123933. // },
  123934. // "response": {
  123935. // "$ref": "Operation"
  123936. // },
  123937. // "scopes": [
  123938. // "https://www.googleapis.com/auth/cloud-platform",
  123939. // "https://www.googleapis.com/auth/compute"
  123940. // ]
  123941. // }
  123942. }
  123943. // method id "compute.targetHttpsProxies.testIamPermissions":
  123944. type TargetHttpsProxiesTestIamPermissionsCall struct {
  123945. s *Service
  123946. project string
  123947. resource string
  123948. testpermissionsrequest *TestPermissionsRequest
  123949. urlParams_ gensupport.URLParams
  123950. ctx_ context.Context
  123951. header_ http.Header
  123952. }
  123953. // TestIamPermissions: Returns permissions that a caller has on the
  123954. // specified resource.
  123955. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  123956. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123957. c.project = project
  123958. c.resource = resource
  123959. c.testpermissionsrequest = testpermissionsrequest
  123960. return c
  123961. }
  123962. // Fields allows partial responses to be retrieved. See
  123963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123964. // for more information.
  123965. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  123966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123967. return c
  123968. }
  123969. // Context sets the context to be used in this call's Do method. Any
  123970. // pending HTTP request will be aborted if the provided context is
  123971. // canceled.
  123972. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  123973. c.ctx_ = ctx
  123974. return c
  123975. }
  123976. // Header returns an http.Header that can be modified by the caller to
  123977. // add HTTP headers to the request.
  123978. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  123979. if c.header_ == nil {
  123980. c.header_ = make(http.Header)
  123981. }
  123982. return c.header_
  123983. }
  123984. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  123985. reqHeaders := make(http.Header)
  123986. for k, v := range c.header_ {
  123987. reqHeaders[k] = v
  123988. }
  123989. reqHeaders.Set("User-Agent", c.s.userAgent())
  123990. var body io.Reader = nil
  123991. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  123992. if err != nil {
  123993. return nil, err
  123994. }
  123995. reqHeaders.Set("Content-Type", "application/json")
  123996. c.urlParams_.Set("alt", alt)
  123997. c.urlParams_.Set("prettyPrint", "false")
  123998. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  123999. urls += "?" + c.urlParams_.Encode()
  124000. req, err := http.NewRequest("POST", urls, body)
  124001. if err != nil {
  124002. return nil, err
  124003. }
  124004. req.Header = reqHeaders
  124005. googleapi.Expand(req.URL, map[string]string{
  124006. "project": c.project,
  124007. "resource": c.resource,
  124008. })
  124009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124010. }
  124011. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  124012. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  124013. // non-2xx status code is an error. Response headers are in either
  124014. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  124015. // returned at all) in error.(*googleapi.Error).Header. Use
  124016. // googleapi.IsNotModified to check whether the returned error was
  124017. // because http.StatusNotModified was returned.
  124018. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  124019. gensupport.SetOptions(c.urlParams_, opts...)
  124020. res, err := c.doRequest("json")
  124021. if res != nil && res.StatusCode == http.StatusNotModified {
  124022. if res.Body != nil {
  124023. res.Body.Close()
  124024. }
  124025. return nil, &googleapi.Error{
  124026. Code: res.StatusCode,
  124027. Header: res.Header,
  124028. }
  124029. }
  124030. if err != nil {
  124031. return nil, err
  124032. }
  124033. defer googleapi.CloseBody(res)
  124034. if err := googleapi.CheckResponse(res); err != nil {
  124035. return nil, err
  124036. }
  124037. ret := &TestPermissionsResponse{
  124038. ServerResponse: googleapi.ServerResponse{
  124039. Header: res.Header,
  124040. HTTPStatusCode: res.StatusCode,
  124041. },
  124042. }
  124043. target := &ret
  124044. if err := gensupport.DecodeResponse(target, res); err != nil {
  124045. return nil, err
  124046. }
  124047. return ret, nil
  124048. // {
  124049. // "description": "Returns permissions that a caller has on the specified resource.",
  124050. // "httpMethod": "POST",
  124051. // "id": "compute.targetHttpsProxies.testIamPermissions",
  124052. // "parameterOrder": [
  124053. // "project",
  124054. // "resource"
  124055. // ],
  124056. // "parameters": {
  124057. // "project": {
  124058. // "description": "Project ID for this request.",
  124059. // "location": "path",
  124060. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124061. // "required": true,
  124062. // "type": "string"
  124063. // },
  124064. // "resource": {
  124065. // "description": "Name or id of the resource for this request.",
  124066. // "location": "path",
  124067. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124068. // "required": true,
  124069. // "type": "string"
  124070. // }
  124071. // },
  124072. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  124073. // "request": {
  124074. // "$ref": "TestPermissionsRequest"
  124075. // },
  124076. // "response": {
  124077. // "$ref": "TestPermissionsResponse"
  124078. // },
  124079. // "scopes": [
  124080. // "https://www.googleapis.com/auth/cloud-platform",
  124081. // "https://www.googleapis.com/auth/compute",
  124082. // "https://www.googleapis.com/auth/compute.readonly"
  124083. // ]
  124084. // }
  124085. }
  124086. // method id "compute.targetInstances.aggregatedList":
  124087. type TargetInstancesAggregatedListCall struct {
  124088. s *Service
  124089. project string
  124090. urlParams_ gensupport.URLParams
  124091. ifNoneMatch_ string
  124092. ctx_ context.Context
  124093. header_ http.Header
  124094. }
  124095. // AggregatedList: Retrieves an aggregated list of target instances.
  124096. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  124097. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  124098. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124099. c.project = project
  124100. return c
  124101. }
  124102. // Filter sets the optional parameter "filter": A filter expression that
  124103. // filters resources listed in the response. The expression must specify
  124104. // the field name, a comparison operator, and the value that you want to
  124105. // use for filtering. The value must be a string, a number, or a
  124106. // boolean. The comparison operator must be either =, !=, >, or <.
  124107. //
  124108. // For example, if you are filtering Compute Engine instances, you can
  124109. // exclude instances named example-instance by specifying name !=
  124110. // example-instance.
  124111. //
  124112. // You can also filter nested fields. For example, you could specify
  124113. // scheduling.automaticRestart = false to include instances only if they
  124114. // are not scheduled for automatic restarts. You can use filtering on
  124115. // nested fields to filter based on resource labels.
  124116. //
  124117. // To filter on multiple expressions, provide each separate expression
  124118. // within parentheses. For example, (scheduling.automaticRestart = true)
  124119. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  124120. // AND expression. However, you can include AND and OR expressions
  124121. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  124122. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  124123. // true).
  124124. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  124125. c.urlParams_.Set("filter", filter)
  124126. return c
  124127. }
  124128. // MaxResults sets the optional parameter "maxResults": The maximum
  124129. // number of results per page that should be returned. If the number of
  124130. // available results is larger than maxResults, Compute Engine returns a
  124131. // nextPageToken that can be used to get the next page of results in
  124132. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  124133. // (Default: 500)
  124134. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  124135. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  124136. return c
  124137. }
  124138. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  124139. // a certain order. By default, results are returned in alphanumerical
  124140. // order based on the resource name.
  124141. //
  124142. // You can also sort results in descending order based on the creation
  124143. // timestamp using orderBy="creationTimestamp desc". This sorts results
  124144. // based on the creationTimestamp field in reverse chronological order
  124145. // (newest result first). Use this to sort resources like operations so
  124146. // that the newest operation is returned first.
  124147. //
  124148. // Currently, only sorting by name or creationTimestamp desc is
  124149. // supported.
  124150. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  124151. c.urlParams_.Set("orderBy", orderBy)
  124152. return c
  124153. }
  124154. // PageToken sets the optional parameter "pageToken": Specifies a page
  124155. // token to use. Set pageToken to the nextPageToken returned by a
  124156. // previous list request to get the next page of results.
  124157. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  124158. c.urlParams_.Set("pageToken", pageToken)
  124159. return c
  124160. }
  124161. // Fields allows partial responses to be retrieved. See
  124162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124163. // for more information.
  124164. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  124165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124166. return c
  124167. }
  124168. // IfNoneMatch sets the optional parameter which makes the operation
  124169. // fail if the object's ETag matches the given value. This is useful for
  124170. // getting updates only after the object has changed since the last
  124171. // request. Use googleapi.IsNotModified to check whether the response
  124172. // error from Do is the result of In-None-Match.
  124173. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  124174. c.ifNoneMatch_ = entityTag
  124175. return c
  124176. }
  124177. // Context sets the context to be used in this call's Do method. Any
  124178. // pending HTTP request will be aborted if the provided context is
  124179. // canceled.
  124180. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  124181. c.ctx_ = ctx
  124182. return c
  124183. }
  124184. // Header returns an http.Header that can be modified by the caller to
  124185. // add HTTP headers to the request.
  124186. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  124187. if c.header_ == nil {
  124188. c.header_ = make(http.Header)
  124189. }
  124190. return c.header_
  124191. }
  124192. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  124193. reqHeaders := make(http.Header)
  124194. for k, v := range c.header_ {
  124195. reqHeaders[k] = v
  124196. }
  124197. reqHeaders.Set("User-Agent", c.s.userAgent())
  124198. if c.ifNoneMatch_ != "" {
  124199. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124200. }
  124201. var body io.Reader = nil
  124202. c.urlParams_.Set("alt", alt)
  124203. c.urlParams_.Set("prettyPrint", "false")
  124204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  124205. urls += "?" + c.urlParams_.Encode()
  124206. req, err := http.NewRequest("GET", urls, body)
  124207. if err != nil {
  124208. return nil, err
  124209. }
  124210. req.Header = reqHeaders
  124211. googleapi.Expand(req.URL, map[string]string{
  124212. "project": c.project,
  124213. })
  124214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124215. }
  124216. // Do executes the "compute.targetInstances.aggregatedList" call.
  124217. // Exactly one of *TargetInstanceAggregatedList or error will be
  124218. // non-nil. Any non-2xx status code is an error. Response headers are in
  124219. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  124220. // response was returned at all) in error.(*googleapi.Error).Header. Use
  124221. // googleapi.IsNotModified to check whether the returned error was
  124222. // because http.StatusNotModified was returned.
  124223. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  124224. gensupport.SetOptions(c.urlParams_, opts...)
  124225. res, err := c.doRequest("json")
  124226. if res != nil && res.StatusCode == http.StatusNotModified {
  124227. if res.Body != nil {
  124228. res.Body.Close()
  124229. }
  124230. return nil, &googleapi.Error{
  124231. Code: res.StatusCode,
  124232. Header: res.Header,
  124233. }
  124234. }
  124235. if err != nil {
  124236. return nil, err
  124237. }
  124238. defer googleapi.CloseBody(res)
  124239. if err := googleapi.CheckResponse(res); err != nil {
  124240. return nil, err
  124241. }
  124242. ret := &TargetInstanceAggregatedList{
  124243. ServerResponse: googleapi.ServerResponse{
  124244. Header: res.Header,
  124245. HTTPStatusCode: res.StatusCode,
  124246. },
  124247. }
  124248. target := &ret
  124249. if err := gensupport.DecodeResponse(target, res); err != nil {
  124250. return nil, err
  124251. }
  124252. return ret, nil
  124253. // {
  124254. // "description": "Retrieves an aggregated list of target instances.",
  124255. // "httpMethod": "GET",
  124256. // "id": "compute.targetInstances.aggregatedList",
  124257. // "parameterOrder": [
  124258. // "project"
  124259. // ],
  124260. // "parameters": {
  124261. // "filter": {
  124262. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  124263. // "location": "query",
  124264. // "type": "string"
  124265. // },
  124266. // "maxResults": {
  124267. // "default": "500",
  124268. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  124269. // "format": "uint32",
  124270. // "location": "query",
  124271. // "minimum": "0",
  124272. // "type": "integer"
  124273. // },
  124274. // "orderBy": {
  124275. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  124276. // "location": "query",
  124277. // "type": "string"
  124278. // },
  124279. // "pageToken": {
  124280. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  124281. // "location": "query",
  124282. // "type": "string"
  124283. // },
  124284. // "project": {
  124285. // "description": "Project ID for this request.",
  124286. // "location": "path",
  124287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124288. // "required": true,
  124289. // "type": "string"
  124290. // }
  124291. // },
  124292. // "path": "{project}/aggregated/targetInstances",
  124293. // "response": {
  124294. // "$ref": "TargetInstanceAggregatedList"
  124295. // },
  124296. // "scopes": [
  124297. // "https://www.googleapis.com/auth/cloud-platform",
  124298. // "https://www.googleapis.com/auth/compute",
  124299. // "https://www.googleapis.com/auth/compute.readonly"
  124300. // ]
  124301. // }
  124302. }
  124303. // Pages invokes f for each page of results.
  124304. // A non-nil error returned from f will halt the iteration.
  124305. // The provided context supersedes any context provided to the Context method.
  124306. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  124307. c.ctx_ = ctx
  124308. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  124309. for {
  124310. x, err := c.Do()
  124311. if err != nil {
  124312. return err
  124313. }
  124314. if err := f(x); err != nil {
  124315. return err
  124316. }
  124317. if x.NextPageToken == "" {
  124318. return nil
  124319. }
  124320. c.PageToken(x.NextPageToken)
  124321. }
  124322. }
  124323. // method id "compute.targetInstances.delete":
  124324. type TargetInstancesDeleteCall struct {
  124325. s *Service
  124326. project string
  124327. zone string
  124328. targetInstance string
  124329. urlParams_ gensupport.URLParams
  124330. ctx_ context.Context
  124331. header_ http.Header
  124332. }
  124333. // Delete: Deletes the specified TargetInstance resource.
  124334. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  124335. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  124336. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124337. c.project = project
  124338. c.zone = zone
  124339. c.targetInstance = targetInstance
  124340. return c
  124341. }
  124342. // RequestId sets the optional parameter "requestId": An optional
  124343. // request ID to identify requests. Specify a unique request ID so that
  124344. // if you must retry your request, the server will know to ignore the
  124345. // request if it has already been completed.
  124346. //
  124347. // For example, consider a situation where you make an initial request
  124348. // and the request times out. If you make the request again with the
  124349. // same request ID, the server can check if original operation with the
  124350. // same request ID was received, and if so, will ignore the second
  124351. // request. This prevents clients from accidentally creating duplicate
  124352. // commitments.
  124353. //
  124354. // The request ID must be a valid UUID with the exception that zero UUID
  124355. // is not supported (00000000-0000-0000-0000-000000000000).
  124356. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  124357. c.urlParams_.Set("requestId", requestId)
  124358. return c
  124359. }
  124360. // Fields allows partial responses to be retrieved. See
  124361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124362. // for more information.
  124363. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  124364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124365. return c
  124366. }
  124367. // Context sets the context to be used in this call's Do method. Any
  124368. // pending HTTP request will be aborted if the provided context is
  124369. // canceled.
  124370. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  124371. c.ctx_ = ctx
  124372. return c
  124373. }
  124374. // Header returns an http.Header that can be modified by the caller to
  124375. // add HTTP headers to the request.
  124376. func (c *TargetInstancesDeleteCall) Header() http.Header {
  124377. if c.header_ == nil {
  124378. c.header_ = make(http.Header)
  124379. }
  124380. return c.header_
  124381. }
  124382. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  124383. reqHeaders := make(http.Header)
  124384. for k, v := range c.header_ {
  124385. reqHeaders[k] = v
  124386. }
  124387. reqHeaders.Set("User-Agent", c.s.userAgent())
  124388. var body io.Reader = nil
  124389. c.urlParams_.Set("alt", alt)
  124390. c.urlParams_.Set("prettyPrint", "false")
  124391. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  124392. urls += "?" + c.urlParams_.Encode()
  124393. req, err := http.NewRequest("DELETE", urls, body)
  124394. if err != nil {
  124395. return nil, err
  124396. }
  124397. req.Header = reqHeaders
  124398. googleapi.Expand(req.URL, map[string]string{
  124399. "project": c.project,
  124400. "zone": c.zone,
  124401. "targetInstance": c.targetInstance,
  124402. })
  124403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124404. }
  124405. // Do executes the "compute.targetInstances.delete" call.
  124406. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124407. // status code is an error. Response headers are in either
  124408. // *Operation.ServerResponse.Header or (if a response was returned at
  124409. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124410. // to check whether the returned error was because
  124411. // http.StatusNotModified was returned.
  124412. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124413. gensupport.SetOptions(c.urlParams_, opts...)
  124414. res, err := c.doRequest("json")
  124415. if res != nil && res.StatusCode == http.StatusNotModified {
  124416. if res.Body != nil {
  124417. res.Body.Close()
  124418. }
  124419. return nil, &googleapi.Error{
  124420. Code: res.StatusCode,
  124421. Header: res.Header,
  124422. }
  124423. }
  124424. if err != nil {
  124425. return nil, err
  124426. }
  124427. defer googleapi.CloseBody(res)
  124428. if err := googleapi.CheckResponse(res); err != nil {
  124429. return nil, err
  124430. }
  124431. ret := &Operation{
  124432. ServerResponse: googleapi.ServerResponse{
  124433. Header: res.Header,
  124434. HTTPStatusCode: res.StatusCode,
  124435. },
  124436. }
  124437. target := &ret
  124438. if err := gensupport.DecodeResponse(target, res); err != nil {
  124439. return nil, err
  124440. }
  124441. return ret, nil
  124442. // {
  124443. // "description": "Deletes the specified TargetInstance resource.",
  124444. // "httpMethod": "DELETE",
  124445. // "id": "compute.targetInstances.delete",
  124446. // "parameterOrder": [
  124447. // "project",
  124448. // "zone",
  124449. // "targetInstance"
  124450. // ],
  124451. // "parameters": {
  124452. // "project": {
  124453. // "description": "Project ID for this request.",
  124454. // "location": "path",
  124455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124456. // "required": true,
  124457. // "type": "string"
  124458. // },
  124459. // "requestId": {
  124460. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  124461. // "location": "query",
  124462. // "type": "string"
  124463. // },
  124464. // "targetInstance": {
  124465. // "description": "Name of the TargetInstance resource to delete.",
  124466. // "location": "path",
  124467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  124468. // "required": true,
  124469. // "type": "string"
  124470. // },
  124471. // "zone": {
  124472. // "description": "Name of the zone scoping this request.",
  124473. // "location": "path",
  124474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  124475. // "required": true,
  124476. // "type": "string"
  124477. // }
  124478. // },
  124479. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  124480. // "response": {
  124481. // "$ref": "Operation"
  124482. // },
  124483. // "scopes": [
  124484. // "https://www.googleapis.com/auth/cloud-platform",
  124485. // "https://www.googleapis.com/auth/compute"
  124486. // ]
  124487. // }
  124488. }
  124489. // method id "compute.targetInstances.get":
  124490. type TargetInstancesGetCall struct {
  124491. s *Service
  124492. project string
  124493. zone string
  124494. targetInstance string
  124495. urlParams_ gensupport.URLParams
  124496. ifNoneMatch_ string
  124497. ctx_ context.Context
  124498. header_ http.Header
  124499. }
  124500. // Get: Returns the specified TargetInstance resource. Gets a list of
  124501. // available target instances by making a list() request.
  124502. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  124503. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  124504. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124505. c.project = project
  124506. c.zone = zone
  124507. c.targetInstance = targetInstance
  124508. return c
  124509. }
  124510. // Fields allows partial responses to be retrieved. See
  124511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124512. // for more information.
  124513. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  124514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124515. return c
  124516. }
  124517. // IfNoneMatch sets the optional parameter which makes the operation
  124518. // fail if the object's ETag matches the given value. This is useful for
  124519. // getting updates only after the object has changed since the last
  124520. // request. Use googleapi.IsNotModified to check whether the response
  124521. // error from Do is the result of In-None-Match.
  124522. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  124523. c.ifNoneMatch_ = entityTag
  124524. return c
  124525. }
  124526. // Context sets the context to be used in this call's Do method. Any
  124527. // pending HTTP request will be aborted if the provided context is
  124528. // canceled.
  124529. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  124530. c.ctx_ = ctx
  124531. return c
  124532. }
  124533. // Header returns an http.Header that can be modified by the caller to
  124534. // add HTTP headers to the request.
  124535. func (c *TargetInstancesGetCall) Header() http.Header {
  124536. if c.header_ == nil {
  124537. c.header_ = make(http.Header)
  124538. }
  124539. return c.header_
  124540. }
  124541. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  124542. reqHeaders := make(http.Header)
  124543. for k, v := range c.header_ {
  124544. reqHeaders[k] = v
  124545. }
  124546. reqHeaders.Set("User-Agent", c.s.userAgent())
  124547. if c.ifNoneMatch_ != "" {
  124548. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124549. }
  124550. var body io.Reader = nil
  124551. c.urlParams_.Set("alt", alt)
  124552. c.urlParams_.Set("prettyPrint", "false")
  124553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  124554. urls += "?" + c.urlParams_.Encode()
  124555. req, err := http.NewRequest("GET", urls, body)
  124556. if err != nil {
  124557. return nil, err
  124558. }
  124559. req.Header = reqHeaders
  124560. googleapi.Expand(req.URL, map[string]string{
  124561. "project": c.project,
  124562. "zone": c.zone,
  124563. "targetInstance": c.targetInstance,
  124564. })
  124565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124566. }
  124567. // Do executes the "compute.targetInstances.get" call.
  124568. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  124569. // status code is an error. Response headers are in either
  124570. // *TargetInstance.ServerResponse.Header or (if a response was returned
  124571. // at all) in error.(*googleapi.Error).Header. Use
  124572. // googleapi.IsNotModified to check whether the returned error was
  124573. // because http.StatusNotModified was returned.
  124574. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  124575. gensupport.SetOptions(c.urlParams_, opts...)
  124576. res, err := c.doRequest("json")
  124577. if res != nil && res.StatusCode == http.StatusNotModified {
  124578. if res.Body != nil {
  124579. res.Body.Close()
  124580. }
  124581. return nil, &googleapi.Error{
  124582. Code: res.StatusCode,
  124583. Header: res.Header,
  124584. }
  124585. }
  124586. if err != nil {
  124587. return nil, err
  124588. }
  124589. defer googleapi.CloseBody(res)
  124590. if err := googleapi.CheckResponse(res); err != nil {
  124591. return nil, err
  124592. }
  124593. ret := &TargetInstance{
  124594. ServerResponse: googleapi.ServerResponse{
  124595. Header: res.Header,
  124596. HTTPStatusCode: res.StatusCode,
  124597. },
  124598. }
  124599. target := &ret
  124600. if err := gensupport.DecodeResponse(target, res); err != nil {
  124601. return nil, err
  124602. }
  124603. return ret, nil
  124604. // {
  124605. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  124606. // "httpMethod": "GET",
  124607. // "id": "compute.targetInstances.get",
  124608. // "parameterOrder": [
  124609. // "project",
  124610. // "zone",
  124611. // "targetInstance"
  124612. // ],
  124613. // "parameters": {
  124614. // "project": {
  124615. // "description": "Project ID for this request.",
  124616. // "location": "path",
  124617. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124618. // "required": true,
  124619. // "type": "string"
  124620. // },
  124621. // "targetInstance": {
  124622. // "description": "Name of the TargetInstance resource to return.",
  124623. // "location": "path",
  124624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  124625. // "required": true,
  124626. // "type": "string"
  124627. // },
  124628. // "zone": {
  124629. // "description": "Name of the zone scoping this request.",
  124630. // "location": "path",
  124631. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  124632. // "required": true,
  124633. // "type": "string"
  124634. // }
  124635. // },
  124636. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  124637. // "response": {
  124638. // "$ref": "TargetInstance"
  124639. // },
  124640. // "scopes": [
  124641. // "https://www.googleapis.com/auth/cloud-platform",
  124642. // "https://www.googleapis.com/auth/compute",
  124643. // "https://www.googleapis.com/auth/compute.readonly"
  124644. // ]
  124645. // }
  124646. }
  124647. // method id "compute.targetInstances.insert":
  124648. type TargetInstancesInsertCall struct {
  124649. s *Service
  124650. project string
  124651. zone string
  124652. targetinstance *TargetInstance
  124653. urlParams_ gensupport.URLParams
  124654. ctx_ context.Context
  124655. header_ http.Header
  124656. }
  124657. // Insert: Creates a TargetInstance resource in the specified project
  124658. // and zone using the data included in the request.
  124659. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  124660. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  124661. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124662. c.project = project
  124663. c.zone = zone
  124664. c.targetinstance = targetinstance
  124665. return c
  124666. }
  124667. // RequestId sets the optional parameter "requestId": An optional
  124668. // request ID to identify requests. Specify a unique request ID so that
  124669. // if you must retry your request, the server will know to ignore the
  124670. // request if it has already been completed.
  124671. //
  124672. // For example, consider a situation where you make an initial request
  124673. // and the request times out. If you make the request again with the
  124674. // same request ID, the server can check if original operation with the
  124675. // same request ID was received, and if so, will ignore the second
  124676. // request. This prevents clients from accidentally creating duplicate
  124677. // commitments.
  124678. //
  124679. // The request ID must be a valid UUID with the exception that zero UUID
  124680. // is not supported (00000000-0000-0000-0000-000000000000).
  124681. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  124682. c.urlParams_.Set("requestId", requestId)
  124683. return c
  124684. }
  124685. // Fields allows partial responses to be retrieved. See
  124686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124687. // for more information.
  124688. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  124689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124690. return c
  124691. }
  124692. // Context sets the context to be used in this call's Do method. Any
  124693. // pending HTTP request will be aborted if the provided context is
  124694. // canceled.
  124695. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  124696. c.ctx_ = ctx
  124697. return c
  124698. }
  124699. // Header returns an http.Header that can be modified by the caller to
  124700. // add HTTP headers to the request.
  124701. func (c *TargetInstancesInsertCall) Header() http.Header {
  124702. if c.header_ == nil {
  124703. c.header_ = make(http.Header)
  124704. }
  124705. return c.header_
  124706. }
  124707. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  124708. reqHeaders := make(http.Header)
  124709. for k, v := range c.header_ {
  124710. reqHeaders[k] = v
  124711. }
  124712. reqHeaders.Set("User-Agent", c.s.userAgent())
  124713. var body io.Reader = nil
  124714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  124715. if err != nil {
  124716. return nil, err
  124717. }
  124718. reqHeaders.Set("Content-Type", "application/json")
  124719. c.urlParams_.Set("alt", alt)
  124720. c.urlParams_.Set("prettyPrint", "false")
  124721. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  124722. urls += "?" + c.urlParams_.Encode()
  124723. req, err := http.NewRequest("POST", urls, body)
  124724. if err != nil {
  124725. return nil, err
  124726. }
  124727. req.Header = reqHeaders
  124728. googleapi.Expand(req.URL, map[string]string{
  124729. "project": c.project,
  124730. "zone": c.zone,
  124731. })
  124732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124733. }
  124734. // Do executes the "compute.targetInstances.insert" call.
  124735. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124736. // status code is an error. Response headers are in either
  124737. // *Operation.ServerResponse.Header or (if a response was returned at
  124738. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124739. // to check whether the returned error was because
  124740. // http.StatusNotModified was returned.
  124741. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124742. gensupport.SetOptions(c.urlParams_, opts...)
  124743. res, err := c.doRequest("json")
  124744. if res != nil && res.StatusCode == http.StatusNotModified {
  124745. if res.Body != nil {
  124746. res.Body.Close()
  124747. }
  124748. return nil, &googleapi.Error{
  124749. Code: res.StatusCode,
  124750. Header: res.Header,
  124751. }
  124752. }
  124753. if err != nil {
  124754. return nil, err
  124755. }
  124756. defer googleapi.CloseBody(res)
  124757. if err := googleapi.CheckResponse(res); err != nil {
  124758. return nil, err
  124759. }
  124760. ret := &Operation{
  124761. ServerResponse: googleapi.ServerResponse{
  124762. Header: res.Header,
  124763. HTTPStatusCode: res.StatusCode,
  124764. },
  124765. }
  124766. target := &ret
  124767. if err := gensupport.DecodeResponse(target, res); err != nil {
  124768. return nil, err
  124769. }
  124770. return ret, nil
  124771. // {
  124772. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  124773. // "httpMethod": "POST",
  124774. // "id": "compute.targetInstances.insert",
  124775. // "parameterOrder": [
  124776. // "project",
  124777. // "zone"
  124778. // ],
  124779. // "parameters": {
  124780. // "project": {
  124781. // "description": "Project ID for this request.",
  124782. // "location": "path",
  124783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124784. // "required": true,
  124785. // "type": "string"
  124786. // },
  124787. // "requestId": {
  124788. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  124789. // "location": "query",
  124790. // "type": "string"
  124791. // },
  124792. // "zone": {
  124793. // "description": "Name of the zone scoping this request.",
  124794. // "location": "path",
  124795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  124796. // "required": true,
  124797. // "type": "string"
  124798. // }
  124799. // },
  124800. // "path": "{project}/zones/{zone}/targetInstances",
  124801. // "request": {
  124802. // "$ref": "TargetInstance"
  124803. // },
  124804. // "response": {
  124805. // "$ref": "Operation"
  124806. // },
  124807. // "scopes": [
  124808. // "https://www.googleapis.com/auth/cloud-platform",
  124809. // "https://www.googleapis.com/auth/compute"
  124810. // ]
  124811. // }
  124812. }
  124813. // method id "compute.targetInstances.list":
  124814. type TargetInstancesListCall struct {
  124815. s *Service
  124816. project string
  124817. zone string
  124818. urlParams_ gensupport.URLParams
  124819. ifNoneMatch_ string
  124820. ctx_ context.Context
  124821. header_ http.Header
  124822. }
  124823. // List: Retrieves a list of TargetInstance resources available to the
  124824. // specified project and zone.
  124825. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  124826. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  124827. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124828. c.project = project
  124829. c.zone = zone
  124830. return c
  124831. }
  124832. // Filter sets the optional parameter "filter": A filter expression that
  124833. // filters resources listed in the response. The expression must specify
  124834. // the field name, a comparison operator, and the value that you want to
  124835. // use for filtering. The value must be a string, a number, or a
  124836. // boolean. The comparison operator must be either =, !=, >, or <.
  124837. //
  124838. // For example, if you are filtering Compute Engine instances, you can
  124839. // exclude instances named example-instance by specifying name !=
  124840. // example-instance.
  124841. //
  124842. // You can also filter nested fields. For example, you could specify
  124843. // scheduling.automaticRestart = false to include instances only if they
  124844. // are not scheduled for automatic restarts. You can use filtering on
  124845. // nested fields to filter based on resource labels.
  124846. //
  124847. // To filter on multiple expressions, provide each separate expression
  124848. // within parentheses. For example, (scheduling.automaticRestart = true)
  124849. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  124850. // AND expression. However, you can include AND and OR expressions
  124851. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  124852. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  124853. // true).
  124854. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  124855. c.urlParams_.Set("filter", filter)
  124856. return c
  124857. }
  124858. // MaxResults sets the optional parameter "maxResults": The maximum
  124859. // number of results per page that should be returned. If the number of
  124860. // available results is larger than maxResults, Compute Engine returns a
  124861. // nextPageToken that can be used to get the next page of results in
  124862. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  124863. // (Default: 500)
  124864. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  124865. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  124866. return c
  124867. }
  124868. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  124869. // a certain order. By default, results are returned in alphanumerical
  124870. // order based on the resource name.
  124871. //
  124872. // You can also sort results in descending order based on the creation
  124873. // timestamp using orderBy="creationTimestamp desc". This sorts results
  124874. // based on the creationTimestamp field in reverse chronological order
  124875. // (newest result first). Use this to sort resources like operations so
  124876. // that the newest operation is returned first.
  124877. //
  124878. // Currently, only sorting by name or creationTimestamp desc is
  124879. // supported.
  124880. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  124881. c.urlParams_.Set("orderBy", orderBy)
  124882. return c
  124883. }
  124884. // PageToken sets the optional parameter "pageToken": Specifies a page
  124885. // token to use. Set pageToken to the nextPageToken returned by a
  124886. // previous list request to get the next page of results.
  124887. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  124888. c.urlParams_.Set("pageToken", pageToken)
  124889. return c
  124890. }
  124891. // Fields allows partial responses to be retrieved. See
  124892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124893. // for more information.
  124894. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  124895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124896. return c
  124897. }
  124898. // IfNoneMatch sets the optional parameter which makes the operation
  124899. // fail if the object's ETag matches the given value. This is useful for
  124900. // getting updates only after the object has changed since the last
  124901. // request. Use googleapi.IsNotModified to check whether the response
  124902. // error from Do is the result of In-None-Match.
  124903. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  124904. c.ifNoneMatch_ = entityTag
  124905. return c
  124906. }
  124907. // Context sets the context to be used in this call's Do method. Any
  124908. // pending HTTP request will be aborted if the provided context is
  124909. // canceled.
  124910. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  124911. c.ctx_ = ctx
  124912. return c
  124913. }
  124914. // Header returns an http.Header that can be modified by the caller to
  124915. // add HTTP headers to the request.
  124916. func (c *TargetInstancesListCall) Header() http.Header {
  124917. if c.header_ == nil {
  124918. c.header_ = make(http.Header)
  124919. }
  124920. return c.header_
  124921. }
  124922. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  124923. reqHeaders := make(http.Header)
  124924. for k, v := range c.header_ {
  124925. reqHeaders[k] = v
  124926. }
  124927. reqHeaders.Set("User-Agent", c.s.userAgent())
  124928. if c.ifNoneMatch_ != "" {
  124929. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124930. }
  124931. var body io.Reader = nil
  124932. c.urlParams_.Set("alt", alt)
  124933. c.urlParams_.Set("prettyPrint", "false")
  124934. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  124935. urls += "?" + c.urlParams_.Encode()
  124936. req, err := http.NewRequest("GET", urls, body)
  124937. if err != nil {
  124938. return nil, err
  124939. }
  124940. req.Header = reqHeaders
  124941. googleapi.Expand(req.URL, map[string]string{
  124942. "project": c.project,
  124943. "zone": c.zone,
  124944. })
  124945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124946. }
  124947. // Do executes the "compute.targetInstances.list" call.
  124948. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  124949. // non-2xx status code is an error. Response headers are in either
  124950. // *TargetInstanceList.ServerResponse.Header or (if a response was
  124951. // returned at all) in error.(*googleapi.Error).Header. Use
  124952. // googleapi.IsNotModified to check whether the returned error was
  124953. // because http.StatusNotModified was returned.
  124954. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  124955. gensupport.SetOptions(c.urlParams_, opts...)
  124956. res, err := c.doRequest("json")
  124957. if res != nil && res.StatusCode == http.StatusNotModified {
  124958. if res.Body != nil {
  124959. res.Body.Close()
  124960. }
  124961. return nil, &googleapi.Error{
  124962. Code: res.StatusCode,
  124963. Header: res.Header,
  124964. }
  124965. }
  124966. if err != nil {
  124967. return nil, err
  124968. }
  124969. defer googleapi.CloseBody(res)
  124970. if err := googleapi.CheckResponse(res); err != nil {
  124971. return nil, err
  124972. }
  124973. ret := &TargetInstanceList{
  124974. ServerResponse: googleapi.ServerResponse{
  124975. Header: res.Header,
  124976. HTTPStatusCode: res.StatusCode,
  124977. },
  124978. }
  124979. target := &ret
  124980. if err := gensupport.DecodeResponse(target, res); err != nil {
  124981. return nil, err
  124982. }
  124983. return ret, nil
  124984. // {
  124985. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  124986. // "httpMethod": "GET",
  124987. // "id": "compute.targetInstances.list",
  124988. // "parameterOrder": [
  124989. // "project",
  124990. // "zone"
  124991. // ],
  124992. // "parameters": {
  124993. // "filter": {
  124994. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  124995. // "location": "query",
  124996. // "type": "string"
  124997. // },
  124998. // "maxResults": {
  124999. // "default": "500",
  125000. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  125001. // "format": "uint32",
  125002. // "location": "query",
  125003. // "minimum": "0",
  125004. // "type": "integer"
  125005. // },
  125006. // "orderBy": {
  125007. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  125008. // "location": "query",
  125009. // "type": "string"
  125010. // },
  125011. // "pageToken": {
  125012. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  125013. // "location": "query",
  125014. // "type": "string"
  125015. // },
  125016. // "project": {
  125017. // "description": "Project ID for this request.",
  125018. // "location": "path",
  125019. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125020. // "required": true,
  125021. // "type": "string"
  125022. // },
  125023. // "zone": {
  125024. // "description": "Name of the zone scoping this request.",
  125025. // "location": "path",
  125026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125027. // "required": true,
  125028. // "type": "string"
  125029. // }
  125030. // },
  125031. // "path": "{project}/zones/{zone}/targetInstances",
  125032. // "response": {
  125033. // "$ref": "TargetInstanceList"
  125034. // },
  125035. // "scopes": [
  125036. // "https://www.googleapis.com/auth/cloud-platform",
  125037. // "https://www.googleapis.com/auth/compute",
  125038. // "https://www.googleapis.com/auth/compute.readonly"
  125039. // ]
  125040. // }
  125041. }
  125042. // Pages invokes f for each page of results.
  125043. // A non-nil error returned from f will halt the iteration.
  125044. // The provided context supersedes any context provided to the Context method.
  125045. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  125046. c.ctx_ = ctx
  125047. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  125048. for {
  125049. x, err := c.Do()
  125050. if err != nil {
  125051. return err
  125052. }
  125053. if err := f(x); err != nil {
  125054. return err
  125055. }
  125056. if x.NextPageToken == "" {
  125057. return nil
  125058. }
  125059. c.PageToken(x.NextPageToken)
  125060. }
  125061. }
  125062. // method id "compute.targetInstances.testIamPermissions":
  125063. type TargetInstancesTestIamPermissionsCall struct {
  125064. s *Service
  125065. project string
  125066. zone string
  125067. resource string
  125068. testpermissionsrequest *TestPermissionsRequest
  125069. urlParams_ gensupport.URLParams
  125070. ctx_ context.Context
  125071. header_ http.Header
  125072. }
  125073. // TestIamPermissions: Returns permissions that a caller has on the
  125074. // specified resource.
  125075. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  125076. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125077. c.project = project
  125078. c.zone = zone
  125079. c.resource = resource
  125080. c.testpermissionsrequest = testpermissionsrequest
  125081. return c
  125082. }
  125083. // Fields allows partial responses to be retrieved. See
  125084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125085. // for more information.
  125086. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  125087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125088. return c
  125089. }
  125090. // Context sets the context to be used in this call's Do method. Any
  125091. // pending HTTP request will be aborted if the provided context is
  125092. // canceled.
  125093. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  125094. c.ctx_ = ctx
  125095. return c
  125096. }
  125097. // Header returns an http.Header that can be modified by the caller to
  125098. // add HTTP headers to the request.
  125099. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  125100. if c.header_ == nil {
  125101. c.header_ = make(http.Header)
  125102. }
  125103. return c.header_
  125104. }
  125105. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  125106. reqHeaders := make(http.Header)
  125107. for k, v := range c.header_ {
  125108. reqHeaders[k] = v
  125109. }
  125110. reqHeaders.Set("User-Agent", c.s.userAgent())
  125111. var body io.Reader = nil
  125112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  125113. if err != nil {
  125114. return nil, err
  125115. }
  125116. reqHeaders.Set("Content-Type", "application/json")
  125117. c.urlParams_.Set("alt", alt)
  125118. c.urlParams_.Set("prettyPrint", "false")
  125119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  125120. urls += "?" + c.urlParams_.Encode()
  125121. req, err := http.NewRequest("POST", urls, body)
  125122. if err != nil {
  125123. return nil, err
  125124. }
  125125. req.Header = reqHeaders
  125126. googleapi.Expand(req.URL, map[string]string{
  125127. "project": c.project,
  125128. "zone": c.zone,
  125129. "resource": c.resource,
  125130. })
  125131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125132. }
  125133. // Do executes the "compute.targetInstances.testIamPermissions" call.
  125134. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  125135. // non-2xx status code is an error. Response headers are in either
  125136. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  125137. // returned at all) in error.(*googleapi.Error).Header. Use
  125138. // googleapi.IsNotModified to check whether the returned error was
  125139. // because http.StatusNotModified was returned.
  125140. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  125141. gensupport.SetOptions(c.urlParams_, opts...)
  125142. res, err := c.doRequest("json")
  125143. if res != nil && res.StatusCode == http.StatusNotModified {
  125144. if res.Body != nil {
  125145. res.Body.Close()
  125146. }
  125147. return nil, &googleapi.Error{
  125148. Code: res.StatusCode,
  125149. Header: res.Header,
  125150. }
  125151. }
  125152. if err != nil {
  125153. return nil, err
  125154. }
  125155. defer googleapi.CloseBody(res)
  125156. if err := googleapi.CheckResponse(res); err != nil {
  125157. return nil, err
  125158. }
  125159. ret := &TestPermissionsResponse{
  125160. ServerResponse: googleapi.ServerResponse{
  125161. Header: res.Header,
  125162. HTTPStatusCode: res.StatusCode,
  125163. },
  125164. }
  125165. target := &ret
  125166. if err := gensupport.DecodeResponse(target, res); err != nil {
  125167. return nil, err
  125168. }
  125169. return ret, nil
  125170. // {
  125171. // "description": "Returns permissions that a caller has on the specified resource.",
  125172. // "httpMethod": "POST",
  125173. // "id": "compute.targetInstances.testIamPermissions",
  125174. // "parameterOrder": [
  125175. // "project",
  125176. // "zone",
  125177. // "resource"
  125178. // ],
  125179. // "parameters": {
  125180. // "project": {
  125181. // "description": "Project ID for this request.",
  125182. // "location": "path",
  125183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125184. // "required": true,
  125185. // "type": "string"
  125186. // },
  125187. // "resource": {
  125188. // "description": "Name or id of the resource for this request.",
  125189. // "location": "path",
  125190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125191. // "required": true,
  125192. // "type": "string"
  125193. // },
  125194. // "zone": {
  125195. // "description": "The name of the zone for this request.",
  125196. // "location": "path",
  125197. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125198. // "required": true,
  125199. // "type": "string"
  125200. // }
  125201. // },
  125202. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  125203. // "request": {
  125204. // "$ref": "TestPermissionsRequest"
  125205. // },
  125206. // "response": {
  125207. // "$ref": "TestPermissionsResponse"
  125208. // },
  125209. // "scopes": [
  125210. // "https://www.googleapis.com/auth/cloud-platform",
  125211. // "https://www.googleapis.com/auth/compute",
  125212. // "https://www.googleapis.com/auth/compute.readonly"
  125213. // ]
  125214. // }
  125215. }
  125216. // method id "compute.targetPools.addHealthCheck":
  125217. type TargetPoolsAddHealthCheckCall struct {
  125218. s *Service
  125219. project string
  125220. region string
  125221. targetPool string
  125222. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  125223. urlParams_ gensupport.URLParams
  125224. ctx_ context.Context
  125225. header_ http.Header
  125226. }
  125227. // AddHealthCheck: Adds health check URLs to a target pool.
  125228. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  125229. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  125230. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125231. c.project = project
  125232. c.region = region
  125233. c.targetPool = targetPool
  125234. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  125235. return c
  125236. }
  125237. // RequestId sets the optional parameter "requestId": An optional
  125238. // request ID to identify requests. Specify a unique request ID so that
  125239. // if you must retry your request, the server will know to ignore the
  125240. // request if it has already been completed.
  125241. //
  125242. // For example, consider a situation where you make an initial request
  125243. // and the request times out. If you make the request again with the
  125244. // same request ID, the server can check if original operation with the
  125245. // same request ID was received, and if so, will ignore the second
  125246. // request. This prevents clients from accidentally creating duplicate
  125247. // commitments.
  125248. //
  125249. // The request ID must be a valid UUID with the exception that zero UUID
  125250. // is not supported (00000000-0000-0000-0000-000000000000).
  125251. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  125252. c.urlParams_.Set("requestId", requestId)
  125253. return c
  125254. }
  125255. // Fields allows partial responses to be retrieved. See
  125256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125257. // for more information.
  125258. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  125259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125260. return c
  125261. }
  125262. // Context sets the context to be used in this call's Do method. Any
  125263. // pending HTTP request will be aborted if the provided context is
  125264. // canceled.
  125265. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  125266. c.ctx_ = ctx
  125267. return c
  125268. }
  125269. // Header returns an http.Header that can be modified by the caller to
  125270. // add HTTP headers to the request.
  125271. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  125272. if c.header_ == nil {
  125273. c.header_ = make(http.Header)
  125274. }
  125275. return c.header_
  125276. }
  125277. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  125278. reqHeaders := make(http.Header)
  125279. for k, v := range c.header_ {
  125280. reqHeaders[k] = v
  125281. }
  125282. reqHeaders.Set("User-Agent", c.s.userAgent())
  125283. var body io.Reader = nil
  125284. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  125285. if err != nil {
  125286. return nil, err
  125287. }
  125288. reqHeaders.Set("Content-Type", "application/json")
  125289. c.urlParams_.Set("alt", alt)
  125290. c.urlParams_.Set("prettyPrint", "false")
  125291. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  125292. urls += "?" + c.urlParams_.Encode()
  125293. req, err := http.NewRequest("POST", urls, body)
  125294. if err != nil {
  125295. return nil, err
  125296. }
  125297. req.Header = reqHeaders
  125298. googleapi.Expand(req.URL, map[string]string{
  125299. "project": c.project,
  125300. "region": c.region,
  125301. "targetPool": c.targetPool,
  125302. })
  125303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125304. }
  125305. // Do executes the "compute.targetPools.addHealthCheck" call.
  125306. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125307. // status code is an error. Response headers are in either
  125308. // *Operation.ServerResponse.Header or (if a response was returned at
  125309. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125310. // to check whether the returned error was because
  125311. // http.StatusNotModified was returned.
  125312. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125313. gensupport.SetOptions(c.urlParams_, opts...)
  125314. res, err := c.doRequest("json")
  125315. if res != nil && res.StatusCode == http.StatusNotModified {
  125316. if res.Body != nil {
  125317. res.Body.Close()
  125318. }
  125319. return nil, &googleapi.Error{
  125320. Code: res.StatusCode,
  125321. Header: res.Header,
  125322. }
  125323. }
  125324. if err != nil {
  125325. return nil, err
  125326. }
  125327. defer googleapi.CloseBody(res)
  125328. if err := googleapi.CheckResponse(res); err != nil {
  125329. return nil, err
  125330. }
  125331. ret := &Operation{
  125332. ServerResponse: googleapi.ServerResponse{
  125333. Header: res.Header,
  125334. HTTPStatusCode: res.StatusCode,
  125335. },
  125336. }
  125337. target := &ret
  125338. if err := gensupport.DecodeResponse(target, res); err != nil {
  125339. return nil, err
  125340. }
  125341. return ret, nil
  125342. // {
  125343. // "description": "Adds health check URLs to a target pool.",
  125344. // "httpMethod": "POST",
  125345. // "id": "compute.targetPools.addHealthCheck",
  125346. // "parameterOrder": [
  125347. // "project",
  125348. // "region",
  125349. // "targetPool"
  125350. // ],
  125351. // "parameters": {
  125352. // "project": {
  125353. // "description": "Project ID for this request.",
  125354. // "location": "path",
  125355. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125356. // "required": true,
  125357. // "type": "string"
  125358. // },
  125359. // "region": {
  125360. // "description": "Name of the region scoping this request.",
  125361. // "location": "path",
  125362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125363. // "required": true,
  125364. // "type": "string"
  125365. // },
  125366. // "requestId": {
  125367. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125368. // "location": "query",
  125369. // "type": "string"
  125370. // },
  125371. // "targetPool": {
  125372. // "description": "Name of the target pool to add a health check to.",
  125373. // "location": "path",
  125374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125375. // "required": true,
  125376. // "type": "string"
  125377. // }
  125378. // },
  125379. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  125380. // "request": {
  125381. // "$ref": "TargetPoolsAddHealthCheckRequest"
  125382. // },
  125383. // "response": {
  125384. // "$ref": "Operation"
  125385. // },
  125386. // "scopes": [
  125387. // "https://www.googleapis.com/auth/cloud-platform",
  125388. // "https://www.googleapis.com/auth/compute"
  125389. // ]
  125390. // }
  125391. }
  125392. // method id "compute.targetPools.addInstance":
  125393. type TargetPoolsAddInstanceCall struct {
  125394. s *Service
  125395. project string
  125396. region string
  125397. targetPool string
  125398. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  125399. urlParams_ gensupport.URLParams
  125400. ctx_ context.Context
  125401. header_ http.Header
  125402. }
  125403. // AddInstance: Adds an instance to a target pool.
  125404. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  125405. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  125406. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125407. c.project = project
  125408. c.region = region
  125409. c.targetPool = targetPool
  125410. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  125411. return c
  125412. }
  125413. // RequestId sets the optional parameter "requestId": An optional
  125414. // request ID to identify requests. Specify a unique request ID so that
  125415. // if you must retry your request, the server will know to ignore the
  125416. // request if it has already been completed.
  125417. //
  125418. // For example, consider a situation where you make an initial request
  125419. // and the request times out. If you make the request again with the
  125420. // same request ID, the server can check if original operation with the
  125421. // same request ID was received, and if so, will ignore the second
  125422. // request. This prevents clients from accidentally creating duplicate
  125423. // commitments.
  125424. //
  125425. // The request ID must be a valid UUID with the exception that zero UUID
  125426. // is not supported (00000000-0000-0000-0000-000000000000).
  125427. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  125428. c.urlParams_.Set("requestId", requestId)
  125429. return c
  125430. }
  125431. // Fields allows partial responses to be retrieved. See
  125432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125433. // for more information.
  125434. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  125435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125436. return c
  125437. }
  125438. // Context sets the context to be used in this call's Do method. Any
  125439. // pending HTTP request will be aborted if the provided context is
  125440. // canceled.
  125441. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  125442. c.ctx_ = ctx
  125443. return c
  125444. }
  125445. // Header returns an http.Header that can be modified by the caller to
  125446. // add HTTP headers to the request.
  125447. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  125448. if c.header_ == nil {
  125449. c.header_ = make(http.Header)
  125450. }
  125451. return c.header_
  125452. }
  125453. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  125454. reqHeaders := make(http.Header)
  125455. for k, v := range c.header_ {
  125456. reqHeaders[k] = v
  125457. }
  125458. reqHeaders.Set("User-Agent", c.s.userAgent())
  125459. var body io.Reader = nil
  125460. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  125461. if err != nil {
  125462. return nil, err
  125463. }
  125464. reqHeaders.Set("Content-Type", "application/json")
  125465. c.urlParams_.Set("alt", alt)
  125466. c.urlParams_.Set("prettyPrint", "false")
  125467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  125468. urls += "?" + c.urlParams_.Encode()
  125469. req, err := http.NewRequest("POST", urls, body)
  125470. if err != nil {
  125471. return nil, err
  125472. }
  125473. req.Header = reqHeaders
  125474. googleapi.Expand(req.URL, map[string]string{
  125475. "project": c.project,
  125476. "region": c.region,
  125477. "targetPool": c.targetPool,
  125478. })
  125479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125480. }
  125481. // Do executes the "compute.targetPools.addInstance" call.
  125482. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125483. // status code is an error. Response headers are in either
  125484. // *Operation.ServerResponse.Header or (if a response was returned at
  125485. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125486. // to check whether the returned error was because
  125487. // http.StatusNotModified was returned.
  125488. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125489. gensupport.SetOptions(c.urlParams_, opts...)
  125490. res, err := c.doRequest("json")
  125491. if res != nil && res.StatusCode == http.StatusNotModified {
  125492. if res.Body != nil {
  125493. res.Body.Close()
  125494. }
  125495. return nil, &googleapi.Error{
  125496. Code: res.StatusCode,
  125497. Header: res.Header,
  125498. }
  125499. }
  125500. if err != nil {
  125501. return nil, err
  125502. }
  125503. defer googleapi.CloseBody(res)
  125504. if err := googleapi.CheckResponse(res); err != nil {
  125505. return nil, err
  125506. }
  125507. ret := &Operation{
  125508. ServerResponse: googleapi.ServerResponse{
  125509. Header: res.Header,
  125510. HTTPStatusCode: res.StatusCode,
  125511. },
  125512. }
  125513. target := &ret
  125514. if err := gensupport.DecodeResponse(target, res); err != nil {
  125515. return nil, err
  125516. }
  125517. return ret, nil
  125518. // {
  125519. // "description": "Adds an instance to a target pool.",
  125520. // "httpMethod": "POST",
  125521. // "id": "compute.targetPools.addInstance",
  125522. // "parameterOrder": [
  125523. // "project",
  125524. // "region",
  125525. // "targetPool"
  125526. // ],
  125527. // "parameters": {
  125528. // "project": {
  125529. // "description": "Project ID for this request.",
  125530. // "location": "path",
  125531. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125532. // "required": true,
  125533. // "type": "string"
  125534. // },
  125535. // "region": {
  125536. // "description": "Name of the region scoping this request.",
  125537. // "location": "path",
  125538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125539. // "required": true,
  125540. // "type": "string"
  125541. // },
  125542. // "requestId": {
  125543. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125544. // "location": "query",
  125545. // "type": "string"
  125546. // },
  125547. // "targetPool": {
  125548. // "description": "Name of the TargetPool resource to add instances to.",
  125549. // "location": "path",
  125550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125551. // "required": true,
  125552. // "type": "string"
  125553. // }
  125554. // },
  125555. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  125556. // "request": {
  125557. // "$ref": "TargetPoolsAddInstanceRequest"
  125558. // },
  125559. // "response": {
  125560. // "$ref": "Operation"
  125561. // },
  125562. // "scopes": [
  125563. // "https://www.googleapis.com/auth/cloud-platform",
  125564. // "https://www.googleapis.com/auth/compute"
  125565. // ]
  125566. // }
  125567. }
  125568. // method id "compute.targetPools.aggregatedList":
  125569. type TargetPoolsAggregatedListCall struct {
  125570. s *Service
  125571. project string
  125572. urlParams_ gensupport.URLParams
  125573. ifNoneMatch_ string
  125574. ctx_ context.Context
  125575. header_ http.Header
  125576. }
  125577. // AggregatedList: Retrieves an aggregated list of target pools.
  125578. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  125579. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  125580. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125581. c.project = project
  125582. return c
  125583. }
  125584. // Filter sets the optional parameter "filter": A filter expression that
  125585. // filters resources listed in the response. The expression must specify
  125586. // the field name, a comparison operator, and the value that you want to
  125587. // use for filtering. The value must be a string, a number, or a
  125588. // boolean. The comparison operator must be either =, !=, >, or <.
  125589. //
  125590. // For example, if you are filtering Compute Engine instances, you can
  125591. // exclude instances named example-instance by specifying name !=
  125592. // example-instance.
  125593. //
  125594. // You can also filter nested fields. For example, you could specify
  125595. // scheduling.automaticRestart = false to include instances only if they
  125596. // are not scheduled for automatic restarts. You can use filtering on
  125597. // nested fields to filter based on resource labels.
  125598. //
  125599. // To filter on multiple expressions, provide each separate expression
  125600. // within parentheses. For example, (scheduling.automaticRestart = true)
  125601. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  125602. // AND expression. However, you can include AND and OR expressions
  125603. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  125604. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  125605. // true).
  125606. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  125607. c.urlParams_.Set("filter", filter)
  125608. return c
  125609. }
  125610. // MaxResults sets the optional parameter "maxResults": The maximum
  125611. // number of results per page that should be returned. If the number of
  125612. // available results is larger than maxResults, Compute Engine returns a
  125613. // nextPageToken that can be used to get the next page of results in
  125614. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  125615. // (Default: 500)
  125616. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  125617. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  125618. return c
  125619. }
  125620. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  125621. // a certain order. By default, results are returned in alphanumerical
  125622. // order based on the resource name.
  125623. //
  125624. // You can also sort results in descending order based on the creation
  125625. // timestamp using orderBy="creationTimestamp desc". This sorts results
  125626. // based on the creationTimestamp field in reverse chronological order
  125627. // (newest result first). Use this to sort resources like operations so
  125628. // that the newest operation is returned first.
  125629. //
  125630. // Currently, only sorting by name or creationTimestamp desc is
  125631. // supported.
  125632. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  125633. c.urlParams_.Set("orderBy", orderBy)
  125634. return c
  125635. }
  125636. // PageToken sets the optional parameter "pageToken": Specifies a page
  125637. // token to use. Set pageToken to the nextPageToken returned by a
  125638. // previous list request to get the next page of results.
  125639. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  125640. c.urlParams_.Set("pageToken", pageToken)
  125641. return c
  125642. }
  125643. // Fields allows partial responses to be retrieved. See
  125644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125645. // for more information.
  125646. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  125647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125648. return c
  125649. }
  125650. // IfNoneMatch sets the optional parameter which makes the operation
  125651. // fail if the object's ETag matches the given value. This is useful for
  125652. // getting updates only after the object has changed since the last
  125653. // request. Use googleapi.IsNotModified to check whether the response
  125654. // error from Do is the result of In-None-Match.
  125655. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  125656. c.ifNoneMatch_ = entityTag
  125657. return c
  125658. }
  125659. // Context sets the context to be used in this call's Do method. Any
  125660. // pending HTTP request will be aborted if the provided context is
  125661. // canceled.
  125662. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  125663. c.ctx_ = ctx
  125664. return c
  125665. }
  125666. // Header returns an http.Header that can be modified by the caller to
  125667. // add HTTP headers to the request.
  125668. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  125669. if c.header_ == nil {
  125670. c.header_ = make(http.Header)
  125671. }
  125672. return c.header_
  125673. }
  125674. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  125675. reqHeaders := make(http.Header)
  125676. for k, v := range c.header_ {
  125677. reqHeaders[k] = v
  125678. }
  125679. reqHeaders.Set("User-Agent", c.s.userAgent())
  125680. if c.ifNoneMatch_ != "" {
  125681. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125682. }
  125683. var body io.Reader = nil
  125684. c.urlParams_.Set("alt", alt)
  125685. c.urlParams_.Set("prettyPrint", "false")
  125686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  125687. urls += "?" + c.urlParams_.Encode()
  125688. req, err := http.NewRequest("GET", urls, body)
  125689. if err != nil {
  125690. return nil, err
  125691. }
  125692. req.Header = reqHeaders
  125693. googleapi.Expand(req.URL, map[string]string{
  125694. "project": c.project,
  125695. })
  125696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125697. }
  125698. // Do executes the "compute.targetPools.aggregatedList" call.
  125699. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  125700. // Any non-2xx status code is an error. Response headers are in either
  125701. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  125702. // returned at all) in error.(*googleapi.Error).Header. Use
  125703. // googleapi.IsNotModified to check whether the returned error was
  125704. // because http.StatusNotModified was returned.
  125705. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  125706. gensupport.SetOptions(c.urlParams_, opts...)
  125707. res, err := c.doRequest("json")
  125708. if res != nil && res.StatusCode == http.StatusNotModified {
  125709. if res.Body != nil {
  125710. res.Body.Close()
  125711. }
  125712. return nil, &googleapi.Error{
  125713. Code: res.StatusCode,
  125714. Header: res.Header,
  125715. }
  125716. }
  125717. if err != nil {
  125718. return nil, err
  125719. }
  125720. defer googleapi.CloseBody(res)
  125721. if err := googleapi.CheckResponse(res); err != nil {
  125722. return nil, err
  125723. }
  125724. ret := &TargetPoolAggregatedList{
  125725. ServerResponse: googleapi.ServerResponse{
  125726. Header: res.Header,
  125727. HTTPStatusCode: res.StatusCode,
  125728. },
  125729. }
  125730. target := &ret
  125731. if err := gensupport.DecodeResponse(target, res); err != nil {
  125732. return nil, err
  125733. }
  125734. return ret, nil
  125735. // {
  125736. // "description": "Retrieves an aggregated list of target pools.",
  125737. // "httpMethod": "GET",
  125738. // "id": "compute.targetPools.aggregatedList",
  125739. // "parameterOrder": [
  125740. // "project"
  125741. // ],
  125742. // "parameters": {
  125743. // "filter": {
  125744. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  125745. // "location": "query",
  125746. // "type": "string"
  125747. // },
  125748. // "maxResults": {
  125749. // "default": "500",
  125750. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  125751. // "format": "uint32",
  125752. // "location": "query",
  125753. // "minimum": "0",
  125754. // "type": "integer"
  125755. // },
  125756. // "orderBy": {
  125757. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  125758. // "location": "query",
  125759. // "type": "string"
  125760. // },
  125761. // "pageToken": {
  125762. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  125763. // "location": "query",
  125764. // "type": "string"
  125765. // },
  125766. // "project": {
  125767. // "description": "Project ID for this request.",
  125768. // "location": "path",
  125769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125770. // "required": true,
  125771. // "type": "string"
  125772. // }
  125773. // },
  125774. // "path": "{project}/aggregated/targetPools",
  125775. // "response": {
  125776. // "$ref": "TargetPoolAggregatedList"
  125777. // },
  125778. // "scopes": [
  125779. // "https://www.googleapis.com/auth/cloud-platform",
  125780. // "https://www.googleapis.com/auth/compute",
  125781. // "https://www.googleapis.com/auth/compute.readonly"
  125782. // ]
  125783. // }
  125784. }
  125785. // Pages invokes f for each page of results.
  125786. // A non-nil error returned from f will halt the iteration.
  125787. // The provided context supersedes any context provided to the Context method.
  125788. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  125789. c.ctx_ = ctx
  125790. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  125791. for {
  125792. x, err := c.Do()
  125793. if err != nil {
  125794. return err
  125795. }
  125796. if err := f(x); err != nil {
  125797. return err
  125798. }
  125799. if x.NextPageToken == "" {
  125800. return nil
  125801. }
  125802. c.PageToken(x.NextPageToken)
  125803. }
  125804. }
  125805. // method id "compute.targetPools.delete":
  125806. type TargetPoolsDeleteCall struct {
  125807. s *Service
  125808. project string
  125809. region string
  125810. targetPool string
  125811. urlParams_ gensupport.URLParams
  125812. ctx_ context.Context
  125813. header_ http.Header
  125814. }
  125815. // Delete: Deletes the specified target pool.
  125816. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  125817. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  125818. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125819. c.project = project
  125820. c.region = region
  125821. c.targetPool = targetPool
  125822. return c
  125823. }
  125824. // RequestId sets the optional parameter "requestId": An optional
  125825. // request ID to identify requests. Specify a unique request ID so that
  125826. // if you must retry your request, the server will know to ignore the
  125827. // request if it has already been completed.
  125828. //
  125829. // For example, consider a situation where you make an initial request
  125830. // and the request times out. If you make the request again with the
  125831. // same request ID, the server can check if original operation with the
  125832. // same request ID was received, and if so, will ignore the second
  125833. // request. This prevents clients from accidentally creating duplicate
  125834. // commitments.
  125835. //
  125836. // The request ID must be a valid UUID with the exception that zero UUID
  125837. // is not supported (00000000-0000-0000-0000-000000000000).
  125838. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  125839. c.urlParams_.Set("requestId", requestId)
  125840. return c
  125841. }
  125842. // Fields allows partial responses to be retrieved. See
  125843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125844. // for more information.
  125845. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  125846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125847. return c
  125848. }
  125849. // Context sets the context to be used in this call's Do method. Any
  125850. // pending HTTP request will be aborted if the provided context is
  125851. // canceled.
  125852. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  125853. c.ctx_ = ctx
  125854. return c
  125855. }
  125856. // Header returns an http.Header that can be modified by the caller to
  125857. // add HTTP headers to the request.
  125858. func (c *TargetPoolsDeleteCall) Header() http.Header {
  125859. if c.header_ == nil {
  125860. c.header_ = make(http.Header)
  125861. }
  125862. return c.header_
  125863. }
  125864. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  125865. reqHeaders := make(http.Header)
  125866. for k, v := range c.header_ {
  125867. reqHeaders[k] = v
  125868. }
  125869. reqHeaders.Set("User-Agent", c.s.userAgent())
  125870. var body io.Reader = nil
  125871. c.urlParams_.Set("alt", alt)
  125872. c.urlParams_.Set("prettyPrint", "false")
  125873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  125874. urls += "?" + c.urlParams_.Encode()
  125875. req, err := http.NewRequest("DELETE", urls, body)
  125876. if err != nil {
  125877. return nil, err
  125878. }
  125879. req.Header = reqHeaders
  125880. googleapi.Expand(req.URL, map[string]string{
  125881. "project": c.project,
  125882. "region": c.region,
  125883. "targetPool": c.targetPool,
  125884. })
  125885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125886. }
  125887. // Do executes the "compute.targetPools.delete" call.
  125888. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125889. // status code is an error. Response headers are in either
  125890. // *Operation.ServerResponse.Header or (if a response was returned at
  125891. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125892. // to check whether the returned error was because
  125893. // http.StatusNotModified was returned.
  125894. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125895. gensupport.SetOptions(c.urlParams_, opts...)
  125896. res, err := c.doRequest("json")
  125897. if res != nil && res.StatusCode == http.StatusNotModified {
  125898. if res.Body != nil {
  125899. res.Body.Close()
  125900. }
  125901. return nil, &googleapi.Error{
  125902. Code: res.StatusCode,
  125903. Header: res.Header,
  125904. }
  125905. }
  125906. if err != nil {
  125907. return nil, err
  125908. }
  125909. defer googleapi.CloseBody(res)
  125910. if err := googleapi.CheckResponse(res); err != nil {
  125911. return nil, err
  125912. }
  125913. ret := &Operation{
  125914. ServerResponse: googleapi.ServerResponse{
  125915. Header: res.Header,
  125916. HTTPStatusCode: res.StatusCode,
  125917. },
  125918. }
  125919. target := &ret
  125920. if err := gensupport.DecodeResponse(target, res); err != nil {
  125921. return nil, err
  125922. }
  125923. return ret, nil
  125924. // {
  125925. // "description": "Deletes the specified target pool.",
  125926. // "httpMethod": "DELETE",
  125927. // "id": "compute.targetPools.delete",
  125928. // "parameterOrder": [
  125929. // "project",
  125930. // "region",
  125931. // "targetPool"
  125932. // ],
  125933. // "parameters": {
  125934. // "project": {
  125935. // "description": "Project ID for this request.",
  125936. // "location": "path",
  125937. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125938. // "required": true,
  125939. // "type": "string"
  125940. // },
  125941. // "region": {
  125942. // "description": "Name of the region scoping this request.",
  125943. // "location": "path",
  125944. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125945. // "required": true,
  125946. // "type": "string"
  125947. // },
  125948. // "requestId": {
  125949. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125950. // "location": "query",
  125951. // "type": "string"
  125952. // },
  125953. // "targetPool": {
  125954. // "description": "Name of the TargetPool resource to delete.",
  125955. // "location": "path",
  125956. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  125957. // "required": true,
  125958. // "type": "string"
  125959. // }
  125960. // },
  125961. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  125962. // "response": {
  125963. // "$ref": "Operation"
  125964. // },
  125965. // "scopes": [
  125966. // "https://www.googleapis.com/auth/cloud-platform",
  125967. // "https://www.googleapis.com/auth/compute"
  125968. // ]
  125969. // }
  125970. }
  125971. // method id "compute.targetPools.get":
  125972. type TargetPoolsGetCall struct {
  125973. s *Service
  125974. project string
  125975. region string
  125976. targetPool string
  125977. urlParams_ gensupport.URLParams
  125978. ifNoneMatch_ string
  125979. ctx_ context.Context
  125980. header_ http.Header
  125981. }
  125982. // Get: Returns the specified target pool. Gets a list of available
  125983. // target pools by making a list() request.
  125984. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  125985. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  125986. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125987. c.project = project
  125988. c.region = region
  125989. c.targetPool = targetPool
  125990. return c
  125991. }
  125992. // Fields allows partial responses to be retrieved. See
  125993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125994. // for more information.
  125995. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  125996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125997. return c
  125998. }
  125999. // IfNoneMatch sets the optional parameter which makes the operation
  126000. // fail if the object's ETag matches the given value. This is useful for
  126001. // getting updates only after the object has changed since the last
  126002. // request. Use googleapi.IsNotModified to check whether the response
  126003. // error from Do is the result of In-None-Match.
  126004. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  126005. c.ifNoneMatch_ = entityTag
  126006. return c
  126007. }
  126008. // Context sets the context to be used in this call's Do method. Any
  126009. // pending HTTP request will be aborted if the provided context is
  126010. // canceled.
  126011. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  126012. c.ctx_ = ctx
  126013. return c
  126014. }
  126015. // Header returns an http.Header that can be modified by the caller to
  126016. // add HTTP headers to the request.
  126017. func (c *TargetPoolsGetCall) Header() http.Header {
  126018. if c.header_ == nil {
  126019. c.header_ = make(http.Header)
  126020. }
  126021. return c.header_
  126022. }
  126023. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  126024. reqHeaders := make(http.Header)
  126025. for k, v := range c.header_ {
  126026. reqHeaders[k] = v
  126027. }
  126028. reqHeaders.Set("User-Agent", c.s.userAgent())
  126029. if c.ifNoneMatch_ != "" {
  126030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126031. }
  126032. var body io.Reader = nil
  126033. c.urlParams_.Set("alt", alt)
  126034. c.urlParams_.Set("prettyPrint", "false")
  126035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  126036. urls += "?" + c.urlParams_.Encode()
  126037. req, err := http.NewRequest("GET", urls, body)
  126038. if err != nil {
  126039. return nil, err
  126040. }
  126041. req.Header = reqHeaders
  126042. googleapi.Expand(req.URL, map[string]string{
  126043. "project": c.project,
  126044. "region": c.region,
  126045. "targetPool": c.targetPool,
  126046. })
  126047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126048. }
  126049. // Do executes the "compute.targetPools.get" call.
  126050. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  126051. // status code is an error. Response headers are in either
  126052. // *TargetPool.ServerResponse.Header or (if a response was returned at
  126053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126054. // to check whether the returned error was because
  126055. // http.StatusNotModified was returned.
  126056. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  126057. gensupport.SetOptions(c.urlParams_, opts...)
  126058. res, err := c.doRequest("json")
  126059. if res != nil && res.StatusCode == http.StatusNotModified {
  126060. if res.Body != nil {
  126061. res.Body.Close()
  126062. }
  126063. return nil, &googleapi.Error{
  126064. Code: res.StatusCode,
  126065. Header: res.Header,
  126066. }
  126067. }
  126068. if err != nil {
  126069. return nil, err
  126070. }
  126071. defer googleapi.CloseBody(res)
  126072. if err := googleapi.CheckResponse(res); err != nil {
  126073. return nil, err
  126074. }
  126075. ret := &TargetPool{
  126076. ServerResponse: googleapi.ServerResponse{
  126077. Header: res.Header,
  126078. HTTPStatusCode: res.StatusCode,
  126079. },
  126080. }
  126081. target := &ret
  126082. if err := gensupport.DecodeResponse(target, res); err != nil {
  126083. return nil, err
  126084. }
  126085. return ret, nil
  126086. // {
  126087. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  126088. // "httpMethod": "GET",
  126089. // "id": "compute.targetPools.get",
  126090. // "parameterOrder": [
  126091. // "project",
  126092. // "region",
  126093. // "targetPool"
  126094. // ],
  126095. // "parameters": {
  126096. // "project": {
  126097. // "description": "Project ID for this request.",
  126098. // "location": "path",
  126099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126100. // "required": true,
  126101. // "type": "string"
  126102. // },
  126103. // "region": {
  126104. // "description": "Name of the region scoping this request.",
  126105. // "location": "path",
  126106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126107. // "required": true,
  126108. // "type": "string"
  126109. // },
  126110. // "targetPool": {
  126111. // "description": "Name of the TargetPool resource to return.",
  126112. // "location": "path",
  126113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126114. // "required": true,
  126115. // "type": "string"
  126116. // }
  126117. // },
  126118. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  126119. // "response": {
  126120. // "$ref": "TargetPool"
  126121. // },
  126122. // "scopes": [
  126123. // "https://www.googleapis.com/auth/cloud-platform",
  126124. // "https://www.googleapis.com/auth/compute",
  126125. // "https://www.googleapis.com/auth/compute.readonly"
  126126. // ]
  126127. // }
  126128. }
  126129. // method id "compute.targetPools.getHealth":
  126130. type TargetPoolsGetHealthCall struct {
  126131. s *Service
  126132. project string
  126133. region string
  126134. targetPool string
  126135. instancereference *InstanceReference
  126136. urlParams_ gensupport.URLParams
  126137. ctx_ context.Context
  126138. header_ http.Header
  126139. }
  126140. // GetHealth: Gets the most recent health check results for each IP for
  126141. // the instance that is referenced by the given target pool.
  126142. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  126143. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  126144. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126145. c.project = project
  126146. c.region = region
  126147. c.targetPool = targetPool
  126148. c.instancereference = instancereference
  126149. return c
  126150. }
  126151. // Fields allows partial responses to be retrieved. See
  126152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126153. // for more information.
  126154. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  126155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126156. return c
  126157. }
  126158. // Context sets the context to be used in this call's Do method. Any
  126159. // pending HTTP request will be aborted if the provided context is
  126160. // canceled.
  126161. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  126162. c.ctx_ = ctx
  126163. return c
  126164. }
  126165. // Header returns an http.Header that can be modified by the caller to
  126166. // add HTTP headers to the request.
  126167. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  126168. if c.header_ == nil {
  126169. c.header_ = make(http.Header)
  126170. }
  126171. return c.header_
  126172. }
  126173. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  126174. reqHeaders := make(http.Header)
  126175. for k, v := range c.header_ {
  126176. reqHeaders[k] = v
  126177. }
  126178. reqHeaders.Set("User-Agent", c.s.userAgent())
  126179. var body io.Reader = nil
  126180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  126181. if err != nil {
  126182. return nil, err
  126183. }
  126184. reqHeaders.Set("Content-Type", "application/json")
  126185. c.urlParams_.Set("alt", alt)
  126186. c.urlParams_.Set("prettyPrint", "false")
  126187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  126188. urls += "?" + c.urlParams_.Encode()
  126189. req, err := http.NewRequest("POST", urls, body)
  126190. if err != nil {
  126191. return nil, err
  126192. }
  126193. req.Header = reqHeaders
  126194. googleapi.Expand(req.URL, map[string]string{
  126195. "project": c.project,
  126196. "region": c.region,
  126197. "targetPool": c.targetPool,
  126198. })
  126199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126200. }
  126201. // Do executes the "compute.targetPools.getHealth" call.
  126202. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  126203. // Any non-2xx status code is an error. Response headers are in either
  126204. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  126205. // returned at all) in error.(*googleapi.Error).Header. Use
  126206. // googleapi.IsNotModified to check whether the returned error was
  126207. // because http.StatusNotModified was returned.
  126208. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  126209. gensupport.SetOptions(c.urlParams_, opts...)
  126210. res, err := c.doRequest("json")
  126211. if res != nil && res.StatusCode == http.StatusNotModified {
  126212. if res.Body != nil {
  126213. res.Body.Close()
  126214. }
  126215. return nil, &googleapi.Error{
  126216. Code: res.StatusCode,
  126217. Header: res.Header,
  126218. }
  126219. }
  126220. if err != nil {
  126221. return nil, err
  126222. }
  126223. defer googleapi.CloseBody(res)
  126224. if err := googleapi.CheckResponse(res); err != nil {
  126225. return nil, err
  126226. }
  126227. ret := &TargetPoolInstanceHealth{
  126228. ServerResponse: googleapi.ServerResponse{
  126229. Header: res.Header,
  126230. HTTPStatusCode: res.StatusCode,
  126231. },
  126232. }
  126233. target := &ret
  126234. if err := gensupport.DecodeResponse(target, res); err != nil {
  126235. return nil, err
  126236. }
  126237. return ret, nil
  126238. // {
  126239. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  126240. // "httpMethod": "POST",
  126241. // "id": "compute.targetPools.getHealth",
  126242. // "parameterOrder": [
  126243. // "project",
  126244. // "region",
  126245. // "targetPool"
  126246. // ],
  126247. // "parameters": {
  126248. // "project": {
  126249. // "description": "Project ID for this request.",
  126250. // "location": "path",
  126251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126252. // "required": true,
  126253. // "type": "string"
  126254. // },
  126255. // "region": {
  126256. // "description": "Name of the region scoping this request.",
  126257. // "location": "path",
  126258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126259. // "required": true,
  126260. // "type": "string"
  126261. // },
  126262. // "targetPool": {
  126263. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  126264. // "location": "path",
  126265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126266. // "required": true,
  126267. // "type": "string"
  126268. // }
  126269. // },
  126270. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  126271. // "request": {
  126272. // "$ref": "InstanceReference"
  126273. // },
  126274. // "response": {
  126275. // "$ref": "TargetPoolInstanceHealth"
  126276. // },
  126277. // "scopes": [
  126278. // "https://www.googleapis.com/auth/cloud-platform",
  126279. // "https://www.googleapis.com/auth/compute",
  126280. // "https://www.googleapis.com/auth/compute.readonly"
  126281. // ]
  126282. // }
  126283. }
  126284. // method id "compute.targetPools.insert":
  126285. type TargetPoolsInsertCall struct {
  126286. s *Service
  126287. project string
  126288. region string
  126289. targetpool *TargetPool
  126290. urlParams_ gensupport.URLParams
  126291. ctx_ context.Context
  126292. header_ http.Header
  126293. }
  126294. // Insert: Creates a target pool in the specified project and region
  126295. // using the data included in the request.
  126296. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  126297. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  126298. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126299. c.project = project
  126300. c.region = region
  126301. c.targetpool = targetpool
  126302. return c
  126303. }
  126304. // RequestId sets the optional parameter "requestId": An optional
  126305. // request ID to identify requests. Specify a unique request ID so that
  126306. // if you must retry your request, the server will know to ignore the
  126307. // request if it has already been completed.
  126308. //
  126309. // For example, consider a situation where you make an initial request
  126310. // and the request times out. If you make the request again with the
  126311. // same request ID, the server can check if original operation with the
  126312. // same request ID was received, and if so, will ignore the second
  126313. // request. This prevents clients from accidentally creating duplicate
  126314. // commitments.
  126315. //
  126316. // The request ID must be a valid UUID with the exception that zero UUID
  126317. // is not supported (00000000-0000-0000-0000-000000000000).
  126318. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  126319. c.urlParams_.Set("requestId", requestId)
  126320. return c
  126321. }
  126322. // Fields allows partial responses to be retrieved. See
  126323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126324. // for more information.
  126325. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  126326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126327. return c
  126328. }
  126329. // Context sets the context to be used in this call's Do method. Any
  126330. // pending HTTP request will be aborted if the provided context is
  126331. // canceled.
  126332. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  126333. c.ctx_ = ctx
  126334. return c
  126335. }
  126336. // Header returns an http.Header that can be modified by the caller to
  126337. // add HTTP headers to the request.
  126338. func (c *TargetPoolsInsertCall) Header() http.Header {
  126339. if c.header_ == nil {
  126340. c.header_ = make(http.Header)
  126341. }
  126342. return c.header_
  126343. }
  126344. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  126345. reqHeaders := make(http.Header)
  126346. for k, v := range c.header_ {
  126347. reqHeaders[k] = v
  126348. }
  126349. reqHeaders.Set("User-Agent", c.s.userAgent())
  126350. var body io.Reader = nil
  126351. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  126352. if err != nil {
  126353. return nil, err
  126354. }
  126355. reqHeaders.Set("Content-Type", "application/json")
  126356. c.urlParams_.Set("alt", alt)
  126357. c.urlParams_.Set("prettyPrint", "false")
  126358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  126359. urls += "?" + c.urlParams_.Encode()
  126360. req, err := http.NewRequest("POST", urls, body)
  126361. if err != nil {
  126362. return nil, err
  126363. }
  126364. req.Header = reqHeaders
  126365. googleapi.Expand(req.URL, map[string]string{
  126366. "project": c.project,
  126367. "region": c.region,
  126368. })
  126369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126370. }
  126371. // Do executes the "compute.targetPools.insert" call.
  126372. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126373. // status code is an error. Response headers are in either
  126374. // *Operation.ServerResponse.Header or (if a response was returned at
  126375. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126376. // to check whether the returned error was because
  126377. // http.StatusNotModified was returned.
  126378. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126379. gensupport.SetOptions(c.urlParams_, opts...)
  126380. res, err := c.doRequest("json")
  126381. if res != nil && res.StatusCode == http.StatusNotModified {
  126382. if res.Body != nil {
  126383. res.Body.Close()
  126384. }
  126385. return nil, &googleapi.Error{
  126386. Code: res.StatusCode,
  126387. Header: res.Header,
  126388. }
  126389. }
  126390. if err != nil {
  126391. return nil, err
  126392. }
  126393. defer googleapi.CloseBody(res)
  126394. if err := googleapi.CheckResponse(res); err != nil {
  126395. return nil, err
  126396. }
  126397. ret := &Operation{
  126398. ServerResponse: googleapi.ServerResponse{
  126399. Header: res.Header,
  126400. HTTPStatusCode: res.StatusCode,
  126401. },
  126402. }
  126403. target := &ret
  126404. if err := gensupport.DecodeResponse(target, res); err != nil {
  126405. return nil, err
  126406. }
  126407. return ret, nil
  126408. // {
  126409. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  126410. // "httpMethod": "POST",
  126411. // "id": "compute.targetPools.insert",
  126412. // "parameterOrder": [
  126413. // "project",
  126414. // "region"
  126415. // ],
  126416. // "parameters": {
  126417. // "project": {
  126418. // "description": "Project ID for this request.",
  126419. // "location": "path",
  126420. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126421. // "required": true,
  126422. // "type": "string"
  126423. // },
  126424. // "region": {
  126425. // "description": "Name of the region scoping this request.",
  126426. // "location": "path",
  126427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126428. // "required": true,
  126429. // "type": "string"
  126430. // },
  126431. // "requestId": {
  126432. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126433. // "location": "query",
  126434. // "type": "string"
  126435. // }
  126436. // },
  126437. // "path": "{project}/regions/{region}/targetPools",
  126438. // "request": {
  126439. // "$ref": "TargetPool"
  126440. // },
  126441. // "response": {
  126442. // "$ref": "Operation"
  126443. // },
  126444. // "scopes": [
  126445. // "https://www.googleapis.com/auth/cloud-platform",
  126446. // "https://www.googleapis.com/auth/compute"
  126447. // ]
  126448. // }
  126449. }
  126450. // method id "compute.targetPools.list":
  126451. type TargetPoolsListCall struct {
  126452. s *Service
  126453. project string
  126454. region string
  126455. urlParams_ gensupport.URLParams
  126456. ifNoneMatch_ string
  126457. ctx_ context.Context
  126458. header_ http.Header
  126459. }
  126460. // List: Retrieves a list of target pools available to the specified
  126461. // project and region.
  126462. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  126463. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  126464. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126465. c.project = project
  126466. c.region = region
  126467. return c
  126468. }
  126469. // Filter sets the optional parameter "filter": A filter expression that
  126470. // filters resources listed in the response. The expression must specify
  126471. // the field name, a comparison operator, and the value that you want to
  126472. // use for filtering. The value must be a string, a number, or a
  126473. // boolean. The comparison operator must be either =, !=, >, or <.
  126474. //
  126475. // For example, if you are filtering Compute Engine instances, you can
  126476. // exclude instances named example-instance by specifying name !=
  126477. // example-instance.
  126478. //
  126479. // You can also filter nested fields. For example, you could specify
  126480. // scheduling.automaticRestart = false to include instances only if they
  126481. // are not scheduled for automatic restarts. You can use filtering on
  126482. // nested fields to filter based on resource labels.
  126483. //
  126484. // To filter on multiple expressions, provide each separate expression
  126485. // within parentheses. For example, (scheduling.automaticRestart = true)
  126486. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  126487. // AND expression. However, you can include AND and OR expressions
  126488. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  126489. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  126490. // true).
  126491. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  126492. c.urlParams_.Set("filter", filter)
  126493. return c
  126494. }
  126495. // MaxResults sets the optional parameter "maxResults": The maximum
  126496. // number of results per page that should be returned. If the number of
  126497. // available results is larger than maxResults, Compute Engine returns a
  126498. // nextPageToken that can be used to get the next page of results in
  126499. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  126500. // (Default: 500)
  126501. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  126502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  126503. return c
  126504. }
  126505. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  126506. // a certain order. By default, results are returned in alphanumerical
  126507. // order based on the resource name.
  126508. //
  126509. // You can also sort results in descending order based on the creation
  126510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  126511. // based on the creationTimestamp field in reverse chronological order
  126512. // (newest result first). Use this to sort resources like operations so
  126513. // that the newest operation is returned first.
  126514. //
  126515. // Currently, only sorting by name or creationTimestamp desc is
  126516. // supported.
  126517. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  126518. c.urlParams_.Set("orderBy", orderBy)
  126519. return c
  126520. }
  126521. // PageToken sets the optional parameter "pageToken": Specifies a page
  126522. // token to use. Set pageToken to the nextPageToken returned by a
  126523. // previous list request to get the next page of results.
  126524. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  126525. c.urlParams_.Set("pageToken", pageToken)
  126526. return c
  126527. }
  126528. // Fields allows partial responses to be retrieved. See
  126529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126530. // for more information.
  126531. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  126532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126533. return c
  126534. }
  126535. // IfNoneMatch sets the optional parameter which makes the operation
  126536. // fail if the object's ETag matches the given value. This is useful for
  126537. // getting updates only after the object has changed since the last
  126538. // request. Use googleapi.IsNotModified to check whether the response
  126539. // error from Do is the result of In-None-Match.
  126540. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  126541. c.ifNoneMatch_ = entityTag
  126542. return c
  126543. }
  126544. // Context sets the context to be used in this call's Do method. Any
  126545. // pending HTTP request will be aborted if the provided context is
  126546. // canceled.
  126547. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  126548. c.ctx_ = ctx
  126549. return c
  126550. }
  126551. // Header returns an http.Header that can be modified by the caller to
  126552. // add HTTP headers to the request.
  126553. func (c *TargetPoolsListCall) Header() http.Header {
  126554. if c.header_ == nil {
  126555. c.header_ = make(http.Header)
  126556. }
  126557. return c.header_
  126558. }
  126559. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  126560. reqHeaders := make(http.Header)
  126561. for k, v := range c.header_ {
  126562. reqHeaders[k] = v
  126563. }
  126564. reqHeaders.Set("User-Agent", c.s.userAgent())
  126565. if c.ifNoneMatch_ != "" {
  126566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126567. }
  126568. var body io.Reader = nil
  126569. c.urlParams_.Set("alt", alt)
  126570. c.urlParams_.Set("prettyPrint", "false")
  126571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  126572. urls += "?" + c.urlParams_.Encode()
  126573. req, err := http.NewRequest("GET", urls, body)
  126574. if err != nil {
  126575. return nil, err
  126576. }
  126577. req.Header = reqHeaders
  126578. googleapi.Expand(req.URL, map[string]string{
  126579. "project": c.project,
  126580. "region": c.region,
  126581. })
  126582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126583. }
  126584. // Do executes the "compute.targetPools.list" call.
  126585. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  126586. // status code is an error. Response headers are in either
  126587. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  126588. // at all) in error.(*googleapi.Error).Header. Use
  126589. // googleapi.IsNotModified to check whether the returned error was
  126590. // because http.StatusNotModified was returned.
  126591. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  126592. gensupport.SetOptions(c.urlParams_, opts...)
  126593. res, err := c.doRequest("json")
  126594. if res != nil && res.StatusCode == http.StatusNotModified {
  126595. if res.Body != nil {
  126596. res.Body.Close()
  126597. }
  126598. return nil, &googleapi.Error{
  126599. Code: res.StatusCode,
  126600. Header: res.Header,
  126601. }
  126602. }
  126603. if err != nil {
  126604. return nil, err
  126605. }
  126606. defer googleapi.CloseBody(res)
  126607. if err := googleapi.CheckResponse(res); err != nil {
  126608. return nil, err
  126609. }
  126610. ret := &TargetPoolList{
  126611. ServerResponse: googleapi.ServerResponse{
  126612. Header: res.Header,
  126613. HTTPStatusCode: res.StatusCode,
  126614. },
  126615. }
  126616. target := &ret
  126617. if err := gensupport.DecodeResponse(target, res); err != nil {
  126618. return nil, err
  126619. }
  126620. return ret, nil
  126621. // {
  126622. // "description": "Retrieves a list of target pools available to the specified project and region.",
  126623. // "httpMethod": "GET",
  126624. // "id": "compute.targetPools.list",
  126625. // "parameterOrder": [
  126626. // "project",
  126627. // "region"
  126628. // ],
  126629. // "parameters": {
  126630. // "filter": {
  126631. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  126632. // "location": "query",
  126633. // "type": "string"
  126634. // },
  126635. // "maxResults": {
  126636. // "default": "500",
  126637. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  126638. // "format": "uint32",
  126639. // "location": "query",
  126640. // "minimum": "0",
  126641. // "type": "integer"
  126642. // },
  126643. // "orderBy": {
  126644. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  126645. // "location": "query",
  126646. // "type": "string"
  126647. // },
  126648. // "pageToken": {
  126649. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  126650. // "location": "query",
  126651. // "type": "string"
  126652. // },
  126653. // "project": {
  126654. // "description": "Project ID for this request.",
  126655. // "location": "path",
  126656. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126657. // "required": true,
  126658. // "type": "string"
  126659. // },
  126660. // "region": {
  126661. // "description": "Name of the region scoping this request.",
  126662. // "location": "path",
  126663. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126664. // "required": true,
  126665. // "type": "string"
  126666. // }
  126667. // },
  126668. // "path": "{project}/regions/{region}/targetPools",
  126669. // "response": {
  126670. // "$ref": "TargetPoolList"
  126671. // },
  126672. // "scopes": [
  126673. // "https://www.googleapis.com/auth/cloud-platform",
  126674. // "https://www.googleapis.com/auth/compute",
  126675. // "https://www.googleapis.com/auth/compute.readonly"
  126676. // ]
  126677. // }
  126678. }
  126679. // Pages invokes f for each page of results.
  126680. // A non-nil error returned from f will halt the iteration.
  126681. // The provided context supersedes any context provided to the Context method.
  126682. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  126683. c.ctx_ = ctx
  126684. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  126685. for {
  126686. x, err := c.Do()
  126687. if err != nil {
  126688. return err
  126689. }
  126690. if err := f(x); err != nil {
  126691. return err
  126692. }
  126693. if x.NextPageToken == "" {
  126694. return nil
  126695. }
  126696. c.PageToken(x.NextPageToken)
  126697. }
  126698. }
  126699. // method id "compute.targetPools.removeHealthCheck":
  126700. type TargetPoolsRemoveHealthCheckCall struct {
  126701. s *Service
  126702. project string
  126703. region string
  126704. targetPool string
  126705. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  126706. urlParams_ gensupport.URLParams
  126707. ctx_ context.Context
  126708. header_ http.Header
  126709. }
  126710. // RemoveHealthCheck: Removes health check URL from a target pool.
  126711. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  126712. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  126713. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126714. c.project = project
  126715. c.region = region
  126716. c.targetPool = targetPool
  126717. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  126718. return c
  126719. }
  126720. // RequestId sets the optional parameter "requestId": An optional
  126721. // request ID to identify requests. Specify a unique request ID so that
  126722. // if you must retry your request, the server will know to ignore the
  126723. // request if it has already been completed.
  126724. //
  126725. // For example, consider a situation where you make an initial request
  126726. // and the request times out. If you make the request again with the
  126727. // same request ID, the server can check if original operation with the
  126728. // same request ID was received, and if so, will ignore the second
  126729. // request. This prevents clients from accidentally creating duplicate
  126730. // commitments.
  126731. //
  126732. // The request ID must be a valid UUID with the exception that zero UUID
  126733. // is not supported (00000000-0000-0000-0000-000000000000).
  126734. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  126735. c.urlParams_.Set("requestId", requestId)
  126736. return c
  126737. }
  126738. // Fields allows partial responses to be retrieved. See
  126739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126740. // for more information.
  126741. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  126742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126743. return c
  126744. }
  126745. // Context sets the context to be used in this call's Do method. Any
  126746. // pending HTTP request will be aborted if the provided context is
  126747. // canceled.
  126748. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  126749. c.ctx_ = ctx
  126750. return c
  126751. }
  126752. // Header returns an http.Header that can be modified by the caller to
  126753. // add HTTP headers to the request.
  126754. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  126755. if c.header_ == nil {
  126756. c.header_ = make(http.Header)
  126757. }
  126758. return c.header_
  126759. }
  126760. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  126761. reqHeaders := make(http.Header)
  126762. for k, v := range c.header_ {
  126763. reqHeaders[k] = v
  126764. }
  126765. reqHeaders.Set("User-Agent", c.s.userAgent())
  126766. var body io.Reader = nil
  126767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  126768. if err != nil {
  126769. return nil, err
  126770. }
  126771. reqHeaders.Set("Content-Type", "application/json")
  126772. c.urlParams_.Set("alt", alt)
  126773. c.urlParams_.Set("prettyPrint", "false")
  126774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  126775. urls += "?" + c.urlParams_.Encode()
  126776. req, err := http.NewRequest("POST", urls, body)
  126777. if err != nil {
  126778. return nil, err
  126779. }
  126780. req.Header = reqHeaders
  126781. googleapi.Expand(req.URL, map[string]string{
  126782. "project": c.project,
  126783. "region": c.region,
  126784. "targetPool": c.targetPool,
  126785. })
  126786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126787. }
  126788. // Do executes the "compute.targetPools.removeHealthCheck" call.
  126789. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126790. // status code is an error. Response headers are in either
  126791. // *Operation.ServerResponse.Header or (if a response was returned at
  126792. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126793. // to check whether the returned error was because
  126794. // http.StatusNotModified was returned.
  126795. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126796. gensupport.SetOptions(c.urlParams_, opts...)
  126797. res, err := c.doRequest("json")
  126798. if res != nil && res.StatusCode == http.StatusNotModified {
  126799. if res.Body != nil {
  126800. res.Body.Close()
  126801. }
  126802. return nil, &googleapi.Error{
  126803. Code: res.StatusCode,
  126804. Header: res.Header,
  126805. }
  126806. }
  126807. if err != nil {
  126808. return nil, err
  126809. }
  126810. defer googleapi.CloseBody(res)
  126811. if err := googleapi.CheckResponse(res); err != nil {
  126812. return nil, err
  126813. }
  126814. ret := &Operation{
  126815. ServerResponse: googleapi.ServerResponse{
  126816. Header: res.Header,
  126817. HTTPStatusCode: res.StatusCode,
  126818. },
  126819. }
  126820. target := &ret
  126821. if err := gensupport.DecodeResponse(target, res); err != nil {
  126822. return nil, err
  126823. }
  126824. return ret, nil
  126825. // {
  126826. // "description": "Removes health check URL from a target pool.",
  126827. // "httpMethod": "POST",
  126828. // "id": "compute.targetPools.removeHealthCheck",
  126829. // "parameterOrder": [
  126830. // "project",
  126831. // "region",
  126832. // "targetPool"
  126833. // ],
  126834. // "parameters": {
  126835. // "project": {
  126836. // "description": "Project ID for this request.",
  126837. // "location": "path",
  126838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126839. // "required": true,
  126840. // "type": "string"
  126841. // },
  126842. // "region": {
  126843. // "description": "Name of the region for this request.",
  126844. // "location": "path",
  126845. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126846. // "required": true,
  126847. // "type": "string"
  126848. // },
  126849. // "requestId": {
  126850. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126851. // "location": "query",
  126852. // "type": "string"
  126853. // },
  126854. // "targetPool": {
  126855. // "description": "Name of the target pool to remove health checks from.",
  126856. // "location": "path",
  126857. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  126858. // "required": true,
  126859. // "type": "string"
  126860. // }
  126861. // },
  126862. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  126863. // "request": {
  126864. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  126865. // },
  126866. // "response": {
  126867. // "$ref": "Operation"
  126868. // },
  126869. // "scopes": [
  126870. // "https://www.googleapis.com/auth/cloud-platform",
  126871. // "https://www.googleapis.com/auth/compute"
  126872. // ]
  126873. // }
  126874. }
  126875. // method id "compute.targetPools.removeInstance":
  126876. type TargetPoolsRemoveInstanceCall struct {
  126877. s *Service
  126878. project string
  126879. region string
  126880. targetPool string
  126881. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  126882. urlParams_ gensupport.URLParams
  126883. ctx_ context.Context
  126884. header_ http.Header
  126885. }
  126886. // RemoveInstance: Removes instance URL from a target pool.
  126887. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  126888. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  126889. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126890. c.project = project
  126891. c.region = region
  126892. c.targetPool = targetPool
  126893. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  126894. return c
  126895. }
  126896. // RequestId sets the optional parameter "requestId": An optional
  126897. // request ID to identify requests. Specify a unique request ID so that
  126898. // if you must retry your request, the server will know to ignore the
  126899. // request if it has already been completed.
  126900. //
  126901. // For example, consider a situation where you make an initial request
  126902. // and the request times out. If you make the request again with the
  126903. // same request ID, the server can check if original operation with the
  126904. // same request ID was received, and if so, will ignore the second
  126905. // request. This prevents clients from accidentally creating duplicate
  126906. // commitments.
  126907. //
  126908. // The request ID must be a valid UUID with the exception that zero UUID
  126909. // is not supported (00000000-0000-0000-0000-000000000000).
  126910. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  126911. c.urlParams_.Set("requestId", requestId)
  126912. return c
  126913. }
  126914. // Fields allows partial responses to be retrieved. See
  126915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126916. // for more information.
  126917. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  126918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126919. return c
  126920. }
  126921. // Context sets the context to be used in this call's Do method. Any
  126922. // pending HTTP request will be aborted if the provided context is
  126923. // canceled.
  126924. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  126925. c.ctx_ = ctx
  126926. return c
  126927. }
  126928. // Header returns an http.Header that can be modified by the caller to
  126929. // add HTTP headers to the request.
  126930. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  126931. if c.header_ == nil {
  126932. c.header_ = make(http.Header)
  126933. }
  126934. return c.header_
  126935. }
  126936. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  126937. reqHeaders := make(http.Header)
  126938. for k, v := range c.header_ {
  126939. reqHeaders[k] = v
  126940. }
  126941. reqHeaders.Set("User-Agent", c.s.userAgent())
  126942. var body io.Reader = nil
  126943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  126944. if err != nil {
  126945. return nil, err
  126946. }
  126947. reqHeaders.Set("Content-Type", "application/json")
  126948. c.urlParams_.Set("alt", alt)
  126949. c.urlParams_.Set("prettyPrint", "false")
  126950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  126951. urls += "?" + c.urlParams_.Encode()
  126952. req, err := http.NewRequest("POST", urls, body)
  126953. if err != nil {
  126954. return nil, err
  126955. }
  126956. req.Header = reqHeaders
  126957. googleapi.Expand(req.URL, map[string]string{
  126958. "project": c.project,
  126959. "region": c.region,
  126960. "targetPool": c.targetPool,
  126961. })
  126962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126963. }
  126964. // Do executes the "compute.targetPools.removeInstance" call.
  126965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126966. // status code is an error. Response headers are in either
  126967. // *Operation.ServerResponse.Header or (if a response was returned at
  126968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126969. // to check whether the returned error was because
  126970. // http.StatusNotModified was returned.
  126971. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126972. gensupport.SetOptions(c.urlParams_, opts...)
  126973. res, err := c.doRequest("json")
  126974. if res != nil && res.StatusCode == http.StatusNotModified {
  126975. if res.Body != nil {
  126976. res.Body.Close()
  126977. }
  126978. return nil, &googleapi.Error{
  126979. Code: res.StatusCode,
  126980. Header: res.Header,
  126981. }
  126982. }
  126983. if err != nil {
  126984. return nil, err
  126985. }
  126986. defer googleapi.CloseBody(res)
  126987. if err := googleapi.CheckResponse(res); err != nil {
  126988. return nil, err
  126989. }
  126990. ret := &Operation{
  126991. ServerResponse: googleapi.ServerResponse{
  126992. Header: res.Header,
  126993. HTTPStatusCode: res.StatusCode,
  126994. },
  126995. }
  126996. target := &ret
  126997. if err := gensupport.DecodeResponse(target, res); err != nil {
  126998. return nil, err
  126999. }
  127000. return ret, nil
  127001. // {
  127002. // "description": "Removes instance URL from a target pool.",
  127003. // "httpMethod": "POST",
  127004. // "id": "compute.targetPools.removeInstance",
  127005. // "parameterOrder": [
  127006. // "project",
  127007. // "region",
  127008. // "targetPool"
  127009. // ],
  127010. // "parameters": {
  127011. // "project": {
  127012. // "description": "Project ID for this request.",
  127013. // "location": "path",
  127014. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127015. // "required": true,
  127016. // "type": "string"
  127017. // },
  127018. // "region": {
  127019. // "description": "Name of the region scoping this request.",
  127020. // "location": "path",
  127021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127022. // "required": true,
  127023. // "type": "string"
  127024. // },
  127025. // "requestId": {
  127026. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127027. // "location": "query",
  127028. // "type": "string"
  127029. // },
  127030. // "targetPool": {
  127031. // "description": "Name of the TargetPool resource to remove instances from.",
  127032. // "location": "path",
  127033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127034. // "required": true,
  127035. // "type": "string"
  127036. // }
  127037. // },
  127038. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  127039. // "request": {
  127040. // "$ref": "TargetPoolsRemoveInstanceRequest"
  127041. // },
  127042. // "response": {
  127043. // "$ref": "Operation"
  127044. // },
  127045. // "scopes": [
  127046. // "https://www.googleapis.com/auth/cloud-platform",
  127047. // "https://www.googleapis.com/auth/compute"
  127048. // ]
  127049. // }
  127050. }
  127051. // method id "compute.targetPools.setBackup":
  127052. type TargetPoolsSetBackupCall struct {
  127053. s *Service
  127054. project string
  127055. region string
  127056. targetPool string
  127057. targetreference *TargetReference
  127058. urlParams_ gensupport.URLParams
  127059. ctx_ context.Context
  127060. header_ http.Header
  127061. }
  127062. // SetBackup: Changes a backup target pool's configurations.
  127063. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  127064. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  127065. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127066. c.project = project
  127067. c.region = region
  127068. c.targetPool = targetPool
  127069. c.targetreference = targetreference
  127070. return c
  127071. }
  127072. // FailoverRatio sets the optional parameter "failoverRatio": New
  127073. // failoverRatio value for the target pool.
  127074. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  127075. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  127076. return c
  127077. }
  127078. // RequestId sets the optional parameter "requestId": An optional
  127079. // request ID to identify requests. Specify a unique request ID so that
  127080. // if you must retry your request, the server will know to ignore the
  127081. // request if it has already been completed.
  127082. //
  127083. // For example, consider a situation where you make an initial request
  127084. // and the request times out. If you make the request again with the
  127085. // same request ID, the server can check if original operation with the
  127086. // same request ID was received, and if so, will ignore the second
  127087. // request. This prevents clients from accidentally creating duplicate
  127088. // commitments.
  127089. //
  127090. // The request ID must be a valid UUID with the exception that zero UUID
  127091. // is not supported (00000000-0000-0000-0000-000000000000).
  127092. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  127093. c.urlParams_.Set("requestId", requestId)
  127094. return c
  127095. }
  127096. // Fields allows partial responses to be retrieved. See
  127097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127098. // for more information.
  127099. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  127100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127101. return c
  127102. }
  127103. // Context sets the context to be used in this call's Do method. Any
  127104. // pending HTTP request will be aborted if the provided context is
  127105. // canceled.
  127106. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  127107. c.ctx_ = ctx
  127108. return c
  127109. }
  127110. // Header returns an http.Header that can be modified by the caller to
  127111. // add HTTP headers to the request.
  127112. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  127113. if c.header_ == nil {
  127114. c.header_ = make(http.Header)
  127115. }
  127116. return c.header_
  127117. }
  127118. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  127119. reqHeaders := make(http.Header)
  127120. for k, v := range c.header_ {
  127121. reqHeaders[k] = v
  127122. }
  127123. reqHeaders.Set("User-Agent", c.s.userAgent())
  127124. var body io.Reader = nil
  127125. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  127126. if err != nil {
  127127. return nil, err
  127128. }
  127129. reqHeaders.Set("Content-Type", "application/json")
  127130. c.urlParams_.Set("alt", alt)
  127131. c.urlParams_.Set("prettyPrint", "false")
  127132. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  127133. urls += "?" + c.urlParams_.Encode()
  127134. req, err := http.NewRequest("POST", urls, body)
  127135. if err != nil {
  127136. return nil, err
  127137. }
  127138. req.Header = reqHeaders
  127139. googleapi.Expand(req.URL, map[string]string{
  127140. "project": c.project,
  127141. "region": c.region,
  127142. "targetPool": c.targetPool,
  127143. })
  127144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127145. }
  127146. // Do executes the "compute.targetPools.setBackup" call.
  127147. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127148. // status code is an error. Response headers are in either
  127149. // *Operation.ServerResponse.Header or (if a response was returned at
  127150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127151. // to check whether the returned error was because
  127152. // http.StatusNotModified was returned.
  127153. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127154. gensupport.SetOptions(c.urlParams_, opts...)
  127155. res, err := c.doRequest("json")
  127156. if res != nil && res.StatusCode == http.StatusNotModified {
  127157. if res.Body != nil {
  127158. res.Body.Close()
  127159. }
  127160. return nil, &googleapi.Error{
  127161. Code: res.StatusCode,
  127162. Header: res.Header,
  127163. }
  127164. }
  127165. if err != nil {
  127166. return nil, err
  127167. }
  127168. defer googleapi.CloseBody(res)
  127169. if err := googleapi.CheckResponse(res); err != nil {
  127170. return nil, err
  127171. }
  127172. ret := &Operation{
  127173. ServerResponse: googleapi.ServerResponse{
  127174. Header: res.Header,
  127175. HTTPStatusCode: res.StatusCode,
  127176. },
  127177. }
  127178. target := &ret
  127179. if err := gensupport.DecodeResponse(target, res); err != nil {
  127180. return nil, err
  127181. }
  127182. return ret, nil
  127183. // {
  127184. // "description": "Changes a backup target pool's configurations.",
  127185. // "httpMethod": "POST",
  127186. // "id": "compute.targetPools.setBackup",
  127187. // "parameterOrder": [
  127188. // "project",
  127189. // "region",
  127190. // "targetPool"
  127191. // ],
  127192. // "parameters": {
  127193. // "failoverRatio": {
  127194. // "description": "New failoverRatio value for the target pool.",
  127195. // "format": "float",
  127196. // "location": "query",
  127197. // "type": "number"
  127198. // },
  127199. // "project": {
  127200. // "description": "Project ID for this request.",
  127201. // "location": "path",
  127202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127203. // "required": true,
  127204. // "type": "string"
  127205. // },
  127206. // "region": {
  127207. // "description": "Name of the region scoping this request.",
  127208. // "location": "path",
  127209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127210. // "required": true,
  127211. // "type": "string"
  127212. // },
  127213. // "requestId": {
  127214. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127215. // "location": "query",
  127216. // "type": "string"
  127217. // },
  127218. // "targetPool": {
  127219. // "description": "Name of the TargetPool resource to set a backup pool for.",
  127220. // "location": "path",
  127221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127222. // "required": true,
  127223. // "type": "string"
  127224. // }
  127225. // },
  127226. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  127227. // "request": {
  127228. // "$ref": "TargetReference"
  127229. // },
  127230. // "response": {
  127231. // "$ref": "Operation"
  127232. // },
  127233. // "scopes": [
  127234. // "https://www.googleapis.com/auth/cloud-platform",
  127235. // "https://www.googleapis.com/auth/compute"
  127236. // ]
  127237. // }
  127238. }
  127239. // method id "compute.targetPools.testIamPermissions":
  127240. type TargetPoolsTestIamPermissionsCall struct {
  127241. s *Service
  127242. project string
  127243. region string
  127244. resource string
  127245. testpermissionsrequest *TestPermissionsRequest
  127246. urlParams_ gensupport.URLParams
  127247. ctx_ context.Context
  127248. header_ http.Header
  127249. }
  127250. // TestIamPermissions: Returns permissions that a caller has on the
  127251. // specified resource.
  127252. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  127253. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127254. c.project = project
  127255. c.region = region
  127256. c.resource = resource
  127257. c.testpermissionsrequest = testpermissionsrequest
  127258. return c
  127259. }
  127260. // Fields allows partial responses to be retrieved. See
  127261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127262. // for more information.
  127263. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  127264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127265. return c
  127266. }
  127267. // Context sets the context to be used in this call's Do method. Any
  127268. // pending HTTP request will be aborted if the provided context is
  127269. // canceled.
  127270. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  127271. c.ctx_ = ctx
  127272. return c
  127273. }
  127274. // Header returns an http.Header that can be modified by the caller to
  127275. // add HTTP headers to the request.
  127276. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  127277. if c.header_ == nil {
  127278. c.header_ = make(http.Header)
  127279. }
  127280. return c.header_
  127281. }
  127282. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  127283. reqHeaders := make(http.Header)
  127284. for k, v := range c.header_ {
  127285. reqHeaders[k] = v
  127286. }
  127287. reqHeaders.Set("User-Agent", c.s.userAgent())
  127288. var body io.Reader = nil
  127289. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  127290. if err != nil {
  127291. return nil, err
  127292. }
  127293. reqHeaders.Set("Content-Type", "application/json")
  127294. c.urlParams_.Set("alt", alt)
  127295. c.urlParams_.Set("prettyPrint", "false")
  127296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  127297. urls += "?" + c.urlParams_.Encode()
  127298. req, err := http.NewRequest("POST", urls, body)
  127299. if err != nil {
  127300. return nil, err
  127301. }
  127302. req.Header = reqHeaders
  127303. googleapi.Expand(req.URL, map[string]string{
  127304. "project": c.project,
  127305. "region": c.region,
  127306. "resource": c.resource,
  127307. })
  127308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127309. }
  127310. // Do executes the "compute.targetPools.testIamPermissions" call.
  127311. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  127312. // non-2xx status code is an error. Response headers are in either
  127313. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  127314. // returned at all) in error.(*googleapi.Error).Header. Use
  127315. // googleapi.IsNotModified to check whether the returned error was
  127316. // because http.StatusNotModified was returned.
  127317. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  127318. gensupport.SetOptions(c.urlParams_, opts...)
  127319. res, err := c.doRequest("json")
  127320. if res != nil && res.StatusCode == http.StatusNotModified {
  127321. if res.Body != nil {
  127322. res.Body.Close()
  127323. }
  127324. return nil, &googleapi.Error{
  127325. Code: res.StatusCode,
  127326. Header: res.Header,
  127327. }
  127328. }
  127329. if err != nil {
  127330. return nil, err
  127331. }
  127332. defer googleapi.CloseBody(res)
  127333. if err := googleapi.CheckResponse(res); err != nil {
  127334. return nil, err
  127335. }
  127336. ret := &TestPermissionsResponse{
  127337. ServerResponse: googleapi.ServerResponse{
  127338. Header: res.Header,
  127339. HTTPStatusCode: res.StatusCode,
  127340. },
  127341. }
  127342. target := &ret
  127343. if err := gensupport.DecodeResponse(target, res); err != nil {
  127344. return nil, err
  127345. }
  127346. return ret, nil
  127347. // {
  127348. // "description": "Returns permissions that a caller has on the specified resource.",
  127349. // "httpMethod": "POST",
  127350. // "id": "compute.targetPools.testIamPermissions",
  127351. // "parameterOrder": [
  127352. // "project",
  127353. // "region",
  127354. // "resource"
  127355. // ],
  127356. // "parameters": {
  127357. // "project": {
  127358. // "description": "Project ID for this request.",
  127359. // "location": "path",
  127360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127361. // "required": true,
  127362. // "type": "string"
  127363. // },
  127364. // "region": {
  127365. // "description": "The name of the region for this request.",
  127366. // "location": "path",
  127367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127368. // "required": true,
  127369. // "type": "string"
  127370. // },
  127371. // "resource": {
  127372. // "description": "Name or id of the resource for this request.",
  127373. // "location": "path",
  127374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127375. // "required": true,
  127376. // "type": "string"
  127377. // }
  127378. // },
  127379. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  127380. // "request": {
  127381. // "$ref": "TestPermissionsRequest"
  127382. // },
  127383. // "response": {
  127384. // "$ref": "TestPermissionsResponse"
  127385. // },
  127386. // "scopes": [
  127387. // "https://www.googleapis.com/auth/cloud-platform",
  127388. // "https://www.googleapis.com/auth/compute",
  127389. // "https://www.googleapis.com/auth/compute.readonly"
  127390. // ]
  127391. // }
  127392. }
  127393. // method id "compute.targetSslProxies.delete":
  127394. type TargetSslProxiesDeleteCall struct {
  127395. s *Service
  127396. project string
  127397. targetSslProxy string
  127398. urlParams_ gensupport.URLParams
  127399. ctx_ context.Context
  127400. header_ http.Header
  127401. }
  127402. // Delete: Deletes the specified TargetSslProxy resource.
  127403. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  127404. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127405. c.project = project
  127406. c.targetSslProxy = targetSslProxy
  127407. return c
  127408. }
  127409. // RequestId sets the optional parameter "requestId": An optional
  127410. // request ID to identify requests. Specify a unique request ID so that
  127411. // if you must retry your request, the server will know to ignore the
  127412. // request if it has already been completed.
  127413. //
  127414. // For example, consider a situation where you make an initial request
  127415. // and the request times out. If you make the request again with the
  127416. // same request ID, the server can check if original operation with the
  127417. // same request ID was received, and if so, will ignore the second
  127418. // request. This prevents clients from accidentally creating duplicate
  127419. // commitments.
  127420. //
  127421. // The request ID must be a valid UUID with the exception that zero UUID
  127422. // is not supported (00000000-0000-0000-0000-000000000000).
  127423. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  127424. c.urlParams_.Set("requestId", requestId)
  127425. return c
  127426. }
  127427. // Fields allows partial responses to be retrieved. See
  127428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127429. // for more information.
  127430. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  127431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127432. return c
  127433. }
  127434. // Context sets the context to be used in this call's Do method. Any
  127435. // pending HTTP request will be aborted if the provided context is
  127436. // canceled.
  127437. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  127438. c.ctx_ = ctx
  127439. return c
  127440. }
  127441. // Header returns an http.Header that can be modified by the caller to
  127442. // add HTTP headers to the request.
  127443. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  127444. if c.header_ == nil {
  127445. c.header_ = make(http.Header)
  127446. }
  127447. return c.header_
  127448. }
  127449. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  127450. reqHeaders := make(http.Header)
  127451. for k, v := range c.header_ {
  127452. reqHeaders[k] = v
  127453. }
  127454. reqHeaders.Set("User-Agent", c.s.userAgent())
  127455. var body io.Reader = nil
  127456. c.urlParams_.Set("alt", alt)
  127457. c.urlParams_.Set("prettyPrint", "false")
  127458. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  127459. urls += "?" + c.urlParams_.Encode()
  127460. req, err := http.NewRequest("DELETE", urls, body)
  127461. if err != nil {
  127462. return nil, err
  127463. }
  127464. req.Header = reqHeaders
  127465. googleapi.Expand(req.URL, map[string]string{
  127466. "project": c.project,
  127467. "targetSslProxy": c.targetSslProxy,
  127468. })
  127469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127470. }
  127471. // Do executes the "compute.targetSslProxies.delete" call.
  127472. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127473. // status code is an error. Response headers are in either
  127474. // *Operation.ServerResponse.Header or (if a response was returned at
  127475. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127476. // to check whether the returned error was because
  127477. // http.StatusNotModified was returned.
  127478. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127479. gensupport.SetOptions(c.urlParams_, opts...)
  127480. res, err := c.doRequest("json")
  127481. if res != nil && res.StatusCode == http.StatusNotModified {
  127482. if res.Body != nil {
  127483. res.Body.Close()
  127484. }
  127485. return nil, &googleapi.Error{
  127486. Code: res.StatusCode,
  127487. Header: res.Header,
  127488. }
  127489. }
  127490. if err != nil {
  127491. return nil, err
  127492. }
  127493. defer googleapi.CloseBody(res)
  127494. if err := googleapi.CheckResponse(res); err != nil {
  127495. return nil, err
  127496. }
  127497. ret := &Operation{
  127498. ServerResponse: googleapi.ServerResponse{
  127499. Header: res.Header,
  127500. HTTPStatusCode: res.StatusCode,
  127501. },
  127502. }
  127503. target := &ret
  127504. if err := gensupport.DecodeResponse(target, res); err != nil {
  127505. return nil, err
  127506. }
  127507. return ret, nil
  127508. // {
  127509. // "description": "Deletes the specified TargetSslProxy resource.",
  127510. // "httpMethod": "DELETE",
  127511. // "id": "compute.targetSslProxies.delete",
  127512. // "parameterOrder": [
  127513. // "project",
  127514. // "targetSslProxy"
  127515. // ],
  127516. // "parameters": {
  127517. // "project": {
  127518. // "description": "Project ID for this request.",
  127519. // "location": "path",
  127520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127521. // "required": true,
  127522. // "type": "string"
  127523. // },
  127524. // "requestId": {
  127525. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127526. // "location": "query",
  127527. // "type": "string"
  127528. // },
  127529. // "targetSslProxy": {
  127530. // "description": "Name of the TargetSslProxy resource to delete.",
  127531. // "location": "path",
  127532. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127533. // "required": true,
  127534. // "type": "string"
  127535. // }
  127536. // },
  127537. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  127538. // "response": {
  127539. // "$ref": "Operation"
  127540. // },
  127541. // "scopes": [
  127542. // "https://www.googleapis.com/auth/cloud-platform",
  127543. // "https://www.googleapis.com/auth/compute"
  127544. // ]
  127545. // }
  127546. }
  127547. // method id "compute.targetSslProxies.get":
  127548. type TargetSslProxiesGetCall struct {
  127549. s *Service
  127550. project string
  127551. targetSslProxy string
  127552. urlParams_ gensupport.URLParams
  127553. ifNoneMatch_ string
  127554. ctx_ context.Context
  127555. header_ http.Header
  127556. }
  127557. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  127558. // available target SSL proxies by making a list() request.
  127559. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  127560. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127561. c.project = project
  127562. c.targetSslProxy = targetSslProxy
  127563. return c
  127564. }
  127565. // Fields allows partial responses to be retrieved. See
  127566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127567. // for more information.
  127568. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  127569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127570. return c
  127571. }
  127572. // IfNoneMatch sets the optional parameter which makes the operation
  127573. // fail if the object's ETag matches the given value. This is useful for
  127574. // getting updates only after the object has changed since the last
  127575. // request. Use googleapi.IsNotModified to check whether the response
  127576. // error from Do is the result of In-None-Match.
  127577. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  127578. c.ifNoneMatch_ = entityTag
  127579. return c
  127580. }
  127581. // Context sets the context to be used in this call's Do method. Any
  127582. // pending HTTP request will be aborted if the provided context is
  127583. // canceled.
  127584. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  127585. c.ctx_ = ctx
  127586. return c
  127587. }
  127588. // Header returns an http.Header that can be modified by the caller to
  127589. // add HTTP headers to the request.
  127590. func (c *TargetSslProxiesGetCall) Header() http.Header {
  127591. if c.header_ == nil {
  127592. c.header_ = make(http.Header)
  127593. }
  127594. return c.header_
  127595. }
  127596. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  127597. reqHeaders := make(http.Header)
  127598. for k, v := range c.header_ {
  127599. reqHeaders[k] = v
  127600. }
  127601. reqHeaders.Set("User-Agent", c.s.userAgent())
  127602. if c.ifNoneMatch_ != "" {
  127603. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127604. }
  127605. var body io.Reader = nil
  127606. c.urlParams_.Set("alt", alt)
  127607. c.urlParams_.Set("prettyPrint", "false")
  127608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  127609. urls += "?" + c.urlParams_.Encode()
  127610. req, err := http.NewRequest("GET", urls, body)
  127611. if err != nil {
  127612. return nil, err
  127613. }
  127614. req.Header = reqHeaders
  127615. googleapi.Expand(req.URL, map[string]string{
  127616. "project": c.project,
  127617. "targetSslProxy": c.targetSslProxy,
  127618. })
  127619. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127620. }
  127621. // Do executes the "compute.targetSslProxies.get" call.
  127622. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  127623. // status code is an error. Response headers are in either
  127624. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  127625. // at all) in error.(*googleapi.Error).Header. Use
  127626. // googleapi.IsNotModified to check whether the returned error was
  127627. // because http.StatusNotModified was returned.
  127628. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  127629. gensupport.SetOptions(c.urlParams_, opts...)
  127630. res, err := c.doRequest("json")
  127631. if res != nil && res.StatusCode == http.StatusNotModified {
  127632. if res.Body != nil {
  127633. res.Body.Close()
  127634. }
  127635. return nil, &googleapi.Error{
  127636. Code: res.StatusCode,
  127637. Header: res.Header,
  127638. }
  127639. }
  127640. if err != nil {
  127641. return nil, err
  127642. }
  127643. defer googleapi.CloseBody(res)
  127644. if err := googleapi.CheckResponse(res); err != nil {
  127645. return nil, err
  127646. }
  127647. ret := &TargetSslProxy{
  127648. ServerResponse: googleapi.ServerResponse{
  127649. Header: res.Header,
  127650. HTTPStatusCode: res.StatusCode,
  127651. },
  127652. }
  127653. target := &ret
  127654. if err := gensupport.DecodeResponse(target, res); err != nil {
  127655. return nil, err
  127656. }
  127657. return ret, nil
  127658. // {
  127659. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  127660. // "httpMethod": "GET",
  127661. // "id": "compute.targetSslProxies.get",
  127662. // "parameterOrder": [
  127663. // "project",
  127664. // "targetSslProxy"
  127665. // ],
  127666. // "parameters": {
  127667. // "project": {
  127668. // "description": "Project ID for this request.",
  127669. // "location": "path",
  127670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127671. // "required": true,
  127672. // "type": "string"
  127673. // },
  127674. // "targetSslProxy": {
  127675. // "description": "Name of the TargetSslProxy resource to return.",
  127676. // "location": "path",
  127677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127678. // "required": true,
  127679. // "type": "string"
  127680. // }
  127681. // },
  127682. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  127683. // "response": {
  127684. // "$ref": "TargetSslProxy"
  127685. // },
  127686. // "scopes": [
  127687. // "https://www.googleapis.com/auth/cloud-platform",
  127688. // "https://www.googleapis.com/auth/compute",
  127689. // "https://www.googleapis.com/auth/compute.readonly"
  127690. // ]
  127691. // }
  127692. }
  127693. // method id "compute.targetSslProxies.insert":
  127694. type TargetSslProxiesInsertCall struct {
  127695. s *Service
  127696. project string
  127697. targetsslproxy *TargetSslProxy
  127698. urlParams_ gensupport.URLParams
  127699. ctx_ context.Context
  127700. header_ http.Header
  127701. }
  127702. // Insert: Creates a TargetSslProxy resource in the specified project
  127703. // using the data included in the request.
  127704. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  127705. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127706. c.project = project
  127707. c.targetsslproxy = targetsslproxy
  127708. return c
  127709. }
  127710. // RequestId sets the optional parameter "requestId": An optional
  127711. // request ID to identify requests. Specify a unique request ID so that
  127712. // if you must retry your request, the server will know to ignore the
  127713. // request if it has already been completed.
  127714. //
  127715. // For example, consider a situation where you make an initial request
  127716. // and the request times out. If you make the request again with the
  127717. // same request ID, the server can check if original operation with the
  127718. // same request ID was received, and if so, will ignore the second
  127719. // request. This prevents clients from accidentally creating duplicate
  127720. // commitments.
  127721. //
  127722. // The request ID must be a valid UUID with the exception that zero UUID
  127723. // is not supported (00000000-0000-0000-0000-000000000000).
  127724. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  127725. c.urlParams_.Set("requestId", requestId)
  127726. return c
  127727. }
  127728. // Fields allows partial responses to be retrieved. See
  127729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127730. // for more information.
  127731. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  127732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127733. return c
  127734. }
  127735. // Context sets the context to be used in this call's Do method. Any
  127736. // pending HTTP request will be aborted if the provided context is
  127737. // canceled.
  127738. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  127739. c.ctx_ = ctx
  127740. return c
  127741. }
  127742. // Header returns an http.Header that can be modified by the caller to
  127743. // add HTTP headers to the request.
  127744. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  127745. if c.header_ == nil {
  127746. c.header_ = make(http.Header)
  127747. }
  127748. return c.header_
  127749. }
  127750. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  127751. reqHeaders := make(http.Header)
  127752. for k, v := range c.header_ {
  127753. reqHeaders[k] = v
  127754. }
  127755. reqHeaders.Set("User-Agent", c.s.userAgent())
  127756. var body io.Reader = nil
  127757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  127758. if err != nil {
  127759. return nil, err
  127760. }
  127761. reqHeaders.Set("Content-Type", "application/json")
  127762. c.urlParams_.Set("alt", alt)
  127763. c.urlParams_.Set("prettyPrint", "false")
  127764. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  127765. urls += "?" + c.urlParams_.Encode()
  127766. req, err := http.NewRequest("POST", urls, body)
  127767. if err != nil {
  127768. return nil, err
  127769. }
  127770. req.Header = reqHeaders
  127771. googleapi.Expand(req.URL, map[string]string{
  127772. "project": c.project,
  127773. })
  127774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127775. }
  127776. // Do executes the "compute.targetSslProxies.insert" call.
  127777. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127778. // status code is an error. Response headers are in either
  127779. // *Operation.ServerResponse.Header or (if a response was returned at
  127780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127781. // to check whether the returned error was because
  127782. // http.StatusNotModified was returned.
  127783. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127784. gensupport.SetOptions(c.urlParams_, opts...)
  127785. res, err := c.doRequest("json")
  127786. if res != nil && res.StatusCode == http.StatusNotModified {
  127787. if res.Body != nil {
  127788. res.Body.Close()
  127789. }
  127790. return nil, &googleapi.Error{
  127791. Code: res.StatusCode,
  127792. Header: res.Header,
  127793. }
  127794. }
  127795. if err != nil {
  127796. return nil, err
  127797. }
  127798. defer googleapi.CloseBody(res)
  127799. if err := googleapi.CheckResponse(res); err != nil {
  127800. return nil, err
  127801. }
  127802. ret := &Operation{
  127803. ServerResponse: googleapi.ServerResponse{
  127804. Header: res.Header,
  127805. HTTPStatusCode: res.StatusCode,
  127806. },
  127807. }
  127808. target := &ret
  127809. if err := gensupport.DecodeResponse(target, res); err != nil {
  127810. return nil, err
  127811. }
  127812. return ret, nil
  127813. // {
  127814. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  127815. // "httpMethod": "POST",
  127816. // "id": "compute.targetSslProxies.insert",
  127817. // "parameterOrder": [
  127818. // "project"
  127819. // ],
  127820. // "parameters": {
  127821. // "project": {
  127822. // "description": "Project ID for this request.",
  127823. // "location": "path",
  127824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127825. // "required": true,
  127826. // "type": "string"
  127827. // },
  127828. // "requestId": {
  127829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127830. // "location": "query",
  127831. // "type": "string"
  127832. // }
  127833. // },
  127834. // "path": "{project}/global/targetSslProxies",
  127835. // "request": {
  127836. // "$ref": "TargetSslProxy"
  127837. // },
  127838. // "response": {
  127839. // "$ref": "Operation"
  127840. // },
  127841. // "scopes": [
  127842. // "https://www.googleapis.com/auth/cloud-platform",
  127843. // "https://www.googleapis.com/auth/compute"
  127844. // ]
  127845. // }
  127846. }
  127847. // method id "compute.targetSslProxies.list":
  127848. type TargetSslProxiesListCall struct {
  127849. s *Service
  127850. project string
  127851. urlParams_ gensupport.URLParams
  127852. ifNoneMatch_ string
  127853. ctx_ context.Context
  127854. header_ http.Header
  127855. }
  127856. // List: Retrieves the list of TargetSslProxy resources available to the
  127857. // specified project.
  127858. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  127859. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127860. c.project = project
  127861. return c
  127862. }
  127863. // Filter sets the optional parameter "filter": A filter expression that
  127864. // filters resources listed in the response. The expression must specify
  127865. // the field name, a comparison operator, and the value that you want to
  127866. // use for filtering. The value must be a string, a number, or a
  127867. // boolean. The comparison operator must be either =, !=, >, or <.
  127868. //
  127869. // For example, if you are filtering Compute Engine instances, you can
  127870. // exclude instances named example-instance by specifying name !=
  127871. // example-instance.
  127872. //
  127873. // You can also filter nested fields. For example, you could specify
  127874. // scheduling.automaticRestart = false to include instances only if they
  127875. // are not scheduled for automatic restarts. You can use filtering on
  127876. // nested fields to filter based on resource labels.
  127877. //
  127878. // To filter on multiple expressions, provide each separate expression
  127879. // within parentheses. For example, (scheduling.automaticRestart = true)
  127880. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  127881. // AND expression. However, you can include AND and OR expressions
  127882. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  127883. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  127884. // true).
  127885. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  127886. c.urlParams_.Set("filter", filter)
  127887. return c
  127888. }
  127889. // MaxResults sets the optional parameter "maxResults": The maximum
  127890. // number of results per page that should be returned. If the number of
  127891. // available results is larger than maxResults, Compute Engine returns a
  127892. // nextPageToken that can be used to get the next page of results in
  127893. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  127894. // (Default: 500)
  127895. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  127896. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  127897. return c
  127898. }
  127899. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  127900. // a certain order. By default, results are returned in alphanumerical
  127901. // order based on the resource name.
  127902. //
  127903. // You can also sort results in descending order based on the creation
  127904. // timestamp using orderBy="creationTimestamp desc". This sorts results
  127905. // based on the creationTimestamp field in reverse chronological order
  127906. // (newest result first). Use this to sort resources like operations so
  127907. // that the newest operation is returned first.
  127908. //
  127909. // Currently, only sorting by name or creationTimestamp desc is
  127910. // supported.
  127911. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  127912. c.urlParams_.Set("orderBy", orderBy)
  127913. return c
  127914. }
  127915. // PageToken sets the optional parameter "pageToken": Specifies a page
  127916. // token to use. Set pageToken to the nextPageToken returned by a
  127917. // previous list request to get the next page of results.
  127918. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  127919. c.urlParams_.Set("pageToken", pageToken)
  127920. return c
  127921. }
  127922. // Fields allows partial responses to be retrieved. See
  127923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127924. // for more information.
  127925. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  127926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127927. return c
  127928. }
  127929. // IfNoneMatch sets the optional parameter which makes the operation
  127930. // fail if the object's ETag matches the given value. This is useful for
  127931. // getting updates only after the object has changed since the last
  127932. // request. Use googleapi.IsNotModified to check whether the response
  127933. // error from Do is the result of In-None-Match.
  127934. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  127935. c.ifNoneMatch_ = entityTag
  127936. return c
  127937. }
  127938. // Context sets the context to be used in this call's Do method. Any
  127939. // pending HTTP request will be aborted if the provided context is
  127940. // canceled.
  127941. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  127942. c.ctx_ = ctx
  127943. return c
  127944. }
  127945. // Header returns an http.Header that can be modified by the caller to
  127946. // add HTTP headers to the request.
  127947. func (c *TargetSslProxiesListCall) Header() http.Header {
  127948. if c.header_ == nil {
  127949. c.header_ = make(http.Header)
  127950. }
  127951. return c.header_
  127952. }
  127953. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  127954. reqHeaders := make(http.Header)
  127955. for k, v := range c.header_ {
  127956. reqHeaders[k] = v
  127957. }
  127958. reqHeaders.Set("User-Agent", c.s.userAgent())
  127959. if c.ifNoneMatch_ != "" {
  127960. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127961. }
  127962. var body io.Reader = nil
  127963. c.urlParams_.Set("alt", alt)
  127964. c.urlParams_.Set("prettyPrint", "false")
  127965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  127966. urls += "?" + c.urlParams_.Encode()
  127967. req, err := http.NewRequest("GET", urls, body)
  127968. if err != nil {
  127969. return nil, err
  127970. }
  127971. req.Header = reqHeaders
  127972. googleapi.Expand(req.URL, map[string]string{
  127973. "project": c.project,
  127974. })
  127975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127976. }
  127977. // Do executes the "compute.targetSslProxies.list" call.
  127978. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  127979. // non-2xx status code is an error. Response headers are in either
  127980. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  127981. // returned at all) in error.(*googleapi.Error).Header. Use
  127982. // googleapi.IsNotModified to check whether the returned error was
  127983. // because http.StatusNotModified was returned.
  127984. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  127985. gensupport.SetOptions(c.urlParams_, opts...)
  127986. res, err := c.doRequest("json")
  127987. if res != nil && res.StatusCode == http.StatusNotModified {
  127988. if res.Body != nil {
  127989. res.Body.Close()
  127990. }
  127991. return nil, &googleapi.Error{
  127992. Code: res.StatusCode,
  127993. Header: res.Header,
  127994. }
  127995. }
  127996. if err != nil {
  127997. return nil, err
  127998. }
  127999. defer googleapi.CloseBody(res)
  128000. if err := googleapi.CheckResponse(res); err != nil {
  128001. return nil, err
  128002. }
  128003. ret := &TargetSslProxyList{
  128004. ServerResponse: googleapi.ServerResponse{
  128005. Header: res.Header,
  128006. HTTPStatusCode: res.StatusCode,
  128007. },
  128008. }
  128009. target := &ret
  128010. if err := gensupport.DecodeResponse(target, res); err != nil {
  128011. return nil, err
  128012. }
  128013. return ret, nil
  128014. // {
  128015. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  128016. // "httpMethod": "GET",
  128017. // "id": "compute.targetSslProxies.list",
  128018. // "parameterOrder": [
  128019. // "project"
  128020. // ],
  128021. // "parameters": {
  128022. // "filter": {
  128023. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  128024. // "location": "query",
  128025. // "type": "string"
  128026. // },
  128027. // "maxResults": {
  128028. // "default": "500",
  128029. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  128030. // "format": "uint32",
  128031. // "location": "query",
  128032. // "minimum": "0",
  128033. // "type": "integer"
  128034. // },
  128035. // "orderBy": {
  128036. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  128037. // "location": "query",
  128038. // "type": "string"
  128039. // },
  128040. // "pageToken": {
  128041. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  128042. // "location": "query",
  128043. // "type": "string"
  128044. // },
  128045. // "project": {
  128046. // "description": "Project ID for this request.",
  128047. // "location": "path",
  128048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128049. // "required": true,
  128050. // "type": "string"
  128051. // }
  128052. // },
  128053. // "path": "{project}/global/targetSslProxies",
  128054. // "response": {
  128055. // "$ref": "TargetSslProxyList"
  128056. // },
  128057. // "scopes": [
  128058. // "https://www.googleapis.com/auth/cloud-platform",
  128059. // "https://www.googleapis.com/auth/compute",
  128060. // "https://www.googleapis.com/auth/compute.readonly"
  128061. // ]
  128062. // }
  128063. }
  128064. // Pages invokes f for each page of results.
  128065. // A non-nil error returned from f will halt the iteration.
  128066. // The provided context supersedes any context provided to the Context method.
  128067. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  128068. c.ctx_ = ctx
  128069. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  128070. for {
  128071. x, err := c.Do()
  128072. if err != nil {
  128073. return err
  128074. }
  128075. if err := f(x); err != nil {
  128076. return err
  128077. }
  128078. if x.NextPageToken == "" {
  128079. return nil
  128080. }
  128081. c.PageToken(x.NextPageToken)
  128082. }
  128083. }
  128084. // method id "compute.targetSslProxies.setBackendService":
  128085. type TargetSslProxiesSetBackendServiceCall struct {
  128086. s *Service
  128087. project string
  128088. targetSslProxy string
  128089. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  128090. urlParams_ gensupport.URLParams
  128091. ctx_ context.Context
  128092. header_ http.Header
  128093. }
  128094. // SetBackendService: Changes the BackendService for TargetSslProxy.
  128095. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  128096. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128097. c.project = project
  128098. c.targetSslProxy = targetSslProxy
  128099. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  128100. return c
  128101. }
  128102. // RequestId sets the optional parameter "requestId": An optional
  128103. // request ID to identify requests. Specify a unique request ID so that
  128104. // if you must retry your request, the server will know to ignore the
  128105. // request if it has already been completed.
  128106. //
  128107. // For example, consider a situation where you make an initial request
  128108. // and the request times out. If you make the request again with the
  128109. // same request ID, the server can check if original operation with the
  128110. // same request ID was received, and if so, will ignore the second
  128111. // request. This prevents clients from accidentally creating duplicate
  128112. // commitments.
  128113. //
  128114. // The request ID must be a valid UUID with the exception that zero UUID
  128115. // is not supported (00000000-0000-0000-0000-000000000000).
  128116. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  128117. c.urlParams_.Set("requestId", requestId)
  128118. return c
  128119. }
  128120. // Fields allows partial responses to be retrieved. See
  128121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128122. // for more information.
  128123. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  128124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128125. return c
  128126. }
  128127. // Context sets the context to be used in this call's Do method. Any
  128128. // pending HTTP request will be aborted if the provided context is
  128129. // canceled.
  128130. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  128131. c.ctx_ = ctx
  128132. return c
  128133. }
  128134. // Header returns an http.Header that can be modified by the caller to
  128135. // add HTTP headers to the request.
  128136. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  128137. if c.header_ == nil {
  128138. c.header_ = make(http.Header)
  128139. }
  128140. return c.header_
  128141. }
  128142. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  128143. reqHeaders := make(http.Header)
  128144. for k, v := range c.header_ {
  128145. reqHeaders[k] = v
  128146. }
  128147. reqHeaders.Set("User-Agent", c.s.userAgent())
  128148. var body io.Reader = nil
  128149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  128150. if err != nil {
  128151. return nil, err
  128152. }
  128153. reqHeaders.Set("Content-Type", "application/json")
  128154. c.urlParams_.Set("alt", alt)
  128155. c.urlParams_.Set("prettyPrint", "false")
  128156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  128157. urls += "?" + c.urlParams_.Encode()
  128158. req, err := http.NewRequest("POST", urls, body)
  128159. if err != nil {
  128160. return nil, err
  128161. }
  128162. req.Header = reqHeaders
  128163. googleapi.Expand(req.URL, map[string]string{
  128164. "project": c.project,
  128165. "targetSslProxy": c.targetSslProxy,
  128166. })
  128167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128168. }
  128169. // Do executes the "compute.targetSslProxies.setBackendService" call.
  128170. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128171. // status code is an error. Response headers are in either
  128172. // *Operation.ServerResponse.Header or (if a response was returned at
  128173. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128174. // to check whether the returned error was because
  128175. // http.StatusNotModified was returned.
  128176. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128177. gensupport.SetOptions(c.urlParams_, opts...)
  128178. res, err := c.doRequest("json")
  128179. if res != nil && res.StatusCode == http.StatusNotModified {
  128180. if res.Body != nil {
  128181. res.Body.Close()
  128182. }
  128183. return nil, &googleapi.Error{
  128184. Code: res.StatusCode,
  128185. Header: res.Header,
  128186. }
  128187. }
  128188. if err != nil {
  128189. return nil, err
  128190. }
  128191. defer googleapi.CloseBody(res)
  128192. if err := googleapi.CheckResponse(res); err != nil {
  128193. return nil, err
  128194. }
  128195. ret := &Operation{
  128196. ServerResponse: googleapi.ServerResponse{
  128197. Header: res.Header,
  128198. HTTPStatusCode: res.StatusCode,
  128199. },
  128200. }
  128201. target := &ret
  128202. if err := gensupport.DecodeResponse(target, res); err != nil {
  128203. return nil, err
  128204. }
  128205. return ret, nil
  128206. // {
  128207. // "description": "Changes the BackendService for TargetSslProxy.",
  128208. // "httpMethod": "POST",
  128209. // "id": "compute.targetSslProxies.setBackendService",
  128210. // "parameterOrder": [
  128211. // "project",
  128212. // "targetSslProxy"
  128213. // ],
  128214. // "parameters": {
  128215. // "project": {
  128216. // "description": "Project ID for this request.",
  128217. // "location": "path",
  128218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128219. // "required": true,
  128220. // "type": "string"
  128221. // },
  128222. // "requestId": {
  128223. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128224. // "location": "query",
  128225. // "type": "string"
  128226. // },
  128227. // "targetSslProxy": {
  128228. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  128229. // "location": "path",
  128230. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128231. // "required": true,
  128232. // "type": "string"
  128233. // }
  128234. // },
  128235. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  128236. // "request": {
  128237. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  128238. // },
  128239. // "response": {
  128240. // "$ref": "Operation"
  128241. // },
  128242. // "scopes": [
  128243. // "https://www.googleapis.com/auth/cloud-platform",
  128244. // "https://www.googleapis.com/auth/compute"
  128245. // ]
  128246. // }
  128247. }
  128248. // method id "compute.targetSslProxies.setProxyHeader":
  128249. type TargetSslProxiesSetProxyHeaderCall struct {
  128250. s *Service
  128251. project string
  128252. targetSslProxy string
  128253. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  128254. urlParams_ gensupport.URLParams
  128255. ctx_ context.Context
  128256. header_ http.Header
  128257. }
  128258. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  128259. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  128260. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128261. c.project = project
  128262. c.targetSslProxy = targetSslProxy
  128263. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  128264. return c
  128265. }
  128266. // RequestId sets the optional parameter "requestId": An optional
  128267. // request ID to identify requests. Specify a unique request ID so that
  128268. // if you must retry your request, the server will know to ignore the
  128269. // request if it has already been completed.
  128270. //
  128271. // For example, consider a situation where you make an initial request
  128272. // and the request times out. If you make the request again with the
  128273. // same request ID, the server can check if original operation with the
  128274. // same request ID was received, and if so, will ignore the second
  128275. // request. This prevents clients from accidentally creating duplicate
  128276. // commitments.
  128277. //
  128278. // The request ID must be a valid UUID with the exception that zero UUID
  128279. // is not supported (00000000-0000-0000-0000-000000000000).
  128280. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  128281. c.urlParams_.Set("requestId", requestId)
  128282. return c
  128283. }
  128284. // Fields allows partial responses to be retrieved. See
  128285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128286. // for more information.
  128287. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  128288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128289. return c
  128290. }
  128291. // Context sets the context to be used in this call's Do method. Any
  128292. // pending HTTP request will be aborted if the provided context is
  128293. // canceled.
  128294. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  128295. c.ctx_ = ctx
  128296. return c
  128297. }
  128298. // Header returns an http.Header that can be modified by the caller to
  128299. // add HTTP headers to the request.
  128300. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  128301. if c.header_ == nil {
  128302. c.header_ = make(http.Header)
  128303. }
  128304. return c.header_
  128305. }
  128306. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  128307. reqHeaders := make(http.Header)
  128308. for k, v := range c.header_ {
  128309. reqHeaders[k] = v
  128310. }
  128311. reqHeaders.Set("User-Agent", c.s.userAgent())
  128312. var body io.Reader = nil
  128313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  128314. if err != nil {
  128315. return nil, err
  128316. }
  128317. reqHeaders.Set("Content-Type", "application/json")
  128318. c.urlParams_.Set("alt", alt)
  128319. c.urlParams_.Set("prettyPrint", "false")
  128320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  128321. urls += "?" + c.urlParams_.Encode()
  128322. req, err := http.NewRequest("POST", urls, body)
  128323. if err != nil {
  128324. return nil, err
  128325. }
  128326. req.Header = reqHeaders
  128327. googleapi.Expand(req.URL, map[string]string{
  128328. "project": c.project,
  128329. "targetSslProxy": c.targetSslProxy,
  128330. })
  128331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128332. }
  128333. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  128334. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128335. // status code is an error. Response headers are in either
  128336. // *Operation.ServerResponse.Header or (if a response was returned at
  128337. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128338. // to check whether the returned error was because
  128339. // http.StatusNotModified was returned.
  128340. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128341. gensupport.SetOptions(c.urlParams_, opts...)
  128342. res, err := c.doRequest("json")
  128343. if res != nil && res.StatusCode == http.StatusNotModified {
  128344. if res.Body != nil {
  128345. res.Body.Close()
  128346. }
  128347. return nil, &googleapi.Error{
  128348. Code: res.StatusCode,
  128349. Header: res.Header,
  128350. }
  128351. }
  128352. if err != nil {
  128353. return nil, err
  128354. }
  128355. defer googleapi.CloseBody(res)
  128356. if err := googleapi.CheckResponse(res); err != nil {
  128357. return nil, err
  128358. }
  128359. ret := &Operation{
  128360. ServerResponse: googleapi.ServerResponse{
  128361. Header: res.Header,
  128362. HTTPStatusCode: res.StatusCode,
  128363. },
  128364. }
  128365. target := &ret
  128366. if err := gensupport.DecodeResponse(target, res); err != nil {
  128367. return nil, err
  128368. }
  128369. return ret, nil
  128370. // {
  128371. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  128372. // "httpMethod": "POST",
  128373. // "id": "compute.targetSslProxies.setProxyHeader",
  128374. // "parameterOrder": [
  128375. // "project",
  128376. // "targetSslProxy"
  128377. // ],
  128378. // "parameters": {
  128379. // "project": {
  128380. // "description": "Project ID for this request.",
  128381. // "location": "path",
  128382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128383. // "required": true,
  128384. // "type": "string"
  128385. // },
  128386. // "requestId": {
  128387. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128388. // "location": "query",
  128389. // "type": "string"
  128390. // },
  128391. // "targetSslProxy": {
  128392. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  128393. // "location": "path",
  128394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128395. // "required": true,
  128396. // "type": "string"
  128397. // }
  128398. // },
  128399. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  128400. // "request": {
  128401. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  128402. // },
  128403. // "response": {
  128404. // "$ref": "Operation"
  128405. // },
  128406. // "scopes": [
  128407. // "https://www.googleapis.com/auth/cloud-platform",
  128408. // "https://www.googleapis.com/auth/compute"
  128409. // ]
  128410. // }
  128411. }
  128412. // method id "compute.targetSslProxies.setSslCertificates":
  128413. type TargetSslProxiesSetSslCertificatesCall struct {
  128414. s *Service
  128415. project string
  128416. targetSslProxy string
  128417. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  128418. urlParams_ gensupport.URLParams
  128419. ctx_ context.Context
  128420. header_ http.Header
  128421. }
  128422. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  128423. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  128424. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128425. c.project = project
  128426. c.targetSslProxy = targetSslProxy
  128427. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  128428. return c
  128429. }
  128430. // RequestId sets the optional parameter "requestId": An optional
  128431. // request ID to identify requests. Specify a unique request ID so that
  128432. // if you must retry your request, the server will know to ignore the
  128433. // request if it has already been completed.
  128434. //
  128435. // For example, consider a situation where you make an initial request
  128436. // and the request times out. If you make the request again with the
  128437. // same request ID, the server can check if original operation with the
  128438. // same request ID was received, and if so, will ignore the second
  128439. // request. This prevents clients from accidentally creating duplicate
  128440. // commitments.
  128441. //
  128442. // The request ID must be a valid UUID with the exception that zero UUID
  128443. // is not supported (00000000-0000-0000-0000-000000000000).
  128444. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  128445. c.urlParams_.Set("requestId", requestId)
  128446. return c
  128447. }
  128448. // Fields allows partial responses to be retrieved. See
  128449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128450. // for more information.
  128451. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  128452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128453. return c
  128454. }
  128455. // Context sets the context to be used in this call's Do method. Any
  128456. // pending HTTP request will be aborted if the provided context is
  128457. // canceled.
  128458. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  128459. c.ctx_ = ctx
  128460. return c
  128461. }
  128462. // Header returns an http.Header that can be modified by the caller to
  128463. // add HTTP headers to the request.
  128464. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  128465. if c.header_ == nil {
  128466. c.header_ = make(http.Header)
  128467. }
  128468. return c.header_
  128469. }
  128470. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  128471. reqHeaders := make(http.Header)
  128472. for k, v := range c.header_ {
  128473. reqHeaders[k] = v
  128474. }
  128475. reqHeaders.Set("User-Agent", c.s.userAgent())
  128476. var body io.Reader = nil
  128477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  128478. if err != nil {
  128479. return nil, err
  128480. }
  128481. reqHeaders.Set("Content-Type", "application/json")
  128482. c.urlParams_.Set("alt", alt)
  128483. c.urlParams_.Set("prettyPrint", "false")
  128484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  128485. urls += "?" + c.urlParams_.Encode()
  128486. req, err := http.NewRequest("POST", urls, body)
  128487. if err != nil {
  128488. return nil, err
  128489. }
  128490. req.Header = reqHeaders
  128491. googleapi.Expand(req.URL, map[string]string{
  128492. "project": c.project,
  128493. "targetSslProxy": c.targetSslProxy,
  128494. })
  128495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128496. }
  128497. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  128498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128499. // status code is an error. Response headers are in either
  128500. // *Operation.ServerResponse.Header or (if a response was returned at
  128501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128502. // to check whether the returned error was because
  128503. // http.StatusNotModified was returned.
  128504. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128505. gensupport.SetOptions(c.urlParams_, opts...)
  128506. res, err := c.doRequest("json")
  128507. if res != nil && res.StatusCode == http.StatusNotModified {
  128508. if res.Body != nil {
  128509. res.Body.Close()
  128510. }
  128511. return nil, &googleapi.Error{
  128512. Code: res.StatusCode,
  128513. Header: res.Header,
  128514. }
  128515. }
  128516. if err != nil {
  128517. return nil, err
  128518. }
  128519. defer googleapi.CloseBody(res)
  128520. if err := googleapi.CheckResponse(res); err != nil {
  128521. return nil, err
  128522. }
  128523. ret := &Operation{
  128524. ServerResponse: googleapi.ServerResponse{
  128525. Header: res.Header,
  128526. HTTPStatusCode: res.StatusCode,
  128527. },
  128528. }
  128529. target := &ret
  128530. if err := gensupport.DecodeResponse(target, res); err != nil {
  128531. return nil, err
  128532. }
  128533. return ret, nil
  128534. // {
  128535. // "description": "Changes SslCertificates for TargetSslProxy.",
  128536. // "httpMethod": "POST",
  128537. // "id": "compute.targetSslProxies.setSslCertificates",
  128538. // "parameterOrder": [
  128539. // "project",
  128540. // "targetSslProxy"
  128541. // ],
  128542. // "parameters": {
  128543. // "project": {
  128544. // "description": "Project ID for this request.",
  128545. // "location": "path",
  128546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128547. // "required": true,
  128548. // "type": "string"
  128549. // },
  128550. // "requestId": {
  128551. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128552. // "location": "query",
  128553. // "type": "string"
  128554. // },
  128555. // "targetSslProxy": {
  128556. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  128557. // "location": "path",
  128558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128559. // "required": true,
  128560. // "type": "string"
  128561. // }
  128562. // },
  128563. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  128564. // "request": {
  128565. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  128566. // },
  128567. // "response": {
  128568. // "$ref": "Operation"
  128569. // },
  128570. // "scopes": [
  128571. // "https://www.googleapis.com/auth/cloud-platform",
  128572. // "https://www.googleapis.com/auth/compute"
  128573. // ]
  128574. // }
  128575. }
  128576. // method id "compute.targetSslProxies.setSslPolicy":
  128577. type TargetSslProxiesSetSslPolicyCall struct {
  128578. s *Service
  128579. project string
  128580. targetSslProxy string
  128581. sslpolicyreference *SslPolicyReference
  128582. urlParams_ gensupport.URLParams
  128583. ctx_ context.Context
  128584. header_ http.Header
  128585. }
  128586. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  128587. // specifies the server-side support for SSL features. This affects
  128588. // connections between clients and the SSL proxy load balancer. They do
  128589. // not affect the connection between the load balancer and the backends.
  128590. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  128591. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128592. c.project = project
  128593. c.targetSslProxy = targetSslProxy
  128594. c.sslpolicyreference = sslpolicyreference
  128595. return c
  128596. }
  128597. // RequestId sets the optional parameter "requestId": An optional
  128598. // request ID to identify requests. Specify a unique request ID so that
  128599. // if you must retry your request, the server will know to ignore the
  128600. // request if it has already been completed.
  128601. //
  128602. // For example, consider a situation where you make an initial request
  128603. // and the request times out. If you make the request again with the
  128604. // same request ID, the server can check if original operation with the
  128605. // same request ID was received, and if so, will ignore the second
  128606. // request. This prevents clients from accidentally creating duplicate
  128607. // commitments.
  128608. //
  128609. // The request ID must be a valid UUID with the exception that zero UUID
  128610. // is not supported (00000000-0000-0000-0000-000000000000).
  128611. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  128612. c.urlParams_.Set("requestId", requestId)
  128613. return c
  128614. }
  128615. // Fields allows partial responses to be retrieved. See
  128616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128617. // for more information.
  128618. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  128619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128620. return c
  128621. }
  128622. // Context sets the context to be used in this call's Do method. Any
  128623. // pending HTTP request will be aborted if the provided context is
  128624. // canceled.
  128625. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  128626. c.ctx_ = ctx
  128627. return c
  128628. }
  128629. // Header returns an http.Header that can be modified by the caller to
  128630. // add HTTP headers to the request.
  128631. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  128632. if c.header_ == nil {
  128633. c.header_ = make(http.Header)
  128634. }
  128635. return c.header_
  128636. }
  128637. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  128638. reqHeaders := make(http.Header)
  128639. for k, v := range c.header_ {
  128640. reqHeaders[k] = v
  128641. }
  128642. reqHeaders.Set("User-Agent", c.s.userAgent())
  128643. var body io.Reader = nil
  128644. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  128645. if err != nil {
  128646. return nil, err
  128647. }
  128648. reqHeaders.Set("Content-Type", "application/json")
  128649. c.urlParams_.Set("alt", alt)
  128650. c.urlParams_.Set("prettyPrint", "false")
  128651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  128652. urls += "?" + c.urlParams_.Encode()
  128653. req, err := http.NewRequest("POST", urls, body)
  128654. if err != nil {
  128655. return nil, err
  128656. }
  128657. req.Header = reqHeaders
  128658. googleapi.Expand(req.URL, map[string]string{
  128659. "project": c.project,
  128660. "targetSslProxy": c.targetSslProxy,
  128661. })
  128662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128663. }
  128664. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  128665. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128666. // status code is an error. Response headers are in either
  128667. // *Operation.ServerResponse.Header or (if a response was returned at
  128668. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128669. // to check whether the returned error was because
  128670. // http.StatusNotModified was returned.
  128671. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128672. gensupport.SetOptions(c.urlParams_, opts...)
  128673. res, err := c.doRequest("json")
  128674. if res != nil && res.StatusCode == http.StatusNotModified {
  128675. if res.Body != nil {
  128676. res.Body.Close()
  128677. }
  128678. return nil, &googleapi.Error{
  128679. Code: res.StatusCode,
  128680. Header: res.Header,
  128681. }
  128682. }
  128683. if err != nil {
  128684. return nil, err
  128685. }
  128686. defer googleapi.CloseBody(res)
  128687. if err := googleapi.CheckResponse(res); err != nil {
  128688. return nil, err
  128689. }
  128690. ret := &Operation{
  128691. ServerResponse: googleapi.ServerResponse{
  128692. Header: res.Header,
  128693. HTTPStatusCode: res.StatusCode,
  128694. },
  128695. }
  128696. target := &ret
  128697. if err := gensupport.DecodeResponse(target, res); err != nil {
  128698. return nil, err
  128699. }
  128700. return ret, nil
  128701. // {
  128702. // "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.",
  128703. // "httpMethod": "POST",
  128704. // "id": "compute.targetSslProxies.setSslPolicy",
  128705. // "parameterOrder": [
  128706. // "project",
  128707. // "targetSslProxy"
  128708. // ],
  128709. // "parameters": {
  128710. // "project": {
  128711. // "description": "Project ID for this request.",
  128712. // "location": "path",
  128713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128714. // "required": true,
  128715. // "type": "string"
  128716. // },
  128717. // "requestId": {
  128718. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128719. // "location": "query",
  128720. // "type": "string"
  128721. // },
  128722. // "targetSslProxy": {
  128723. // "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.",
  128724. // "location": "path",
  128725. // "required": true,
  128726. // "type": "string"
  128727. // }
  128728. // },
  128729. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  128730. // "request": {
  128731. // "$ref": "SslPolicyReference"
  128732. // },
  128733. // "response": {
  128734. // "$ref": "Operation"
  128735. // },
  128736. // "scopes": [
  128737. // "https://www.googleapis.com/auth/cloud-platform",
  128738. // "https://www.googleapis.com/auth/compute"
  128739. // ]
  128740. // }
  128741. }
  128742. // method id "compute.targetSslProxies.testIamPermissions":
  128743. type TargetSslProxiesTestIamPermissionsCall struct {
  128744. s *Service
  128745. project string
  128746. resource string
  128747. testpermissionsrequest *TestPermissionsRequest
  128748. urlParams_ gensupport.URLParams
  128749. ctx_ context.Context
  128750. header_ http.Header
  128751. }
  128752. // TestIamPermissions: Returns permissions that a caller has on the
  128753. // specified resource.
  128754. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  128755. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128756. c.project = project
  128757. c.resource = resource
  128758. c.testpermissionsrequest = testpermissionsrequest
  128759. return c
  128760. }
  128761. // Fields allows partial responses to be retrieved. See
  128762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128763. // for more information.
  128764. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  128765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128766. return c
  128767. }
  128768. // Context sets the context to be used in this call's Do method. Any
  128769. // pending HTTP request will be aborted if the provided context is
  128770. // canceled.
  128771. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  128772. c.ctx_ = ctx
  128773. return c
  128774. }
  128775. // Header returns an http.Header that can be modified by the caller to
  128776. // add HTTP headers to the request.
  128777. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  128778. if c.header_ == nil {
  128779. c.header_ = make(http.Header)
  128780. }
  128781. return c.header_
  128782. }
  128783. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  128784. reqHeaders := make(http.Header)
  128785. for k, v := range c.header_ {
  128786. reqHeaders[k] = v
  128787. }
  128788. reqHeaders.Set("User-Agent", c.s.userAgent())
  128789. var body io.Reader = nil
  128790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  128791. if err != nil {
  128792. return nil, err
  128793. }
  128794. reqHeaders.Set("Content-Type", "application/json")
  128795. c.urlParams_.Set("alt", alt)
  128796. c.urlParams_.Set("prettyPrint", "false")
  128797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  128798. urls += "?" + c.urlParams_.Encode()
  128799. req, err := http.NewRequest("POST", urls, body)
  128800. if err != nil {
  128801. return nil, err
  128802. }
  128803. req.Header = reqHeaders
  128804. googleapi.Expand(req.URL, map[string]string{
  128805. "project": c.project,
  128806. "resource": c.resource,
  128807. })
  128808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128809. }
  128810. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  128811. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  128812. // non-2xx status code is an error. Response headers are in either
  128813. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  128814. // returned at all) in error.(*googleapi.Error).Header. Use
  128815. // googleapi.IsNotModified to check whether the returned error was
  128816. // because http.StatusNotModified was returned.
  128817. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  128818. gensupport.SetOptions(c.urlParams_, opts...)
  128819. res, err := c.doRequest("json")
  128820. if res != nil && res.StatusCode == http.StatusNotModified {
  128821. if res.Body != nil {
  128822. res.Body.Close()
  128823. }
  128824. return nil, &googleapi.Error{
  128825. Code: res.StatusCode,
  128826. Header: res.Header,
  128827. }
  128828. }
  128829. if err != nil {
  128830. return nil, err
  128831. }
  128832. defer googleapi.CloseBody(res)
  128833. if err := googleapi.CheckResponse(res); err != nil {
  128834. return nil, err
  128835. }
  128836. ret := &TestPermissionsResponse{
  128837. ServerResponse: googleapi.ServerResponse{
  128838. Header: res.Header,
  128839. HTTPStatusCode: res.StatusCode,
  128840. },
  128841. }
  128842. target := &ret
  128843. if err := gensupport.DecodeResponse(target, res); err != nil {
  128844. return nil, err
  128845. }
  128846. return ret, nil
  128847. // {
  128848. // "description": "Returns permissions that a caller has on the specified resource.",
  128849. // "httpMethod": "POST",
  128850. // "id": "compute.targetSslProxies.testIamPermissions",
  128851. // "parameterOrder": [
  128852. // "project",
  128853. // "resource"
  128854. // ],
  128855. // "parameters": {
  128856. // "project": {
  128857. // "description": "Project ID for this request.",
  128858. // "location": "path",
  128859. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128860. // "required": true,
  128861. // "type": "string"
  128862. // },
  128863. // "resource": {
  128864. // "description": "Name or id of the resource for this request.",
  128865. // "location": "path",
  128866. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128867. // "required": true,
  128868. // "type": "string"
  128869. // }
  128870. // },
  128871. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  128872. // "request": {
  128873. // "$ref": "TestPermissionsRequest"
  128874. // },
  128875. // "response": {
  128876. // "$ref": "TestPermissionsResponse"
  128877. // },
  128878. // "scopes": [
  128879. // "https://www.googleapis.com/auth/cloud-platform",
  128880. // "https://www.googleapis.com/auth/compute",
  128881. // "https://www.googleapis.com/auth/compute.readonly"
  128882. // ]
  128883. // }
  128884. }
  128885. // method id "compute.targetTcpProxies.delete":
  128886. type TargetTcpProxiesDeleteCall struct {
  128887. s *Service
  128888. project string
  128889. targetTcpProxy string
  128890. urlParams_ gensupport.URLParams
  128891. ctx_ context.Context
  128892. header_ http.Header
  128893. }
  128894. // Delete: Deletes the specified TargetTcpProxy resource.
  128895. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  128896. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128897. c.project = project
  128898. c.targetTcpProxy = targetTcpProxy
  128899. return c
  128900. }
  128901. // RequestId sets the optional parameter "requestId": An optional
  128902. // request ID to identify requests. Specify a unique request ID so that
  128903. // if you must retry your request, the server will know to ignore the
  128904. // request if it has already been completed.
  128905. //
  128906. // For example, consider a situation where you make an initial request
  128907. // and the request times out. If you make the request again with the
  128908. // same request ID, the server can check if original operation with the
  128909. // same request ID was received, and if so, will ignore the second
  128910. // request. This prevents clients from accidentally creating duplicate
  128911. // commitments.
  128912. //
  128913. // The request ID must be a valid UUID with the exception that zero UUID
  128914. // is not supported (00000000-0000-0000-0000-000000000000).
  128915. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  128916. c.urlParams_.Set("requestId", requestId)
  128917. return c
  128918. }
  128919. // Fields allows partial responses to be retrieved. See
  128920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128921. // for more information.
  128922. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  128923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128924. return c
  128925. }
  128926. // Context sets the context to be used in this call's Do method. Any
  128927. // pending HTTP request will be aborted if the provided context is
  128928. // canceled.
  128929. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  128930. c.ctx_ = ctx
  128931. return c
  128932. }
  128933. // Header returns an http.Header that can be modified by the caller to
  128934. // add HTTP headers to the request.
  128935. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  128936. if c.header_ == nil {
  128937. c.header_ = make(http.Header)
  128938. }
  128939. return c.header_
  128940. }
  128941. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  128942. reqHeaders := make(http.Header)
  128943. for k, v := range c.header_ {
  128944. reqHeaders[k] = v
  128945. }
  128946. reqHeaders.Set("User-Agent", c.s.userAgent())
  128947. var body io.Reader = nil
  128948. c.urlParams_.Set("alt", alt)
  128949. c.urlParams_.Set("prettyPrint", "false")
  128950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  128951. urls += "?" + c.urlParams_.Encode()
  128952. req, err := http.NewRequest("DELETE", urls, body)
  128953. if err != nil {
  128954. return nil, err
  128955. }
  128956. req.Header = reqHeaders
  128957. googleapi.Expand(req.URL, map[string]string{
  128958. "project": c.project,
  128959. "targetTcpProxy": c.targetTcpProxy,
  128960. })
  128961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128962. }
  128963. // Do executes the "compute.targetTcpProxies.delete" call.
  128964. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128965. // status code is an error. Response headers are in either
  128966. // *Operation.ServerResponse.Header or (if a response was returned at
  128967. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128968. // to check whether the returned error was because
  128969. // http.StatusNotModified was returned.
  128970. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128971. gensupport.SetOptions(c.urlParams_, opts...)
  128972. res, err := c.doRequest("json")
  128973. if res != nil && res.StatusCode == http.StatusNotModified {
  128974. if res.Body != nil {
  128975. res.Body.Close()
  128976. }
  128977. return nil, &googleapi.Error{
  128978. Code: res.StatusCode,
  128979. Header: res.Header,
  128980. }
  128981. }
  128982. if err != nil {
  128983. return nil, err
  128984. }
  128985. defer googleapi.CloseBody(res)
  128986. if err := googleapi.CheckResponse(res); err != nil {
  128987. return nil, err
  128988. }
  128989. ret := &Operation{
  128990. ServerResponse: googleapi.ServerResponse{
  128991. Header: res.Header,
  128992. HTTPStatusCode: res.StatusCode,
  128993. },
  128994. }
  128995. target := &ret
  128996. if err := gensupport.DecodeResponse(target, res); err != nil {
  128997. return nil, err
  128998. }
  128999. return ret, nil
  129000. // {
  129001. // "description": "Deletes the specified TargetTcpProxy resource.",
  129002. // "httpMethod": "DELETE",
  129003. // "id": "compute.targetTcpProxies.delete",
  129004. // "parameterOrder": [
  129005. // "project",
  129006. // "targetTcpProxy"
  129007. // ],
  129008. // "parameters": {
  129009. // "project": {
  129010. // "description": "Project ID for this request.",
  129011. // "location": "path",
  129012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129013. // "required": true,
  129014. // "type": "string"
  129015. // },
  129016. // "requestId": {
  129017. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129018. // "location": "query",
  129019. // "type": "string"
  129020. // },
  129021. // "targetTcpProxy": {
  129022. // "description": "Name of the TargetTcpProxy resource to delete.",
  129023. // "location": "path",
  129024. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129025. // "required": true,
  129026. // "type": "string"
  129027. // }
  129028. // },
  129029. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  129030. // "response": {
  129031. // "$ref": "Operation"
  129032. // },
  129033. // "scopes": [
  129034. // "https://www.googleapis.com/auth/cloud-platform",
  129035. // "https://www.googleapis.com/auth/compute"
  129036. // ]
  129037. // }
  129038. }
  129039. // method id "compute.targetTcpProxies.get":
  129040. type TargetTcpProxiesGetCall struct {
  129041. s *Service
  129042. project string
  129043. targetTcpProxy string
  129044. urlParams_ gensupport.URLParams
  129045. ifNoneMatch_ string
  129046. ctx_ context.Context
  129047. header_ http.Header
  129048. }
  129049. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  129050. // available target TCP proxies by making a list() request.
  129051. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  129052. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129053. c.project = project
  129054. c.targetTcpProxy = targetTcpProxy
  129055. return c
  129056. }
  129057. // Fields allows partial responses to be retrieved. See
  129058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129059. // for more information.
  129060. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  129061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129062. return c
  129063. }
  129064. // IfNoneMatch sets the optional parameter which makes the operation
  129065. // fail if the object's ETag matches the given value. This is useful for
  129066. // getting updates only after the object has changed since the last
  129067. // request. Use googleapi.IsNotModified to check whether the response
  129068. // error from Do is the result of In-None-Match.
  129069. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  129070. c.ifNoneMatch_ = entityTag
  129071. return c
  129072. }
  129073. // Context sets the context to be used in this call's Do method. Any
  129074. // pending HTTP request will be aborted if the provided context is
  129075. // canceled.
  129076. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  129077. c.ctx_ = ctx
  129078. return c
  129079. }
  129080. // Header returns an http.Header that can be modified by the caller to
  129081. // add HTTP headers to the request.
  129082. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  129083. if c.header_ == nil {
  129084. c.header_ = make(http.Header)
  129085. }
  129086. return c.header_
  129087. }
  129088. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  129089. reqHeaders := make(http.Header)
  129090. for k, v := range c.header_ {
  129091. reqHeaders[k] = v
  129092. }
  129093. reqHeaders.Set("User-Agent", c.s.userAgent())
  129094. if c.ifNoneMatch_ != "" {
  129095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129096. }
  129097. var body io.Reader = nil
  129098. c.urlParams_.Set("alt", alt)
  129099. c.urlParams_.Set("prettyPrint", "false")
  129100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  129101. urls += "?" + c.urlParams_.Encode()
  129102. req, err := http.NewRequest("GET", urls, body)
  129103. if err != nil {
  129104. return nil, err
  129105. }
  129106. req.Header = reqHeaders
  129107. googleapi.Expand(req.URL, map[string]string{
  129108. "project": c.project,
  129109. "targetTcpProxy": c.targetTcpProxy,
  129110. })
  129111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129112. }
  129113. // Do executes the "compute.targetTcpProxies.get" call.
  129114. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  129115. // status code is an error. Response headers are in either
  129116. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  129117. // at all) in error.(*googleapi.Error).Header. Use
  129118. // googleapi.IsNotModified to check whether the returned error was
  129119. // because http.StatusNotModified was returned.
  129120. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  129121. gensupport.SetOptions(c.urlParams_, opts...)
  129122. res, err := c.doRequest("json")
  129123. if res != nil && res.StatusCode == http.StatusNotModified {
  129124. if res.Body != nil {
  129125. res.Body.Close()
  129126. }
  129127. return nil, &googleapi.Error{
  129128. Code: res.StatusCode,
  129129. Header: res.Header,
  129130. }
  129131. }
  129132. if err != nil {
  129133. return nil, err
  129134. }
  129135. defer googleapi.CloseBody(res)
  129136. if err := googleapi.CheckResponse(res); err != nil {
  129137. return nil, err
  129138. }
  129139. ret := &TargetTcpProxy{
  129140. ServerResponse: googleapi.ServerResponse{
  129141. Header: res.Header,
  129142. HTTPStatusCode: res.StatusCode,
  129143. },
  129144. }
  129145. target := &ret
  129146. if err := gensupport.DecodeResponse(target, res); err != nil {
  129147. return nil, err
  129148. }
  129149. return ret, nil
  129150. // {
  129151. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  129152. // "httpMethod": "GET",
  129153. // "id": "compute.targetTcpProxies.get",
  129154. // "parameterOrder": [
  129155. // "project",
  129156. // "targetTcpProxy"
  129157. // ],
  129158. // "parameters": {
  129159. // "project": {
  129160. // "description": "Project ID for this request.",
  129161. // "location": "path",
  129162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129163. // "required": true,
  129164. // "type": "string"
  129165. // },
  129166. // "targetTcpProxy": {
  129167. // "description": "Name of the TargetTcpProxy resource to return.",
  129168. // "location": "path",
  129169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129170. // "required": true,
  129171. // "type": "string"
  129172. // }
  129173. // },
  129174. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  129175. // "response": {
  129176. // "$ref": "TargetTcpProxy"
  129177. // },
  129178. // "scopes": [
  129179. // "https://www.googleapis.com/auth/cloud-platform",
  129180. // "https://www.googleapis.com/auth/compute",
  129181. // "https://www.googleapis.com/auth/compute.readonly"
  129182. // ]
  129183. // }
  129184. }
  129185. // method id "compute.targetTcpProxies.insert":
  129186. type TargetTcpProxiesInsertCall struct {
  129187. s *Service
  129188. project string
  129189. targettcpproxy *TargetTcpProxy
  129190. urlParams_ gensupport.URLParams
  129191. ctx_ context.Context
  129192. header_ http.Header
  129193. }
  129194. // Insert: Creates a TargetTcpProxy resource in the specified project
  129195. // using the data included in the request.
  129196. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  129197. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129198. c.project = project
  129199. c.targettcpproxy = targettcpproxy
  129200. return c
  129201. }
  129202. // RequestId sets the optional parameter "requestId": An optional
  129203. // request ID to identify requests. Specify a unique request ID so that
  129204. // if you must retry your request, the server will know to ignore the
  129205. // request if it has already been completed.
  129206. //
  129207. // For example, consider a situation where you make an initial request
  129208. // and the request times out. If you make the request again with the
  129209. // same request ID, the server can check if original operation with the
  129210. // same request ID was received, and if so, will ignore the second
  129211. // request. This prevents clients from accidentally creating duplicate
  129212. // commitments.
  129213. //
  129214. // The request ID must be a valid UUID with the exception that zero UUID
  129215. // is not supported (00000000-0000-0000-0000-000000000000).
  129216. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  129217. c.urlParams_.Set("requestId", requestId)
  129218. return c
  129219. }
  129220. // Fields allows partial responses to be retrieved. See
  129221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129222. // for more information.
  129223. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  129224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129225. return c
  129226. }
  129227. // Context sets the context to be used in this call's Do method. Any
  129228. // pending HTTP request will be aborted if the provided context is
  129229. // canceled.
  129230. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  129231. c.ctx_ = ctx
  129232. return c
  129233. }
  129234. // Header returns an http.Header that can be modified by the caller to
  129235. // add HTTP headers to the request.
  129236. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  129237. if c.header_ == nil {
  129238. c.header_ = make(http.Header)
  129239. }
  129240. return c.header_
  129241. }
  129242. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  129243. reqHeaders := make(http.Header)
  129244. for k, v := range c.header_ {
  129245. reqHeaders[k] = v
  129246. }
  129247. reqHeaders.Set("User-Agent", c.s.userAgent())
  129248. var body io.Reader = nil
  129249. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  129250. if err != nil {
  129251. return nil, err
  129252. }
  129253. reqHeaders.Set("Content-Type", "application/json")
  129254. c.urlParams_.Set("alt", alt)
  129255. c.urlParams_.Set("prettyPrint", "false")
  129256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  129257. urls += "?" + c.urlParams_.Encode()
  129258. req, err := http.NewRequest("POST", urls, body)
  129259. if err != nil {
  129260. return nil, err
  129261. }
  129262. req.Header = reqHeaders
  129263. googleapi.Expand(req.URL, map[string]string{
  129264. "project": c.project,
  129265. })
  129266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129267. }
  129268. // Do executes the "compute.targetTcpProxies.insert" call.
  129269. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129270. // status code is an error. Response headers are in either
  129271. // *Operation.ServerResponse.Header or (if a response was returned at
  129272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129273. // to check whether the returned error was because
  129274. // http.StatusNotModified was returned.
  129275. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129276. gensupport.SetOptions(c.urlParams_, opts...)
  129277. res, err := c.doRequest("json")
  129278. if res != nil && res.StatusCode == http.StatusNotModified {
  129279. if res.Body != nil {
  129280. res.Body.Close()
  129281. }
  129282. return nil, &googleapi.Error{
  129283. Code: res.StatusCode,
  129284. Header: res.Header,
  129285. }
  129286. }
  129287. if err != nil {
  129288. return nil, err
  129289. }
  129290. defer googleapi.CloseBody(res)
  129291. if err := googleapi.CheckResponse(res); err != nil {
  129292. return nil, err
  129293. }
  129294. ret := &Operation{
  129295. ServerResponse: googleapi.ServerResponse{
  129296. Header: res.Header,
  129297. HTTPStatusCode: res.StatusCode,
  129298. },
  129299. }
  129300. target := &ret
  129301. if err := gensupport.DecodeResponse(target, res); err != nil {
  129302. return nil, err
  129303. }
  129304. return ret, nil
  129305. // {
  129306. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  129307. // "httpMethod": "POST",
  129308. // "id": "compute.targetTcpProxies.insert",
  129309. // "parameterOrder": [
  129310. // "project"
  129311. // ],
  129312. // "parameters": {
  129313. // "project": {
  129314. // "description": "Project ID for this request.",
  129315. // "location": "path",
  129316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129317. // "required": true,
  129318. // "type": "string"
  129319. // },
  129320. // "requestId": {
  129321. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129322. // "location": "query",
  129323. // "type": "string"
  129324. // }
  129325. // },
  129326. // "path": "{project}/global/targetTcpProxies",
  129327. // "request": {
  129328. // "$ref": "TargetTcpProxy"
  129329. // },
  129330. // "response": {
  129331. // "$ref": "Operation"
  129332. // },
  129333. // "scopes": [
  129334. // "https://www.googleapis.com/auth/cloud-platform",
  129335. // "https://www.googleapis.com/auth/compute"
  129336. // ]
  129337. // }
  129338. }
  129339. // method id "compute.targetTcpProxies.list":
  129340. type TargetTcpProxiesListCall struct {
  129341. s *Service
  129342. project string
  129343. urlParams_ gensupport.URLParams
  129344. ifNoneMatch_ string
  129345. ctx_ context.Context
  129346. header_ http.Header
  129347. }
  129348. // List: Retrieves the list of TargetTcpProxy resources available to the
  129349. // specified project.
  129350. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  129351. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129352. c.project = project
  129353. return c
  129354. }
  129355. // Filter sets the optional parameter "filter": A filter expression that
  129356. // filters resources listed in the response. The expression must specify
  129357. // the field name, a comparison operator, and the value that you want to
  129358. // use for filtering. The value must be a string, a number, or a
  129359. // boolean. The comparison operator must be either =, !=, >, or <.
  129360. //
  129361. // For example, if you are filtering Compute Engine instances, you can
  129362. // exclude instances named example-instance by specifying name !=
  129363. // example-instance.
  129364. //
  129365. // You can also filter nested fields. For example, you could specify
  129366. // scheduling.automaticRestart = false to include instances only if they
  129367. // are not scheduled for automatic restarts. You can use filtering on
  129368. // nested fields to filter based on resource labels.
  129369. //
  129370. // To filter on multiple expressions, provide each separate expression
  129371. // within parentheses. For example, (scheduling.automaticRestart = true)
  129372. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  129373. // AND expression. However, you can include AND and OR expressions
  129374. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  129375. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  129376. // true).
  129377. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  129378. c.urlParams_.Set("filter", filter)
  129379. return c
  129380. }
  129381. // MaxResults sets the optional parameter "maxResults": The maximum
  129382. // number of results per page that should be returned. If the number of
  129383. // available results is larger than maxResults, Compute Engine returns a
  129384. // nextPageToken that can be used to get the next page of results in
  129385. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  129386. // (Default: 500)
  129387. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  129388. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  129389. return c
  129390. }
  129391. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  129392. // a certain order. By default, results are returned in alphanumerical
  129393. // order based on the resource name.
  129394. //
  129395. // You can also sort results in descending order based on the creation
  129396. // timestamp using orderBy="creationTimestamp desc". This sorts results
  129397. // based on the creationTimestamp field in reverse chronological order
  129398. // (newest result first). Use this to sort resources like operations so
  129399. // that the newest operation is returned first.
  129400. //
  129401. // Currently, only sorting by name or creationTimestamp desc is
  129402. // supported.
  129403. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  129404. c.urlParams_.Set("orderBy", orderBy)
  129405. return c
  129406. }
  129407. // PageToken sets the optional parameter "pageToken": Specifies a page
  129408. // token to use. Set pageToken to the nextPageToken returned by a
  129409. // previous list request to get the next page of results.
  129410. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  129411. c.urlParams_.Set("pageToken", pageToken)
  129412. return c
  129413. }
  129414. // Fields allows partial responses to be retrieved. See
  129415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129416. // for more information.
  129417. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  129418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129419. return c
  129420. }
  129421. // IfNoneMatch sets the optional parameter which makes the operation
  129422. // fail if the object's ETag matches the given value. This is useful for
  129423. // getting updates only after the object has changed since the last
  129424. // request. Use googleapi.IsNotModified to check whether the response
  129425. // error from Do is the result of In-None-Match.
  129426. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  129427. c.ifNoneMatch_ = entityTag
  129428. return c
  129429. }
  129430. // Context sets the context to be used in this call's Do method. Any
  129431. // pending HTTP request will be aborted if the provided context is
  129432. // canceled.
  129433. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  129434. c.ctx_ = ctx
  129435. return c
  129436. }
  129437. // Header returns an http.Header that can be modified by the caller to
  129438. // add HTTP headers to the request.
  129439. func (c *TargetTcpProxiesListCall) Header() http.Header {
  129440. if c.header_ == nil {
  129441. c.header_ = make(http.Header)
  129442. }
  129443. return c.header_
  129444. }
  129445. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  129446. reqHeaders := make(http.Header)
  129447. for k, v := range c.header_ {
  129448. reqHeaders[k] = v
  129449. }
  129450. reqHeaders.Set("User-Agent", c.s.userAgent())
  129451. if c.ifNoneMatch_ != "" {
  129452. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129453. }
  129454. var body io.Reader = nil
  129455. c.urlParams_.Set("alt", alt)
  129456. c.urlParams_.Set("prettyPrint", "false")
  129457. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  129458. urls += "?" + c.urlParams_.Encode()
  129459. req, err := http.NewRequest("GET", urls, body)
  129460. if err != nil {
  129461. return nil, err
  129462. }
  129463. req.Header = reqHeaders
  129464. googleapi.Expand(req.URL, map[string]string{
  129465. "project": c.project,
  129466. })
  129467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129468. }
  129469. // Do executes the "compute.targetTcpProxies.list" call.
  129470. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  129471. // non-2xx status code is an error. Response headers are in either
  129472. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  129473. // returned at all) in error.(*googleapi.Error).Header. Use
  129474. // googleapi.IsNotModified to check whether the returned error was
  129475. // because http.StatusNotModified was returned.
  129476. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  129477. gensupport.SetOptions(c.urlParams_, opts...)
  129478. res, err := c.doRequest("json")
  129479. if res != nil && res.StatusCode == http.StatusNotModified {
  129480. if res.Body != nil {
  129481. res.Body.Close()
  129482. }
  129483. return nil, &googleapi.Error{
  129484. Code: res.StatusCode,
  129485. Header: res.Header,
  129486. }
  129487. }
  129488. if err != nil {
  129489. return nil, err
  129490. }
  129491. defer googleapi.CloseBody(res)
  129492. if err := googleapi.CheckResponse(res); err != nil {
  129493. return nil, err
  129494. }
  129495. ret := &TargetTcpProxyList{
  129496. ServerResponse: googleapi.ServerResponse{
  129497. Header: res.Header,
  129498. HTTPStatusCode: res.StatusCode,
  129499. },
  129500. }
  129501. target := &ret
  129502. if err := gensupport.DecodeResponse(target, res); err != nil {
  129503. return nil, err
  129504. }
  129505. return ret, nil
  129506. // {
  129507. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  129508. // "httpMethod": "GET",
  129509. // "id": "compute.targetTcpProxies.list",
  129510. // "parameterOrder": [
  129511. // "project"
  129512. // ],
  129513. // "parameters": {
  129514. // "filter": {
  129515. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  129516. // "location": "query",
  129517. // "type": "string"
  129518. // },
  129519. // "maxResults": {
  129520. // "default": "500",
  129521. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  129522. // "format": "uint32",
  129523. // "location": "query",
  129524. // "minimum": "0",
  129525. // "type": "integer"
  129526. // },
  129527. // "orderBy": {
  129528. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  129529. // "location": "query",
  129530. // "type": "string"
  129531. // },
  129532. // "pageToken": {
  129533. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  129534. // "location": "query",
  129535. // "type": "string"
  129536. // },
  129537. // "project": {
  129538. // "description": "Project ID for this request.",
  129539. // "location": "path",
  129540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129541. // "required": true,
  129542. // "type": "string"
  129543. // }
  129544. // },
  129545. // "path": "{project}/global/targetTcpProxies",
  129546. // "response": {
  129547. // "$ref": "TargetTcpProxyList"
  129548. // },
  129549. // "scopes": [
  129550. // "https://www.googleapis.com/auth/cloud-platform",
  129551. // "https://www.googleapis.com/auth/compute",
  129552. // "https://www.googleapis.com/auth/compute.readonly"
  129553. // ]
  129554. // }
  129555. }
  129556. // Pages invokes f for each page of results.
  129557. // A non-nil error returned from f will halt the iteration.
  129558. // The provided context supersedes any context provided to the Context method.
  129559. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  129560. c.ctx_ = ctx
  129561. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  129562. for {
  129563. x, err := c.Do()
  129564. if err != nil {
  129565. return err
  129566. }
  129567. if err := f(x); err != nil {
  129568. return err
  129569. }
  129570. if x.NextPageToken == "" {
  129571. return nil
  129572. }
  129573. c.PageToken(x.NextPageToken)
  129574. }
  129575. }
  129576. // method id "compute.targetTcpProxies.setBackendService":
  129577. type TargetTcpProxiesSetBackendServiceCall struct {
  129578. s *Service
  129579. project string
  129580. targetTcpProxy string
  129581. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  129582. urlParams_ gensupport.URLParams
  129583. ctx_ context.Context
  129584. header_ http.Header
  129585. }
  129586. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  129587. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  129588. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129589. c.project = project
  129590. c.targetTcpProxy = targetTcpProxy
  129591. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  129592. return c
  129593. }
  129594. // RequestId sets the optional parameter "requestId": An optional
  129595. // request ID to identify requests. Specify a unique request ID so that
  129596. // if you must retry your request, the server will know to ignore the
  129597. // request if it has already been completed.
  129598. //
  129599. // For example, consider a situation where you make an initial request
  129600. // and the request times out. If you make the request again with the
  129601. // same request ID, the server can check if original operation with the
  129602. // same request ID was received, and if so, will ignore the second
  129603. // request. This prevents clients from accidentally creating duplicate
  129604. // commitments.
  129605. //
  129606. // The request ID must be a valid UUID with the exception that zero UUID
  129607. // is not supported (00000000-0000-0000-0000-000000000000).
  129608. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  129609. c.urlParams_.Set("requestId", requestId)
  129610. return c
  129611. }
  129612. // Fields allows partial responses to be retrieved. See
  129613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129614. // for more information.
  129615. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  129616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129617. return c
  129618. }
  129619. // Context sets the context to be used in this call's Do method. Any
  129620. // pending HTTP request will be aborted if the provided context is
  129621. // canceled.
  129622. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  129623. c.ctx_ = ctx
  129624. return c
  129625. }
  129626. // Header returns an http.Header that can be modified by the caller to
  129627. // add HTTP headers to the request.
  129628. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  129629. if c.header_ == nil {
  129630. c.header_ = make(http.Header)
  129631. }
  129632. return c.header_
  129633. }
  129634. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  129635. reqHeaders := make(http.Header)
  129636. for k, v := range c.header_ {
  129637. reqHeaders[k] = v
  129638. }
  129639. reqHeaders.Set("User-Agent", c.s.userAgent())
  129640. var body io.Reader = nil
  129641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  129642. if err != nil {
  129643. return nil, err
  129644. }
  129645. reqHeaders.Set("Content-Type", "application/json")
  129646. c.urlParams_.Set("alt", alt)
  129647. c.urlParams_.Set("prettyPrint", "false")
  129648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  129649. urls += "?" + c.urlParams_.Encode()
  129650. req, err := http.NewRequest("POST", urls, body)
  129651. if err != nil {
  129652. return nil, err
  129653. }
  129654. req.Header = reqHeaders
  129655. googleapi.Expand(req.URL, map[string]string{
  129656. "project": c.project,
  129657. "targetTcpProxy": c.targetTcpProxy,
  129658. })
  129659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129660. }
  129661. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  129662. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129663. // status code is an error. Response headers are in either
  129664. // *Operation.ServerResponse.Header or (if a response was returned at
  129665. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129666. // to check whether the returned error was because
  129667. // http.StatusNotModified was returned.
  129668. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129669. gensupport.SetOptions(c.urlParams_, opts...)
  129670. res, err := c.doRequest("json")
  129671. if res != nil && res.StatusCode == http.StatusNotModified {
  129672. if res.Body != nil {
  129673. res.Body.Close()
  129674. }
  129675. return nil, &googleapi.Error{
  129676. Code: res.StatusCode,
  129677. Header: res.Header,
  129678. }
  129679. }
  129680. if err != nil {
  129681. return nil, err
  129682. }
  129683. defer googleapi.CloseBody(res)
  129684. if err := googleapi.CheckResponse(res); err != nil {
  129685. return nil, err
  129686. }
  129687. ret := &Operation{
  129688. ServerResponse: googleapi.ServerResponse{
  129689. Header: res.Header,
  129690. HTTPStatusCode: res.StatusCode,
  129691. },
  129692. }
  129693. target := &ret
  129694. if err := gensupport.DecodeResponse(target, res); err != nil {
  129695. return nil, err
  129696. }
  129697. return ret, nil
  129698. // {
  129699. // "description": "Changes the BackendService for TargetTcpProxy.",
  129700. // "httpMethod": "POST",
  129701. // "id": "compute.targetTcpProxies.setBackendService",
  129702. // "parameterOrder": [
  129703. // "project",
  129704. // "targetTcpProxy"
  129705. // ],
  129706. // "parameters": {
  129707. // "project": {
  129708. // "description": "Project ID for this request.",
  129709. // "location": "path",
  129710. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129711. // "required": true,
  129712. // "type": "string"
  129713. // },
  129714. // "requestId": {
  129715. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129716. // "location": "query",
  129717. // "type": "string"
  129718. // },
  129719. // "targetTcpProxy": {
  129720. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  129721. // "location": "path",
  129722. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129723. // "required": true,
  129724. // "type": "string"
  129725. // }
  129726. // },
  129727. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  129728. // "request": {
  129729. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  129730. // },
  129731. // "response": {
  129732. // "$ref": "Operation"
  129733. // },
  129734. // "scopes": [
  129735. // "https://www.googleapis.com/auth/cloud-platform",
  129736. // "https://www.googleapis.com/auth/compute"
  129737. // ]
  129738. // }
  129739. }
  129740. // method id "compute.targetTcpProxies.setProxyHeader":
  129741. type TargetTcpProxiesSetProxyHeaderCall struct {
  129742. s *Service
  129743. project string
  129744. targetTcpProxy string
  129745. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  129746. urlParams_ gensupport.URLParams
  129747. ctx_ context.Context
  129748. header_ http.Header
  129749. }
  129750. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  129751. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  129752. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129753. c.project = project
  129754. c.targetTcpProxy = targetTcpProxy
  129755. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  129756. return c
  129757. }
  129758. // RequestId sets the optional parameter "requestId": An optional
  129759. // request ID to identify requests. Specify a unique request ID so that
  129760. // if you must retry your request, the server will know to ignore the
  129761. // request if it has already been completed.
  129762. //
  129763. // For example, consider a situation where you make an initial request
  129764. // and the request times out. If you make the request again with the
  129765. // same request ID, the server can check if original operation with the
  129766. // same request ID was received, and if so, will ignore the second
  129767. // request. This prevents clients from accidentally creating duplicate
  129768. // commitments.
  129769. //
  129770. // The request ID must be a valid UUID with the exception that zero UUID
  129771. // is not supported (00000000-0000-0000-0000-000000000000).
  129772. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  129773. c.urlParams_.Set("requestId", requestId)
  129774. return c
  129775. }
  129776. // Fields allows partial responses to be retrieved. See
  129777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129778. // for more information.
  129779. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  129780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129781. return c
  129782. }
  129783. // Context sets the context to be used in this call's Do method. Any
  129784. // pending HTTP request will be aborted if the provided context is
  129785. // canceled.
  129786. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  129787. c.ctx_ = ctx
  129788. return c
  129789. }
  129790. // Header returns an http.Header that can be modified by the caller to
  129791. // add HTTP headers to the request.
  129792. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  129793. if c.header_ == nil {
  129794. c.header_ = make(http.Header)
  129795. }
  129796. return c.header_
  129797. }
  129798. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  129799. reqHeaders := make(http.Header)
  129800. for k, v := range c.header_ {
  129801. reqHeaders[k] = v
  129802. }
  129803. reqHeaders.Set("User-Agent", c.s.userAgent())
  129804. var body io.Reader = nil
  129805. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  129806. if err != nil {
  129807. return nil, err
  129808. }
  129809. reqHeaders.Set("Content-Type", "application/json")
  129810. c.urlParams_.Set("alt", alt)
  129811. c.urlParams_.Set("prettyPrint", "false")
  129812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  129813. urls += "?" + c.urlParams_.Encode()
  129814. req, err := http.NewRequest("POST", urls, body)
  129815. if err != nil {
  129816. return nil, err
  129817. }
  129818. req.Header = reqHeaders
  129819. googleapi.Expand(req.URL, map[string]string{
  129820. "project": c.project,
  129821. "targetTcpProxy": c.targetTcpProxy,
  129822. })
  129823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129824. }
  129825. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  129826. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129827. // status code is an error. Response headers are in either
  129828. // *Operation.ServerResponse.Header or (if a response was returned at
  129829. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129830. // to check whether the returned error was because
  129831. // http.StatusNotModified was returned.
  129832. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129833. gensupport.SetOptions(c.urlParams_, opts...)
  129834. res, err := c.doRequest("json")
  129835. if res != nil && res.StatusCode == http.StatusNotModified {
  129836. if res.Body != nil {
  129837. res.Body.Close()
  129838. }
  129839. return nil, &googleapi.Error{
  129840. Code: res.StatusCode,
  129841. Header: res.Header,
  129842. }
  129843. }
  129844. if err != nil {
  129845. return nil, err
  129846. }
  129847. defer googleapi.CloseBody(res)
  129848. if err := googleapi.CheckResponse(res); err != nil {
  129849. return nil, err
  129850. }
  129851. ret := &Operation{
  129852. ServerResponse: googleapi.ServerResponse{
  129853. Header: res.Header,
  129854. HTTPStatusCode: res.StatusCode,
  129855. },
  129856. }
  129857. target := &ret
  129858. if err := gensupport.DecodeResponse(target, res); err != nil {
  129859. return nil, err
  129860. }
  129861. return ret, nil
  129862. // {
  129863. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  129864. // "httpMethod": "POST",
  129865. // "id": "compute.targetTcpProxies.setProxyHeader",
  129866. // "parameterOrder": [
  129867. // "project",
  129868. // "targetTcpProxy"
  129869. // ],
  129870. // "parameters": {
  129871. // "project": {
  129872. // "description": "Project ID for this request.",
  129873. // "location": "path",
  129874. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129875. // "required": true,
  129876. // "type": "string"
  129877. // },
  129878. // "requestId": {
  129879. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129880. // "location": "query",
  129881. // "type": "string"
  129882. // },
  129883. // "targetTcpProxy": {
  129884. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  129885. // "location": "path",
  129886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129887. // "required": true,
  129888. // "type": "string"
  129889. // }
  129890. // },
  129891. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  129892. // "request": {
  129893. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  129894. // },
  129895. // "response": {
  129896. // "$ref": "Operation"
  129897. // },
  129898. // "scopes": [
  129899. // "https://www.googleapis.com/auth/cloud-platform",
  129900. // "https://www.googleapis.com/auth/compute"
  129901. // ]
  129902. // }
  129903. }
  129904. // method id "compute.targetTcpProxies.testIamPermissions":
  129905. type TargetTcpProxiesTestIamPermissionsCall struct {
  129906. s *Service
  129907. project string
  129908. resource string
  129909. testpermissionsrequest *TestPermissionsRequest
  129910. urlParams_ gensupport.URLParams
  129911. ctx_ context.Context
  129912. header_ http.Header
  129913. }
  129914. // TestIamPermissions: Returns permissions that a caller has on the
  129915. // specified resource.
  129916. func (r *TargetTcpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetTcpProxiesTestIamPermissionsCall {
  129917. c := &TargetTcpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129918. c.project = project
  129919. c.resource = resource
  129920. c.testpermissionsrequest = testpermissionsrequest
  129921. return c
  129922. }
  129923. // Fields allows partial responses to be retrieved. See
  129924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129925. // for more information.
  129926. func (c *TargetTcpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetTcpProxiesTestIamPermissionsCall {
  129927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129928. return c
  129929. }
  129930. // Context sets the context to be used in this call's Do method. Any
  129931. // pending HTTP request will be aborted if the provided context is
  129932. // canceled.
  129933. func (c *TargetTcpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetTcpProxiesTestIamPermissionsCall {
  129934. c.ctx_ = ctx
  129935. return c
  129936. }
  129937. // Header returns an http.Header that can be modified by the caller to
  129938. // add HTTP headers to the request.
  129939. func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header {
  129940. if c.header_ == nil {
  129941. c.header_ = make(http.Header)
  129942. }
  129943. return c.header_
  129944. }
  129945. func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  129946. reqHeaders := make(http.Header)
  129947. for k, v := range c.header_ {
  129948. reqHeaders[k] = v
  129949. }
  129950. reqHeaders.Set("User-Agent", c.s.userAgent())
  129951. var body io.Reader = nil
  129952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  129953. if err != nil {
  129954. return nil, err
  129955. }
  129956. reqHeaders.Set("Content-Type", "application/json")
  129957. c.urlParams_.Set("alt", alt)
  129958. c.urlParams_.Set("prettyPrint", "false")
  129959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{resource}/testIamPermissions")
  129960. urls += "?" + c.urlParams_.Encode()
  129961. req, err := http.NewRequest("POST", urls, body)
  129962. if err != nil {
  129963. return nil, err
  129964. }
  129965. req.Header = reqHeaders
  129966. googleapi.Expand(req.URL, map[string]string{
  129967. "project": c.project,
  129968. "resource": c.resource,
  129969. })
  129970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129971. }
  129972. // Do executes the "compute.targetTcpProxies.testIamPermissions" call.
  129973. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  129974. // non-2xx status code is an error. Response headers are in either
  129975. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  129976. // returned at all) in error.(*googleapi.Error).Header. Use
  129977. // googleapi.IsNotModified to check whether the returned error was
  129978. // because http.StatusNotModified was returned.
  129979. func (c *TargetTcpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  129980. gensupport.SetOptions(c.urlParams_, opts...)
  129981. res, err := c.doRequest("json")
  129982. if res != nil && res.StatusCode == http.StatusNotModified {
  129983. if res.Body != nil {
  129984. res.Body.Close()
  129985. }
  129986. return nil, &googleapi.Error{
  129987. Code: res.StatusCode,
  129988. Header: res.Header,
  129989. }
  129990. }
  129991. if err != nil {
  129992. return nil, err
  129993. }
  129994. defer googleapi.CloseBody(res)
  129995. if err := googleapi.CheckResponse(res); err != nil {
  129996. return nil, err
  129997. }
  129998. ret := &TestPermissionsResponse{
  129999. ServerResponse: googleapi.ServerResponse{
  130000. Header: res.Header,
  130001. HTTPStatusCode: res.StatusCode,
  130002. },
  130003. }
  130004. target := &ret
  130005. if err := gensupport.DecodeResponse(target, res); err != nil {
  130006. return nil, err
  130007. }
  130008. return ret, nil
  130009. // {
  130010. // "description": "Returns permissions that a caller has on the specified resource.",
  130011. // "httpMethod": "POST",
  130012. // "id": "compute.targetTcpProxies.testIamPermissions",
  130013. // "parameterOrder": [
  130014. // "project",
  130015. // "resource"
  130016. // ],
  130017. // "parameters": {
  130018. // "project": {
  130019. // "description": "Project ID for this request.",
  130020. // "location": "path",
  130021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130022. // "required": true,
  130023. // "type": "string"
  130024. // },
  130025. // "resource": {
  130026. // "description": "Name or id of the resource for this request.",
  130027. // "location": "path",
  130028. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130029. // "required": true,
  130030. // "type": "string"
  130031. // }
  130032. // },
  130033. // "path": "{project}/global/targetTcpProxies/{resource}/testIamPermissions",
  130034. // "request": {
  130035. // "$ref": "TestPermissionsRequest"
  130036. // },
  130037. // "response": {
  130038. // "$ref": "TestPermissionsResponse"
  130039. // },
  130040. // "scopes": [
  130041. // "https://www.googleapis.com/auth/cloud-platform",
  130042. // "https://www.googleapis.com/auth/compute",
  130043. // "https://www.googleapis.com/auth/compute.readonly"
  130044. // ]
  130045. // }
  130046. }
  130047. // method id "compute.targetVpnGateways.aggregatedList":
  130048. type TargetVpnGatewaysAggregatedListCall struct {
  130049. s *Service
  130050. project string
  130051. urlParams_ gensupport.URLParams
  130052. ifNoneMatch_ string
  130053. ctx_ context.Context
  130054. header_ http.Header
  130055. }
  130056. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  130057. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  130058. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130059. c.project = project
  130060. return c
  130061. }
  130062. // Filter sets the optional parameter "filter": A filter expression that
  130063. // filters resources listed in the response. The expression must specify
  130064. // the field name, a comparison operator, and the value that you want to
  130065. // use for filtering. The value must be a string, a number, or a
  130066. // boolean. The comparison operator must be either =, !=, >, or <.
  130067. //
  130068. // For example, if you are filtering Compute Engine instances, you can
  130069. // exclude instances named example-instance by specifying name !=
  130070. // example-instance.
  130071. //
  130072. // You can also filter nested fields. For example, you could specify
  130073. // scheduling.automaticRestart = false to include instances only if they
  130074. // are not scheduled for automatic restarts. You can use filtering on
  130075. // nested fields to filter based on resource labels.
  130076. //
  130077. // To filter on multiple expressions, provide each separate expression
  130078. // within parentheses. For example, (scheduling.automaticRestart = true)
  130079. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  130080. // AND expression. However, you can include AND and OR expressions
  130081. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  130082. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  130083. // true).
  130084. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  130085. c.urlParams_.Set("filter", filter)
  130086. return c
  130087. }
  130088. // MaxResults sets the optional parameter "maxResults": The maximum
  130089. // number of results per page that should be returned. If the number of
  130090. // available results is larger than maxResults, Compute Engine returns a
  130091. // nextPageToken that can be used to get the next page of results in
  130092. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  130093. // (Default: 500)
  130094. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  130095. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  130096. return c
  130097. }
  130098. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  130099. // a certain order. By default, results are returned in alphanumerical
  130100. // order based on the resource name.
  130101. //
  130102. // You can also sort results in descending order based on the creation
  130103. // timestamp using orderBy="creationTimestamp desc". This sorts results
  130104. // based on the creationTimestamp field in reverse chronological order
  130105. // (newest result first). Use this to sort resources like operations so
  130106. // that the newest operation is returned first.
  130107. //
  130108. // Currently, only sorting by name or creationTimestamp desc is
  130109. // supported.
  130110. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  130111. c.urlParams_.Set("orderBy", orderBy)
  130112. return c
  130113. }
  130114. // PageToken sets the optional parameter "pageToken": Specifies a page
  130115. // token to use. Set pageToken to the nextPageToken returned by a
  130116. // previous list request to get the next page of results.
  130117. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  130118. c.urlParams_.Set("pageToken", pageToken)
  130119. return c
  130120. }
  130121. // Fields allows partial responses to be retrieved. See
  130122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130123. // for more information.
  130124. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  130125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130126. return c
  130127. }
  130128. // IfNoneMatch sets the optional parameter which makes the operation
  130129. // fail if the object's ETag matches the given value. This is useful for
  130130. // getting updates only after the object has changed since the last
  130131. // request. Use googleapi.IsNotModified to check whether the response
  130132. // error from Do is the result of In-None-Match.
  130133. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  130134. c.ifNoneMatch_ = entityTag
  130135. return c
  130136. }
  130137. // Context sets the context to be used in this call's Do method. Any
  130138. // pending HTTP request will be aborted if the provided context is
  130139. // canceled.
  130140. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  130141. c.ctx_ = ctx
  130142. return c
  130143. }
  130144. // Header returns an http.Header that can be modified by the caller to
  130145. // add HTTP headers to the request.
  130146. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  130147. if c.header_ == nil {
  130148. c.header_ = make(http.Header)
  130149. }
  130150. return c.header_
  130151. }
  130152. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  130153. reqHeaders := make(http.Header)
  130154. for k, v := range c.header_ {
  130155. reqHeaders[k] = v
  130156. }
  130157. reqHeaders.Set("User-Agent", c.s.userAgent())
  130158. if c.ifNoneMatch_ != "" {
  130159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130160. }
  130161. var body io.Reader = nil
  130162. c.urlParams_.Set("alt", alt)
  130163. c.urlParams_.Set("prettyPrint", "false")
  130164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  130165. urls += "?" + c.urlParams_.Encode()
  130166. req, err := http.NewRequest("GET", urls, body)
  130167. if err != nil {
  130168. return nil, err
  130169. }
  130170. req.Header = reqHeaders
  130171. googleapi.Expand(req.URL, map[string]string{
  130172. "project": c.project,
  130173. })
  130174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130175. }
  130176. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  130177. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  130178. // non-nil. Any non-2xx status code is an error. Response headers are in
  130179. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  130180. // response was returned at all) in error.(*googleapi.Error).Header. Use
  130181. // googleapi.IsNotModified to check whether the returned error was
  130182. // because http.StatusNotModified was returned.
  130183. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  130184. gensupport.SetOptions(c.urlParams_, opts...)
  130185. res, err := c.doRequest("json")
  130186. if res != nil && res.StatusCode == http.StatusNotModified {
  130187. if res.Body != nil {
  130188. res.Body.Close()
  130189. }
  130190. return nil, &googleapi.Error{
  130191. Code: res.StatusCode,
  130192. Header: res.Header,
  130193. }
  130194. }
  130195. if err != nil {
  130196. return nil, err
  130197. }
  130198. defer googleapi.CloseBody(res)
  130199. if err := googleapi.CheckResponse(res); err != nil {
  130200. return nil, err
  130201. }
  130202. ret := &TargetVpnGatewayAggregatedList{
  130203. ServerResponse: googleapi.ServerResponse{
  130204. Header: res.Header,
  130205. HTTPStatusCode: res.StatusCode,
  130206. },
  130207. }
  130208. target := &ret
  130209. if err := gensupport.DecodeResponse(target, res); err != nil {
  130210. return nil, err
  130211. }
  130212. return ret, nil
  130213. // {
  130214. // "description": "Retrieves an aggregated list of target VPN gateways.",
  130215. // "httpMethod": "GET",
  130216. // "id": "compute.targetVpnGateways.aggregatedList",
  130217. // "parameterOrder": [
  130218. // "project"
  130219. // ],
  130220. // "parameters": {
  130221. // "filter": {
  130222. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  130223. // "location": "query",
  130224. // "type": "string"
  130225. // },
  130226. // "maxResults": {
  130227. // "default": "500",
  130228. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  130229. // "format": "uint32",
  130230. // "location": "query",
  130231. // "minimum": "0",
  130232. // "type": "integer"
  130233. // },
  130234. // "orderBy": {
  130235. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  130236. // "location": "query",
  130237. // "type": "string"
  130238. // },
  130239. // "pageToken": {
  130240. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  130241. // "location": "query",
  130242. // "type": "string"
  130243. // },
  130244. // "project": {
  130245. // "description": "Project ID for this request.",
  130246. // "location": "path",
  130247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130248. // "required": true,
  130249. // "type": "string"
  130250. // }
  130251. // },
  130252. // "path": "{project}/aggregated/targetVpnGateways",
  130253. // "response": {
  130254. // "$ref": "TargetVpnGatewayAggregatedList"
  130255. // },
  130256. // "scopes": [
  130257. // "https://www.googleapis.com/auth/cloud-platform",
  130258. // "https://www.googleapis.com/auth/compute",
  130259. // "https://www.googleapis.com/auth/compute.readonly"
  130260. // ]
  130261. // }
  130262. }
  130263. // Pages invokes f for each page of results.
  130264. // A non-nil error returned from f will halt the iteration.
  130265. // The provided context supersedes any context provided to the Context method.
  130266. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  130267. c.ctx_ = ctx
  130268. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  130269. for {
  130270. x, err := c.Do()
  130271. if err != nil {
  130272. return err
  130273. }
  130274. if err := f(x); err != nil {
  130275. return err
  130276. }
  130277. if x.NextPageToken == "" {
  130278. return nil
  130279. }
  130280. c.PageToken(x.NextPageToken)
  130281. }
  130282. }
  130283. // method id "compute.targetVpnGateways.delete":
  130284. type TargetVpnGatewaysDeleteCall struct {
  130285. s *Service
  130286. project string
  130287. region string
  130288. targetVpnGateway string
  130289. urlParams_ gensupport.URLParams
  130290. ctx_ context.Context
  130291. header_ http.Header
  130292. }
  130293. // Delete: Deletes the specified target VPN gateway.
  130294. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  130295. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130296. c.project = project
  130297. c.region = region
  130298. c.targetVpnGateway = targetVpnGateway
  130299. return c
  130300. }
  130301. // RequestId sets the optional parameter "requestId": An optional
  130302. // request ID to identify requests. Specify a unique request ID so that
  130303. // if you must retry your request, the server will know to ignore the
  130304. // request if it has already been completed.
  130305. //
  130306. // For example, consider a situation where you make an initial request
  130307. // and the request times out. If you make the request again with the
  130308. // same request ID, the server can check if original operation with the
  130309. // same request ID was received, and if so, will ignore the second
  130310. // request. This prevents clients from accidentally creating duplicate
  130311. // commitments.
  130312. //
  130313. // The request ID must be a valid UUID with the exception that zero UUID
  130314. // is not supported (00000000-0000-0000-0000-000000000000).
  130315. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  130316. c.urlParams_.Set("requestId", requestId)
  130317. return c
  130318. }
  130319. // Fields allows partial responses to be retrieved. See
  130320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130321. // for more information.
  130322. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  130323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130324. return c
  130325. }
  130326. // Context sets the context to be used in this call's Do method. Any
  130327. // pending HTTP request will be aborted if the provided context is
  130328. // canceled.
  130329. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  130330. c.ctx_ = ctx
  130331. return c
  130332. }
  130333. // Header returns an http.Header that can be modified by the caller to
  130334. // add HTTP headers to the request.
  130335. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  130336. if c.header_ == nil {
  130337. c.header_ = make(http.Header)
  130338. }
  130339. return c.header_
  130340. }
  130341. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  130342. reqHeaders := make(http.Header)
  130343. for k, v := range c.header_ {
  130344. reqHeaders[k] = v
  130345. }
  130346. reqHeaders.Set("User-Agent", c.s.userAgent())
  130347. var body io.Reader = nil
  130348. c.urlParams_.Set("alt", alt)
  130349. c.urlParams_.Set("prettyPrint", "false")
  130350. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  130351. urls += "?" + c.urlParams_.Encode()
  130352. req, err := http.NewRequest("DELETE", urls, body)
  130353. if err != nil {
  130354. return nil, err
  130355. }
  130356. req.Header = reqHeaders
  130357. googleapi.Expand(req.URL, map[string]string{
  130358. "project": c.project,
  130359. "region": c.region,
  130360. "targetVpnGateway": c.targetVpnGateway,
  130361. })
  130362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130363. }
  130364. // Do executes the "compute.targetVpnGateways.delete" call.
  130365. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130366. // status code is an error. Response headers are in either
  130367. // *Operation.ServerResponse.Header or (if a response was returned at
  130368. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130369. // to check whether the returned error was because
  130370. // http.StatusNotModified was returned.
  130371. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130372. gensupport.SetOptions(c.urlParams_, opts...)
  130373. res, err := c.doRequest("json")
  130374. if res != nil && res.StatusCode == http.StatusNotModified {
  130375. if res.Body != nil {
  130376. res.Body.Close()
  130377. }
  130378. return nil, &googleapi.Error{
  130379. Code: res.StatusCode,
  130380. Header: res.Header,
  130381. }
  130382. }
  130383. if err != nil {
  130384. return nil, err
  130385. }
  130386. defer googleapi.CloseBody(res)
  130387. if err := googleapi.CheckResponse(res); err != nil {
  130388. return nil, err
  130389. }
  130390. ret := &Operation{
  130391. ServerResponse: googleapi.ServerResponse{
  130392. Header: res.Header,
  130393. HTTPStatusCode: res.StatusCode,
  130394. },
  130395. }
  130396. target := &ret
  130397. if err := gensupport.DecodeResponse(target, res); err != nil {
  130398. return nil, err
  130399. }
  130400. return ret, nil
  130401. // {
  130402. // "description": "Deletes the specified target VPN gateway.",
  130403. // "httpMethod": "DELETE",
  130404. // "id": "compute.targetVpnGateways.delete",
  130405. // "parameterOrder": [
  130406. // "project",
  130407. // "region",
  130408. // "targetVpnGateway"
  130409. // ],
  130410. // "parameters": {
  130411. // "project": {
  130412. // "description": "Project ID for this request.",
  130413. // "location": "path",
  130414. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130415. // "required": true,
  130416. // "type": "string"
  130417. // },
  130418. // "region": {
  130419. // "description": "Name of the region for this request.",
  130420. // "location": "path",
  130421. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130422. // "required": true,
  130423. // "type": "string"
  130424. // },
  130425. // "requestId": {
  130426. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130427. // "location": "query",
  130428. // "type": "string"
  130429. // },
  130430. // "targetVpnGateway": {
  130431. // "description": "Name of the target VPN gateway to delete.",
  130432. // "location": "path",
  130433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130434. // "required": true,
  130435. // "type": "string"
  130436. // }
  130437. // },
  130438. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  130439. // "response": {
  130440. // "$ref": "Operation"
  130441. // },
  130442. // "scopes": [
  130443. // "https://www.googleapis.com/auth/cloud-platform",
  130444. // "https://www.googleapis.com/auth/compute"
  130445. // ]
  130446. // }
  130447. }
  130448. // method id "compute.targetVpnGateways.get":
  130449. type TargetVpnGatewaysGetCall struct {
  130450. s *Service
  130451. project string
  130452. region string
  130453. targetVpnGateway string
  130454. urlParams_ gensupport.URLParams
  130455. ifNoneMatch_ string
  130456. ctx_ context.Context
  130457. header_ http.Header
  130458. }
  130459. // Get: Returns the specified target VPN gateway. Gets a list of
  130460. // available target VPN gateways by making a list() request.
  130461. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  130462. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130463. c.project = project
  130464. c.region = region
  130465. c.targetVpnGateway = targetVpnGateway
  130466. return c
  130467. }
  130468. // Fields allows partial responses to be retrieved. See
  130469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130470. // for more information.
  130471. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  130472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130473. return c
  130474. }
  130475. // IfNoneMatch sets the optional parameter which makes the operation
  130476. // fail if the object's ETag matches the given value. This is useful for
  130477. // getting updates only after the object has changed since the last
  130478. // request. Use googleapi.IsNotModified to check whether the response
  130479. // error from Do is the result of In-None-Match.
  130480. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  130481. c.ifNoneMatch_ = entityTag
  130482. return c
  130483. }
  130484. // Context sets the context to be used in this call's Do method. Any
  130485. // pending HTTP request will be aborted if the provided context is
  130486. // canceled.
  130487. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  130488. c.ctx_ = ctx
  130489. return c
  130490. }
  130491. // Header returns an http.Header that can be modified by the caller to
  130492. // add HTTP headers to the request.
  130493. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  130494. if c.header_ == nil {
  130495. c.header_ = make(http.Header)
  130496. }
  130497. return c.header_
  130498. }
  130499. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  130500. reqHeaders := make(http.Header)
  130501. for k, v := range c.header_ {
  130502. reqHeaders[k] = v
  130503. }
  130504. reqHeaders.Set("User-Agent", c.s.userAgent())
  130505. if c.ifNoneMatch_ != "" {
  130506. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130507. }
  130508. var body io.Reader = nil
  130509. c.urlParams_.Set("alt", alt)
  130510. c.urlParams_.Set("prettyPrint", "false")
  130511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  130512. urls += "?" + c.urlParams_.Encode()
  130513. req, err := http.NewRequest("GET", urls, body)
  130514. if err != nil {
  130515. return nil, err
  130516. }
  130517. req.Header = reqHeaders
  130518. googleapi.Expand(req.URL, map[string]string{
  130519. "project": c.project,
  130520. "region": c.region,
  130521. "targetVpnGateway": c.targetVpnGateway,
  130522. })
  130523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130524. }
  130525. // Do executes the "compute.targetVpnGateways.get" call.
  130526. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  130527. // non-2xx status code is an error. Response headers are in either
  130528. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  130529. // returned at all) in error.(*googleapi.Error).Header. Use
  130530. // googleapi.IsNotModified to check whether the returned error was
  130531. // because http.StatusNotModified was returned.
  130532. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  130533. gensupport.SetOptions(c.urlParams_, opts...)
  130534. res, err := c.doRequest("json")
  130535. if res != nil && res.StatusCode == http.StatusNotModified {
  130536. if res.Body != nil {
  130537. res.Body.Close()
  130538. }
  130539. return nil, &googleapi.Error{
  130540. Code: res.StatusCode,
  130541. Header: res.Header,
  130542. }
  130543. }
  130544. if err != nil {
  130545. return nil, err
  130546. }
  130547. defer googleapi.CloseBody(res)
  130548. if err := googleapi.CheckResponse(res); err != nil {
  130549. return nil, err
  130550. }
  130551. ret := &TargetVpnGateway{
  130552. ServerResponse: googleapi.ServerResponse{
  130553. Header: res.Header,
  130554. HTTPStatusCode: res.StatusCode,
  130555. },
  130556. }
  130557. target := &ret
  130558. if err := gensupport.DecodeResponse(target, res); err != nil {
  130559. return nil, err
  130560. }
  130561. return ret, nil
  130562. // {
  130563. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  130564. // "httpMethod": "GET",
  130565. // "id": "compute.targetVpnGateways.get",
  130566. // "parameterOrder": [
  130567. // "project",
  130568. // "region",
  130569. // "targetVpnGateway"
  130570. // ],
  130571. // "parameters": {
  130572. // "project": {
  130573. // "description": "Project ID for this request.",
  130574. // "location": "path",
  130575. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130576. // "required": true,
  130577. // "type": "string"
  130578. // },
  130579. // "region": {
  130580. // "description": "Name of the region for this request.",
  130581. // "location": "path",
  130582. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130583. // "required": true,
  130584. // "type": "string"
  130585. // },
  130586. // "targetVpnGateway": {
  130587. // "description": "Name of the target VPN gateway to return.",
  130588. // "location": "path",
  130589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130590. // "required": true,
  130591. // "type": "string"
  130592. // }
  130593. // },
  130594. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  130595. // "response": {
  130596. // "$ref": "TargetVpnGateway"
  130597. // },
  130598. // "scopes": [
  130599. // "https://www.googleapis.com/auth/cloud-platform",
  130600. // "https://www.googleapis.com/auth/compute",
  130601. // "https://www.googleapis.com/auth/compute.readonly"
  130602. // ]
  130603. // }
  130604. }
  130605. // method id "compute.targetVpnGateways.insert":
  130606. type TargetVpnGatewaysInsertCall struct {
  130607. s *Service
  130608. project string
  130609. region string
  130610. targetvpngateway *TargetVpnGateway
  130611. urlParams_ gensupport.URLParams
  130612. ctx_ context.Context
  130613. header_ http.Header
  130614. }
  130615. // Insert: Creates a target VPN gateway in the specified project and
  130616. // region using the data included in the request.
  130617. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  130618. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130619. c.project = project
  130620. c.region = region
  130621. c.targetvpngateway = targetvpngateway
  130622. return c
  130623. }
  130624. // RequestId sets the optional parameter "requestId": An optional
  130625. // request ID to identify requests. Specify a unique request ID so that
  130626. // if you must retry your request, the server will know to ignore the
  130627. // request if it has already been completed.
  130628. //
  130629. // For example, consider a situation where you make an initial request
  130630. // and the request times out. If you make the request again with the
  130631. // same request ID, the server can check if original operation with the
  130632. // same request ID was received, and if so, will ignore the second
  130633. // request. This prevents clients from accidentally creating duplicate
  130634. // commitments.
  130635. //
  130636. // The request ID must be a valid UUID with the exception that zero UUID
  130637. // is not supported (00000000-0000-0000-0000-000000000000).
  130638. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  130639. c.urlParams_.Set("requestId", requestId)
  130640. return c
  130641. }
  130642. // Fields allows partial responses to be retrieved. See
  130643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130644. // for more information.
  130645. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  130646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130647. return c
  130648. }
  130649. // Context sets the context to be used in this call's Do method. Any
  130650. // pending HTTP request will be aborted if the provided context is
  130651. // canceled.
  130652. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  130653. c.ctx_ = ctx
  130654. return c
  130655. }
  130656. // Header returns an http.Header that can be modified by the caller to
  130657. // add HTTP headers to the request.
  130658. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  130659. if c.header_ == nil {
  130660. c.header_ = make(http.Header)
  130661. }
  130662. return c.header_
  130663. }
  130664. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  130665. reqHeaders := make(http.Header)
  130666. for k, v := range c.header_ {
  130667. reqHeaders[k] = v
  130668. }
  130669. reqHeaders.Set("User-Agent", c.s.userAgent())
  130670. var body io.Reader = nil
  130671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  130672. if err != nil {
  130673. return nil, err
  130674. }
  130675. reqHeaders.Set("Content-Type", "application/json")
  130676. c.urlParams_.Set("alt", alt)
  130677. c.urlParams_.Set("prettyPrint", "false")
  130678. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  130679. urls += "?" + c.urlParams_.Encode()
  130680. req, err := http.NewRequest("POST", urls, body)
  130681. if err != nil {
  130682. return nil, err
  130683. }
  130684. req.Header = reqHeaders
  130685. googleapi.Expand(req.URL, map[string]string{
  130686. "project": c.project,
  130687. "region": c.region,
  130688. })
  130689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130690. }
  130691. // Do executes the "compute.targetVpnGateways.insert" call.
  130692. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130693. // status code is an error. Response headers are in either
  130694. // *Operation.ServerResponse.Header or (if a response was returned at
  130695. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130696. // to check whether the returned error was because
  130697. // http.StatusNotModified was returned.
  130698. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130699. gensupport.SetOptions(c.urlParams_, opts...)
  130700. res, err := c.doRequest("json")
  130701. if res != nil && res.StatusCode == http.StatusNotModified {
  130702. if res.Body != nil {
  130703. res.Body.Close()
  130704. }
  130705. return nil, &googleapi.Error{
  130706. Code: res.StatusCode,
  130707. Header: res.Header,
  130708. }
  130709. }
  130710. if err != nil {
  130711. return nil, err
  130712. }
  130713. defer googleapi.CloseBody(res)
  130714. if err := googleapi.CheckResponse(res); err != nil {
  130715. return nil, err
  130716. }
  130717. ret := &Operation{
  130718. ServerResponse: googleapi.ServerResponse{
  130719. Header: res.Header,
  130720. HTTPStatusCode: res.StatusCode,
  130721. },
  130722. }
  130723. target := &ret
  130724. if err := gensupport.DecodeResponse(target, res); err != nil {
  130725. return nil, err
  130726. }
  130727. return ret, nil
  130728. // {
  130729. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  130730. // "httpMethod": "POST",
  130731. // "id": "compute.targetVpnGateways.insert",
  130732. // "parameterOrder": [
  130733. // "project",
  130734. // "region"
  130735. // ],
  130736. // "parameters": {
  130737. // "project": {
  130738. // "description": "Project ID for this request.",
  130739. // "location": "path",
  130740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130741. // "required": true,
  130742. // "type": "string"
  130743. // },
  130744. // "region": {
  130745. // "description": "Name of the region for this request.",
  130746. // "location": "path",
  130747. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130748. // "required": true,
  130749. // "type": "string"
  130750. // },
  130751. // "requestId": {
  130752. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130753. // "location": "query",
  130754. // "type": "string"
  130755. // }
  130756. // },
  130757. // "path": "{project}/regions/{region}/targetVpnGateways",
  130758. // "request": {
  130759. // "$ref": "TargetVpnGateway"
  130760. // },
  130761. // "response": {
  130762. // "$ref": "Operation"
  130763. // },
  130764. // "scopes": [
  130765. // "https://www.googleapis.com/auth/cloud-platform",
  130766. // "https://www.googleapis.com/auth/compute"
  130767. // ]
  130768. // }
  130769. }
  130770. // method id "compute.targetVpnGateways.list":
  130771. type TargetVpnGatewaysListCall struct {
  130772. s *Service
  130773. project string
  130774. region string
  130775. urlParams_ gensupport.URLParams
  130776. ifNoneMatch_ string
  130777. ctx_ context.Context
  130778. header_ http.Header
  130779. }
  130780. // List: Retrieves a list of target VPN gateways available to the
  130781. // specified project and region.
  130782. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  130783. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130784. c.project = project
  130785. c.region = region
  130786. return c
  130787. }
  130788. // Filter sets the optional parameter "filter": A filter expression that
  130789. // filters resources listed in the response. The expression must specify
  130790. // the field name, a comparison operator, and the value that you want to
  130791. // use for filtering. The value must be a string, a number, or a
  130792. // boolean. The comparison operator must be either =, !=, >, or <.
  130793. //
  130794. // For example, if you are filtering Compute Engine instances, you can
  130795. // exclude instances named example-instance by specifying name !=
  130796. // example-instance.
  130797. //
  130798. // You can also filter nested fields. For example, you could specify
  130799. // scheduling.automaticRestart = false to include instances only if they
  130800. // are not scheduled for automatic restarts. You can use filtering on
  130801. // nested fields to filter based on resource labels.
  130802. //
  130803. // To filter on multiple expressions, provide each separate expression
  130804. // within parentheses. For example, (scheduling.automaticRestart = true)
  130805. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  130806. // AND expression. However, you can include AND and OR expressions
  130807. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  130808. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  130809. // true).
  130810. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  130811. c.urlParams_.Set("filter", filter)
  130812. return c
  130813. }
  130814. // MaxResults sets the optional parameter "maxResults": The maximum
  130815. // number of results per page that should be returned. If the number of
  130816. // available results is larger than maxResults, Compute Engine returns a
  130817. // nextPageToken that can be used to get the next page of results in
  130818. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  130819. // (Default: 500)
  130820. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  130821. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  130822. return c
  130823. }
  130824. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  130825. // a certain order. By default, results are returned in alphanumerical
  130826. // order based on the resource name.
  130827. //
  130828. // You can also sort results in descending order based on the creation
  130829. // timestamp using orderBy="creationTimestamp desc". This sorts results
  130830. // based on the creationTimestamp field in reverse chronological order
  130831. // (newest result first). Use this to sort resources like operations so
  130832. // that the newest operation is returned first.
  130833. //
  130834. // Currently, only sorting by name or creationTimestamp desc is
  130835. // supported.
  130836. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  130837. c.urlParams_.Set("orderBy", orderBy)
  130838. return c
  130839. }
  130840. // PageToken sets the optional parameter "pageToken": Specifies a page
  130841. // token to use. Set pageToken to the nextPageToken returned by a
  130842. // previous list request to get the next page of results.
  130843. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  130844. c.urlParams_.Set("pageToken", pageToken)
  130845. return c
  130846. }
  130847. // Fields allows partial responses to be retrieved. See
  130848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130849. // for more information.
  130850. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  130851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130852. return c
  130853. }
  130854. // IfNoneMatch sets the optional parameter which makes the operation
  130855. // fail if the object's ETag matches the given value. This is useful for
  130856. // getting updates only after the object has changed since the last
  130857. // request. Use googleapi.IsNotModified to check whether the response
  130858. // error from Do is the result of In-None-Match.
  130859. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  130860. c.ifNoneMatch_ = entityTag
  130861. return c
  130862. }
  130863. // Context sets the context to be used in this call's Do method. Any
  130864. // pending HTTP request will be aborted if the provided context is
  130865. // canceled.
  130866. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  130867. c.ctx_ = ctx
  130868. return c
  130869. }
  130870. // Header returns an http.Header that can be modified by the caller to
  130871. // add HTTP headers to the request.
  130872. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  130873. if c.header_ == nil {
  130874. c.header_ = make(http.Header)
  130875. }
  130876. return c.header_
  130877. }
  130878. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  130879. reqHeaders := make(http.Header)
  130880. for k, v := range c.header_ {
  130881. reqHeaders[k] = v
  130882. }
  130883. reqHeaders.Set("User-Agent", c.s.userAgent())
  130884. if c.ifNoneMatch_ != "" {
  130885. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130886. }
  130887. var body io.Reader = nil
  130888. c.urlParams_.Set("alt", alt)
  130889. c.urlParams_.Set("prettyPrint", "false")
  130890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  130891. urls += "?" + c.urlParams_.Encode()
  130892. req, err := http.NewRequest("GET", urls, body)
  130893. if err != nil {
  130894. return nil, err
  130895. }
  130896. req.Header = reqHeaders
  130897. googleapi.Expand(req.URL, map[string]string{
  130898. "project": c.project,
  130899. "region": c.region,
  130900. })
  130901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130902. }
  130903. // Do executes the "compute.targetVpnGateways.list" call.
  130904. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  130905. // non-2xx status code is an error. Response headers are in either
  130906. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  130907. // returned at all) in error.(*googleapi.Error).Header. Use
  130908. // googleapi.IsNotModified to check whether the returned error was
  130909. // because http.StatusNotModified was returned.
  130910. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  130911. gensupport.SetOptions(c.urlParams_, opts...)
  130912. res, err := c.doRequest("json")
  130913. if res != nil && res.StatusCode == http.StatusNotModified {
  130914. if res.Body != nil {
  130915. res.Body.Close()
  130916. }
  130917. return nil, &googleapi.Error{
  130918. Code: res.StatusCode,
  130919. Header: res.Header,
  130920. }
  130921. }
  130922. if err != nil {
  130923. return nil, err
  130924. }
  130925. defer googleapi.CloseBody(res)
  130926. if err := googleapi.CheckResponse(res); err != nil {
  130927. return nil, err
  130928. }
  130929. ret := &TargetVpnGatewayList{
  130930. ServerResponse: googleapi.ServerResponse{
  130931. Header: res.Header,
  130932. HTTPStatusCode: res.StatusCode,
  130933. },
  130934. }
  130935. target := &ret
  130936. if err := gensupport.DecodeResponse(target, res); err != nil {
  130937. return nil, err
  130938. }
  130939. return ret, nil
  130940. // {
  130941. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  130942. // "httpMethod": "GET",
  130943. // "id": "compute.targetVpnGateways.list",
  130944. // "parameterOrder": [
  130945. // "project",
  130946. // "region"
  130947. // ],
  130948. // "parameters": {
  130949. // "filter": {
  130950. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  130951. // "location": "query",
  130952. // "type": "string"
  130953. // },
  130954. // "maxResults": {
  130955. // "default": "500",
  130956. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  130957. // "format": "uint32",
  130958. // "location": "query",
  130959. // "minimum": "0",
  130960. // "type": "integer"
  130961. // },
  130962. // "orderBy": {
  130963. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  130964. // "location": "query",
  130965. // "type": "string"
  130966. // },
  130967. // "pageToken": {
  130968. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  130969. // "location": "query",
  130970. // "type": "string"
  130971. // },
  130972. // "project": {
  130973. // "description": "Project ID for this request.",
  130974. // "location": "path",
  130975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130976. // "required": true,
  130977. // "type": "string"
  130978. // },
  130979. // "region": {
  130980. // "description": "Name of the region for this request.",
  130981. // "location": "path",
  130982. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  130983. // "required": true,
  130984. // "type": "string"
  130985. // }
  130986. // },
  130987. // "path": "{project}/regions/{region}/targetVpnGateways",
  130988. // "response": {
  130989. // "$ref": "TargetVpnGatewayList"
  130990. // },
  130991. // "scopes": [
  130992. // "https://www.googleapis.com/auth/cloud-platform",
  130993. // "https://www.googleapis.com/auth/compute",
  130994. // "https://www.googleapis.com/auth/compute.readonly"
  130995. // ]
  130996. // }
  130997. }
  130998. // Pages invokes f for each page of results.
  130999. // A non-nil error returned from f will halt the iteration.
  131000. // The provided context supersedes any context provided to the Context method.
  131001. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  131002. c.ctx_ = ctx
  131003. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  131004. for {
  131005. x, err := c.Do()
  131006. if err != nil {
  131007. return err
  131008. }
  131009. if err := f(x); err != nil {
  131010. return err
  131011. }
  131012. if x.NextPageToken == "" {
  131013. return nil
  131014. }
  131015. c.PageToken(x.NextPageToken)
  131016. }
  131017. }
  131018. // method id "compute.targetVpnGateways.setLabels":
  131019. type TargetVpnGatewaysSetLabelsCall struct {
  131020. s *Service
  131021. project string
  131022. region string
  131023. resource string
  131024. regionsetlabelsrequest *RegionSetLabelsRequest
  131025. urlParams_ gensupport.URLParams
  131026. ctx_ context.Context
  131027. header_ http.Header
  131028. }
  131029. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  131030. // labels, read the Labeling Resources documentation.
  131031. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  131032. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131033. c.project = project
  131034. c.region = region
  131035. c.resource = resource
  131036. c.regionsetlabelsrequest = regionsetlabelsrequest
  131037. return c
  131038. }
  131039. // RequestId sets the optional parameter "requestId": An optional
  131040. // request ID to identify requests. Specify a unique request ID so that
  131041. // if you must retry your request, the server will know to ignore the
  131042. // request if it has already been completed.
  131043. //
  131044. // For example, consider a situation where you make an initial request
  131045. // and the request times out. If you make the request again with the
  131046. // same request ID, the server can check if original operation with the
  131047. // same request ID was received, and if so, will ignore the second
  131048. // request. This prevents clients from accidentally creating duplicate
  131049. // commitments.
  131050. //
  131051. // The request ID must be a valid UUID with the exception that zero UUID
  131052. // is not supported (00000000-0000-0000-0000-000000000000).
  131053. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  131054. c.urlParams_.Set("requestId", requestId)
  131055. return c
  131056. }
  131057. // Fields allows partial responses to be retrieved. See
  131058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131059. // for more information.
  131060. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  131061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131062. return c
  131063. }
  131064. // Context sets the context to be used in this call's Do method. Any
  131065. // pending HTTP request will be aborted if the provided context is
  131066. // canceled.
  131067. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  131068. c.ctx_ = ctx
  131069. return c
  131070. }
  131071. // Header returns an http.Header that can be modified by the caller to
  131072. // add HTTP headers to the request.
  131073. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  131074. if c.header_ == nil {
  131075. c.header_ = make(http.Header)
  131076. }
  131077. return c.header_
  131078. }
  131079. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  131080. reqHeaders := make(http.Header)
  131081. for k, v := range c.header_ {
  131082. reqHeaders[k] = v
  131083. }
  131084. reqHeaders.Set("User-Agent", c.s.userAgent())
  131085. var body io.Reader = nil
  131086. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  131087. if err != nil {
  131088. return nil, err
  131089. }
  131090. reqHeaders.Set("Content-Type", "application/json")
  131091. c.urlParams_.Set("alt", alt)
  131092. c.urlParams_.Set("prettyPrint", "false")
  131093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  131094. urls += "?" + c.urlParams_.Encode()
  131095. req, err := http.NewRequest("POST", urls, body)
  131096. if err != nil {
  131097. return nil, err
  131098. }
  131099. req.Header = reqHeaders
  131100. googleapi.Expand(req.URL, map[string]string{
  131101. "project": c.project,
  131102. "region": c.region,
  131103. "resource": c.resource,
  131104. })
  131105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131106. }
  131107. // Do executes the "compute.targetVpnGateways.setLabels" call.
  131108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131109. // status code is an error. Response headers are in either
  131110. // *Operation.ServerResponse.Header or (if a response was returned at
  131111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131112. // to check whether the returned error was because
  131113. // http.StatusNotModified was returned.
  131114. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131115. gensupport.SetOptions(c.urlParams_, opts...)
  131116. res, err := c.doRequest("json")
  131117. if res != nil && res.StatusCode == http.StatusNotModified {
  131118. if res.Body != nil {
  131119. res.Body.Close()
  131120. }
  131121. return nil, &googleapi.Error{
  131122. Code: res.StatusCode,
  131123. Header: res.Header,
  131124. }
  131125. }
  131126. if err != nil {
  131127. return nil, err
  131128. }
  131129. defer googleapi.CloseBody(res)
  131130. if err := googleapi.CheckResponse(res); err != nil {
  131131. return nil, err
  131132. }
  131133. ret := &Operation{
  131134. ServerResponse: googleapi.ServerResponse{
  131135. Header: res.Header,
  131136. HTTPStatusCode: res.StatusCode,
  131137. },
  131138. }
  131139. target := &ret
  131140. if err := gensupport.DecodeResponse(target, res); err != nil {
  131141. return nil, err
  131142. }
  131143. return ret, nil
  131144. // {
  131145. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  131146. // "httpMethod": "POST",
  131147. // "id": "compute.targetVpnGateways.setLabels",
  131148. // "parameterOrder": [
  131149. // "project",
  131150. // "region",
  131151. // "resource"
  131152. // ],
  131153. // "parameters": {
  131154. // "project": {
  131155. // "description": "Project ID for this request.",
  131156. // "location": "path",
  131157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131158. // "required": true,
  131159. // "type": "string"
  131160. // },
  131161. // "region": {
  131162. // "description": "The region for this request.",
  131163. // "location": "path",
  131164. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131165. // "required": true,
  131166. // "type": "string"
  131167. // },
  131168. // "requestId": {
  131169. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131170. // "location": "query",
  131171. // "type": "string"
  131172. // },
  131173. // "resource": {
  131174. // "description": "Name or id of the resource for this request.",
  131175. // "location": "path",
  131176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131177. // "required": true,
  131178. // "type": "string"
  131179. // }
  131180. // },
  131181. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  131182. // "request": {
  131183. // "$ref": "RegionSetLabelsRequest"
  131184. // },
  131185. // "response": {
  131186. // "$ref": "Operation"
  131187. // },
  131188. // "scopes": [
  131189. // "https://www.googleapis.com/auth/cloud-platform",
  131190. // "https://www.googleapis.com/auth/compute"
  131191. // ]
  131192. // }
  131193. }
  131194. // method id "compute.targetVpnGateways.testIamPermissions":
  131195. type TargetVpnGatewaysTestIamPermissionsCall struct {
  131196. s *Service
  131197. project string
  131198. region string
  131199. resource string
  131200. testpermissionsrequest *TestPermissionsRequest
  131201. urlParams_ gensupport.URLParams
  131202. ctx_ context.Context
  131203. header_ http.Header
  131204. }
  131205. // TestIamPermissions: Returns permissions that a caller has on the
  131206. // specified resource.
  131207. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  131208. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131209. c.project = project
  131210. c.region = region
  131211. c.resource = resource
  131212. c.testpermissionsrequest = testpermissionsrequest
  131213. return c
  131214. }
  131215. // Fields allows partial responses to be retrieved. See
  131216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131217. // for more information.
  131218. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  131219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131220. return c
  131221. }
  131222. // Context sets the context to be used in this call's Do method. Any
  131223. // pending HTTP request will be aborted if the provided context is
  131224. // canceled.
  131225. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  131226. c.ctx_ = ctx
  131227. return c
  131228. }
  131229. // Header returns an http.Header that can be modified by the caller to
  131230. // add HTTP headers to the request.
  131231. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  131232. if c.header_ == nil {
  131233. c.header_ = make(http.Header)
  131234. }
  131235. return c.header_
  131236. }
  131237. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  131238. reqHeaders := make(http.Header)
  131239. for k, v := range c.header_ {
  131240. reqHeaders[k] = v
  131241. }
  131242. reqHeaders.Set("User-Agent", c.s.userAgent())
  131243. var body io.Reader = nil
  131244. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  131245. if err != nil {
  131246. return nil, err
  131247. }
  131248. reqHeaders.Set("Content-Type", "application/json")
  131249. c.urlParams_.Set("alt", alt)
  131250. c.urlParams_.Set("prettyPrint", "false")
  131251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  131252. urls += "?" + c.urlParams_.Encode()
  131253. req, err := http.NewRequest("POST", urls, body)
  131254. if err != nil {
  131255. return nil, err
  131256. }
  131257. req.Header = reqHeaders
  131258. googleapi.Expand(req.URL, map[string]string{
  131259. "project": c.project,
  131260. "region": c.region,
  131261. "resource": c.resource,
  131262. })
  131263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131264. }
  131265. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  131266. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  131267. // non-2xx status code is an error. Response headers are in either
  131268. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  131269. // returned at all) in error.(*googleapi.Error).Header. Use
  131270. // googleapi.IsNotModified to check whether the returned error was
  131271. // because http.StatusNotModified was returned.
  131272. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  131273. gensupport.SetOptions(c.urlParams_, opts...)
  131274. res, err := c.doRequest("json")
  131275. if res != nil && res.StatusCode == http.StatusNotModified {
  131276. if res.Body != nil {
  131277. res.Body.Close()
  131278. }
  131279. return nil, &googleapi.Error{
  131280. Code: res.StatusCode,
  131281. Header: res.Header,
  131282. }
  131283. }
  131284. if err != nil {
  131285. return nil, err
  131286. }
  131287. defer googleapi.CloseBody(res)
  131288. if err := googleapi.CheckResponse(res); err != nil {
  131289. return nil, err
  131290. }
  131291. ret := &TestPermissionsResponse{
  131292. ServerResponse: googleapi.ServerResponse{
  131293. Header: res.Header,
  131294. HTTPStatusCode: res.StatusCode,
  131295. },
  131296. }
  131297. target := &ret
  131298. if err := gensupport.DecodeResponse(target, res); err != nil {
  131299. return nil, err
  131300. }
  131301. return ret, nil
  131302. // {
  131303. // "description": "Returns permissions that a caller has on the specified resource.",
  131304. // "httpMethod": "POST",
  131305. // "id": "compute.targetVpnGateways.testIamPermissions",
  131306. // "parameterOrder": [
  131307. // "project",
  131308. // "region",
  131309. // "resource"
  131310. // ],
  131311. // "parameters": {
  131312. // "project": {
  131313. // "description": "Project ID for this request.",
  131314. // "location": "path",
  131315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131316. // "required": true,
  131317. // "type": "string"
  131318. // },
  131319. // "region": {
  131320. // "description": "The name of the region for this request.",
  131321. // "location": "path",
  131322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131323. // "required": true,
  131324. // "type": "string"
  131325. // },
  131326. // "resource": {
  131327. // "description": "Name or id of the resource for this request.",
  131328. // "location": "path",
  131329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131330. // "required": true,
  131331. // "type": "string"
  131332. // }
  131333. // },
  131334. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  131335. // "request": {
  131336. // "$ref": "TestPermissionsRequest"
  131337. // },
  131338. // "response": {
  131339. // "$ref": "TestPermissionsResponse"
  131340. // },
  131341. // "scopes": [
  131342. // "https://www.googleapis.com/auth/cloud-platform",
  131343. // "https://www.googleapis.com/auth/compute",
  131344. // "https://www.googleapis.com/auth/compute.readonly"
  131345. // ]
  131346. // }
  131347. }
  131348. // method id "compute.urlMaps.aggregatedList":
  131349. type UrlMapsAggregatedListCall struct {
  131350. s *Service
  131351. project string
  131352. urlParams_ gensupport.URLParams
  131353. ifNoneMatch_ string
  131354. ctx_ context.Context
  131355. header_ http.Header
  131356. }
  131357. // AggregatedList: Retrieves the list of all UrlMap resources, regional
  131358. // and global, available to the specified project.
  131359. func (r *UrlMapsService) AggregatedList(project string) *UrlMapsAggregatedListCall {
  131360. c := &UrlMapsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131361. c.project = project
  131362. return c
  131363. }
  131364. // Filter sets the optional parameter "filter": A filter expression that
  131365. // filters resources listed in the response. The expression must specify
  131366. // the field name, a comparison operator, and the value that you want to
  131367. // use for filtering. The value must be a string, a number, or a
  131368. // boolean. The comparison operator must be either =, !=, >, or <.
  131369. //
  131370. // For example, if you are filtering Compute Engine instances, you can
  131371. // exclude instances named example-instance by specifying name !=
  131372. // example-instance.
  131373. //
  131374. // You can also filter nested fields. For example, you could specify
  131375. // scheduling.automaticRestart = false to include instances only if they
  131376. // are not scheduled for automatic restarts. You can use filtering on
  131377. // nested fields to filter based on resource labels.
  131378. //
  131379. // To filter on multiple expressions, provide each separate expression
  131380. // within parentheses. For example, (scheduling.automaticRestart = true)
  131381. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  131382. // AND expression. However, you can include AND and OR expressions
  131383. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  131384. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  131385. // true).
  131386. func (c *UrlMapsAggregatedListCall) Filter(filter string) *UrlMapsAggregatedListCall {
  131387. c.urlParams_.Set("filter", filter)
  131388. return c
  131389. }
  131390. // MaxResults sets the optional parameter "maxResults": The maximum
  131391. // number of results per page that should be returned. If the number of
  131392. // available results is larger than maxResults, Compute Engine returns a
  131393. // nextPageToken that can be used to get the next page of results in
  131394. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  131395. // (Default: 500)
  131396. func (c *UrlMapsAggregatedListCall) MaxResults(maxResults int64) *UrlMapsAggregatedListCall {
  131397. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  131398. return c
  131399. }
  131400. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  131401. // a certain order. By default, results are returned in alphanumerical
  131402. // order based on the resource name.
  131403. //
  131404. // You can also sort results in descending order based on the creation
  131405. // timestamp using orderBy="creationTimestamp desc". This sorts results
  131406. // based on the creationTimestamp field in reverse chronological order
  131407. // (newest result first). Use this to sort resources like operations so
  131408. // that the newest operation is returned first.
  131409. //
  131410. // Currently, only sorting by name or creationTimestamp desc is
  131411. // supported.
  131412. func (c *UrlMapsAggregatedListCall) OrderBy(orderBy string) *UrlMapsAggregatedListCall {
  131413. c.urlParams_.Set("orderBy", orderBy)
  131414. return c
  131415. }
  131416. // PageToken sets the optional parameter "pageToken": Specifies a page
  131417. // token to use. Set pageToken to the nextPageToken returned by a
  131418. // previous list request to get the next page of results.
  131419. func (c *UrlMapsAggregatedListCall) PageToken(pageToken string) *UrlMapsAggregatedListCall {
  131420. c.urlParams_.Set("pageToken", pageToken)
  131421. return c
  131422. }
  131423. // Fields allows partial responses to be retrieved. See
  131424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131425. // for more information.
  131426. func (c *UrlMapsAggregatedListCall) Fields(s ...googleapi.Field) *UrlMapsAggregatedListCall {
  131427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131428. return c
  131429. }
  131430. // IfNoneMatch sets the optional parameter which makes the operation
  131431. // fail if the object's ETag matches the given value. This is useful for
  131432. // getting updates only after the object has changed since the last
  131433. // request. Use googleapi.IsNotModified to check whether the response
  131434. // error from Do is the result of In-None-Match.
  131435. func (c *UrlMapsAggregatedListCall) IfNoneMatch(entityTag string) *UrlMapsAggregatedListCall {
  131436. c.ifNoneMatch_ = entityTag
  131437. return c
  131438. }
  131439. // Context sets the context to be used in this call's Do method. Any
  131440. // pending HTTP request will be aborted if the provided context is
  131441. // canceled.
  131442. func (c *UrlMapsAggregatedListCall) Context(ctx context.Context) *UrlMapsAggregatedListCall {
  131443. c.ctx_ = ctx
  131444. return c
  131445. }
  131446. // Header returns an http.Header that can be modified by the caller to
  131447. // add HTTP headers to the request.
  131448. func (c *UrlMapsAggregatedListCall) Header() http.Header {
  131449. if c.header_ == nil {
  131450. c.header_ = make(http.Header)
  131451. }
  131452. return c.header_
  131453. }
  131454. func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  131455. reqHeaders := make(http.Header)
  131456. for k, v := range c.header_ {
  131457. reqHeaders[k] = v
  131458. }
  131459. reqHeaders.Set("User-Agent", c.s.userAgent())
  131460. if c.ifNoneMatch_ != "" {
  131461. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  131462. }
  131463. var body io.Reader = nil
  131464. c.urlParams_.Set("alt", alt)
  131465. c.urlParams_.Set("prettyPrint", "false")
  131466. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/urlMaps")
  131467. urls += "?" + c.urlParams_.Encode()
  131468. req, err := http.NewRequest("GET", urls, body)
  131469. if err != nil {
  131470. return nil, err
  131471. }
  131472. req.Header = reqHeaders
  131473. googleapi.Expand(req.URL, map[string]string{
  131474. "project": c.project,
  131475. })
  131476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131477. }
  131478. // Do executes the "compute.urlMaps.aggregatedList" call.
  131479. // Exactly one of *UrlMapsAggregatedList or error will be non-nil. Any
  131480. // non-2xx status code is an error. Response headers are in either
  131481. // *UrlMapsAggregatedList.ServerResponse.Header or (if a response was
  131482. // returned at all) in error.(*googleapi.Error).Header. Use
  131483. // googleapi.IsNotModified to check whether the returned error was
  131484. // because http.StatusNotModified was returned.
  131485. func (c *UrlMapsAggregatedListCall) Do(opts ...googleapi.CallOption) (*UrlMapsAggregatedList, error) {
  131486. gensupport.SetOptions(c.urlParams_, opts...)
  131487. res, err := c.doRequest("json")
  131488. if res != nil && res.StatusCode == http.StatusNotModified {
  131489. if res.Body != nil {
  131490. res.Body.Close()
  131491. }
  131492. return nil, &googleapi.Error{
  131493. Code: res.StatusCode,
  131494. Header: res.Header,
  131495. }
  131496. }
  131497. if err != nil {
  131498. return nil, err
  131499. }
  131500. defer googleapi.CloseBody(res)
  131501. if err := googleapi.CheckResponse(res); err != nil {
  131502. return nil, err
  131503. }
  131504. ret := &UrlMapsAggregatedList{
  131505. ServerResponse: googleapi.ServerResponse{
  131506. Header: res.Header,
  131507. HTTPStatusCode: res.StatusCode,
  131508. },
  131509. }
  131510. target := &ret
  131511. if err := gensupport.DecodeResponse(target, res); err != nil {
  131512. return nil, err
  131513. }
  131514. return ret, nil
  131515. // {
  131516. // "description": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project.",
  131517. // "httpMethod": "GET",
  131518. // "id": "compute.urlMaps.aggregatedList",
  131519. // "parameterOrder": [
  131520. // "project"
  131521. // ],
  131522. // "parameters": {
  131523. // "filter": {
  131524. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  131525. // "location": "query",
  131526. // "type": "string"
  131527. // },
  131528. // "maxResults": {
  131529. // "default": "500",
  131530. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  131531. // "format": "uint32",
  131532. // "location": "query",
  131533. // "minimum": "0",
  131534. // "type": "integer"
  131535. // },
  131536. // "orderBy": {
  131537. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  131538. // "location": "query",
  131539. // "type": "string"
  131540. // },
  131541. // "pageToken": {
  131542. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  131543. // "location": "query",
  131544. // "type": "string"
  131545. // },
  131546. // "project": {
  131547. // "description": "Name of the project scoping this request.",
  131548. // "location": "path",
  131549. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131550. // "required": true,
  131551. // "type": "string"
  131552. // }
  131553. // },
  131554. // "path": "{project}/aggregated/urlMaps",
  131555. // "response": {
  131556. // "$ref": "UrlMapsAggregatedList"
  131557. // },
  131558. // "scopes": [
  131559. // "https://www.googleapis.com/auth/cloud-platform",
  131560. // "https://www.googleapis.com/auth/compute",
  131561. // "https://www.googleapis.com/auth/compute.readonly"
  131562. // ]
  131563. // }
  131564. }
  131565. // Pages invokes f for each page of results.
  131566. // A non-nil error returned from f will halt the iteration.
  131567. // The provided context supersedes any context provided to the Context method.
  131568. func (c *UrlMapsAggregatedListCall) Pages(ctx context.Context, f func(*UrlMapsAggregatedList) error) error {
  131569. c.ctx_ = ctx
  131570. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  131571. for {
  131572. x, err := c.Do()
  131573. if err != nil {
  131574. return err
  131575. }
  131576. if err := f(x); err != nil {
  131577. return err
  131578. }
  131579. if x.NextPageToken == "" {
  131580. return nil
  131581. }
  131582. c.PageToken(x.NextPageToken)
  131583. }
  131584. }
  131585. // method id "compute.urlMaps.delete":
  131586. type UrlMapsDeleteCall struct {
  131587. s *Service
  131588. project string
  131589. urlMap string
  131590. urlParams_ gensupport.URLParams
  131591. ctx_ context.Context
  131592. header_ http.Header
  131593. }
  131594. // Delete: Deletes the specified UrlMap resource.
  131595. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  131596. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  131597. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131598. c.project = project
  131599. c.urlMap = urlMap
  131600. return c
  131601. }
  131602. // RequestId sets the optional parameter "requestId": An optional
  131603. // request ID to identify requests. Specify a unique request ID so that
  131604. // if you must retry your request, the server will know to ignore the
  131605. // request if it has already been completed.
  131606. //
  131607. // For example, consider a situation where you make an initial request
  131608. // and the request times out. If you make the request again with the
  131609. // same request ID, the server can check if original operation with the
  131610. // same request ID was received, and if so, will ignore the second
  131611. // request. This prevents clients from accidentally creating duplicate
  131612. // commitments.
  131613. //
  131614. // The request ID must be a valid UUID with the exception that zero UUID
  131615. // is not supported (00000000-0000-0000-0000-000000000000).
  131616. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  131617. c.urlParams_.Set("requestId", requestId)
  131618. return c
  131619. }
  131620. // Fields allows partial responses to be retrieved. See
  131621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131622. // for more information.
  131623. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  131624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131625. return c
  131626. }
  131627. // Context sets the context to be used in this call's Do method. Any
  131628. // pending HTTP request will be aborted if the provided context is
  131629. // canceled.
  131630. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  131631. c.ctx_ = ctx
  131632. return c
  131633. }
  131634. // Header returns an http.Header that can be modified by the caller to
  131635. // add HTTP headers to the request.
  131636. func (c *UrlMapsDeleteCall) Header() http.Header {
  131637. if c.header_ == nil {
  131638. c.header_ = make(http.Header)
  131639. }
  131640. return c.header_
  131641. }
  131642. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  131643. reqHeaders := make(http.Header)
  131644. for k, v := range c.header_ {
  131645. reqHeaders[k] = v
  131646. }
  131647. reqHeaders.Set("User-Agent", c.s.userAgent())
  131648. var body io.Reader = nil
  131649. c.urlParams_.Set("alt", alt)
  131650. c.urlParams_.Set("prettyPrint", "false")
  131651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  131652. urls += "?" + c.urlParams_.Encode()
  131653. req, err := http.NewRequest("DELETE", urls, body)
  131654. if err != nil {
  131655. return nil, err
  131656. }
  131657. req.Header = reqHeaders
  131658. googleapi.Expand(req.URL, map[string]string{
  131659. "project": c.project,
  131660. "urlMap": c.urlMap,
  131661. })
  131662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131663. }
  131664. // Do executes the "compute.urlMaps.delete" call.
  131665. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131666. // status code is an error. Response headers are in either
  131667. // *Operation.ServerResponse.Header or (if a response was returned at
  131668. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131669. // to check whether the returned error was because
  131670. // http.StatusNotModified was returned.
  131671. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131672. gensupport.SetOptions(c.urlParams_, opts...)
  131673. res, err := c.doRequest("json")
  131674. if res != nil && res.StatusCode == http.StatusNotModified {
  131675. if res.Body != nil {
  131676. res.Body.Close()
  131677. }
  131678. return nil, &googleapi.Error{
  131679. Code: res.StatusCode,
  131680. Header: res.Header,
  131681. }
  131682. }
  131683. if err != nil {
  131684. return nil, err
  131685. }
  131686. defer googleapi.CloseBody(res)
  131687. if err := googleapi.CheckResponse(res); err != nil {
  131688. return nil, err
  131689. }
  131690. ret := &Operation{
  131691. ServerResponse: googleapi.ServerResponse{
  131692. Header: res.Header,
  131693. HTTPStatusCode: res.StatusCode,
  131694. },
  131695. }
  131696. target := &ret
  131697. if err := gensupport.DecodeResponse(target, res); err != nil {
  131698. return nil, err
  131699. }
  131700. return ret, nil
  131701. // {
  131702. // "description": "Deletes the specified UrlMap resource.",
  131703. // "httpMethod": "DELETE",
  131704. // "id": "compute.urlMaps.delete",
  131705. // "parameterOrder": [
  131706. // "project",
  131707. // "urlMap"
  131708. // ],
  131709. // "parameters": {
  131710. // "project": {
  131711. // "description": "Project ID for this request.",
  131712. // "location": "path",
  131713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131714. // "required": true,
  131715. // "type": "string"
  131716. // },
  131717. // "requestId": {
  131718. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131719. // "location": "query",
  131720. // "type": "string"
  131721. // },
  131722. // "urlMap": {
  131723. // "description": "Name of the UrlMap resource to delete.",
  131724. // "location": "path",
  131725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131726. // "required": true,
  131727. // "type": "string"
  131728. // }
  131729. // },
  131730. // "path": "{project}/global/urlMaps/{urlMap}",
  131731. // "response": {
  131732. // "$ref": "Operation"
  131733. // },
  131734. // "scopes": [
  131735. // "https://www.googleapis.com/auth/cloud-platform",
  131736. // "https://www.googleapis.com/auth/compute"
  131737. // ]
  131738. // }
  131739. }
  131740. // method id "compute.urlMaps.get":
  131741. type UrlMapsGetCall struct {
  131742. s *Service
  131743. project string
  131744. urlMap string
  131745. urlParams_ gensupport.URLParams
  131746. ifNoneMatch_ string
  131747. ctx_ context.Context
  131748. header_ http.Header
  131749. }
  131750. // Get: Returns the specified UrlMap resource. Gets a list of available
  131751. // URL maps by making a list() request.
  131752. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  131753. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  131754. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131755. c.project = project
  131756. c.urlMap = urlMap
  131757. return c
  131758. }
  131759. // Fields allows partial responses to be retrieved. See
  131760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131761. // for more information.
  131762. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  131763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131764. return c
  131765. }
  131766. // IfNoneMatch sets the optional parameter which makes the operation
  131767. // fail if the object's ETag matches the given value. This is useful for
  131768. // getting updates only after the object has changed since the last
  131769. // request. Use googleapi.IsNotModified to check whether the response
  131770. // error from Do is the result of In-None-Match.
  131771. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  131772. c.ifNoneMatch_ = entityTag
  131773. return c
  131774. }
  131775. // Context sets the context to be used in this call's Do method. Any
  131776. // pending HTTP request will be aborted if the provided context is
  131777. // canceled.
  131778. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  131779. c.ctx_ = ctx
  131780. return c
  131781. }
  131782. // Header returns an http.Header that can be modified by the caller to
  131783. // add HTTP headers to the request.
  131784. func (c *UrlMapsGetCall) Header() http.Header {
  131785. if c.header_ == nil {
  131786. c.header_ = make(http.Header)
  131787. }
  131788. return c.header_
  131789. }
  131790. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  131791. reqHeaders := make(http.Header)
  131792. for k, v := range c.header_ {
  131793. reqHeaders[k] = v
  131794. }
  131795. reqHeaders.Set("User-Agent", c.s.userAgent())
  131796. if c.ifNoneMatch_ != "" {
  131797. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  131798. }
  131799. var body io.Reader = nil
  131800. c.urlParams_.Set("alt", alt)
  131801. c.urlParams_.Set("prettyPrint", "false")
  131802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  131803. urls += "?" + c.urlParams_.Encode()
  131804. req, err := http.NewRequest("GET", urls, body)
  131805. if err != nil {
  131806. return nil, err
  131807. }
  131808. req.Header = reqHeaders
  131809. googleapi.Expand(req.URL, map[string]string{
  131810. "project": c.project,
  131811. "urlMap": c.urlMap,
  131812. })
  131813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131814. }
  131815. // Do executes the "compute.urlMaps.get" call.
  131816. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  131817. // code is an error. Response headers are in either
  131818. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  131819. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  131820. // check whether the returned error was because http.StatusNotModified
  131821. // was returned.
  131822. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  131823. gensupport.SetOptions(c.urlParams_, opts...)
  131824. res, err := c.doRequest("json")
  131825. if res != nil && res.StatusCode == http.StatusNotModified {
  131826. if res.Body != nil {
  131827. res.Body.Close()
  131828. }
  131829. return nil, &googleapi.Error{
  131830. Code: res.StatusCode,
  131831. Header: res.Header,
  131832. }
  131833. }
  131834. if err != nil {
  131835. return nil, err
  131836. }
  131837. defer googleapi.CloseBody(res)
  131838. if err := googleapi.CheckResponse(res); err != nil {
  131839. return nil, err
  131840. }
  131841. ret := &UrlMap{
  131842. ServerResponse: googleapi.ServerResponse{
  131843. Header: res.Header,
  131844. HTTPStatusCode: res.StatusCode,
  131845. },
  131846. }
  131847. target := &ret
  131848. if err := gensupport.DecodeResponse(target, res); err != nil {
  131849. return nil, err
  131850. }
  131851. return ret, nil
  131852. // {
  131853. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  131854. // "httpMethod": "GET",
  131855. // "id": "compute.urlMaps.get",
  131856. // "parameterOrder": [
  131857. // "project",
  131858. // "urlMap"
  131859. // ],
  131860. // "parameters": {
  131861. // "project": {
  131862. // "description": "Project ID for this request.",
  131863. // "location": "path",
  131864. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131865. // "required": true,
  131866. // "type": "string"
  131867. // },
  131868. // "urlMap": {
  131869. // "description": "Name of the UrlMap resource to return.",
  131870. // "location": "path",
  131871. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  131872. // "required": true,
  131873. // "type": "string"
  131874. // }
  131875. // },
  131876. // "path": "{project}/global/urlMaps/{urlMap}",
  131877. // "response": {
  131878. // "$ref": "UrlMap"
  131879. // },
  131880. // "scopes": [
  131881. // "https://www.googleapis.com/auth/cloud-platform",
  131882. // "https://www.googleapis.com/auth/compute",
  131883. // "https://www.googleapis.com/auth/compute.readonly"
  131884. // ]
  131885. // }
  131886. }
  131887. // method id "compute.urlMaps.insert":
  131888. type UrlMapsInsertCall struct {
  131889. s *Service
  131890. project string
  131891. urlmap *UrlMap
  131892. urlParams_ gensupport.URLParams
  131893. ctx_ context.Context
  131894. header_ http.Header
  131895. }
  131896. // Insert: Creates a UrlMap resource in the specified project using the
  131897. // data included in the request.
  131898. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  131899. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  131900. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131901. c.project = project
  131902. c.urlmap = urlmap
  131903. return c
  131904. }
  131905. // RequestId sets the optional parameter "requestId": An optional
  131906. // request ID to identify requests. Specify a unique request ID so that
  131907. // if you must retry your request, the server will know to ignore the
  131908. // request if it has already been completed.
  131909. //
  131910. // For example, consider a situation where you make an initial request
  131911. // and the request times out. If you make the request again with the
  131912. // same request ID, the server can check if original operation with the
  131913. // same request ID was received, and if so, will ignore the second
  131914. // request. This prevents clients from accidentally creating duplicate
  131915. // commitments.
  131916. //
  131917. // The request ID must be a valid UUID with the exception that zero UUID
  131918. // is not supported (00000000-0000-0000-0000-000000000000).
  131919. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  131920. c.urlParams_.Set("requestId", requestId)
  131921. return c
  131922. }
  131923. // Fields allows partial responses to be retrieved. See
  131924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131925. // for more information.
  131926. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  131927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131928. return c
  131929. }
  131930. // Context sets the context to be used in this call's Do method. Any
  131931. // pending HTTP request will be aborted if the provided context is
  131932. // canceled.
  131933. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  131934. c.ctx_ = ctx
  131935. return c
  131936. }
  131937. // Header returns an http.Header that can be modified by the caller to
  131938. // add HTTP headers to the request.
  131939. func (c *UrlMapsInsertCall) Header() http.Header {
  131940. if c.header_ == nil {
  131941. c.header_ = make(http.Header)
  131942. }
  131943. return c.header_
  131944. }
  131945. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  131946. reqHeaders := make(http.Header)
  131947. for k, v := range c.header_ {
  131948. reqHeaders[k] = v
  131949. }
  131950. reqHeaders.Set("User-Agent", c.s.userAgent())
  131951. var body io.Reader = nil
  131952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  131953. if err != nil {
  131954. return nil, err
  131955. }
  131956. reqHeaders.Set("Content-Type", "application/json")
  131957. c.urlParams_.Set("alt", alt)
  131958. c.urlParams_.Set("prettyPrint", "false")
  131959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  131960. urls += "?" + c.urlParams_.Encode()
  131961. req, err := http.NewRequest("POST", urls, body)
  131962. if err != nil {
  131963. return nil, err
  131964. }
  131965. req.Header = reqHeaders
  131966. googleapi.Expand(req.URL, map[string]string{
  131967. "project": c.project,
  131968. })
  131969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131970. }
  131971. // Do executes the "compute.urlMaps.insert" call.
  131972. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131973. // status code is an error. Response headers are in either
  131974. // *Operation.ServerResponse.Header or (if a response was returned at
  131975. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131976. // to check whether the returned error was because
  131977. // http.StatusNotModified was returned.
  131978. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131979. gensupport.SetOptions(c.urlParams_, opts...)
  131980. res, err := c.doRequest("json")
  131981. if res != nil && res.StatusCode == http.StatusNotModified {
  131982. if res.Body != nil {
  131983. res.Body.Close()
  131984. }
  131985. return nil, &googleapi.Error{
  131986. Code: res.StatusCode,
  131987. Header: res.Header,
  131988. }
  131989. }
  131990. if err != nil {
  131991. return nil, err
  131992. }
  131993. defer googleapi.CloseBody(res)
  131994. if err := googleapi.CheckResponse(res); err != nil {
  131995. return nil, err
  131996. }
  131997. ret := &Operation{
  131998. ServerResponse: googleapi.ServerResponse{
  131999. Header: res.Header,
  132000. HTTPStatusCode: res.StatusCode,
  132001. },
  132002. }
  132003. target := &ret
  132004. if err := gensupport.DecodeResponse(target, res); err != nil {
  132005. return nil, err
  132006. }
  132007. return ret, nil
  132008. // {
  132009. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  132010. // "httpMethod": "POST",
  132011. // "id": "compute.urlMaps.insert",
  132012. // "parameterOrder": [
  132013. // "project"
  132014. // ],
  132015. // "parameters": {
  132016. // "project": {
  132017. // "description": "Project ID for this request.",
  132018. // "location": "path",
  132019. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132020. // "required": true,
  132021. // "type": "string"
  132022. // },
  132023. // "requestId": {
  132024. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132025. // "location": "query",
  132026. // "type": "string"
  132027. // }
  132028. // },
  132029. // "path": "{project}/global/urlMaps",
  132030. // "request": {
  132031. // "$ref": "UrlMap"
  132032. // },
  132033. // "response": {
  132034. // "$ref": "Operation"
  132035. // },
  132036. // "scopes": [
  132037. // "https://www.googleapis.com/auth/cloud-platform",
  132038. // "https://www.googleapis.com/auth/compute"
  132039. // ]
  132040. // }
  132041. }
  132042. // method id "compute.urlMaps.invalidateCache":
  132043. type UrlMapsInvalidateCacheCall struct {
  132044. s *Service
  132045. project string
  132046. urlMap string
  132047. cacheinvalidationrule *CacheInvalidationRule
  132048. urlParams_ gensupport.URLParams
  132049. ctx_ context.Context
  132050. header_ http.Header
  132051. }
  132052. // InvalidateCache: Initiates a cache invalidation operation,
  132053. // invalidating the specified path, scoped to the specified UrlMap.
  132054. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  132055. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132056. c.project = project
  132057. c.urlMap = urlMap
  132058. c.cacheinvalidationrule = cacheinvalidationrule
  132059. return c
  132060. }
  132061. // RequestId sets the optional parameter "requestId": An optional
  132062. // request ID to identify requests. Specify a unique request ID so that
  132063. // if you must retry your request, the server will know to ignore the
  132064. // request if it has already been completed.
  132065. //
  132066. // For example, consider a situation where you make an initial request
  132067. // and the request times out. If you make the request again with the
  132068. // same request ID, the server can check if original operation with the
  132069. // same request ID was received, and if so, will ignore the second
  132070. // request. This prevents clients from accidentally creating duplicate
  132071. // commitments.
  132072. //
  132073. // The request ID must be a valid UUID with the exception that zero UUID
  132074. // is not supported (00000000-0000-0000-0000-000000000000).
  132075. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  132076. c.urlParams_.Set("requestId", requestId)
  132077. return c
  132078. }
  132079. // Fields allows partial responses to be retrieved. See
  132080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132081. // for more information.
  132082. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  132083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132084. return c
  132085. }
  132086. // Context sets the context to be used in this call's Do method. Any
  132087. // pending HTTP request will be aborted if the provided context is
  132088. // canceled.
  132089. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  132090. c.ctx_ = ctx
  132091. return c
  132092. }
  132093. // Header returns an http.Header that can be modified by the caller to
  132094. // add HTTP headers to the request.
  132095. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  132096. if c.header_ == nil {
  132097. c.header_ = make(http.Header)
  132098. }
  132099. return c.header_
  132100. }
  132101. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  132102. reqHeaders := make(http.Header)
  132103. for k, v := range c.header_ {
  132104. reqHeaders[k] = v
  132105. }
  132106. reqHeaders.Set("User-Agent", c.s.userAgent())
  132107. var body io.Reader = nil
  132108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  132109. if err != nil {
  132110. return nil, err
  132111. }
  132112. reqHeaders.Set("Content-Type", "application/json")
  132113. c.urlParams_.Set("alt", alt)
  132114. c.urlParams_.Set("prettyPrint", "false")
  132115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  132116. urls += "?" + c.urlParams_.Encode()
  132117. req, err := http.NewRequest("POST", urls, body)
  132118. if err != nil {
  132119. return nil, err
  132120. }
  132121. req.Header = reqHeaders
  132122. googleapi.Expand(req.URL, map[string]string{
  132123. "project": c.project,
  132124. "urlMap": c.urlMap,
  132125. })
  132126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132127. }
  132128. // Do executes the "compute.urlMaps.invalidateCache" call.
  132129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132130. // status code is an error. Response headers are in either
  132131. // *Operation.ServerResponse.Header or (if a response was returned at
  132132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132133. // to check whether the returned error was because
  132134. // http.StatusNotModified was returned.
  132135. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132136. gensupport.SetOptions(c.urlParams_, opts...)
  132137. res, err := c.doRequest("json")
  132138. if res != nil && res.StatusCode == http.StatusNotModified {
  132139. if res.Body != nil {
  132140. res.Body.Close()
  132141. }
  132142. return nil, &googleapi.Error{
  132143. Code: res.StatusCode,
  132144. Header: res.Header,
  132145. }
  132146. }
  132147. if err != nil {
  132148. return nil, err
  132149. }
  132150. defer googleapi.CloseBody(res)
  132151. if err := googleapi.CheckResponse(res); err != nil {
  132152. return nil, err
  132153. }
  132154. ret := &Operation{
  132155. ServerResponse: googleapi.ServerResponse{
  132156. Header: res.Header,
  132157. HTTPStatusCode: res.StatusCode,
  132158. },
  132159. }
  132160. target := &ret
  132161. if err := gensupport.DecodeResponse(target, res); err != nil {
  132162. return nil, err
  132163. }
  132164. return ret, nil
  132165. // {
  132166. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  132167. // "httpMethod": "POST",
  132168. // "id": "compute.urlMaps.invalidateCache",
  132169. // "parameterOrder": [
  132170. // "project",
  132171. // "urlMap"
  132172. // ],
  132173. // "parameters": {
  132174. // "project": {
  132175. // "description": "Project ID for this request.",
  132176. // "location": "path",
  132177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132178. // "required": true,
  132179. // "type": "string"
  132180. // },
  132181. // "requestId": {
  132182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132183. // "location": "query",
  132184. // "type": "string"
  132185. // },
  132186. // "urlMap": {
  132187. // "description": "Name of the UrlMap scoping this request.",
  132188. // "location": "path",
  132189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132190. // "required": true,
  132191. // "type": "string"
  132192. // }
  132193. // },
  132194. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  132195. // "request": {
  132196. // "$ref": "CacheInvalidationRule"
  132197. // },
  132198. // "response": {
  132199. // "$ref": "Operation"
  132200. // },
  132201. // "scopes": [
  132202. // "https://www.googleapis.com/auth/cloud-platform",
  132203. // "https://www.googleapis.com/auth/compute"
  132204. // ]
  132205. // }
  132206. }
  132207. // method id "compute.urlMaps.list":
  132208. type UrlMapsListCall struct {
  132209. s *Service
  132210. project string
  132211. urlParams_ gensupport.URLParams
  132212. ifNoneMatch_ string
  132213. ctx_ context.Context
  132214. header_ http.Header
  132215. }
  132216. // List: Retrieves the list of UrlMap resources available to the
  132217. // specified project.
  132218. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  132219. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  132220. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132221. c.project = project
  132222. return c
  132223. }
  132224. // Filter sets the optional parameter "filter": A filter expression that
  132225. // filters resources listed in the response. The expression must specify
  132226. // the field name, a comparison operator, and the value that you want to
  132227. // use for filtering. The value must be a string, a number, or a
  132228. // boolean. The comparison operator must be either =, !=, >, or <.
  132229. //
  132230. // For example, if you are filtering Compute Engine instances, you can
  132231. // exclude instances named example-instance by specifying name !=
  132232. // example-instance.
  132233. //
  132234. // You can also filter nested fields. For example, you could specify
  132235. // scheduling.automaticRestart = false to include instances only if they
  132236. // are not scheduled for automatic restarts. You can use filtering on
  132237. // nested fields to filter based on resource labels.
  132238. //
  132239. // To filter on multiple expressions, provide each separate expression
  132240. // within parentheses. For example, (scheduling.automaticRestart = true)
  132241. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  132242. // AND expression. However, you can include AND and OR expressions
  132243. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  132244. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  132245. // true).
  132246. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  132247. c.urlParams_.Set("filter", filter)
  132248. return c
  132249. }
  132250. // MaxResults sets the optional parameter "maxResults": The maximum
  132251. // number of results per page that should be returned. If the number of
  132252. // available results is larger than maxResults, Compute Engine returns a
  132253. // nextPageToken that can be used to get the next page of results in
  132254. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  132255. // (Default: 500)
  132256. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  132257. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  132258. return c
  132259. }
  132260. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  132261. // a certain order. By default, results are returned in alphanumerical
  132262. // order based on the resource name.
  132263. //
  132264. // You can also sort results in descending order based on the creation
  132265. // timestamp using orderBy="creationTimestamp desc". This sorts results
  132266. // based on the creationTimestamp field in reverse chronological order
  132267. // (newest result first). Use this to sort resources like operations so
  132268. // that the newest operation is returned first.
  132269. //
  132270. // Currently, only sorting by name or creationTimestamp desc is
  132271. // supported.
  132272. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  132273. c.urlParams_.Set("orderBy", orderBy)
  132274. return c
  132275. }
  132276. // PageToken sets the optional parameter "pageToken": Specifies a page
  132277. // token to use. Set pageToken to the nextPageToken returned by a
  132278. // previous list request to get the next page of results.
  132279. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  132280. c.urlParams_.Set("pageToken", pageToken)
  132281. return c
  132282. }
  132283. // Fields allows partial responses to be retrieved. See
  132284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132285. // for more information.
  132286. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  132287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132288. return c
  132289. }
  132290. // IfNoneMatch sets the optional parameter which makes the operation
  132291. // fail if the object's ETag matches the given value. This is useful for
  132292. // getting updates only after the object has changed since the last
  132293. // request. Use googleapi.IsNotModified to check whether the response
  132294. // error from Do is the result of In-None-Match.
  132295. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  132296. c.ifNoneMatch_ = entityTag
  132297. return c
  132298. }
  132299. // Context sets the context to be used in this call's Do method. Any
  132300. // pending HTTP request will be aborted if the provided context is
  132301. // canceled.
  132302. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  132303. c.ctx_ = ctx
  132304. return c
  132305. }
  132306. // Header returns an http.Header that can be modified by the caller to
  132307. // add HTTP headers to the request.
  132308. func (c *UrlMapsListCall) Header() http.Header {
  132309. if c.header_ == nil {
  132310. c.header_ = make(http.Header)
  132311. }
  132312. return c.header_
  132313. }
  132314. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  132315. reqHeaders := make(http.Header)
  132316. for k, v := range c.header_ {
  132317. reqHeaders[k] = v
  132318. }
  132319. reqHeaders.Set("User-Agent", c.s.userAgent())
  132320. if c.ifNoneMatch_ != "" {
  132321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  132322. }
  132323. var body io.Reader = nil
  132324. c.urlParams_.Set("alt", alt)
  132325. c.urlParams_.Set("prettyPrint", "false")
  132326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  132327. urls += "?" + c.urlParams_.Encode()
  132328. req, err := http.NewRequest("GET", urls, body)
  132329. if err != nil {
  132330. return nil, err
  132331. }
  132332. req.Header = reqHeaders
  132333. googleapi.Expand(req.URL, map[string]string{
  132334. "project": c.project,
  132335. })
  132336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132337. }
  132338. // Do executes the "compute.urlMaps.list" call.
  132339. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  132340. // status code is an error. Response headers are in either
  132341. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  132342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132343. // to check whether the returned error was because
  132344. // http.StatusNotModified was returned.
  132345. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  132346. gensupport.SetOptions(c.urlParams_, opts...)
  132347. res, err := c.doRequest("json")
  132348. if res != nil && res.StatusCode == http.StatusNotModified {
  132349. if res.Body != nil {
  132350. res.Body.Close()
  132351. }
  132352. return nil, &googleapi.Error{
  132353. Code: res.StatusCode,
  132354. Header: res.Header,
  132355. }
  132356. }
  132357. if err != nil {
  132358. return nil, err
  132359. }
  132360. defer googleapi.CloseBody(res)
  132361. if err := googleapi.CheckResponse(res); err != nil {
  132362. return nil, err
  132363. }
  132364. ret := &UrlMapList{
  132365. ServerResponse: googleapi.ServerResponse{
  132366. Header: res.Header,
  132367. HTTPStatusCode: res.StatusCode,
  132368. },
  132369. }
  132370. target := &ret
  132371. if err := gensupport.DecodeResponse(target, res); err != nil {
  132372. return nil, err
  132373. }
  132374. return ret, nil
  132375. // {
  132376. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  132377. // "httpMethod": "GET",
  132378. // "id": "compute.urlMaps.list",
  132379. // "parameterOrder": [
  132380. // "project"
  132381. // ],
  132382. // "parameters": {
  132383. // "filter": {
  132384. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  132385. // "location": "query",
  132386. // "type": "string"
  132387. // },
  132388. // "maxResults": {
  132389. // "default": "500",
  132390. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  132391. // "format": "uint32",
  132392. // "location": "query",
  132393. // "minimum": "0",
  132394. // "type": "integer"
  132395. // },
  132396. // "orderBy": {
  132397. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  132398. // "location": "query",
  132399. // "type": "string"
  132400. // },
  132401. // "pageToken": {
  132402. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  132403. // "location": "query",
  132404. // "type": "string"
  132405. // },
  132406. // "project": {
  132407. // "description": "Project ID for this request.",
  132408. // "location": "path",
  132409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132410. // "required": true,
  132411. // "type": "string"
  132412. // }
  132413. // },
  132414. // "path": "{project}/global/urlMaps",
  132415. // "response": {
  132416. // "$ref": "UrlMapList"
  132417. // },
  132418. // "scopes": [
  132419. // "https://www.googleapis.com/auth/cloud-platform",
  132420. // "https://www.googleapis.com/auth/compute",
  132421. // "https://www.googleapis.com/auth/compute.readonly"
  132422. // ]
  132423. // }
  132424. }
  132425. // Pages invokes f for each page of results.
  132426. // A non-nil error returned from f will halt the iteration.
  132427. // The provided context supersedes any context provided to the Context method.
  132428. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  132429. c.ctx_ = ctx
  132430. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  132431. for {
  132432. x, err := c.Do()
  132433. if err != nil {
  132434. return err
  132435. }
  132436. if err := f(x); err != nil {
  132437. return err
  132438. }
  132439. if x.NextPageToken == "" {
  132440. return nil
  132441. }
  132442. c.PageToken(x.NextPageToken)
  132443. }
  132444. }
  132445. // method id "compute.urlMaps.patch":
  132446. type UrlMapsPatchCall struct {
  132447. s *Service
  132448. project string
  132449. urlMap string
  132450. urlmap *UrlMap
  132451. urlParams_ gensupport.URLParams
  132452. ctx_ context.Context
  132453. header_ http.Header
  132454. }
  132455. // Patch: Patches the specified UrlMap resource with the data included
  132456. // in the request. This method supports PATCH semantics and uses the
  132457. // JSON merge patch format and processing rules.
  132458. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  132459. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  132460. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132461. c.project = project
  132462. c.urlMap = urlMap
  132463. c.urlmap = urlmap
  132464. return c
  132465. }
  132466. // RequestId sets the optional parameter "requestId": An optional
  132467. // request ID to identify requests. Specify a unique request ID so that
  132468. // if you must retry your request, the server will know to ignore the
  132469. // request if it has already been completed.
  132470. //
  132471. // For example, consider a situation where you make an initial request
  132472. // and the request times out. If you make the request again with the
  132473. // same request ID, the server can check if original operation with the
  132474. // same request ID was received, and if so, will ignore the second
  132475. // request. This prevents clients from accidentally creating duplicate
  132476. // commitments.
  132477. //
  132478. // The request ID must be a valid UUID with the exception that zero UUID
  132479. // is not supported (00000000-0000-0000-0000-000000000000).
  132480. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  132481. c.urlParams_.Set("requestId", requestId)
  132482. return c
  132483. }
  132484. // Fields allows partial responses to be retrieved. See
  132485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132486. // for more information.
  132487. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  132488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132489. return c
  132490. }
  132491. // Context sets the context to be used in this call's Do method. Any
  132492. // pending HTTP request will be aborted if the provided context is
  132493. // canceled.
  132494. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  132495. c.ctx_ = ctx
  132496. return c
  132497. }
  132498. // Header returns an http.Header that can be modified by the caller to
  132499. // add HTTP headers to the request.
  132500. func (c *UrlMapsPatchCall) Header() http.Header {
  132501. if c.header_ == nil {
  132502. c.header_ = make(http.Header)
  132503. }
  132504. return c.header_
  132505. }
  132506. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  132507. reqHeaders := make(http.Header)
  132508. for k, v := range c.header_ {
  132509. reqHeaders[k] = v
  132510. }
  132511. reqHeaders.Set("User-Agent", c.s.userAgent())
  132512. var body io.Reader = nil
  132513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  132514. if err != nil {
  132515. return nil, err
  132516. }
  132517. reqHeaders.Set("Content-Type", "application/json")
  132518. c.urlParams_.Set("alt", alt)
  132519. c.urlParams_.Set("prettyPrint", "false")
  132520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  132521. urls += "?" + c.urlParams_.Encode()
  132522. req, err := http.NewRequest("PATCH", urls, body)
  132523. if err != nil {
  132524. return nil, err
  132525. }
  132526. req.Header = reqHeaders
  132527. googleapi.Expand(req.URL, map[string]string{
  132528. "project": c.project,
  132529. "urlMap": c.urlMap,
  132530. })
  132531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132532. }
  132533. // Do executes the "compute.urlMaps.patch" call.
  132534. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132535. // status code is an error. Response headers are in either
  132536. // *Operation.ServerResponse.Header or (if a response was returned at
  132537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132538. // to check whether the returned error was because
  132539. // http.StatusNotModified was returned.
  132540. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132541. gensupport.SetOptions(c.urlParams_, opts...)
  132542. res, err := c.doRequest("json")
  132543. if res != nil && res.StatusCode == http.StatusNotModified {
  132544. if res.Body != nil {
  132545. res.Body.Close()
  132546. }
  132547. return nil, &googleapi.Error{
  132548. Code: res.StatusCode,
  132549. Header: res.Header,
  132550. }
  132551. }
  132552. if err != nil {
  132553. return nil, err
  132554. }
  132555. defer googleapi.CloseBody(res)
  132556. if err := googleapi.CheckResponse(res); err != nil {
  132557. return nil, err
  132558. }
  132559. ret := &Operation{
  132560. ServerResponse: googleapi.ServerResponse{
  132561. Header: res.Header,
  132562. HTTPStatusCode: res.StatusCode,
  132563. },
  132564. }
  132565. target := &ret
  132566. if err := gensupport.DecodeResponse(target, res); err != nil {
  132567. return nil, err
  132568. }
  132569. return ret, nil
  132570. // {
  132571. // "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.",
  132572. // "httpMethod": "PATCH",
  132573. // "id": "compute.urlMaps.patch",
  132574. // "parameterOrder": [
  132575. // "project",
  132576. // "urlMap"
  132577. // ],
  132578. // "parameters": {
  132579. // "project": {
  132580. // "description": "Project ID for this request.",
  132581. // "location": "path",
  132582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132583. // "required": true,
  132584. // "type": "string"
  132585. // },
  132586. // "requestId": {
  132587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132588. // "location": "query",
  132589. // "type": "string"
  132590. // },
  132591. // "urlMap": {
  132592. // "description": "Name of the UrlMap resource to patch.",
  132593. // "location": "path",
  132594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132595. // "required": true,
  132596. // "type": "string"
  132597. // }
  132598. // },
  132599. // "path": "{project}/global/urlMaps/{urlMap}",
  132600. // "request": {
  132601. // "$ref": "UrlMap"
  132602. // },
  132603. // "response": {
  132604. // "$ref": "Operation"
  132605. // },
  132606. // "scopes": [
  132607. // "https://www.googleapis.com/auth/cloud-platform",
  132608. // "https://www.googleapis.com/auth/compute"
  132609. // ]
  132610. // }
  132611. }
  132612. // method id "compute.urlMaps.testIamPermissions":
  132613. type UrlMapsTestIamPermissionsCall struct {
  132614. s *Service
  132615. project string
  132616. resource string
  132617. testpermissionsrequest *TestPermissionsRequest
  132618. urlParams_ gensupport.URLParams
  132619. ctx_ context.Context
  132620. header_ http.Header
  132621. }
  132622. // TestIamPermissions: Returns permissions that a caller has on the
  132623. // specified resource.
  132624. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  132625. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132626. c.project = project
  132627. c.resource = resource
  132628. c.testpermissionsrequest = testpermissionsrequest
  132629. return c
  132630. }
  132631. // Fields allows partial responses to be retrieved. See
  132632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132633. // for more information.
  132634. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  132635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132636. return c
  132637. }
  132638. // Context sets the context to be used in this call's Do method. Any
  132639. // pending HTTP request will be aborted if the provided context is
  132640. // canceled.
  132641. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  132642. c.ctx_ = ctx
  132643. return c
  132644. }
  132645. // Header returns an http.Header that can be modified by the caller to
  132646. // add HTTP headers to the request.
  132647. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  132648. if c.header_ == nil {
  132649. c.header_ = make(http.Header)
  132650. }
  132651. return c.header_
  132652. }
  132653. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  132654. reqHeaders := make(http.Header)
  132655. for k, v := range c.header_ {
  132656. reqHeaders[k] = v
  132657. }
  132658. reqHeaders.Set("User-Agent", c.s.userAgent())
  132659. var body io.Reader = nil
  132660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  132661. if err != nil {
  132662. return nil, err
  132663. }
  132664. reqHeaders.Set("Content-Type", "application/json")
  132665. c.urlParams_.Set("alt", alt)
  132666. c.urlParams_.Set("prettyPrint", "false")
  132667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  132668. urls += "?" + c.urlParams_.Encode()
  132669. req, err := http.NewRequest("POST", urls, body)
  132670. if err != nil {
  132671. return nil, err
  132672. }
  132673. req.Header = reqHeaders
  132674. googleapi.Expand(req.URL, map[string]string{
  132675. "project": c.project,
  132676. "resource": c.resource,
  132677. })
  132678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132679. }
  132680. // Do executes the "compute.urlMaps.testIamPermissions" call.
  132681. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  132682. // non-2xx status code is an error. Response headers are in either
  132683. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  132684. // returned at all) in error.(*googleapi.Error).Header. Use
  132685. // googleapi.IsNotModified to check whether the returned error was
  132686. // because http.StatusNotModified was returned.
  132687. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  132688. gensupport.SetOptions(c.urlParams_, opts...)
  132689. res, err := c.doRequest("json")
  132690. if res != nil && res.StatusCode == http.StatusNotModified {
  132691. if res.Body != nil {
  132692. res.Body.Close()
  132693. }
  132694. return nil, &googleapi.Error{
  132695. Code: res.StatusCode,
  132696. Header: res.Header,
  132697. }
  132698. }
  132699. if err != nil {
  132700. return nil, err
  132701. }
  132702. defer googleapi.CloseBody(res)
  132703. if err := googleapi.CheckResponse(res); err != nil {
  132704. return nil, err
  132705. }
  132706. ret := &TestPermissionsResponse{
  132707. ServerResponse: googleapi.ServerResponse{
  132708. Header: res.Header,
  132709. HTTPStatusCode: res.StatusCode,
  132710. },
  132711. }
  132712. target := &ret
  132713. if err := gensupport.DecodeResponse(target, res); err != nil {
  132714. return nil, err
  132715. }
  132716. return ret, nil
  132717. // {
  132718. // "description": "Returns permissions that a caller has on the specified resource.",
  132719. // "httpMethod": "POST",
  132720. // "id": "compute.urlMaps.testIamPermissions",
  132721. // "parameterOrder": [
  132722. // "project",
  132723. // "resource"
  132724. // ],
  132725. // "parameters": {
  132726. // "project": {
  132727. // "description": "Project ID for this request.",
  132728. // "location": "path",
  132729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132730. // "required": true,
  132731. // "type": "string"
  132732. // },
  132733. // "resource": {
  132734. // "description": "Name or id of the resource for this request.",
  132735. // "location": "path",
  132736. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132737. // "required": true,
  132738. // "type": "string"
  132739. // }
  132740. // },
  132741. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  132742. // "request": {
  132743. // "$ref": "TestPermissionsRequest"
  132744. // },
  132745. // "response": {
  132746. // "$ref": "TestPermissionsResponse"
  132747. // },
  132748. // "scopes": [
  132749. // "https://www.googleapis.com/auth/cloud-platform",
  132750. // "https://www.googleapis.com/auth/compute",
  132751. // "https://www.googleapis.com/auth/compute.readonly"
  132752. // ]
  132753. // }
  132754. }
  132755. // method id "compute.urlMaps.update":
  132756. type UrlMapsUpdateCall struct {
  132757. s *Service
  132758. project string
  132759. urlMap string
  132760. urlmap *UrlMap
  132761. urlParams_ gensupport.URLParams
  132762. ctx_ context.Context
  132763. header_ http.Header
  132764. }
  132765. // Update: Updates the specified UrlMap resource with the data included
  132766. // in the request.
  132767. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  132768. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  132769. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132770. c.project = project
  132771. c.urlMap = urlMap
  132772. c.urlmap = urlmap
  132773. return c
  132774. }
  132775. // RequestId sets the optional parameter "requestId": An optional
  132776. // request ID to identify requests. Specify a unique request ID so that
  132777. // if you must retry your request, the server will know to ignore the
  132778. // request if it has already been completed.
  132779. //
  132780. // For example, consider a situation where you make an initial request
  132781. // and the request times out. If you make the request again with the
  132782. // same request ID, the server can check if original operation with the
  132783. // same request ID was received, and if so, will ignore the second
  132784. // request. This prevents clients from accidentally creating duplicate
  132785. // commitments.
  132786. //
  132787. // The request ID must be a valid UUID with the exception that zero UUID
  132788. // is not supported (00000000-0000-0000-0000-000000000000).
  132789. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  132790. c.urlParams_.Set("requestId", requestId)
  132791. return c
  132792. }
  132793. // Fields allows partial responses to be retrieved. See
  132794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132795. // for more information.
  132796. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  132797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132798. return c
  132799. }
  132800. // Context sets the context to be used in this call's Do method. Any
  132801. // pending HTTP request will be aborted if the provided context is
  132802. // canceled.
  132803. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  132804. c.ctx_ = ctx
  132805. return c
  132806. }
  132807. // Header returns an http.Header that can be modified by the caller to
  132808. // add HTTP headers to the request.
  132809. func (c *UrlMapsUpdateCall) Header() http.Header {
  132810. if c.header_ == nil {
  132811. c.header_ = make(http.Header)
  132812. }
  132813. return c.header_
  132814. }
  132815. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  132816. reqHeaders := make(http.Header)
  132817. for k, v := range c.header_ {
  132818. reqHeaders[k] = v
  132819. }
  132820. reqHeaders.Set("User-Agent", c.s.userAgent())
  132821. var body io.Reader = nil
  132822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  132823. if err != nil {
  132824. return nil, err
  132825. }
  132826. reqHeaders.Set("Content-Type", "application/json")
  132827. c.urlParams_.Set("alt", alt)
  132828. c.urlParams_.Set("prettyPrint", "false")
  132829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  132830. urls += "?" + c.urlParams_.Encode()
  132831. req, err := http.NewRequest("PUT", urls, body)
  132832. if err != nil {
  132833. return nil, err
  132834. }
  132835. req.Header = reqHeaders
  132836. googleapi.Expand(req.URL, map[string]string{
  132837. "project": c.project,
  132838. "urlMap": c.urlMap,
  132839. })
  132840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132841. }
  132842. // Do executes the "compute.urlMaps.update" call.
  132843. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132844. // status code is an error. Response headers are in either
  132845. // *Operation.ServerResponse.Header or (if a response was returned at
  132846. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132847. // to check whether the returned error was because
  132848. // http.StatusNotModified was returned.
  132849. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132850. gensupport.SetOptions(c.urlParams_, opts...)
  132851. res, err := c.doRequest("json")
  132852. if res != nil && res.StatusCode == http.StatusNotModified {
  132853. if res.Body != nil {
  132854. res.Body.Close()
  132855. }
  132856. return nil, &googleapi.Error{
  132857. Code: res.StatusCode,
  132858. Header: res.Header,
  132859. }
  132860. }
  132861. if err != nil {
  132862. return nil, err
  132863. }
  132864. defer googleapi.CloseBody(res)
  132865. if err := googleapi.CheckResponse(res); err != nil {
  132866. return nil, err
  132867. }
  132868. ret := &Operation{
  132869. ServerResponse: googleapi.ServerResponse{
  132870. Header: res.Header,
  132871. HTTPStatusCode: res.StatusCode,
  132872. },
  132873. }
  132874. target := &ret
  132875. if err := gensupport.DecodeResponse(target, res); err != nil {
  132876. return nil, err
  132877. }
  132878. return ret, nil
  132879. // {
  132880. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  132881. // "httpMethod": "PUT",
  132882. // "id": "compute.urlMaps.update",
  132883. // "parameterOrder": [
  132884. // "project",
  132885. // "urlMap"
  132886. // ],
  132887. // "parameters": {
  132888. // "project": {
  132889. // "description": "Project ID for this request.",
  132890. // "location": "path",
  132891. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132892. // "required": true,
  132893. // "type": "string"
  132894. // },
  132895. // "requestId": {
  132896. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132897. // "location": "query",
  132898. // "type": "string"
  132899. // },
  132900. // "urlMap": {
  132901. // "description": "Name of the UrlMap resource to update.",
  132902. // "location": "path",
  132903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132904. // "required": true,
  132905. // "type": "string"
  132906. // }
  132907. // },
  132908. // "path": "{project}/global/urlMaps/{urlMap}",
  132909. // "request": {
  132910. // "$ref": "UrlMap"
  132911. // },
  132912. // "response": {
  132913. // "$ref": "Operation"
  132914. // },
  132915. // "scopes": [
  132916. // "https://www.googleapis.com/auth/cloud-platform",
  132917. // "https://www.googleapis.com/auth/compute"
  132918. // ]
  132919. // }
  132920. }
  132921. // method id "compute.urlMaps.validate":
  132922. type UrlMapsValidateCall struct {
  132923. s *Service
  132924. project string
  132925. urlMap string
  132926. urlmapsvalidaterequest *UrlMapsValidateRequest
  132927. urlParams_ gensupport.URLParams
  132928. ctx_ context.Context
  132929. header_ http.Header
  132930. }
  132931. // Validate: Runs static validation for the UrlMap. In particular, the
  132932. // tests of the provided UrlMap will be run. Calling this method does
  132933. // NOT create the UrlMap.
  132934. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  132935. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  132936. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132937. c.project = project
  132938. c.urlMap = urlMap
  132939. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  132940. return c
  132941. }
  132942. // Fields allows partial responses to be retrieved. See
  132943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132944. // for more information.
  132945. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  132946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132947. return c
  132948. }
  132949. // Context sets the context to be used in this call's Do method. Any
  132950. // pending HTTP request will be aborted if the provided context is
  132951. // canceled.
  132952. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  132953. c.ctx_ = ctx
  132954. return c
  132955. }
  132956. // Header returns an http.Header that can be modified by the caller to
  132957. // add HTTP headers to the request.
  132958. func (c *UrlMapsValidateCall) Header() http.Header {
  132959. if c.header_ == nil {
  132960. c.header_ = make(http.Header)
  132961. }
  132962. return c.header_
  132963. }
  132964. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  132965. reqHeaders := make(http.Header)
  132966. for k, v := range c.header_ {
  132967. reqHeaders[k] = v
  132968. }
  132969. reqHeaders.Set("User-Agent", c.s.userAgent())
  132970. var body io.Reader = nil
  132971. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  132972. if err != nil {
  132973. return nil, err
  132974. }
  132975. reqHeaders.Set("Content-Type", "application/json")
  132976. c.urlParams_.Set("alt", alt)
  132977. c.urlParams_.Set("prettyPrint", "false")
  132978. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  132979. urls += "?" + c.urlParams_.Encode()
  132980. req, err := http.NewRequest("POST", urls, body)
  132981. if err != nil {
  132982. return nil, err
  132983. }
  132984. req.Header = reqHeaders
  132985. googleapi.Expand(req.URL, map[string]string{
  132986. "project": c.project,
  132987. "urlMap": c.urlMap,
  132988. })
  132989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132990. }
  132991. // Do executes the "compute.urlMaps.validate" call.
  132992. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  132993. // non-2xx status code is an error. Response headers are in either
  132994. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  132995. // returned at all) in error.(*googleapi.Error).Header. Use
  132996. // googleapi.IsNotModified to check whether the returned error was
  132997. // because http.StatusNotModified was returned.
  132998. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  132999. gensupport.SetOptions(c.urlParams_, opts...)
  133000. res, err := c.doRequest("json")
  133001. if res != nil && res.StatusCode == http.StatusNotModified {
  133002. if res.Body != nil {
  133003. res.Body.Close()
  133004. }
  133005. return nil, &googleapi.Error{
  133006. Code: res.StatusCode,
  133007. Header: res.Header,
  133008. }
  133009. }
  133010. if err != nil {
  133011. return nil, err
  133012. }
  133013. defer googleapi.CloseBody(res)
  133014. if err := googleapi.CheckResponse(res); err != nil {
  133015. return nil, err
  133016. }
  133017. ret := &UrlMapsValidateResponse{
  133018. ServerResponse: googleapi.ServerResponse{
  133019. Header: res.Header,
  133020. HTTPStatusCode: res.StatusCode,
  133021. },
  133022. }
  133023. target := &ret
  133024. if err := gensupport.DecodeResponse(target, res); err != nil {
  133025. return nil, err
  133026. }
  133027. return ret, nil
  133028. // {
  133029. // "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.",
  133030. // "httpMethod": "POST",
  133031. // "id": "compute.urlMaps.validate",
  133032. // "parameterOrder": [
  133033. // "project",
  133034. // "urlMap"
  133035. // ],
  133036. // "parameters": {
  133037. // "project": {
  133038. // "description": "Project ID for this request.",
  133039. // "location": "path",
  133040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133041. // "required": true,
  133042. // "type": "string"
  133043. // },
  133044. // "urlMap": {
  133045. // "description": "Name of the UrlMap resource to be validated as.",
  133046. // "location": "path",
  133047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133048. // "required": true,
  133049. // "type": "string"
  133050. // }
  133051. // },
  133052. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  133053. // "request": {
  133054. // "$ref": "UrlMapsValidateRequest"
  133055. // },
  133056. // "response": {
  133057. // "$ref": "UrlMapsValidateResponse"
  133058. // },
  133059. // "scopes": [
  133060. // "https://www.googleapis.com/auth/cloud-platform",
  133061. // "https://www.googleapis.com/auth/compute"
  133062. // ]
  133063. // }
  133064. }
  133065. // method id "compute.vpnGateways.aggregatedList":
  133066. type VpnGatewaysAggregatedListCall struct {
  133067. s *Service
  133068. project string
  133069. urlParams_ gensupport.URLParams
  133070. ifNoneMatch_ string
  133071. ctx_ context.Context
  133072. header_ http.Header
  133073. }
  133074. // AggregatedList: Retrieves an aggregated list of VPN gateways.
  133075. func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
  133076. c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133077. c.project = project
  133078. return c
  133079. }
  133080. // Filter sets the optional parameter "filter": A filter expression that
  133081. // filters resources listed in the response. The expression must specify
  133082. // the field name, a comparison operator, and the value that you want to
  133083. // use for filtering. The value must be a string, a number, or a
  133084. // boolean. The comparison operator must be either =, !=, >, or <.
  133085. //
  133086. // For example, if you are filtering Compute Engine instances, you can
  133087. // exclude instances named example-instance by specifying name !=
  133088. // example-instance.
  133089. //
  133090. // You can also filter nested fields. For example, you could specify
  133091. // scheduling.automaticRestart = false to include instances only if they
  133092. // are not scheduled for automatic restarts. You can use filtering on
  133093. // nested fields to filter based on resource labels.
  133094. //
  133095. // To filter on multiple expressions, provide each separate expression
  133096. // within parentheses. For example, (scheduling.automaticRestart = true)
  133097. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133098. // AND expression. However, you can include AND and OR expressions
  133099. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133100. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133101. // true).
  133102. func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
  133103. c.urlParams_.Set("filter", filter)
  133104. return c
  133105. }
  133106. // MaxResults sets the optional parameter "maxResults": The maximum
  133107. // number of results per page that should be returned. If the number of
  133108. // available results is larger than maxResults, Compute Engine returns a
  133109. // nextPageToken that can be used to get the next page of results in
  133110. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133111. // (Default: 500)
  133112. func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
  133113. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133114. return c
  133115. }
  133116. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133117. // a certain order. By default, results are returned in alphanumerical
  133118. // order based on the resource name.
  133119. //
  133120. // You can also sort results in descending order based on the creation
  133121. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133122. // based on the creationTimestamp field in reverse chronological order
  133123. // (newest result first). Use this to sort resources like operations so
  133124. // that the newest operation is returned first.
  133125. //
  133126. // Currently, only sorting by name or creationTimestamp desc is
  133127. // supported.
  133128. func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
  133129. c.urlParams_.Set("orderBy", orderBy)
  133130. return c
  133131. }
  133132. // PageToken sets the optional parameter "pageToken": Specifies a page
  133133. // token to use. Set pageToken to the nextPageToken returned by a
  133134. // previous list request to get the next page of results.
  133135. func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
  133136. c.urlParams_.Set("pageToken", pageToken)
  133137. return c
  133138. }
  133139. // Fields allows partial responses to be retrieved. See
  133140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133141. // for more information.
  133142. func (c *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
  133143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133144. return c
  133145. }
  133146. // IfNoneMatch sets the optional parameter which makes the operation
  133147. // fail if the object's ETag matches the given value. This is useful for
  133148. // getting updates only after the object has changed since the last
  133149. // request. Use googleapi.IsNotModified to check whether the response
  133150. // error from Do is the result of In-None-Match.
  133151. func (c *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
  133152. c.ifNoneMatch_ = entityTag
  133153. return c
  133154. }
  133155. // Context sets the context to be used in this call's Do method. Any
  133156. // pending HTTP request will be aborted if the provided context is
  133157. // canceled.
  133158. func (c *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
  133159. c.ctx_ = ctx
  133160. return c
  133161. }
  133162. // Header returns an http.Header that can be modified by the caller to
  133163. // add HTTP headers to the request.
  133164. func (c *VpnGatewaysAggregatedListCall) Header() http.Header {
  133165. if c.header_ == nil {
  133166. c.header_ = make(http.Header)
  133167. }
  133168. return c.header_
  133169. }
  133170. func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  133171. reqHeaders := make(http.Header)
  133172. for k, v := range c.header_ {
  133173. reqHeaders[k] = v
  133174. }
  133175. reqHeaders.Set("User-Agent", c.s.userAgent())
  133176. if c.ifNoneMatch_ != "" {
  133177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133178. }
  133179. var body io.Reader = nil
  133180. c.urlParams_.Set("alt", alt)
  133181. c.urlParams_.Set("prettyPrint", "false")
  133182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnGateways")
  133183. urls += "?" + c.urlParams_.Encode()
  133184. req, err := http.NewRequest("GET", urls, body)
  133185. if err != nil {
  133186. return nil, err
  133187. }
  133188. req.Header = reqHeaders
  133189. googleapi.Expand(req.URL, map[string]string{
  133190. "project": c.project,
  133191. })
  133192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133193. }
  133194. // Do executes the "compute.vpnGateways.aggregatedList" call.
  133195. // Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
  133196. // Any non-2xx status code is an error. Response headers are in either
  133197. // *VpnGatewayAggregatedList.ServerResponse.Header or (if a response was
  133198. // returned at all) in error.(*googleapi.Error).Header. Use
  133199. // googleapi.IsNotModified to check whether the returned error was
  133200. // because http.StatusNotModified was returned.
  133201. func (c *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, error) {
  133202. gensupport.SetOptions(c.urlParams_, opts...)
  133203. res, err := c.doRequest("json")
  133204. if res != nil && res.StatusCode == http.StatusNotModified {
  133205. if res.Body != nil {
  133206. res.Body.Close()
  133207. }
  133208. return nil, &googleapi.Error{
  133209. Code: res.StatusCode,
  133210. Header: res.Header,
  133211. }
  133212. }
  133213. if err != nil {
  133214. return nil, err
  133215. }
  133216. defer googleapi.CloseBody(res)
  133217. if err := googleapi.CheckResponse(res); err != nil {
  133218. return nil, err
  133219. }
  133220. ret := &VpnGatewayAggregatedList{
  133221. ServerResponse: googleapi.ServerResponse{
  133222. Header: res.Header,
  133223. HTTPStatusCode: res.StatusCode,
  133224. },
  133225. }
  133226. target := &ret
  133227. if err := gensupport.DecodeResponse(target, res); err != nil {
  133228. return nil, err
  133229. }
  133230. return ret, nil
  133231. // {
  133232. // "description": "Retrieves an aggregated list of VPN gateways.",
  133233. // "httpMethod": "GET",
  133234. // "id": "compute.vpnGateways.aggregatedList",
  133235. // "parameterOrder": [
  133236. // "project"
  133237. // ],
  133238. // "parameters": {
  133239. // "filter": {
  133240. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133241. // "location": "query",
  133242. // "type": "string"
  133243. // },
  133244. // "maxResults": {
  133245. // "default": "500",
  133246. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133247. // "format": "uint32",
  133248. // "location": "query",
  133249. // "minimum": "0",
  133250. // "type": "integer"
  133251. // },
  133252. // "orderBy": {
  133253. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133254. // "location": "query",
  133255. // "type": "string"
  133256. // },
  133257. // "pageToken": {
  133258. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133259. // "location": "query",
  133260. // "type": "string"
  133261. // },
  133262. // "project": {
  133263. // "description": "Project ID for this request.",
  133264. // "location": "path",
  133265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133266. // "required": true,
  133267. // "type": "string"
  133268. // }
  133269. // },
  133270. // "path": "{project}/aggregated/vpnGateways",
  133271. // "response": {
  133272. // "$ref": "VpnGatewayAggregatedList"
  133273. // },
  133274. // "scopes": [
  133275. // "https://www.googleapis.com/auth/cloud-platform",
  133276. // "https://www.googleapis.com/auth/compute",
  133277. // "https://www.googleapis.com/auth/compute.readonly"
  133278. // ]
  133279. // }
  133280. }
  133281. // Pages invokes f for each page of results.
  133282. // A non-nil error returned from f will halt the iteration.
  133283. // The provided context supersedes any context provided to the Context method.
  133284. func (c *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) error) error {
  133285. c.ctx_ = ctx
  133286. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  133287. for {
  133288. x, err := c.Do()
  133289. if err != nil {
  133290. return err
  133291. }
  133292. if err := f(x); err != nil {
  133293. return err
  133294. }
  133295. if x.NextPageToken == "" {
  133296. return nil
  133297. }
  133298. c.PageToken(x.NextPageToken)
  133299. }
  133300. }
  133301. // method id "compute.vpnGateways.delete":
  133302. type VpnGatewaysDeleteCall struct {
  133303. s *Service
  133304. project string
  133305. region string
  133306. vpnGateway string
  133307. urlParams_ gensupport.URLParams
  133308. ctx_ context.Context
  133309. header_ http.Header
  133310. }
  133311. // Delete: Deletes the specified VPN gateway.
  133312. func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
  133313. c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133314. c.project = project
  133315. c.region = region
  133316. c.vpnGateway = vpnGateway
  133317. return c
  133318. }
  133319. // RequestId sets the optional parameter "requestId": An optional
  133320. // request ID to identify requests. Specify a unique request ID so that
  133321. // if you must retry your request, the server will know to ignore the
  133322. // request if it has already been completed.
  133323. //
  133324. // For example, consider a situation where you make an initial request
  133325. // and the request times out. If you make the request again with the
  133326. // same request ID, the server can check if original operation with the
  133327. // same request ID was received, and if so, will ignore the second
  133328. // request. This prevents clients from accidentally creating duplicate
  133329. // commitments.
  133330. //
  133331. // The request ID must be a valid UUID with the exception that zero UUID
  133332. // is not supported (00000000-0000-0000-0000-000000000000).
  133333. func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
  133334. c.urlParams_.Set("requestId", requestId)
  133335. return c
  133336. }
  133337. // Fields allows partial responses to be retrieved. See
  133338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133339. // for more information.
  133340. func (c *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
  133341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133342. return c
  133343. }
  133344. // Context sets the context to be used in this call's Do method. Any
  133345. // pending HTTP request will be aborted if the provided context is
  133346. // canceled.
  133347. func (c *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
  133348. c.ctx_ = ctx
  133349. return c
  133350. }
  133351. // Header returns an http.Header that can be modified by the caller to
  133352. // add HTTP headers to the request.
  133353. func (c *VpnGatewaysDeleteCall) Header() http.Header {
  133354. if c.header_ == nil {
  133355. c.header_ = make(http.Header)
  133356. }
  133357. return c.header_
  133358. }
  133359. func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  133360. reqHeaders := make(http.Header)
  133361. for k, v := range c.header_ {
  133362. reqHeaders[k] = v
  133363. }
  133364. reqHeaders.Set("User-Agent", c.s.userAgent())
  133365. var body io.Reader = nil
  133366. c.urlParams_.Set("alt", alt)
  133367. c.urlParams_.Set("prettyPrint", "false")
  133368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  133369. urls += "?" + c.urlParams_.Encode()
  133370. req, err := http.NewRequest("DELETE", urls, body)
  133371. if err != nil {
  133372. return nil, err
  133373. }
  133374. req.Header = reqHeaders
  133375. googleapi.Expand(req.URL, map[string]string{
  133376. "project": c.project,
  133377. "region": c.region,
  133378. "vpnGateway": c.vpnGateway,
  133379. })
  133380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133381. }
  133382. // Do executes the "compute.vpnGateways.delete" call.
  133383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133384. // status code is an error. Response headers are in either
  133385. // *Operation.ServerResponse.Header or (if a response was returned at
  133386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133387. // to check whether the returned error was because
  133388. // http.StatusNotModified was returned.
  133389. func (c *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133390. gensupport.SetOptions(c.urlParams_, opts...)
  133391. res, err := c.doRequest("json")
  133392. if res != nil && res.StatusCode == http.StatusNotModified {
  133393. if res.Body != nil {
  133394. res.Body.Close()
  133395. }
  133396. return nil, &googleapi.Error{
  133397. Code: res.StatusCode,
  133398. Header: res.Header,
  133399. }
  133400. }
  133401. if err != nil {
  133402. return nil, err
  133403. }
  133404. defer googleapi.CloseBody(res)
  133405. if err := googleapi.CheckResponse(res); err != nil {
  133406. return nil, err
  133407. }
  133408. ret := &Operation{
  133409. ServerResponse: googleapi.ServerResponse{
  133410. Header: res.Header,
  133411. HTTPStatusCode: res.StatusCode,
  133412. },
  133413. }
  133414. target := &ret
  133415. if err := gensupport.DecodeResponse(target, res); err != nil {
  133416. return nil, err
  133417. }
  133418. return ret, nil
  133419. // {
  133420. // "description": "Deletes the specified VPN gateway.",
  133421. // "httpMethod": "DELETE",
  133422. // "id": "compute.vpnGateways.delete",
  133423. // "parameterOrder": [
  133424. // "project",
  133425. // "region",
  133426. // "vpnGateway"
  133427. // ],
  133428. // "parameters": {
  133429. // "project": {
  133430. // "description": "Project ID for this request.",
  133431. // "location": "path",
  133432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133433. // "required": true,
  133434. // "type": "string"
  133435. // },
  133436. // "region": {
  133437. // "description": "Name of the region for this request.",
  133438. // "location": "path",
  133439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133440. // "required": true,
  133441. // "type": "string"
  133442. // },
  133443. // "requestId": {
  133444. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133445. // "location": "query",
  133446. // "type": "string"
  133447. // },
  133448. // "vpnGateway": {
  133449. // "description": "Name of the VPN gateway to delete.",
  133450. // "location": "path",
  133451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133452. // "required": true,
  133453. // "type": "string"
  133454. // }
  133455. // },
  133456. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  133457. // "response": {
  133458. // "$ref": "Operation"
  133459. // },
  133460. // "scopes": [
  133461. // "https://www.googleapis.com/auth/cloud-platform",
  133462. // "https://www.googleapis.com/auth/compute"
  133463. // ]
  133464. // }
  133465. }
  133466. // method id "compute.vpnGateways.get":
  133467. type VpnGatewaysGetCall struct {
  133468. s *Service
  133469. project string
  133470. region string
  133471. vpnGateway string
  133472. urlParams_ gensupport.URLParams
  133473. ifNoneMatch_ string
  133474. ctx_ context.Context
  133475. header_ http.Header
  133476. }
  133477. // Get: Returns the specified VPN gateway. Gets a list of available VPN
  133478. // gateways by making a list() request.
  133479. func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
  133480. c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133481. c.project = project
  133482. c.region = region
  133483. c.vpnGateway = vpnGateway
  133484. return c
  133485. }
  133486. // Fields allows partial responses to be retrieved. See
  133487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133488. // for more information.
  133489. func (c *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
  133490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133491. return c
  133492. }
  133493. // IfNoneMatch sets the optional parameter which makes the operation
  133494. // fail if the object's ETag matches the given value. This is useful for
  133495. // getting updates only after the object has changed since the last
  133496. // request. Use googleapi.IsNotModified to check whether the response
  133497. // error from Do is the result of In-None-Match.
  133498. func (c *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
  133499. c.ifNoneMatch_ = entityTag
  133500. return c
  133501. }
  133502. // Context sets the context to be used in this call's Do method. Any
  133503. // pending HTTP request will be aborted if the provided context is
  133504. // canceled.
  133505. func (c *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
  133506. c.ctx_ = ctx
  133507. return c
  133508. }
  133509. // Header returns an http.Header that can be modified by the caller to
  133510. // add HTTP headers to the request.
  133511. func (c *VpnGatewaysGetCall) Header() http.Header {
  133512. if c.header_ == nil {
  133513. c.header_ = make(http.Header)
  133514. }
  133515. return c.header_
  133516. }
  133517. func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  133518. reqHeaders := make(http.Header)
  133519. for k, v := range c.header_ {
  133520. reqHeaders[k] = v
  133521. }
  133522. reqHeaders.Set("User-Agent", c.s.userAgent())
  133523. if c.ifNoneMatch_ != "" {
  133524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133525. }
  133526. var body io.Reader = nil
  133527. c.urlParams_.Set("alt", alt)
  133528. c.urlParams_.Set("prettyPrint", "false")
  133529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  133530. urls += "?" + c.urlParams_.Encode()
  133531. req, err := http.NewRequest("GET", urls, body)
  133532. if err != nil {
  133533. return nil, err
  133534. }
  133535. req.Header = reqHeaders
  133536. googleapi.Expand(req.URL, map[string]string{
  133537. "project": c.project,
  133538. "region": c.region,
  133539. "vpnGateway": c.vpnGateway,
  133540. })
  133541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133542. }
  133543. // Do executes the "compute.vpnGateways.get" call.
  133544. // Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
  133545. // status code is an error. Response headers are in either
  133546. // *VpnGateway.ServerResponse.Header or (if a response was returned at
  133547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133548. // to check whether the returned error was because
  133549. // http.StatusNotModified was returned.
  133550. func (c *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, error) {
  133551. gensupport.SetOptions(c.urlParams_, opts...)
  133552. res, err := c.doRequest("json")
  133553. if res != nil && res.StatusCode == http.StatusNotModified {
  133554. if res.Body != nil {
  133555. res.Body.Close()
  133556. }
  133557. return nil, &googleapi.Error{
  133558. Code: res.StatusCode,
  133559. Header: res.Header,
  133560. }
  133561. }
  133562. if err != nil {
  133563. return nil, err
  133564. }
  133565. defer googleapi.CloseBody(res)
  133566. if err := googleapi.CheckResponse(res); err != nil {
  133567. return nil, err
  133568. }
  133569. ret := &VpnGateway{
  133570. ServerResponse: googleapi.ServerResponse{
  133571. Header: res.Header,
  133572. HTTPStatusCode: res.StatusCode,
  133573. },
  133574. }
  133575. target := &ret
  133576. if err := gensupport.DecodeResponse(target, res); err != nil {
  133577. return nil, err
  133578. }
  133579. return ret, nil
  133580. // {
  133581. // "description": "Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request.",
  133582. // "httpMethod": "GET",
  133583. // "id": "compute.vpnGateways.get",
  133584. // "parameterOrder": [
  133585. // "project",
  133586. // "region",
  133587. // "vpnGateway"
  133588. // ],
  133589. // "parameters": {
  133590. // "project": {
  133591. // "description": "Project ID for this request.",
  133592. // "location": "path",
  133593. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133594. // "required": true,
  133595. // "type": "string"
  133596. // },
  133597. // "region": {
  133598. // "description": "Name of the region for this request.",
  133599. // "location": "path",
  133600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133601. // "required": true,
  133602. // "type": "string"
  133603. // },
  133604. // "vpnGateway": {
  133605. // "description": "Name of the VPN gateway to return.",
  133606. // "location": "path",
  133607. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133608. // "required": true,
  133609. // "type": "string"
  133610. // }
  133611. // },
  133612. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  133613. // "response": {
  133614. // "$ref": "VpnGateway"
  133615. // },
  133616. // "scopes": [
  133617. // "https://www.googleapis.com/auth/cloud-platform",
  133618. // "https://www.googleapis.com/auth/compute",
  133619. // "https://www.googleapis.com/auth/compute.readonly"
  133620. // ]
  133621. // }
  133622. }
  133623. // method id "compute.vpnGateways.insert":
  133624. type VpnGatewaysInsertCall struct {
  133625. s *Service
  133626. project string
  133627. region string
  133628. vpngateway *VpnGateway
  133629. urlParams_ gensupport.URLParams
  133630. ctx_ context.Context
  133631. header_ http.Header
  133632. }
  133633. // Insert: Creates a VPN gateway in the specified project and region
  133634. // using the data included in the request.
  133635. func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
  133636. c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133637. c.project = project
  133638. c.region = region
  133639. c.vpngateway = vpngateway
  133640. return c
  133641. }
  133642. // RequestId sets the optional parameter "requestId": An optional
  133643. // request ID to identify requests. Specify a unique request ID so that
  133644. // if you must retry your request, the server will know to ignore the
  133645. // request if it has already been completed.
  133646. //
  133647. // For example, consider a situation where you make an initial request
  133648. // and the request times out. If you make the request again with the
  133649. // same request ID, the server can check if original operation with the
  133650. // same request ID was received, and if so, will ignore the second
  133651. // request. This prevents clients from accidentally creating duplicate
  133652. // commitments.
  133653. //
  133654. // The request ID must be a valid UUID with the exception that zero UUID
  133655. // is not supported (00000000-0000-0000-0000-000000000000).
  133656. func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
  133657. c.urlParams_.Set("requestId", requestId)
  133658. return c
  133659. }
  133660. // Fields allows partial responses to be retrieved. See
  133661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133662. // for more information.
  133663. func (c *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
  133664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133665. return c
  133666. }
  133667. // Context sets the context to be used in this call's Do method. Any
  133668. // pending HTTP request will be aborted if the provided context is
  133669. // canceled.
  133670. func (c *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
  133671. c.ctx_ = ctx
  133672. return c
  133673. }
  133674. // Header returns an http.Header that can be modified by the caller to
  133675. // add HTTP headers to the request.
  133676. func (c *VpnGatewaysInsertCall) Header() http.Header {
  133677. if c.header_ == nil {
  133678. c.header_ = make(http.Header)
  133679. }
  133680. return c.header_
  133681. }
  133682. func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  133683. reqHeaders := make(http.Header)
  133684. for k, v := range c.header_ {
  133685. reqHeaders[k] = v
  133686. }
  133687. reqHeaders.Set("User-Agent", c.s.userAgent())
  133688. var body io.Reader = nil
  133689. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
  133690. if err != nil {
  133691. return nil, err
  133692. }
  133693. reqHeaders.Set("Content-Type", "application/json")
  133694. c.urlParams_.Set("alt", alt)
  133695. c.urlParams_.Set("prettyPrint", "false")
  133696. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  133697. urls += "?" + c.urlParams_.Encode()
  133698. req, err := http.NewRequest("POST", urls, body)
  133699. if err != nil {
  133700. return nil, err
  133701. }
  133702. req.Header = reqHeaders
  133703. googleapi.Expand(req.URL, map[string]string{
  133704. "project": c.project,
  133705. "region": c.region,
  133706. })
  133707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133708. }
  133709. // Do executes the "compute.vpnGateways.insert" call.
  133710. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133711. // status code is an error. Response headers are in either
  133712. // *Operation.ServerResponse.Header or (if a response was returned at
  133713. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133714. // to check whether the returned error was because
  133715. // http.StatusNotModified was returned.
  133716. func (c *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133717. gensupport.SetOptions(c.urlParams_, opts...)
  133718. res, err := c.doRequest("json")
  133719. if res != nil && res.StatusCode == http.StatusNotModified {
  133720. if res.Body != nil {
  133721. res.Body.Close()
  133722. }
  133723. return nil, &googleapi.Error{
  133724. Code: res.StatusCode,
  133725. Header: res.Header,
  133726. }
  133727. }
  133728. if err != nil {
  133729. return nil, err
  133730. }
  133731. defer googleapi.CloseBody(res)
  133732. if err := googleapi.CheckResponse(res); err != nil {
  133733. return nil, err
  133734. }
  133735. ret := &Operation{
  133736. ServerResponse: googleapi.ServerResponse{
  133737. Header: res.Header,
  133738. HTTPStatusCode: res.StatusCode,
  133739. },
  133740. }
  133741. target := &ret
  133742. if err := gensupport.DecodeResponse(target, res); err != nil {
  133743. return nil, err
  133744. }
  133745. return ret, nil
  133746. // {
  133747. // "description": "Creates a VPN gateway in the specified project and region using the data included in the request.",
  133748. // "httpMethod": "POST",
  133749. // "id": "compute.vpnGateways.insert",
  133750. // "parameterOrder": [
  133751. // "project",
  133752. // "region"
  133753. // ],
  133754. // "parameters": {
  133755. // "project": {
  133756. // "description": "Project ID for this request.",
  133757. // "location": "path",
  133758. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133759. // "required": true,
  133760. // "type": "string"
  133761. // },
  133762. // "region": {
  133763. // "description": "Name of the region for this request.",
  133764. // "location": "path",
  133765. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133766. // "required": true,
  133767. // "type": "string"
  133768. // },
  133769. // "requestId": {
  133770. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133771. // "location": "query",
  133772. // "type": "string"
  133773. // }
  133774. // },
  133775. // "path": "{project}/regions/{region}/vpnGateways",
  133776. // "request": {
  133777. // "$ref": "VpnGateway"
  133778. // },
  133779. // "response": {
  133780. // "$ref": "Operation"
  133781. // },
  133782. // "scopes": [
  133783. // "https://www.googleapis.com/auth/cloud-platform",
  133784. // "https://www.googleapis.com/auth/compute"
  133785. // ]
  133786. // }
  133787. }
  133788. // method id "compute.vpnGateways.list":
  133789. type VpnGatewaysListCall struct {
  133790. s *Service
  133791. project string
  133792. region string
  133793. urlParams_ gensupport.URLParams
  133794. ifNoneMatch_ string
  133795. ctx_ context.Context
  133796. header_ http.Header
  133797. }
  133798. // List: Retrieves a list of VPN gateways available to the specified
  133799. // project and region.
  133800. func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
  133801. c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133802. c.project = project
  133803. c.region = region
  133804. return c
  133805. }
  133806. // Filter sets the optional parameter "filter": A filter expression that
  133807. // filters resources listed in the response. The expression must specify
  133808. // the field name, a comparison operator, and the value that you want to
  133809. // use for filtering. The value must be a string, a number, or a
  133810. // boolean. The comparison operator must be either =, !=, >, or <.
  133811. //
  133812. // For example, if you are filtering Compute Engine instances, you can
  133813. // exclude instances named example-instance by specifying name !=
  133814. // example-instance.
  133815. //
  133816. // You can also filter nested fields. For example, you could specify
  133817. // scheduling.automaticRestart = false to include instances only if they
  133818. // are not scheduled for automatic restarts. You can use filtering on
  133819. // nested fields to filter based on resource labels.
  133820. //
  133821. // To filter on multiple expressions, provide each separate expression
  133822. // within parentheses. For example, (scheduling.automaticRestart = true)
  133823. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133824. // AND expression. However, you can include AND and OR expressions
  133825. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133826. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133827. // true).
  133828. func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
  133829. c.urlParams_.Set("filter", filter)
  133830. return c
  133831. }
  133832. // MaxResults sets the optional parameter "maxResults": The maximum
  133833. // number of results per page that should be returned. If the number of
  133834. // available results is larger than maxResults, Compute Engine returns a
  133835. // nextPageToken that can be used to get the next page of results in
  133836. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133837. // (Default: 500)
  133838. func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
  133839. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133840. return c
  133841. }
  133842. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133843. // a certain order. By default, results are returned in alphanumerical
  133844. // order based on the resource name.
  133845. //
  133846. // You can also sort results in descending order based on the creation
  133847. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133848. // based on the creationTimestamp field in reverse chronological order
  133849. // (newest result first). Use this to sort resources like operations so
  133850. // that the newest operation is returned first.
  133851. //
  133852. // Currently, only sorting by name or creationTimestamp desc is
  133853. // supported.
  133854. func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
  133855. c.urlParams_.Set("orderBy", orderBy)
  133856. return c
  133857. }
  133858. // PageToken sets the optional parameter "pageToken": Specifies a page
  133859. // token to use. Set pageToken to the nextPageToken returned by a
  133860. // previous list request to get the next page of results.
  133861. func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
  133862. c.urlParams_.Set("pageToken", pageToken)
  133863. return c
  133864. }
  133865. // Fields allows partial responses to be retrieved. See
  133866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133867. // for more information.
  133868. func (c *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
  133869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133870. return c
  133871. }
  133872. // IfNoneMatch sets the optional parameter which makes the operation
  133873. // fail if the object's ETag matches the given value. This is useful for
  133874. // getting updates only after the object has changed since the last
  133875. // request. Use googleapi.IsNotModified to check whether the response
  133876. // error from Do is the result of In-None-Match.
  133877. func (c *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
  133878. c.ifNoneMatch_ = entityTag
  133879. return c
  133880. }
  133881. // Context sets the context to be used in this call's Do method. Any
  133882. // pending HTTP request will be aborted if the provided context is
  133883. // canceled.
  133884. func (c *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
  133885. c.ctx_ = ctx
  133886. return c
  133887. }
  133888. // Header returns an http.Header that can be modified by the caller to
  133889. // add HTTP headers to the request.
  133890. func (c *VpnGatewaysListCall) Header() http.Header {
  133891. if c.header_ == nil {
  133892. c.header_ = make(http.Header)
  133893. }
  133894. return c.header_
  133895. }
  133896. func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  133897. reqHeaders := make(http.Header)
  133898. for k, v := range c.header_ {
  133899. reqHeaders[k] = v
  133900. }
  133901. reqHeaders.Set("User-Agent", c.s.userAgent())
  133902. if c.ifNoneMatch_ != "" {
  133903. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133904. }
  133905. var body io.Reader = nil
  133906. c.urlParams_.Set("alt", alt)
  133907. c.urlParams_.Set("prettyPrint", "false")
  133908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  133909. urls += "?" + c.urlParams_.Encode()
  133910. req, err := http.NewRequest("GET", urls, body)
  133911. if err != nil {
  133912. return nil, err
  133913. }
  133914. req.Header = reqHeaders
  133915. googleapi.Expand(req.URL, map[string]string{
  133916. "project": c.project,
  133917. "region": c.region,
  133918. })
  133919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133920. }
  133921. // Do executes the "compute.vpnGateways.list" call.
  133922. // Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
  133923. // status code is an error. Response headers are in either
  133924. // *VpnGatewayList.ServerResponse.Header or (if a response was returned
  133925. // at all) in error.(*googleapi.Error).Header. Use
  133926. // googleapi.IsNotModified to check whether the returned error was
  133927. // because http.StatusNotModified was returned.
  133928. func (c *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, error) {
  133929. gensupport.SetOptions(c.urlParams_, opts...)
  133930. res, err := c.doRequest("json")
  133931. if res != nil && res.StatusCode == http.StatusNotModified {
  133932. if res.Body != nil {
  133933. res.Body.Close()
  133934. }
  133935. return nil, &googleapi.Error{
  133936. Code: res.StatusCode,
  133937. Header: res.Header,
  133938. }
  133939. }
  133940. if err != nil {
  133941. return nil, err
  133942. }
  133943. defer googleapi.CloseBody(res)
  133944. if err := googleapi.CheckResponse(res); err != nil {
  133945. return nil, err
  133946. }
  133947. ret := &VpnGatewayList{
  133948. ServerResponse: googleapi.ServerResponse{
  133949. Header: res.Header,
  133950. HTTPStatusCode: res.StatusCode,
  133951. },
  133952. }
  133953. target := &ret
  133954. if err := gensupport.DecodeResponse(target, res); err != nil {
  133955. return nil, err
  133956. }
  133957. return ret, nil
  133958. // {
  133959. // "description": "Retrieves a list of VPN gateways available to the specified project and region.",
  133960. // "httpMethod": "GET",
  133961. // "id": "compute.vpnGateways.list",
  133962. // "parameterOrder": [
  133963. // "project",
  133964. // "region"
  133965. // ],
  133966. // "parameters": {
  133967. // "filter": {
  133968. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133969. // "location": "query",
  133970. // "type": "string"
  133971. // },
  133972. // "maxResults": {
  133973. // "default": "500",
  133974. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133975. // "format": "uint32",
  133976. // "location": "query",
  133977. // "minimum": "0",
  133978. // "type": "integer"
  133979. // },
  133980. // "orderBy": {
  133981. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133982. // "location": "query",
  133983. // "type": "string"
  133984. // },
  133985. // "pageToken": {
  133986. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133987. // "location": "query",
  133988. // "type": "string"
  133989. // },
  133990. // "project": {
  133991. // "description": "Project ID for this request.",
  133992. // "location": "path",
  133993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133994. // "required": true,
  133995. // "type": "string"
  133996. // },
  133997. // "region": {
  133998. // "description": "Name of the region for this request.",
  133999. // "location": "path",
  134000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134001. // "required": true,
  134002. // "type": "string"
  134003. // }
  134004. // },
  134005. // "path": "{project}/regions/{region}/vpnGateways",
  134006. // "response": {
  134007. // "$ref": "VpnGatewayList"
  134008. // },
  134009. // "scopes": [
  134010. // "https://www.googleapis.com/auth/cloud-platform",
  134011. // "https://www.googleapis.com/auth/compute",
  134012. // "https://www.googleapis.com/auth/compute.readonly"
  134013. // ]
  134014. // }
  134015. }
  134016. // Pages invokes f for each page of results.
  134017. // A non-nil error returned from f will halt the iteration.
  134018. // The provided context supersedes any context provided to the Context method.
  134019. func (c *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) error) error {
  134020. c.ctx_ = ctx
  134021. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  134022. for {
  134023. x, err := c.Do()
  134024. if err != nil {
  134025. return err
  134026. }
  134027. if err := f(x); err != nil {
  134028. return err
  134029. }
  134030. if x.NextPageToken == "" {
  134031. return nil
  134032. }
  134033. c.PageToken(x.NextPageToken)
  134034. }
  134035. }
  134036. // method id "compute.vpnGateways.setLabels":
  134037. type VpnGatewaysSetLabelsCall struct {
  134038. s *Service
  134039. project string
  134040. region string
  134041. resource string
  134042. regionsetlabelsrequest *RegionSetLabelsRequest
  134043. urlParams_ gensupport.URLParams
  134044. ctx_ context.Context
  134045. header_ http.Header
  134046. }
  134047. // SetLabels: Sets the labels on a VpnGateway. To learn more about
  134048. // labels, read the Labeling Resources documentation.
  134049. func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
  134050. c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134051. c.project = project
  134052. c.region = region
  134053. c.resource = resource
  134054. c.regionsetlabelsrequest = regionsetlabelsrequest
  134055. return c
  134056. }
  134057. // RequestId sets the optional parameter "requestId": An optional
  134058. // request ID to identify requests. Specify a unique request ID so that
  134059. // if you must retry your request, the server will know to ignore the
  134060. // request if it has already been completed.
  134061. //
  134062. // For example, consider a situation where you make an initial request
  134063. // and the request times out. If you make the request again with the
  134064. // same request ID, the server can check if original operation with the
  134065. // same request ID was received, and if so, will ignore the second
  134066. // request. This prevents clients from accidentally creating duplicate
  134067. // commitments.
  134068. //
  134069. // The request ID must be a valid UUID with the exception that zero UUID
  134070. // is not supported (00000000-0000-0000-0000-000000000000).
  134071. func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
  134072. c.urlParams_.Set("requestId", requestId)
  134073. return c
  134074. }
  134075. // Fields allows partial responses to be retrieved. See
  134076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134077. // for more information.
  134078. func (c *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
  134079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134080. return c
  134081. }
  134082. // Context sets the context to be used in this call's Do method. Any
  134083. // pending HTTP request will be aborted if the provided context is
  134084. // canceled.
  134085. func (c *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
  134086. c.ctx_ = ctx
  134087. return c
  134088. }
  134089. // Header returns an http.Header that can be modified by the caller to
  134090. // add HTTP headers to the request.
  134091. func (c *VpnGatewaysSetLabelsCall) Header() http.Header {
  134092. if c.header_ == nil {
  134093. c.header_ = make(http.Header)
  134094. }
  134095. return c.header_
  134096. }
  134097. func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  134098. reqHeaders := make(http.Header)
  134099. for k, v := range c.header_ {
  134100. reqHeaders[k] = v
  134101. }
  134102. reqHeaders.Set("User-Agent", c.s.userAgent())
  134103. var body io.Reader = nil
  134104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  134105. if err != nil {
  134106. return nil, err
  134107. }
  134108. reqHeaders.Set("Content-Type", "application/json")
  134109. c.urlParams_.Set("alt", alt)
  134110. c.urlParams_.Set("prettyPrint", "false")
  134111. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/setLabels")
  134112. urls += "?" + c.urlParams_.Encode()
  134113. req, err := http.NewRequest("POST", urls, body)
  134114. if err != nil {
  134115. return nil, err
  134116. }
  134117. req.Header = reqHeaders
  134118. googleapi.Expand(req.URL, map[string]string{
  134119. "project": c.project,
  134120. "region": c.region,
  134121. "resource": c.resource,
  134122. })
  134123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134124. }
  134125. // Do executes the "compute.vpnGateways.setLabels" call.
  134126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134127. // status code is an error. Response headers are in either
  134128. // *Operation.ServerResponse.Header or (if a response was returned at
  134129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134130. // to check whether the returned error was because
  134131. // http.StatusNotModified was returned.
  134132. func (c *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134133. gensupport.SetOptions(c.urlParams_, opts...)
  134134. res, err := c.doRequest("json")
  134135. if res != nil && res.StatusCode == http.StatusNotModified {
  134136. if res.Body != nil {
  134137. res.Body.Close()
  134138. }
  134139. return nil, &googleapi.Error{
  134140. Code: res.StatusCode,
  134141. Header: res.Header,
  134142. }
  134143. }
  134144. if err != nil {
  134145. return nil, err
  134146. }
  134147. defer googleapi.CloseBody(res)
  134148. if err := googleapi.CheckResponse(res); err != nil {
  134149. return nil, err
  134150. }
  134151. ret := &Operation{
  134152. ServerResponse: googleapi.ServerResponse{
  134153. Header: res.Header,
  134154. HTTPStatusCode: res.StatusCode,
  134155. },
  134156. }
  134157. target := &ret
  134158. if err := gensupport.DecodeResponse(target, res); err != nil {
  134159. return nil, err
  134160. }
  134161. return ret, nil
  134162. // {
  134163. // "description": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  134164. // "httpMethod": "POST",
  134165. // "id": "compute.vpnGateways.setLabels",
  134166. // "parameterOrder": [
  134167. // "project",
  134168. // "region",
  134169. // "resource"
  134170. // ],
  134171. // "parameters": {
  134172. // "project": {
  134173. // "description": "Project ID for this request.",
  134174. // "location": "path",
  134175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134176. // "required": true,
  134177. // "type": "string"
  134178. // },
  134179. // "region": {
  134180. // "description": "The region for this request.",
  134181. // "location": "path",
  134182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134183. // "required": true,
  134184. // "type": "string"
  134185. // },
  134186. // "requestId": {
  134187. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134188. // "location": "query",
  134189. // "type": "string"
  134190. // },
  134191. // "resource": {
  134192. // "description": "Name or id of the resource for this request.",
  134193. // "location": "path",
  134194. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134195. // "required": true,
  134196. // "type": "string"
  134197. // }
  134198. // },
  134199. // "path": "{project}/regions/{region}/vpnGateways/{resource}/setLabels",
  134200. // "request": {
  134201. // "$ref": "RegionSetLabelsRequest"
  134202. // },
  134203. // "response": {
  134204. // "$ref": "Operation"
  134205. // },
  134206. // "scopes": [
  134207. // "https://www.googleapis.com/auth/cloud-platform",
  134208. // "https://www.googleapis.com/auth/compute"
  134209. // ]
  134210. // }
  134211. }
  134212. // method id "compute.vpnGateways.testIamPermissions":
  134213. type VpnGatewaysTestIamPermissionsCall struct {
  134214. s *Service
  134215. project string
  134216. region string
  134217. resource string
  134218. testpermissionsrequest *TestPermissionsRequest
  134219. urlParams_ gensupport.URLParams
  134220. ctx_ context.Context
  134221. header_ http.Header
  134222. }
  134223. // TestIamPermissions: Returns permissions that a caller has on the
  134224. // specified resource.
  134225. func (r *VpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnGatewaysTestIamPermissionsCall {
  134226. c := &VpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134227. c.project = project
  134228. c.region = region
  134229. c.resource = resource
  134230. c.testpermissionsrequest = testpermissionsrequest
  134231. return c
  134232. }
  134233. // Fields allows partial responses to be retrieved. See
  134234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134235. // for more information.
  134236. func (c *VpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnGatewaysTestIamPermissionsCall {
  134237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134238. return c
  134239. }
  134240. // Context sets the context to be used in this call's Do method. Any
  134241. // pending HTTP request will be aborted if the provided context is
  134242. // canceled.
  134243. func (c *VpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *VpnGatewaysTestIamPermissionsCall {
  134244. c.ctx_ = ctx
  134245. return c
  134246. }
  134247. // Header returns an http.Header that can be modified by the caller to
  134248. // add HTTP headers to the request.
  134249. func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header {
  134250. if c.header_ == nil {
  134251. c.header_ = make(http.Header)
  134252. }
  134253. return c.header_
  134254. }
  134255. func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  134256. reqHeaders := make(http.Header)
  134257. for k, v := range c.header_ {
  134258. reqHeaders[k] = v
  134259. }
  134260. reqHeaders.Set("User-Agent", c.s.userAgent())
  134261. var body io.Reader = nil
  134262. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  134263. if err != nil {
  134264. return nil, err
  134265. }
  134266. reqHeaders.Set("Content-Type", "application/json")
  134267. c.urlParams_.Set("alt", alt)
  134268. c.urlParams_.Set("prettyPrint", "false")
  134269. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions")
  134270. urls += "?" + c.urlParams_.Encode()
  134271. req, err := http.NewRequest("POST", urls, body)
  134272. if err != nil {
  134273. return nil, err
  134274. }
  134275. req.Header = reqHeaders
  134276. googleapi.Expand(req.URL, map[string]string{
  134277. "project": c.project,
  134278. "region": c.region,
  134279. "resource": c.resource,
  134280. })
  134281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134282. }
  134283. // Do executes the "compute.vpnGateways.testIamPermissions" call.
  134284. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  134285. // non-2xx status code is an error. Response headers are in either
  134286. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  134287. // returned at all) in error.(*googleapi.Error).Header. Use
  134288. // googleapi.IsNotModified to check whether the returned error was
  134289. // because http.StatusNotModified was returned.
  134290. func (c *VpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  134291. gensupport.SetOptions(c.urlParams_, opts...)
  134292. res, err := c.doRequest("json")
  134293. if res != nil && res.StatusCode == http.StatusNotModified {
  134294. if res.Body != nil {
  134295. res.Body.Close()
  134296. }
  134297. return nil, &googleapi.Error{
  134298. Code: res.StatusCode,
  134299. Header: res.Header,
  134300. }
  134301. }
  134302. if err != nil {
  134303. return nil, err
  134304. }
  134305. defer googleapi.CloseBody(res)
  134306. if err := googleapi.CheckResponse(res); err != nil {
  134307. return nil, err
  134308. }
  134309. ret := &TestPermissionsResponse{
  134310. ServerResponse: googleapi.ServerResponse{
  134311. Header: res.Header,
  134312. HTTPStatusCode: res.StatusCode,
  134313. },
  134314. }
  134315. target := &ret
  134316. if err := gensupport.DecodeResponse(target, res); err != nil {
  134317. return nil, err
  134318. }
  134319. return ret, nil
  134320. // {
  134321. // "description": "Returns permissions that a caller has on the specified resource.",
  134322. // "httpMethod": "POST",
  134323. // "id": "compute.vpnGateways.testIamPermissions",
  134324. // "parameterOrder": [
  134325. // "project",
  134326. // "region",
  134327. // "resource"
  134328. // ],
  134329. // "parameters": {
  134330. // "project": {
  134331. // "description": "Project ID for this request.",
  134332. // "location": "path",
  134333. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134334. // "required": true,
  134335. // "type": "string"
  134336. // },
  134337. // "region": {
  134338. // "description": "The name of the region for this request.",
  134339. // "location": "path",
  134340. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134341. // "required": true,
  134342. // "type": "string"
  134343. // },
  134344. // "resource": {
  134345. // "description": "Name or id of the resource for this request.",
  134346. // "location": "path",
  134347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134348. // "required": true,
  134349. // "type": "string"
  134350. // }
  134351. // },
  134352. // "path": "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
  134353. // "request": {
  134354. // "$ref": "TestPermissionsRequest"
  134355. // },
  134356. // "response": {
  134357. // "$ref": "TestPermissionsResponse"
  134358. // },
  134359. // "scopes": [
  134360. // "https://www.googleapis.com/auth/cloud-platform",
  134361. // "https://www.googleapis.com/auth/compute",
  134362. // "https://www.googleapis.com/auth/compute.readonly"
  134363. // ]
  134364. // }
  134365. }
  134366. // method id "compute.vpnTunnels.aggregatedList":
  134367. type VpnTunnelsAggregatedListCall struct {
  134368. s *Service
  134369. project string
  134370. urlParams_ gensupport.URLParams
  134371. ifNoneMatch_ string
  134372. ctx_ context.Context
  134373. header_ http.Header
  134374. }
  134375. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  134376. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  134377. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134378. c.project = project
  134379. return c
  134380. }
  134381. // Filter sets the optional parameter "filter": A filter expression that
  134382. // filters resources listed in the response. The expression must specify
  134383. // the field name, a comparison operator, and the value that you want to
  134384. // use for filtering. The value must be a string, a number, or a
  134385. // boolean. The comparison operator must be either =, !=, >, or <.
  134386. //
  134387. // For example, if you are filtering Compute Engine instances, you can
  134388. // exclude instances named example-instance by specifying name !=
  134389. // example-instance.
  134390. //
  134391. // You can also filter nested fields. For example, you could specify
  134392. // scheduling.automaticRestart = false to include instances only if they
  134393. // are not scheduled for automatic restarts. You can use filtering on
  134394. // nested fields to filter based on resource labels.
  134395. //
  134396. // To filter on multiple expressions, provide each separate expression
  134397. // within parentheses. For example, (scheduling.automaticRestart = true)
  134398. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  134399. // AND expression. However, you can include AND and OR expressions
  134400. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  134401. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  134402. // true).
  134403. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  134404. c.urlParams_.Set("filter", filter)
  134405. return c
  134406. }
  134407. // MaxResults sets the optional parameter "maxResults": The maximum
  134408. // number of results per page that should be returned. If the number of
  134409. // available results is larger than maxResults, Compute Engine returns a
  134410. // nextPageToken that can be used to get the next page of results in
  134411. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  134412. // (Default: 500)
  134413. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  134414. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  134415. return c
  134416. }
  134417. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  134418. // a certain order. By default, results are returned in alphanumerical
  134419. // order based on the resource name.
  134420. //
  134421. // You can also sort results in descending order based on the creation
  134422. // timestamp using orderBy="creationTimestamp desc". This sorts results
  134423. // based on the creationTimestamp field in reverse chronological order
  134424. // (newest result first). Use this to sort resources like operations so
  134425. // that the newest operation is returned first.
  134426. //
  134427. // Currently, only sorting by name or creationTimestamp desc is
  134428. // supported.
  134429. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  134430. c.urlParams_.Set("orderBy", orderBy)
  134431. return c
  134432. }
  134433. // PageToken sets the optional parameter "pageToken": Specifies a page
  134434. // token to use. Set pageToken to the nextPageToken returned by a
  134435. // previous list request to get the next page of results.
  134436. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  134437. c.urlParams_.Set("pageToken", pageToken)
  134438. return c
  134439. }
  134440. // Fields allows partial responses to be retrieved. See
  134441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134442. // for more information.
  134443. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  134444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134445. return c
  134446. }
  134447. // IfNoneMatch sets the optional parameter which makes the operation
  134448. // fail if the object's ETag matches the given value. This is useful for
  134449. // getting updates only after the object has changed since the last
  134450. // request. Use googleapi.IsNotModified to check whether the response
  134451. // error from Do is the result of In-None-Match.
  134452. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  134453. c.ifNoneMatch_ = entityTag
  134454. return c
  134455. }
  134456. // Context sets the context to be used in this call's Do method. Any
  134457. // pending HTTP request will be aborted if the provided context is
  134458. // canceled.
  134459. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  134460. c.ctx_ = ctx
  134461. return c
  134462. }
  134463. // Header returns an http.Header that can be modified by the caller to
  134464. // add HTTP headers to the request.
  134465. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  134466. if c.header_ == nil {
  134467. c.header_ = make(http.Header)
  134468. }
  134469. return c.header_
  134470. }
  134471. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  134472. reqHeaders := make(http.Header)
  134473. for k, v := range c.header_ {
  134474. reqHeaders[k] = v
  134475. }
  134476. reqHeaders.Set("User-Agent", c.s.userAgent())
  134477. if c.ifNoneMatch_ != "" {
  134478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  134479. }
  134480. var body io.Reader = nil
  134481. c.urlParams_.Set("alt", alt)
  134482. c.urlParams_.Set("prettyPrint", "false")
  134483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  134484. urls += "?" + c.urlParams_.Encode()
  134485. req, err := http.NewRequest("GET", urls, body)
  134486. if err != nil {
  134487. return nil, err
  134488. }
  134489. req.Header = reqHeaders
  134490. googleapi.Expand(req.URL, map[string]string{
  134491. "project": c.project,
  134492. })
  134493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134494. }
  134495. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  134496. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  134497. // non-2xx status code is an error. Response headers are in either
  134498. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  134499. // returned at all) in error.(*googleapi.Error).Header. Use
  134500. // googleapi.IsNotModified to check whether the returned error was
  134501. // because http.StatusNotModified was returned.
  134502. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  134503. gensupport.SetOptions(c.urlParams_, opts...)
  134504. res, err := c.doRequest("json")
  134505. if res != nil && res.StatusCode == http.StatusNotModified {
  134506. if res.Body != nil {
  134507. res.Body.Close()
  134508. }
  134509. return nil, &googleapi.Error{
  134510. Code: res.StatusCode,
  134511. Header: res.Header,
  134512. }
  134513. }
  134514. if err != nil {
  134515. return nil, err
  134516. }
  134517. defer googleapi.CloseBody(res)
  134518. if err := googleapi.CheckResponse(res); err != nil {
  134519. return nil, err
  134520. }
  134521. ret := &VpnTunnelAggregatedList{
  134522. ServerResponse: googleapi.ServerResponse{
  134523. Header: res.Header,
  134524. HTTPStatusCode: res.StatusCode,
  134525. },
  134526. }
  134527. target := &ret
  134528. if err := gensupport.DecodeResponse(target, res); err != nil {
  134529. return nil, err
  134530. }
  134531. return ret, nil
  134532. // {
  134533. // "description": "Retrieves an aggregated list of VPN tunnels.",
  134534. // "httpMethod": "GET",
  134535. // "id": "compute.vpnTunnels.aggregatedList",
  134536. // "parameterOrder": [
  134537. // "project"
  134538. // ],
  134539. // "parameters": {
  134540. // "filter": {
  134541. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  134542. // "location": "query",
  134543. // "type": "string"
  134544. // },
  134545. // "maxResults": {
  134546. // "default": "500",
  134547. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  134548. // "format": "uint32",
  134549. // "location": "query",
  134550. // "minimum": "0",
  134551. // "type": "integer"
  134552. // },
  134553. // "orderBy": {
  134554. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  134555. // "location": "query",
  134556. // "type": "string"
  134557. // },
  134558. // "pageToken": {
  134559. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  134560. // "location": "query",
  134561. // "type": "string"
  134562. // },
  134563. // "project": {
  134564. // "description": "Project ID for this request.",
  134565. // "location": "path",
  134566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134567. // "required": true,
  134568. // "type": "string"
  134569. // }
  134570. // },
  134571. // "path": "{project}/aggregated/vpnTunnels",
  134572. // "response": {
  134573. // "$ref": "VpnTunnelAggregatedList"
  134574. // },
  134575. // "scopes": [
  134576. // "https://www.googleapis.com/auth/cloud-platform",
  134577. // "https://www.googleapis.com/auth/compute",
  134578. // "https://www.googleapis.com/auth/compute.readonly"
  134579. // ]
  134580. // }
  134581. }
  134582. // Pages invokes f for each page of results.
  134583. // A non-nil error returned from f will halt the iteration.
  134584. // The provided context supersedes any context provided to the Context method.
  134585. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  134586. c.ctx_ = ctx
  134587. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  134588. for {
  134589. x, err := c.Do()
  134590. if err != nil {
  134591. return err
  134592. }
  134593. if err := f(x); err != nil {
  134594. return err
  134595. }
  134596. if x.NextPageToken == "" {
  134597. return nil
  134598. }
  134599. c.PageToken(x.NextPageToken)
  134600. }
  134601. }
  134602. // method id "compute.vpnTunnels.delete":
  134603. type VpnTunnelsDeleteCall struct {
  134604. s *Service
  134605. project string
  134606. region string
  134607. vpnTunnel string
  134608. urlParams_ gensupport.URLParams
  134609. ctx_ context.Context
  134610. header_ http.Header
  134611. }
  134612. // Delete: Deletes the specified VpnTunnel resource.
  134613. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  134614. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134615. c.project = project
  134616. c.region = region
  134617. c.vpnTunnel = vpnTunnel
  134618. return c
  134619. }
  134620. // RequestId sets the optional parameter "requestId": An optional
  134621. // request ID to identify requests. Specify a unique request ID so that
  134622. // if you must retry your request, the server will know to ignore the
  134623. // request if it has already been completed.
  134624. //
  134625. // For example, consider a situation where you make an initial request
  134626. // and the request times out. If you make the request again with the
  134627. // same request ID, the server can check if original operation with the
  134628. // same request ID was received, and if so, will ignore the second
  134629. // request. This prevents clients from accidentally creating duplicate
  134630. // commitments.
  134631. //
  134632. // The request ID must be a valid UUID with the exception that zero UUID
  134633. // is not supported (00000000-0000-0000-0000-000000000000).
  134634. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  134635. c.urlParams_.Set("requestId", requestId)
  134636. return c
  134637. }
  134638. // Fields allows partial responses to be retrieved. See
  134639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134640. // for more information.
  134641. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  134642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134643. return c
  134644. }
  134645. // Context sets the context to be used in this call's Do method. Any
  134646. // pending HTTP request will be aborted if the provided context is
  134647. // canceled.
  134648. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  134649. c.ctx_ = ctx
  134650. return c
  134651. }
  134652. // Header returns an http.Header that can be modified by the caller to
  134653. // add HTTP headers to the request.
  134654. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  134655. if c.header_ == nil {
  134656. c.header_ = make(http.Header)
  134657. }
  134658. return c.header_
  134659. }
  134660. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  134661. reqHeaders := make(http.Header)
  134662. for k, v := range c.header_ {
  134663. reqHeaders[k] = v
  134664. }
  134665. reqHeaders.Set("User-Agent", c.s.userAgent())
  134666. var body io.Reader = nil
  134667. c.urlParams_.Set("alt", alt)
  134668. c.urlParams_.Set("prettyPrint", "false")
  134669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  134670. urls += "?" + c.urlParams_.Encode()
  134671. req, err := http.NewRequest("DELETE", urls, body)
  134672. if err != nil {
  134673. return nil, err
  134674. }
  134675. req.Header = reqHeaders
  134676. googleapi.Expand(req.URL, map[string]string{
  134677. "project": c.project,
  134678. "region": c.region,
  134679. "vpnTunnel": c.vpnTunnel,
  134680. })
  134681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134682. }
  134683. // Do executes the "compute.vpnTunnels.delete" call.
  134684. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134685. // status code is an error. Response headers are in either
  134686. // *Operation.ServerResponse.Header or (if a response was returned at
  134687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134688. // to check whether the returned error was because
  134689. // http.StatusNotModified was returned.
  134690. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134691. gensupport.SetOptions(c.urlParams_, opts...)
  134692. res, err := c.doRequest("json")
  134693. if res != nil && res.StatusCode == http.StatusNotModified {
  134694. if res.Body != nil {
  134695. res.Body.Close()
  134696. }
  134697. return nil, &googleapi.Error{
  134698. Code: res.StatusCode,
  134699. Header: res.Header,
  134700. }
  134701. }
  134702. if err != nil {
  134703. return nil, err
  134704. }
  134705. defer googleapi.CloseBody(res)
  134706. if err := googleapi.CheckResponse(res); err != nil {
  134707. return nil, err
  134708. }
  134709. ret := &Operation{
  134710. ServerResponse: googleapi.ServerResponse{
  134711. Header: res.Header,
  134712. HTTPStatusCode: res.StatusCode,
  134713. },
  134714. }
  134715. target := &ret
  134716. if err := gensupport.DecodeResponse(target, res); err != nil {
  134717. return nil, err
  134718. }
  134719. return ret, nil
  134720. // {
  134721. // "description": "Deletes the specified VpnTunnel resource.",
  134722. // "httpMethod": "DELETE",
  134723. // "id": "compute.vpnTunnels.delete",
  134724. // "parameterOrder": [
  134725. // "project",
  134726. // "region",
  134727. // "vpnTunnel"
  134728. // ],
  134729. // "parameters": {
  134730. // "project": {
  134731. // "description": "Project ID for this request.",
  134732. // "location": "path",
  134733. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134734. // "required": true,
  134735. // "type": "string"
  134736. // },
  134737. // "region": {
  134738. // "description": "Name of the region for this request.",
  134739. // "location": "path",
  134740. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134741. // "required": true,
  134742. // "type": "string"
  134743. // },
  134744. // "requestId": {
  134745. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134746. // "location": "query",
  134747. // "type": "string"
  134748. // },
  134749. // "vpnTunnel": {
  134750. // "description": "Name of the VpnTunnel resource to delete.",
  134751. // "location": "path",
  134752. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134753. // "required": true,
  134754. // "type": "string"
  134755. // }
  134756. // },
  134757. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  134758. // "response": {
  134759. // "$ref": "Operation"
  134760. // },
  134761. // "scopes": [
  134762. // "https://www.googleapis.com/auth/cloud-platform",
  134763. // "https://www.googleapis.com/auth/compute"
  134764. // ]
  134765. // }
  134766. }
  134767. // method id "compute.vpnTunnels.get":
  134768. type VpnTunnelsGetCall struct {
  134769. s *Service
  134770. project string
  134771. region string
  134772. vpnTunnel string
  134773. urlParams_ gensupport.URLParams
  134774. ifNoneMatch_ string
  134775. ctx_ context.Context
  134776. header_ http.Header
  134777. }
  134778. // Get: Returns the specified VpnTunnel resource. Gets a list of
  134779. // available VPN tunnels by making a list() request.
  134780. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  134781. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134782. c.project = project
  134783. c.region = region
  134784. c.vpnTunnel = vpnTunnel
  134785. return c
  134786. }
  134787. // Fields allows partial responses to be retrieved. See
  134788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134789. // for more information.
  134790. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  134791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134792. return c
  134793. }
  134794. // IfNoneMatch sets the optional parameter which makes the operation
  134795. // fail if the object's ETag matches the given value. This is useful for
  134796. // getting updates only after the object has changed since the last
  134797. // request. Use googleapi.IsNotModified to check whether the response
  134798. // error from Do is the result of In-None-Match.
  134799. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  134800. c.ifNoneMatch_ = entityTag
  134801. return c
  134802. }
  134803. // Context sets the context to be used in this call's Do method. Any
  134804. // pending HTTP request will be aborted if the provided context is
  134805. // canceled.
  134806. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  134807. c.ctx_ = ctx
  134808. return c
  134809. }
  134810. // Header returns an http.Header that can be modified by the caller to
  134811. // add HTTP headers to the request.
  134812. func (c *VpnTunnelsGetCall) Header() http.Header {
  134813. if c.header_ == nil {
  134814. c.header_ = make(http.Header)
  134815. }
  134816. return c.header_
  134817. }
  134818. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  134819. reqHeaders := make(http.Header)
  134820. for k, v := range c.header_ {
  134821. reqHeaders[k] = v
  134822. }
  134823. reqHeaders.Set("User-Agent", c.s.userAgent())
  134824. if c.ifNoneMatch_ != "" {
  134825. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  134826. }
  134827. var body io.Reader = nil
  134828. c.urlParams_.Set("alt", alt)
  134829. c.urlParams_.Set("prettyPrint", "false")
  134830. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  134831. urls += "?" + c.urlParams_.Encode()
  134832. req, err := http.NewRequest("GET", urls, body)
  134833. if err != nil {
  134834. return nil, err
  134835. }
  134836. req.Header = reqHeaders
  134837. googleapi.Expand(req.URL, map[string]string{
  134838. "project": c.project,
  134839. "region": c.region,
  134840. "vpnTunnel": c.vpnTunnel,
  134841. })
  134842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134843. }
  134844. // Do executes the "compute.vpnTunnels.get" call.
  134845. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  134846. // status code is an error. Response headers are in either
  134847. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  134848. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134849. // to check whether the returned error was because
  134850. // http.StatusNotModified was returned.
  134851. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  134852. gensupport.SetOptions(c.urlParams_, opts...)
  134853. res, err := c.doRequest("json")
  134854. if res != nil && res.StatusCode == http.StatusNotModified {
  134855. if res.Body != nil {
  134856. res.Body.Close()
  134857. }
  134858. return nil, &googleapi.Error{
  134859. Code: res.StatusCode,
  134860. Header: res.Header,
  134861. }
  134862. }
  134863. if err != nil {
  134864. return nil, err
  134865. }
  134866. defer googleapi.CloseBody(res)
  134867. if err := googleapi.CheckResponse(res); err != nil {
  134868. return nil, err
  134869. }
  134870. ret := &VpnTunnel{
  134871. ServerResponse: googleapi.ServerResponse{
  134872. Header: res.Header,
  134873. HTTPStatusCode: res.StatusCode,
  134874. },
  134875. }
  134876. target := &ret
  134877. if err := gensupport.DecodeResponse(target, res); err != nil {
  134878. return nil, err
  134879. }
  134880. return ret, nil
  134881. // {
  134882. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  134883. // "httpMethod": "GET",
  134884. // "id": "compute.vpnTunnels.get",
  134885. // "parameterOrder": [
  134886. // "project",
  134887. // "region",
  134888. // "vpnTunnel"
  134889. // ],
  134890. // "parameters": {
  134891. // "project": {
  134892. // "description": "Project ID for this request.",
  134893. // "location": "path",
  134894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134895. // "required": true,
  134896. // "type": "string"
  134897. // },
  134898. // "region": {
  134899. // "description": "Name of the region for this request.",
  134900. // "location": "path",
  134901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134902. // "required": true,
  134903. // "type": "string"
  134904. // },
  134905. // "vpnTunnel": {
  134906. // "description": "Name of the VpnTunnel resource to return.",
  134907. // "location": "path",
  134908. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134909. // "required": true,
  134910. // "type": "string"
  134911. // }
  134912. // },
  134913. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  134914. // "response": {
  134915. // "$ref": "VpnTunnel"
  134916. // },
  134917. // "scopes": [
  134918. // "https://www.googleapis.com/auth/cloud-platform",
  134919. // "https://www.googleapis.com/auth/compute",
  134920. // "https://www.googleapis.com/auth/compute.readonly"
  134921. // ]
  134922. // }
  134923. }
  134924. // method id "compute.vpnTunnels.insert":
  134925. type VpnTunnelsInsertCall struct {
  134926. s *Service
  134927. project string
  134928. region string
  134929. vpntunnel *VpnTunnel
  134930. urlParams_ gensupport.URLParams
  134931. ctx_ context.Context
  134932. header_ http.Header
  134933. }
  134934. // Insert: Creates a VpnTunnel resource in the specified project and
  134935. // region using the data included in the request.
  134936. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  134937. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134938. c.project = project
  134939. c.region = region
  134940. c.vpntunnel = vpntunnel
  134941. return c
  134942. }
  134943. // RequestId sets the optional parameter "requestId": An optional
  134944. // request ID to identify requests. Specify a unique request ID so that
  134945. // if you must retry your request, the server will know to ignore the
  134946. // request if it has already been completed.
  134947. //
  134948. // For example, consider a situation where you make an initial request
  134949. // and the request times out. If you make the request again with the
  134950. // same request ID, the server can check if original operation with the
  134951. // same request ID was received, and if so, will ignore the second
  134952. // request. This prevents clients from accidentally creating duplicate
  134953. // commitments.
  134954. //
  134955. // The request ID must be a valid UUID with the exception that zero UUID
  134956. // is not supported (00000000-0000-0000-0000-000000000000).
  134957. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  134958. c.urlParams_.Set("requestId", requestId)
  134959. return c
  134960. }
  134961. // Fields allows partial responses to be retrieved. See
  134962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134963. // for more information.
  134964. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  134965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134966. return c
  134967. }
  134968. // Context sets the context to be used in this call's Do method. Any
  134969. // pending HTTP request will be aborted if the provided context is
  134970. // canceled.
  134971. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  134972. c.ctx_ = ctx
  134973. return c
  134974. }
  134975. // Header returns an http.Header that can be modified by the caller to
  134976. // add HTTP headers to the request.
  134977. func (c *VpnTunnelsInsertCall) Header() http.Header {
  134978. if c.header_ == nil {
  134979. c.header_ = make(http.Header)
  134980. }
  134981. return c.header_
  134982. }
  134983. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  134984. reqHeaders := make(http.Header)
  134985. for k, v := range c.header_ {
  134986. reqHeaders[k] = v
  134987. }
  134988. reqHeaders.Set("User-Agent", c.s.userAgent())
  134989. var body io.Reader = nil
  134990. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  134991. if err != nil {
  134992. return nil, err
  134993. }
  134994. reqHeaders.Set("Content-Type", "application/json")
  134995. c.urlParams_.Set("alt", alt)
  134996. c.urlParams_.Set("prettyPrint", "false")
  134997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  134998. urls += "?" + c.urlParams_.Encode()
  134999. req, err := http.NewRequest("POST", urls, body)
  135000. if err != nil {
  135001. return nil, err
  135002. }
  135003. req.Header = reqHeaders
  135004. googleapi.Expand(req.URL, map[string]string{
  135005. "project": c.project,
  135006. "region": c.region,
  135007. })
  135008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135009. }
  135010. // Do executes the "compute.vpnTunnels.insert" call.
  135011. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135012. // status code is an error. Response headers are in either
  135013. // *Operation.ServerResponse.Header or (if a response was returned at
  135014. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135015. // to check whether the returned error was because
  135016. // http.StatusNotModified was returned.
  135017. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135018. gensupport.SetOptions(c.urlParams_, opts...)
  135019. res, err := c.doRequest("json")
  135020. if res != nil && res.StatusCode == http.StatusNotModified {
  135021. if res.Body != nil {
  135022. res.Body.Close()
  135023. }
  135024. return nil, &googleapi.Error{
  135025. Code: res.StatusCode,
  135026. Header: res.Header,
  135027. }
  135028. }
  135029. if err != nil {
  135030. return nil, err
  135031. }
  135032. defer googleapi.CloseBody(res)
  135033. if err := googleapi.CheckResponse(res); err != nil {
  135034. return nil, err
  135035. }
  135036. ret := &Operation{
  135037. ServerResponse: googleapi.ServerResponse{
  135038. Header: res.Header,
  135039. HTTPStatusCode: res.StatusCode,
  135040. },
  135041. }
  135042. target := &ret
  135043. if err := gensupport.DecodeResponse(target, res); err != nil {
  135044. return nil, err
  135045. }
  135046. return ret, nil
  135047. // {
  135048. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  135049. // "httpMethod": "POST",
  135050. // "id": "compute.vpnTunnels.insert",
  135051. // "parameterOrder": [
  135052. // "project",
  135053. // "region"
  135054. // ],
  135055. // "parameters": {
  135056. // "project": {
  135057. // "description": "Project ID for this request.",
  135058. // "location": "path",
  135059. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135060. // "required": true,
  135061. // "type": "string"
  135062. // },
  135063. // "region": {
  135064. // "description": "Name of the region for this request.",
  135065. // "location": "path",
  135066. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135067. // "required": true,
  135068. // "type": "string"
  135069. // },
  135070. // "requestId": {
  135071. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135072. // "location": "query",
  135073. // "type": "string"
  135074. // }
  135075. // },
  135076. // "path": "{project}/regions/{region}/vpnTunnels",
  135077. // "request": {
  135078. // "$ref": "VpnTunnel"
  135079. // },
  135080. // "response": {
  135081. // "$ref": "Operation"
  135082. // },
  135083. // "scopes": [
  135084. // "https://www.googleapis.com/auth/cloud-platform",
  135085. // "https://www.googleapis.com/auth/compute"
  135086. // ]
  135087. // }
  135088. }
  135089. // method id "compute.vpnTunnels.list":
  135090. type VpnTunnelsListCall struct {
  135091. s *Service
  135092. project string
  135093. region string
  135094. urlParams_ gensupport.URLParams
  135095. ifNoneMatch_ string
  135096. ctx_ context.Context
  135097. header_ http.Header
  135098. }
  135099. // List: Retrieves a list of VpnTunnel resources contained in the
  135100. // specified project and region.
  135101. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  135102. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135103. c.project = project
  135104. c.region = region
  135105. return c
  135106. }
  135107. // Filter sets the optional parameter "filter": A filter expression that
  135108. // filters resources listed in the response. The expression must specify
  135109. // the field name, a comparison operator, and the value that you want to
  135110. // use for filtering. The value must be a string, a number, or a
  135111. // boolean. The comparison operator must be either =, !=, >, or <.
  135112. //
  135113. // For example, if you are filtering Compute Engine instances, you can
  135114. // exclude instances named example-instance by specifying name !=
  135115. // example-instance.
  135116. //
  135117. // You can also filter nested fields. For example, you could specify
  135118. // scheduling.automaticRestart = false to include instances only if they
  135119. // are not scheduled for automatic restarts. You can use filtering on
  135120. // nested fields to filter based on resource labels.
  135121. //
  135122. // To filter on multiple expressions, provide each separate expression
  135123. // within parentheses. For example, (scheduling.automaticRestart = true)
  135124. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  135125. // AND expression. However, you can include AND and OR expressions
  135126. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  135127. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  135128. // true).
  135129. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  135130. c.urlParams_.Set("filter", filter)
  135131. return c
  135132. }
  135133. // MaxResults sets the optional parameter "maxResults": The maximum
  135134. // number of results per page that should be returned. If the number of
  135135. // available results is larger than maxResults, Compute Engine returns a
  135136. // nextPageToken that can be used to get the next page of results in
  135137. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  135138. // (Default: 500)
  135139. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  135140. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  135141. return c
  135142. }
  135143. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  135144. // a certain order. By default, results are returned in alphanumerical
  135145. // order based on the resource name.
  135146. //
  135147. // You can also sort results in descending order based on the creation
  135148. // timestamp using orderBy="creationTimestamp desc". This sorts results
  135149. // based on the creationTimestamp field in reverse chronological order
  135150. // (newest result first). Use this to sort resources like operations so
  135151. // that the newest operation is returned first.
  135152. //
  135153. // Currently, only sorting by name or creationTimestamp desc is
  135154. // supported.
  135155. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  135156. c.urlParams_.Set("orderBy", orderBy)
  135157. return c
  135158. }
  135159. // PageToken sets the optional parameter "pageToken": Specifies a page
  135160. // token to use. Set pageToken to the nextPageToken returned by a
  135161. // previous list request to get the next page of results.
  135162. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  135163. c.urlParams_.Set("pageToken", pageToken)
  135164. return c
  135165. }
  135166. // Fields allows partial responses to be retrieved. See
  135167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135168. // for more information.
  135169. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  135170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135171. return c
  135172. }
  135173. // IfNoneMatch sets the optional parameter which makes the operation
  135174. // fail if the object's ETag matches the given value. This is useful for
  135175. // getting updates only after the object has changed since the last
  135176. // request. Use googleapi.IsNotModified to check whether the response
  135177. // error from Do is the result of In-None-Match.
  135178. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  135179. c.ifNoneMatch_ = entityTag
  135180. return c
  135181. }
  135182. // Context sets the context to be used in this call's Do method. Any
  135183. // pending HTTP request will be aborted if the provided context is
  135184. // canceled.
  135185. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  135186. c.ctx_ = ctx
  135187. return c
  135188. }
  135189. // Header returns an http.Header that can be modified by the caller to
  135190. // add HTTP headers to the request.
  135191. func (c *VpnTunnelsListCall) Header() http.Header {
  135192. if c.header_ == nil {
  135193. c.header_ = make(http.Header)
  135194. }
  135195. return c.header_
  135196. }
  135197. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  135198. reqHeaders := make(http.Header)
  135199. for k, v := range c.header_ {
  135200. reqHeaders[k] = v
  135201. }
  135202. reqHeaders.Set("User-Agent", c.s.userAgent())
  135203. if c.ifNoneMatch_ != "" {
  135204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  135205. }
  135206. var body io.Reader = nil
  135207. c.urlParams_.Set("alt", alt)
  135208. c.urlParams_.Set("prettyPrint", "false")
  135209. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  135210. urls += "?" + c.urlParams_.Encode()
  135211. req, err := http.NewRequest("GET", urls, body)
  135212. if err != nil {
  135213. return nil, err
  135214. }
  135215. req.Header = reqHeaders
  135216. googleapi.Expand(req.URL, map[string]string{
  135217. "project": c.project,
  135218. "region": c.region,
  135219. })
  135220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135221. }
  135222. // Do executes the "compute.vpnTunnels.list" call.
  135223. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  135224. // status code is an error. Response headers are in either
  135225. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  135226. // at all) in error.(*googleapi.Error).Header. Use
  135227. // googleapi.IsNotModified to check whether the returned error was
  135228. // because http.StatusNotModified was returned.
  135229. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  135230. gensupport.SetOptions(c.urlParams_, opts...)
  135231. res, err := c.doRequest("json")
  135232. if res != nil && res.StatusCode == http.StatusNotModified {
  135233. if res.Body != nil {
  135234. res.Body.Close()
  135235. }
  135236. return nil, &googleapi.Error{
  135237. Code: res.StatusCode,
  135238. Header: res.Header,
  135239. }
  135240. }
  135241. if err != nil {
  135242. return nil, err
  135243. }
  135244. defer googleapi.CloseBody(res)
  135245. if err := googleapi.CheckResponse(res); err != nil {
  135246. return nil, err
  135247. }
  135248. ret := &VpnTunnelList{
  135249. ServerResponse: googleapi.ServerResponse{
  135250. Header: res.Header,
  135251. HTTPStatusCode: res.StatusCode,
  135252. },
  135253. }
  135254. target := &ret
  135255. if err := gensupport.DecodeResponse(target, res); err != nil {
  135256. return nil, err
  135257. }
  135258. return ret, nil
  135259. // {
  135260. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  135261. // "httpMethod": "GET",
  135262. // "id": "compute.vpnTunnels.list",
  135263. // "parameterOrder": [
  135264. // "project",
  135265. // "region"
  135266. // ],
  135267. // "parameters": {
  135268. // "filter": {
  135269. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  135270. // "location": "query",
  135271. // "type": "string"
  135272. // },
  135273. // "maxResults": {
  135274. // "default": "500",
  135275. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  135276. // "format": "uint32",
  135277. // "location": "query",
  135278. // "minimum": "0",
  135279. // "type": "integer"
  135280. // },
  135281. // "orderBy": {
  135282. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  135283. // "location": "query",
  135284. // "type": "string"
  135285. // },
  135286. // "pageToken": {
  135287. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  135288. // "location": "query",
  135289. // "type": "string"
  135290. // },
  135291. // "project": {
  135292. // "description": "Project ID for this request.",
  135293. // "location": "path",
  135294. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135295. // "required": true,
  135296. // "type": "string"
  135297. // },
  135298. // "region": {
  135299. // "description": "Name of the region for this request.",
  135300. // "location": "path",
  135301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135302. // "required": true,
  135303. // "type": "string"
  135304. // }
  135305. // },
  135306. // "path": "{project}/regions/{region}/vpnTunnels",
  135307. // "response": {
  135308. // "$ref": "VpnTunnelList"
  135309. // },
  135310. // "scopes": [
  135311. // "https://www.googleapis.com/auth/cloud-platform",
  135312. // "https://www.googleapis.com/auth/compute",
  135313. // "https://www.googleapis.com/auth/compute.readonly"
  135314. // ]
  135315. // }
  135316. }
  135317. // Pages invokes f for each page of results.
  135318. // A non-nil error returned from f will halt the iteration.
  135319. // The provided context supersedes any context provided to the Context method.
  135320. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  135321. c.ctx_ = ctx
  135322. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  135323. for {
  135324. x, err := c.Do()
  135325. if err != nil {
  135326. return err
  135327. }
  135328. if err := f(x); err != nil {
  135329. return err
  135330. }
  135331. if x.NextPageToken == "" {
  135332. return nil
  135333. }
  135334. c.PageToken(x.NextPageToken)
  135335. }
  135336. }
  135337. // method id "compute.vpnTunnels.setLabels":
  135338. type VpnTunnelsSetLabelsCall struct {
  135339. s *Service
  135340. project string
  135341. region string
  135342. resource string
  135343. regionsetlabelsrequest *RegionSetLabelsRequest
  135344. urlParams_ gensupport.URLParams
  135345. ctx_ context.Context
  135346. header_ http.Header
  135347. }
  135348. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  135349. // labels, read the Labeling Resources documentation.
  135350. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  135351. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135352. c.project = project
  135353. c.region = region
  135354. c.resource = resource
  135355. c.regionsetlabelsrequest = regionsetlabelsrequest
  135356. return c
  135357. }
  135358. // RequestId sets the optional parameter "requestId": An optional
  135359. // request ID to identify requests. Specify a unique request ID so that
  135360. // if you must retry your request, the server will know to ignore the
  135361. // request if it has already been completed.
  135362. //
  135363. // For example, consider a situation where you make an initial request
  135364. // and the request times out. If you make the request again with the
  135365. // same request ID, the server can check if original operation with the
  135366. // same request ID was received, and if so, will ignore the second
  135367. // request. This prevents clients from accidentally creating duplicate
  135368. // commitments.
  135369. //
  135370. // The request ID must be a valid UUID with the exception that zero UUID
  135371. // is not supported (00000000-0000-0000-0000-000000000000).
  135372. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  135373. c.urlParams_.Set("requestId", requestId)
  135374. return c
  135375. }
  135376. // Fields allows partial responses to be retrieved. See
  135377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135378. // for more information.
  135379. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  135380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135381. return c
  135382. }
  135383. // Context sets the context to be used in this call's Do method. Any
  135384. // pending HTTP request will be aborted if the provided context is
  135385. // canceled.
  135386. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  135387. c.ctx_ = ctx
  135388. return c
  135389. }
  135390. // Header returns an http.Header that can be modified by the caller to
  135391. // add HTTP headers to the request.
  135392. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  135393. if c.header_ == nil {
  135394. c.header_ = make(http.Header)
  135395. }
  135396. return c.header_
  135397. }
  135398. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  135399. reqHeaders := make(http.Header)
  135400. for k, v := range c.header_ {
  135401. reqHeaders[k] = v
  135402. }
  135403. reqHeaders.Set("User-Agent", c.s.userAgent())
  135404. var body io.Reader = nil
  135405. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  135406. if err != nil {
  135407. return nil, err
  135408. }
  135409. reqHeaders.Set("Content-Type", "application/json")
  135410. c.urlParams_.Set("alt", alt)
  135411. c.urlParams_.Set("prettyPrint", "false")
  135412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  135413. urls += "?" + c.urlParams_.Encode()
  135414. req, err := http.NewRequest("POST", urls, body)
  135415. if err != nil {
  135416. return nil, err
  135417. }
  135418. req.Header = reqHeaders
  135419. googleapi.Expand(req.URL, map[string]string{
  135420. "project": c.project,
  135421. "region": c.region,
  135422. "resource": c.resource,
  135423. })
  135424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135425. }
  135426. // Do executes the "compute.vpnTunnels.setLabels" call.
  135427. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135428. // status code is an error. Response headers are in either
  135429. // *Operation.ServerResponse.Header or (if a response was returned at
  135430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135431. // to check whether the returned error was because
  135432. // http.StatusNotModified was returned.
  135433. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135434. gensupport.SetOptions(c.urlParams_, opts...)
  135435. res, err := c.doRequest("json")
  135436. if res != nil && res.StatusCode == http.StatusNotModified {
  135437. if res.Body != nil {
  135438. res.Body.Close()
  135439. }
  135440. return nil, &googleapi.Error{
  135441. Code: res.StatusCode,
  135442. Header: res.Header,
  135443. }
  135444. }
  135445. if err != nil {
  135446. return nil, err
  135447. }
  135448. defer googleapi.CloseBody(res)
  135449. if err := googleapi.CheckResponse(res); err != nil {
  135450. return nil, err
  135451. }
  135452. ret := &Operation{
  135453. ServerResponse: googleapi.ServerResponse{
  135454. Header: res.Header,
  135455. HTTPStatusCode: res.StatusCode,
  135456. },
  135457. }
  135458. target := &ret
  135459. if err := gensupport.DecodeResponse(target, res); err != nil {
  135460. return nil, err
  135461. }
  135462. return ret, nil
  135463. // {
  135464. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  135465. // "httpMethod": "POST",
  135466. // "id": "compute.vpnTunnels.setLabels",
  135467. // "parameterOrder": [
  135468. // "project",
  135469. // "region",
  135470. // "resource"
  135471. // ],
  135472. // "parameters": {
  135473. // "project": {
  135474. // "description": "Project ID for this request.",
  135475. // "location": "path",
  135476. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135477. // "required": true,
  135478. // "type": "string"
  135479. // },
  135480. // "region": {
  135481. // "description": "The region for this request.",
  135482. // "location": "path",
  135483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135484. // "required": true,
  135485. // "type": "string"
  135486. // },
  135487. // "requestId": {
  135488. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135489. // "location": "query",
  135490. // "type": "string"
  135491. // },
  135492. // "resource": {
  135493. // "description": "Name or id of the resource for this request.",
  135494. // "location": "path",
  135495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135496. // "required": true,
  135497. // "type": "string"
  135498. // }
  135499. // },
  135500. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  135501. // "request": {
  135502. // "$ref": "RegionSetLabelsRequest"
  135503. // },
  135504. // "response": {
  135505. // "$ref": "Operation"
  135506. // },
  135507. // "scopes": [
  135508. // "https://www.googleapis.com/auth/cloud-platform",
  135509. // "https://www.googleapis.com/auth/compute"
  135510. // ]
  135511. // }
  135512. }
  135513. // method id "compute.vpnTunnels.testIamPermissions":
  135514. type VpnTunnelsTestIamPermissionsCall struct {
  135515. s *Service
  135516. project string
  135517. region string
  135518. resource string
  135519. testpermissionsrequest *TestPermissionsRequest
  135520. urlParams_ gensupport.URLParams
  135521. ctx_ context.Context
  135522. header_ http.Header
  135523. }
  135524. // TestIamPermissions: Returns permissions that a caller has on the
  135525. // specified resource.
  135526. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  135527. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135528. c.project = project
  135529. c.region = region
  135530. c.resource = resource
  135531. c.testpermissionsrequest = testpermissionsrequest
  135532. return c
  135533. }
  135534. // Fields allows partial responses to be retrieved. See
  135535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135536. // for more information.
  135537. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  135538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135539. return c
  135540. }
  135541. // Context sets the context to be used in this call's Do method. Any
  135542. // pending HTTP request will be aborted if the provided context is
  135543. // canceled.
  135544. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  135545. c.ctx_ = ctx
  135546. return c
  135547. }
  135548. // Header returns an http.Header that can be modified by the caller to
  135549. // add HTTP headers to the request.
  135550. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  135551. if c.header_ == nil {
  135552. c.header_ = make(http.Header)
  135553. }
  135554. return c.header_
  135555. }
  135556. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  135557. reqHeaders := make(http.Header)
  135558. for k, v := range c.header_ {
  135559. reqHeaders[k] = v
  135560. }
  135561. reqHeaders.Set("User-Agent", c.s.userAgent())
  135562. var body io.Reader = nil
  135563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  135564. if err != nil {
  135565. return nil, err
  135566. }
  135567. reqHeaders.Set("Content-Type", "application/json")
  135568. c.urlParams_.Set("alt", alt)
  135569. c.urlParams_.Set("prettyPrint", "false")
  135570. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  135571. urls += "?" + c.urlParams_.Encode()
  135572. req, err := http.NewRequest("POST", urls, body)
  135573. if err != nil {
  135574. return nil, err
  135575. }
  135576. req.Header = reqHeaders
  135577. googleapi.Expand(req.URL, map[string]string{
  135578. "project": c.project,
  135579. "region": c.region,
  135580. "resource": c.resource,
  135581. })
  135582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135583. }
  135584. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  135585. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  135586. // non-2xx status code is an error. Response headers are in either
  135587. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  135588. // returned at all) in error.(*googleapi.Error).Header. Use
  135589. // googleapi.IsNotModified to check whether the returned error was
  135590. // because http.StatusNotModified was returned.
  135591. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  135592. gensupport.SetOptions(c.urlParams_, opts...)
  135593. res, err := c.doRequest("json")
  135594. if res != nil && res.StatusCode == http.StatusNotModified {
  135595. if res.Body != nil {
  135596. res.Body.Close()
  135597. }
  135598. return nil, &googleapi.Error{
  135599. Code: res.StatusCode,
  135600. Header: res.Header,
  135601. }
  135602. }
  135603. if err != nil {
  135604. return nil, err
  135605. }
  135606. defer googleapi.CloseBody(res)
  135607. if err := googleapi.CheckResponse(res); err != nil {
  135608. return nil, err
  135609. }
  135610. ret := &TestPermissionsResponse{
  135611. ServerResponse: googleapi.ServerResponse{
  135612. Header: res.Header,
  135613. HTTPStatusCode: res.StatusCode,
  135614. },
  135615. }
  135616. target := &ret
  135617. if err := gensupport.DecodeResponse(target, res); err != nil {
  135618. return nil, err
  135619. }
  135620. return ret, nil
  135621. // {
  135622. // "description": "Returns permissions that a caller has on the specified resource.",
  135623. // "httpMethod": "POST",
  135624. // "id": "compute.vpnTunnels.testIamPermissions",
  135625. // "parameterOrder": [
  135626. // "project",
  135627. // "region",
  135628. // "resource"
  135629. // ],
  135630. // "parameters": {
  135631. // "project": {
  135632. // "description": "Project ID for this request.",
  135633. // "location": "path",
  135634. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135635. // "required": true,
  135636. // "type": "string"
  135637. // },
  135638. // "region": {
  135639. // "description": "The name of the region for this request.",
  135640. // "location": "path",
  135641. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135642. // "required": true,
  135643. // "type": "string"
  135644. // },
  135645. // "resource": {
  135646. // "description": "Name or id of the resource for this request.",
  135647. // "location": "path",
  135648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135649. // "required": true,
  135650. // "type": "string"
  135651. // }
  135652. // },
  135653. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  135654. // "request": {
  135655. // "$ref": "TestPermissionsRequest"
  135656. // },
  135657. // "response": {
  135658. // "$ref": "TestPermissionsResponse"
  135659. // },
  135660. // "scopes": [
  135661. // "https://www.googleapis.com/auth/cloud-platform",
  135662. // "https://www.googleapis.com/auth/compute",
  135663. // "https://www.googleapis.com/auth/compute.readonly"
  135664. // ]
  135665. // }
  135666. }
  135667. // method id "compute.zoneOperations.delete":
  135668. type ZoneOperationsDeleteCall struct {
  135669. s *Service
  135670. project string
  135671. zone string
  135672. operation string
  135673. urlParams_ gensupport.URLParams
  135674. ctx_ context.Context
  135675. header_ http.Header
  135676. }
  135677. // Delete: Deletes the specified zone-specific Operations resource.
  135678. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  135679. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  135680. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135681. c.project = project
  135682. c.zone = zone
  135683. c.operation = operation
  135684. return c
  135685. }
  135686. // Fields allows partial responses to be retrieved. See
  135687. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135688. // for more information.
  135689. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  135690. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135691. return c
  135692. }
  135693. // Context sets the context to be used in this call's Do method. Any
  135694. // pending HTTP request will be aborted if the provided context is
  135695. // canceled.
  135696. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  135697. c.ctx_ = ctx
  135698. return c
  135699. }
  135700. // Header returns an http.Header that can be modified by the caller to
  135701. // add HTTP headers to the request.
  135702. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  135703. if c.header_ == nil {
  135704. c.header_ = make(http.Header)
  135705. }
  135706. return c.header_
  135707. }
  135708. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  135709. reqHeaders := make(http.Header)
  135710. for k, v := range c.header_ {
  135711. reqHeaders[k] = v
  135712. }
  135713. reqHeaders.Set("User-Agent", c.s.userAgent())
  135714. var body io.Reader = nil
  135715. c.urlParams_.Set("alt", alt)
  135716. c.urlParams_.Set("prettyPrint", "false")
  135717. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  135718. urls += "?" + c.urlParams_.Encode()
  135719. req, err := http.NewRequest("DELETE", urls, body)
  135720. if err != nil {
  135721. return nil, err
  135722. }
  135723. req.Header = reqHeaders
  135724. googleapi.Expand(req.URL, map[string]string{
  135725. "project": c.project,
  135726. "zone": c.zone,
  135727. "operation": c.operation,
  135728. })
  135729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135730. }
  135731. // Do executes the "compute.zoneOperations.delete" call.
  135732. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  135733. gensupport.SetOptions(c.urlParams_, opts...)
  135734. res, err := c.doRequest("json")
  135735. if err != nil {
  135736. return err
  135737. }
  135738. defer googleapi.CloseBody(res)
  135739. if err := googleapi.CheckResponse(res); err != nil {
  135740. return err
  135741. }
  135742. return nil
  135743. // {
  135744. // "description": "Deletes the specified zone-specific Operations resource.",
  135745. // "httpMethod": "DELETE",
  135746. // "id": "compute.zoneOperations.delete",
  135747. // "parameterOrder": [
  135748. // "project",
  135749. // "zone",
  135750. // "operation"
  135751. // ],
  135752. // "parameters": {
  135753. // "operation": {
  135754. // "description": "Name of the Operations resource to delete.",
  135755. // "location": "path",
  135756. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135757. // "required": true,
  135758. // "type": "string"
  135759. // },
  135760. // "project": {
  135761. // "description": "Project ID for this request.",
  135762. // "location": "path",
  135763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135764. // "required": true,
  135765. // "type": "string"
  135766. // },
  135767. // "zone": {
  135768. // "description": "Name of the zone for this request.",
  135769. // "location": "path",
  135770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135771. // "required": true,
  135772. // "type": "string"
  135773. // }
  135774. // },
  135775. // "path": "{project}/zones/{zone}/operations/{operation}",
  135776. // "scopes": [
  135777. // "https://www.googleapis.com/auth/cloud-platform",
  135778. // "https://www.googleapis.com/auth/compute"
  135779. // ]
  135780. // }
  135781. }
  135782. // method id "compute.zoneOperations.get":
  135783. type ZoneOperationsGetCall struct {
  135784. s *Service
  135785. project string
  135786. zone string
  135787. operation string
  135788. urlParams_ gensupport.URLParams
  135789. ifNoneMatch_ string
  135790. ctx_ context.Context
  135791. header_ http.Header
  135792. }
  135793. // Get: Retrieves the specified zone-specific Operations resource.
  135794. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  135795. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  135796. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135797. c.project = project
  135798. c.zone = zone
  135799. c.operation = operation
  135800. return c
  135801. }
  135802. // Fields allows partial responses to be retrieved. See
  135803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135804. // for more information.
  135805. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  135806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135807. return c
  135808. }
  135809. // IfNoneMatch sets the optional parameter which makes the operation
  135810. // fail if the object's ETag matches the given value. This is useful for
  135811. // getting updates only after the object has changed since the last
  135812. // request. Use googleapi.IsNotModified to check whether the response
  135813. // error from Do is the result of In-None-Match.
  135814. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  135815. c.ifNoneMatch_ = entityTag
  135816. return c
  135817. }
  135818. // Context sets the context to be used in this call's Do method. Any
  135819. // pending HTTP request will be aborted if the provided context is
  135820. // canceled.
  135821. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  135822. c.ctx_ = ctx
  135823. return c
  135824. }
  135825. // Header returns an http.Header that can be modified by the caller to
  135826. // add HTTP headers to the request.
  135827. func (c *ZoneOperationsGetCall) Header() http.Header {
  135828. if c.header_ == nil {
  135829. c.header_ = make(http.Header)
  135830. }
  135831. return c.header_
  135832. }
  135833. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  135834. reqHeaders := make(http.Header)
  135835. for k, v := range c.header_ {
  135836. reqHeaders[k] = v
  135837. }
  135838. reqHeaders.Set("User-Agent", c.s.userAgent())
  135839. if c.ifNoneMatch_ != "" {
  135840. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  135841. }
  135842. var body io.Reader = nil
  135843. c.urlParams_.Set("alt", alt)
  135844. c.urlParams_.Set("prettyPrint", "false")
  135845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  135846. urls += "?" + c.urlParams_.Encode()
  135847. req, err := http.NewRequest("GET", urls, body)
  135848. if err != nil {
  135849. return nil, err
  135850. }
  135851. req.Header = reqHeaders
  135852. googleapi.Expand(req.URL, map[string]string{
  135853. "project": c.project,
  135854. "zone": c.zone,
  135855. "operation": c.operation,
  135856. })
  135857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135858. }
  135859. // Do executes the "compute.zoneOperations.get" call.
  135860. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135861. // status code is an error. Response headers are in either
  135862. // *Operation.ServerResponse.Header or (if a response was returned at
  135863. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135864. // to check whether the returned error was because
  135865. // http.StatusNotModified was returned.
  135866. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135867. gensupport.SetOptions(c.urlParams_, opts...)
  135868. res, err := c.doRequest("json")
  135869. if res != nil && res.StatusCode == http.StatusNotModified {
  135870. if res.Body != nil {
  135871. res.Body.Close()
  135872. }
  135873. return nil, &googleapi.Error{
  135874. Code: res.StatusCode,
  135875. Header: res.Header,
  135876. }
  135877. }
  135878. if err != nil {
  135879. return nil, err
  135880. }
  135881. defer googleapi.CloseBody(res)
  135882. if err := googleapi.CheckResponse(res); err != nil {
  135883. return nil, err
  135884. }
  135885. ret := &Operation{
  135886. ServerResponse: googleapi.ServerResponse{
  135887. Header: res.Header,
  135888. HTTPStatusCode: res.StatusCode,
  135889. },
  135890. }
  135891. target := &ret
  135892. if err := gensupport.DecodeResponse(target, res); err != nil {
  135893. return nil, err
  135894. }
  135895. return ret, nil
  135896. // {
  135897. // "description": "Retrieves the specified zone-specific Operations resource.",
  135898. // "httpMethod": "GET",
  135899. // "id": "compute.zoneOperations.get",
  135900. // "parameterOrder": [
  135901. // "project",
  135902. // "zone",
  135903. // "operation"
  135904. // ],
  135905. // "parameters": {
  135906. // "operation": {
  135907. // "description": "Name of the Operations resource to return.",
  135908. // "location": "path",
  135909. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135910. // "required": true,
  135911. // "type": "string"
  135912. // },
  135913. // "project": {
  135914. // "description": "Project ID for this request.",
  135915. // "location": "path",
  135916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135917. // "required": true,
  135918. // "type": "string"
  135919. // },
  135920. // "zone": {
  135921. // "description": "Name of the zone for this request.",
  135922. // "location": "path",
  135923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135924. // "required": true,
  135925. // "type": "string"
  135926. // }
  135927. // },
  135928. // "path": "{project}/zones/{zone}/operations/{operation}",
  135929. // "response": {
  135930. // "$ref": "Operation"
  135931. // },
  135932. // "scopes": [
  135933. // "https://www.googleapis.com/auth/cloud-platform",
  135934. // "https://www.googleapis.com/auth/compute",
  135935. // "https://www.googleapis.com/auth/compute.readonly"
  135936. // ]
  135937. // }
  135938. }
  135939. // method id "compute.zoneOperations.list":
  135940. type ZoneOperationsListCall struct {
  135941. s *Service
  135942. project string
  135943. zone string
  135944. urlParams_ gensupport.URLParams
  135945. ifNoneMatch_ string
  135946. ctx_ context.Context
  135947. header_ http.Header
  135948. }
  135949. // List: Retrieves a list of Operation resources contained within the
  135950. // specified zone.
  135951. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  135952. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  135953. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135954. c.project = project
  135955. c.zone = zone
  135956. return c
  135957. }
  135958. // Filter sets the optional parameter "filter": A filter expression that
  135959. // filters resources listed in the response. The expression must specify
  135960. // the field name, a comparison operator, and the value that you want to
  135961. // use for filtering. The value must be a string, a number, or a
  135962. // boolean. The comparison operator must be either =, !=, >, or <.
  135963. //
  135964. // For example, if you are filtering Compute Engine instances, you can
  135965. // exclude instances named example-instance by specifying name !=
  135966. // example-instance.
  135967. //
  135968. // You can also filter nested fields. For example, you could specify
  135969. // scheduling.automaticRestart = false to include instances only if they
  135970. // are not scheduled for automatic restarts. You can use filtering on
  135971. // nested fields to filter based on resource labels.
  135972. //
  135973. // To filter on multiple expressions, provide each separate expression
  135974. // within parentheses. For example, (scheduling.automaticRestart = true)
  135975. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  135976. // AND expression. However, you can include AND and OR expressions
  135977. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  135978. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  135979. // true).
  135980. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  135981. c.urlParams_.Set("filter", filter)
  135982. return c
  135983. }
  135984. // MaxResults sets the optional parameter "maxResults": The maximum
  135985. // number of results per page that should be returned. If the number of
  135986. // available results is larger than maxResults, Compute Engine returns a
  135987. // nextPageToken that can be used to get the next page of results in
  135988. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  135989. // (Default: 500)
  135990. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  135991. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  135992. return c
  135993. }
  135994. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  135995. // a certain order. By default, results are returned in alphanumerical
  135996. // order based on the resource name.
  135997. //
  135998. // You can also sort results in descending order based on the creation
  135999. // timestamp using orderBy="creationTimestamp desc". This sorts results
  136000. // based on the creationTimestamp field in reverse chronological order
  136001. // (newest result first). Use this to sort resources like operations so
  136002. // that the newest operation is returned first.
  136003. //
  136004. // Currently, only sorting by name or creationTimestamp desc is
  136005. // supported.
  136006. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  136007. c.urlParams_.Set("orderBy", orderBy)
  136008. return c
  136009. }
  136010. // PageToken sets the optional parameter "pageToken": Specifies a page
  136011. // token to use. Set pageToken to the nextPageToken returned by a
  136012. // previous list request to get the next page of results.
  136013. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  136014. c.urlParams_.Set("pageToken", pageToken)
  136015. return c
  136016. }
  136017. // Fields allows partial responses to be retrieved. See
  136018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136019. // for more information.
  136020. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  136021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136022. return c
  136023. }
  136024. // IfNoneMatch sets the optional parameter which makes the operation
  136025. // fail if the object's ETag matches the given value. This is useful for
  136026. // getting updates only after the object has changed since the last
  136027. // request. Use googleapi.IsNotModified to check whether the response
  136028. // error from Do is the result of In-None-Match.
  136029. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  136030. c.ifNoneMatch_ = entityTag
  136031. return c
  136032. }
  136033. // Context sets the context to be used in this call's Do method. Any
  136034. // pending HTTP request will be aborted if the provided context is
  136035. // canceled.
  136036. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  136037. c.ctx_ = ctx
  136038. return c
  136039. }
  136040. // Header returns an http.Header that can be modified by the caller to
  136041. // add HTTP headers to the request.
  136042. func (c *ZoneOperationsListCall) Header() http.Header {
  136043. if c.header_ == nil {
  136044. c.header_ = make(http.Header)
  136045. }
  136046. return c.header_
  136047. }
  136048. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  136049. reqHeaders := make(http.Header)
  136050. for k, v := range c.header_ {
  136051. reqHeaders[k] = v
  136052. }
  136053. reqHeaders.Set("User-Agent", c.s.userAgent())
  136054. if c.ifNoneMatch_ != "" {
  136055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136056. }
  136057. var body io.Reader = nil
  136058. c.urlParams_.Set("alt", alt)
  136059. c.urlParams_.Set("prettyPrint", "false")
  136060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  136061. urls += "?" + c.urlParams_.Encode()
  136062. req, err := http.NewRequest("GET", urls, body)
  136063. if err != nil {
  136064. return nil, err
  136065. }
  136066. req.Header = reqHeaders
  136067. googleapi.Expand(req.URL, map[string]string{
  136068. "project": c.project,
  136069. "zone": c.zone,
  136070. })
  136071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136072. }
  136073. // Do executes the "compute.zoneOperations.list" call.
  136074. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  136075. // status code is an error. Response headers are in either
  136076. // *OperationList.ServerResponse.Header or (if a response was returned
  136077. // at all) in error.(*googleapi.Error).Header. Use
  136078. // googleapi.IsNotModified to check whether the returned error was
  136079. // because http.StatusNotModified was returned.
  136080. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  136081. gensupport.SetOptions(c.urlParams_, opts...)
  136082. res, err := c.doRequest("json")
  136083. if res != nil && res.StatusCode == http.StatusNotModified {
  136084. if res.Body != nil {
  136085. res.Body.Close()
  136086. }
  136087. return nil, &googleapi.Error{
  136088. Code: res.StatusCode,
  136089. Header: res.Header,
  136090. }
  136091. }
  136092. if err != nil {
  136093. return nil, err
  136094. }
  136095. defer googleapi.CloseBody(res)
  136096. if err := googleapi.CheckResponse(res); err != nil {
  136097. return nil, err
  136098. }
  136099. ret := &OperationList{
  136100. ServerResponse: googleapi.ServerResponse{
  136101. Header: res.Header,
  136102. HTTPStatusCode: res.StatusCode,
  136103. },
  136104. }
  136105. target := &ret
  136106. if err := gensupport.DecodeResponse(target, res); err != nil {
  136107. return nil, err
  136108. }
  136109. return ret, nil
  136110. // {
  136111. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  136112. // "httpMethod": "GET",
  136113. // "id": "compute.zoneOperations.list",
  136114. // "parameterOrder": [
  136115. // "project",
  136116. // "zone"
  136117. // ],
  136118. // "parameters": {
  136119. // "filter": {
  136120. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  136121. // "location": "query",
  136122. // "type": "string"
  136123. // },
  136124. // "maxResults": {
  136125. // "default": "500",
  136126. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  136127. // "format": "uint32",
  136128. // "location": "query",
  136129. // "minimum": "0",
  136130. // "type": "integer"
  136131. // },
  136132. // "orderBy": {
  136133. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  136134. // "location": "query",
  136135. // "type": "string"
  136136. // },
  136137. // "pageToken": {
  136138. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  136139. // "location": "query",
  136140. // "type": "string"
  136141. // },
  136142. // "project": {
  136143. // "description": "Project ID for this request.",
  136144. // "location": "path",
  136145. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136146. // "required": true,
  136147. // "type": "string"
  136148. // },
  136149. // "zone": {
  136150. // "description": "Name of the zone for request.",
  136151. // "location": "path",
  136152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136153. // "required": true,
  136154. // "type": "string"
  136155. // }
  136156. // },
  136157. // "path": "{project}/zones/{zone}/operations",
  136158. // "response": {
  136159. // "$ref": "OperationList"
  136160. // },
  136161. // "scopes": [
  136162. // "https://www.googleapis.com/auth/cloud-platform",
  136163. // "https://www.googleapis.com/auth/compute",
  136164. // "https://www.googleapis.com/auth/compute.readonly"
  136165. // ]
  136166. // }
  136167. }
  136168. // Pages invokes f for each page of results.
  136169. // A non-nil error returned from f will halt the iteration.
  136170. // The provided context supersedes any context provided to the Context method.
  136171. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  136172. c.ctx_ = ctx
  136173. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  136174. for {
  136175. x, err := c.Do()
  136176. if err != nil {
  136177. return err
  136178. }
  136179. if err := f(x); err != nil {
  136180. return err
  136181. }
  136182. if x.NextPageToken == "" {
  136183. return nil
  136184. }
  136185. c.PageToken(x.NextPageToken)
  136186. }
  136187. }
  136188. // method id "compute.zoneOperations.wait":
  136189. type ZoneOperationsWaitCall struct {
  136190. s *Service
  136191. project string
  136192. zone string
  136193. operation string
  136194. urlParams_ gensupport.URLParams
  136195. ctx_ context.Context
  136196. header_ http.Header
  136197. }
  136198. // Wait: Waits for the specified zone-specific Operations resource until
  136199. // it is done or timeout, and retrieves the specified Operations
  136200. // resource. 1. Immediately returns when the operation is already done.
  136201. // 2. Waits for no more than the default deadline (2 minutes, subject to
  136202. // change) and then returns the current state of the operation, which
  136203. // may be DONE or still in progress. 3. Is best-effort: a. The server
  136204. // can wait less than the default deadline or zero seconds, in overload
  136205. // situations. b. There is no guarantee that the operation is actually
  136206. // done when returns. 4. User should be prepared to retry if the
  136207. // operation is not DONE.
  136208. func (r *ZoneOperationsService) Wait(project string, zone string, operation string) *ZoneOperationsWaitCall {
  136209. c := &ZoneOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136210. c.project = project
  136211. c.zone = zone
  136212. c.operation = operation
  136213. return c
  136214. }
  136215. // Fields allows partial responses to be retrieved. See
  136216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136217. // for more information.
  136218. func (c *ZoneOperationsWaitCall) Fields(s ...googleapi.Field) *ZoneOperationsWaitCall {
  136219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136220. return c
  136221. }
  136222. // Context sets the context to be used in this call's Do method. Any
  136223. // pending HTTP request will be aborted if the provided context is
  136224. // canceled.
  136225. func (c *ZoneOperationsWaitCall) Context(ctx context.Context) *ZoneOperationsWaitCall {
  136226. c.ctx_ = ctx
  136227. return c
  136228. }
  136229. // Header returns an http.Header that can be modified by the caller to
  136230. // add HTTP headers to the request.
  136231. func (c *ZoneOperationsWaitCall) Header() http.Header {
  136232. if c.header_ == nil {
  136233. c.header_ = make(http.Header)
  136234. }
  136235. return c.header_
  136236. }
  136237. func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  136238. reqHeaders := make(http.Header)
  136239. for k, v := range c.header_ {
  136240. reqHeaders[k] = v
  136241. }
  136242. reqHeaders.Set("User-Agent", c.s.userAgent())
  136243. var body io.Reader = nil
  136244. c.urlParams_.Set("alt", alt)
  136245. c.urlParams_.Set("prettyPrint", "false")
  136246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}/wait")
  136247. urls += "?" + c.urlParams_.Encode()
  136248. req, err := http.NewRequest("POST", urls, body)
  136249. if err != nil {
  136250. return nil, err
  136251. }
  136252. req.Header = reqHeaders
  136253. googleapi.Expand(req.URL, map[string]string{
  136254. "project": c.project,
  136255. "zone": c.zone,
  136256. "operation": c.operation,
  136257. })
  136258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136259. }
  136260. // Do executes the "compute.zoneOperations.wait" call.
  136261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136262. // status code is an error. Response headers are in either
  136263. // *Operation.ServerResponse.Header or (if a response was returned at
  136264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136265. // to check whether the returned error was because
  136266. // http.StatusNotModified was returned.
  136267. func (c *ZoneOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136268. gensupport.SetOptions(c.urlParams_, opts...)
  136269. res, err := c.doRequest("json")
  136270. if res != nil && res.StatusCode == http.StatusNotModified {
  136271. if res.Body != nil {
  136272. res.Body.Close()
  136273. }
  136274. return nil, &googleapi.Error{
  136275. Code: res.StatusCode,
  136276. Header: res.Header,
  136277. }
  136278. }
  136279. if err != nil {
  136280. return nil, err
  136281. }
  136282. defer googleapi.CloseBody(res)
  136283. if err := googleapi.CheckResponse(res); err != nil {
  136284. return nil, err
  136285. }
  136286. ret := &Operation{
  136287. ServerResponse: googleapi.ServerResponse{
  136288. Header: res.Header,
  136289. HTTPStatusCode: res.StatusCode,
  136290. },
  136291. }
  136292. target := &ret
  136293. if err := gensupport.DecodeResponse(target, res); err != nil {
  136294. return nil, err
  136295. }
  136296. return ret, nil
  136297. // {
  136298. // "description": "Waits for the specified zone-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  136299. // "httpMethod": "POST",
  136300. // "id": "compute.zoneOperations.wait",
  136301. // "parameterOrder": [
  136302. // "project",
  136303. // "zone",
  136304. // "operation"
  136305. // ],
  136306. // "parameters": {
  136307. // "operation": {
  136308. // "description": "Name of the Operations resource to return.",
  136309. // "location": "path",
  136310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136311. // "required": true,
  136312. // "type": "string"
  136313. // },
  136314. // "project": {
  136315. // "description": "Project ID for this request.",
  136316. // "location": "path",
  136317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136318. // "required": true,
  136319. // "type": "string"
  136320. // },
  136321. // "zone": {
  136322. // "description": "Name of the zone for this request.",
  136323. // "location": "path",
  136324. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136325. // "required": true,
  136326. // "type": "string"
  136327. // }
  136328. // },
  136329. // "path": "{project}/zones/{zone}/operations/{operation}/wait",
  136330. // "response": {
  136331. // "$ref": "Operation"
  136332. // },
  136333. // "scopes": [
  136334. // "https://www.googleapis.com/auth/cloud-platform",
  136335. // "https://www.googleapis.com/auth/compute",
  136336. // "https://www.googleapis.com/auth/compute.readonly"
  136337. // ]
  136338. // }
  136339. }
  136340. // method id "compute.zones.get":
  136341. type ZonesGetCall struct {
  136342. s *Service
  136343. project string
  136344. zone string
  136345. urlParams_ gensupport.URLParams
  136346. ifNoneMatch_ string
  136347. ctx_ context.Context
  136348. header_ http.Header
  136349. }
  136350. // Get: Returns the specified Zone resource. Gets a list of available
  136351. // zones by making a list() request.
  136352. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  136353. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  136354. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136355. c.project = project
  136356. c.zone = zone
  136357. return c
  136358. }
  136359. // Fields allows partial responses to be retrieved. See
  136360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136361. // for more information.
  136362. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  136363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136364. return c
  136365. }
  136366. // IfNoneMatch sets the optional parameter which makes the operation
  136367. // fail if the object's ETag matches the given value. This is useful for
  136368. // getting updates only after the object has changed since the last
  136369. // request. Use googleapi.IsNotModified to check whether the response
  136370. // error from Do is the result of In-None-Match.
  136371. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  136372. c.ifNoneMatch_ = entityTag
  136373. return c
  136374. }
  136375. // Context sets the context to be used in this call's Do method. Any
  136376. // pending HTTP request will be aborted if the provided context is
  136377. // canceled.
  136378. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  136379. c.ctx_ = ctx
  136380. return c
  136381. }
  136382. // Header returns an http.Header that can be modified by the caller to
  136383. // add HTTP headers to the request.
  136384. func (c *ZonesGetCall) Header() http.Header {
  136385. if c.header_ == nil {
  136386. c.header_ = make(http.Header)
  136387. }
  136388. return c.header_
  136389. }
  136390. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  136391. reqHeaders := make(http.Header)
  136392. for k, v := range c.header_ {
  136393. reqHeaders[k] = v
  136394. }
  136395. reqHeaders.Set("User-Agent", c.s.userAgent())
  136396. if c.ifNoneMatch_ != "" {
  136397. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136398. }
  136399. var body io.Reader = nil
  136400. c.urlParams_.Set("alt", alt)
  136401. c.urlParams_.Set("prettyPrint", "false")
  136402. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  136403. urls += "?" + c.urlParams_.Encode()
  136404. req, err := http.NewRequest("GET", urls, body)
  136405. if err != nil {
  136406. return nil, err
  136407. }
  136408. req.Header = reqHeaders
  136409. googleapi.Expand(req.URL, map[string]string{
  136410. "project": c.project,
  136411. "zone": c.zone,
  136412. })
  136413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136414. }
  136415. // Do executes the "compute.zones.get" call.
  136416. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  136417. // code is an error. Response headers are in either
  136418. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  136419. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  136420. // whether the returned error was because http.StatusNotModified was
  136421. // returned.
  136422. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  136423. gensupport.SetOptions(c.urlParams_, opts...)
  136424. res, err := c.doRequest("json")
  136425. if res != nil && res.StatusCode == http.StatusNotModified {
  136426. if res.Body != nil {
  136427. res.Body.Close()
  136428. }
  136429. return nil, &googleapi.Error{
  136430. Code: res.StatusCode,
  136431. Header: res.Header,
  136432. }
  136433. }
  136434. if err != nil {
  136435. return nil, err
  136436. }
  136437. defer googleapi.CloseBody(res)
  136438. if err := googleapi.CheckResponse(res); err != nil {
  136439. return nil, err
  136440. }
  136441. ret := &Zone{
  136442. ServerResponse: googleapi.ServerResponse{
  136443. Header: res.Header,
  136444. HTTPStatusCode: res.StatusCode,
  136445. },
  136446. }
  136447. target := &ret
  136448. if err := gensupport.DecodeResponse(target, res); err != nil {
  136449. return nil, err
  136450. }
  136451. return ret, nil
  136452. // {
  136453. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  136454. // "httpMethod": "GET",
  136455. // "id": "compute.zones.get",
  136456. // "parameterOrder": [
  136457. // "project",
  136458. // "zone"
  136459. // ],
  136460. // "parameters": {
  136461. // "project": {
  136462. // "description": "Project ID for this request.",
  136463. // "location": "path",
  136464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136465. // "required": true,
  136466. // "type": "string"
  136467. // },
  136468. // "zone": {
  136469. // "description": "Name of the zone resource to return.",
  136470. // "location": "path",
  136471. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  136472. // "required": true,
  136473. // "type": "string"
  136474. // }
  136475. // },
  136476. // "path": "{project}/zones/{zone}",
  136477. // "response": {
  136478. // "$ref": "Zone"
  136479. // },
  136480. // "scopes": [
  136481. // "https://www.googleapis.com/auth/cloud-platform",
  136482. // "https://www.googleapis.com/auth/compute",
  136483. // "https://www.googleapis.com/auth/compute.readonly"
  136484. // ]
  136485. // }
  136486. }
  136487. // method id "compute.zones.list":
  136488. type ZonesListCall struct {
  136489. s *Service
  136490. project string
  136491. urlParams_ gensupport.URLParams
  136492. ifNoneMatch_ string
  136493. ctx_ context.Context
  136494. header_ http.Header
  136495. }
  136496. // List: Retrieves the list of Zone resources available to the specified
  136497. // project.
  136498. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  136499. func (r *ZonesService) List(project string) *ZonesListCall {
  136500. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136501. c.project = project
  136502. return c
  136503. }
  136504. // Filter sets the optional parameter "filter": A filter expression that
  136505. // filters resources listed in the response. The expression must specify
  136506. // the field name, a comparison operator, and the value that you want to
  136507. // use for filtering. The value must be a string, a number, or a
  136508. // boolean. The comparison operator must be either =, !=, >, or <.
  136509. //
  136510. // For example, if you are filtering Compute Engine instances, you can
  136511. // exclude instances named example-instance by specifying name !=
  136512. // example-instance.
  136513. //
  136514. // You can also filter nested fields. For example, you could specify
  136515. // scheduling.automaticRestart = false to include instances only if they
  136516. // are not scheduled for automatic restarts. You can use filtering on
  136517. // nested fields to filter based on resource labels.
  136518. //
  136519. // To filter on multiple expressions, provide each separate expression
  136520. // within parentheses. For example, (scheduling.automaticRestart = true)
  136521. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  136522. // AND expression. However, you can include AND and OR expressions
  136523. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  136524. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  136525. // true).
  136526. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  136527. c.urlParams_.Set("filter", filter)
  136528. return c
  136529. }
  136530. // MaxResults sets the optional parameter "maxResults": The maximum
  136531. // number of results per page that should be returned. If the number of
  136532. // available results is larger than maxResults, Compute Engine returns a
  136533. // nextPageToken that can be used to get the next page of results in
  136534. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  136535. // (Default: 500)
  136536. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  136537. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  136538. return c
  136539. }
  136540. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  136541. // a certain order. By default, results are returned in alphanumerical
  136542. // order based on the resource name.
  136543. //
  136544. // You can also sort results in descending order based on the creation
  136545. // timestamp using orderBy="creationTimestamp desc". This sorts results
  136546. // based on the creationTimestamp field in reverse chronological order
  136547. // (newest result first). Use this to sort resources like operations so
  136548. // that the newest operation is returned first.
  136549. //
  136550. // Currently, only sorting by name or creationTimestamp desc is
  136551. // supported.
  136552. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  136553. c.urlParams_.Set("orderBy", orderBy)
  136554. return c
  136555. }
  136556. // PageToken sets the optional parameter "pageToken": Specifies a page
  136557. // token to use. Set pageToken to the nextPageToken returned by a
  136558. // previous list request to get the next page of results.
  136559. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  136560. c.urlParams_.Set("pageToken", pageToken)
  136561. return c
  136562. }
  136563. // Fields allows partial responses to be retrieved. See
  136564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136565. // for more information.
  136566. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  136567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136568. return c
  136569. }
  136570. // IfNoneMatch sets the optional parameter which makes the operation
  136571. // fail if the object's ETag matches the given value. This is useful for
  136572. // getting updates only after the object has changed since the last
  136573. // request. Use googleapi.IsNotModified to check whether the response
  136574. // error from Do is the result of In-None-Match.
  136575. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  136576. c.ifNoneMatch_ = entityTag
  136577. return c
  136578. }
  136579. // Context sets the context to be used in this call's Do method. Any
  136580. // pending HTTP request will be aborted if the provided context is
  136581. // canceled.
  136582. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  136583. c.ctx_ = ctx
  136584. return c
  136585. }
  136586. // Header returns an http.Header that can be modified by the caller to
  136587. // add HTTP headers to the request.
  136588. func (c *ZonesListCall) Header() http.Header {
  136589. if c.header_ == nil {
  136590. c.header_ = make(http.Header)
  136591. }
  136592. return c.header_
  136593. }
  136594. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  136595. reqHeaders := make(http.Header)
  136596. for k, v := range c.header_ {
  136597. reqHeaders[k] = v
  136598. }
  136599. reqHeaders.Set("User-Agent", c.s.userAgent())
  136600. if c.ifNoneMatch_ != "" {
  136601. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136602. }
  136603. var body io.Reader = nil
  136604. c.urlParams_.Set("alt", alt)
  136605. c.urlParams_.Set("prettyPrint", "false")
  136606. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  136607. urls += "?" + c.urlParams_.Encode()
  136608. req, err := http.NewRequest("GET", urls, body)
  136609. if err != nil {
  136610. return nil, err
  136611. }
  136612. req.Header = reqHeaders
  136613. googleapi.Expand(req.URL, map[string]string{
  136614. "project": c.project,
  136615. })
  136616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136617. }
  136618. // Do executes the "compute.zones.list" call.
  136619. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  136620. // code is an error. Response headers are in either
  136621. // *ZoneList.ServerResponse.Header or (if a response was returned at
  136622. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136623. // to check whether the returned error was because
  136624. // http.StatusNotModified was returned.
  136625. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  136626. gensupport.SetOptions(c.urlParams_, opts...)
  136627. res, err := c.doRequest("json")
  136628. if res != nil && res.StatusCode == http.StatusNotModified {
  136629. if res.Body != nil {
  136630. res.Body.Close()
  136631. }
  136632. return nil, &googleapi.Error{
  136633. Code: res.StatusCode,
  136634. Header: res.Header,
  136635. }
  136636. }
  136637. if err != nil {
  136638. return nil, err
  136639. }
  136640. defer googleapi.CloseBody(res)
  136641. if err := googleapi.CheckResponse(res); err != nil {
  136642. return nil, err
  136643. }
  136644. ret := &ZoneList{
  136645. ServerResponse: googleapi.ServerResponse{
  136646. Header: res.Header,
  136647. HTTPStatusCode: res.StatusCode,
  136648. },
  136649. }
  136650. target := &ret
  136651. if err := gensupport.DecodeResponse(target, res); err != nil {
  136652. return nil, err
  136653. }
  136654. return ret, nil
  136655. // {
  136656. // "description": "Retrieves the list of Zone resources available to the specified project.",
  136657. // "httpMethod": "GET",
  136658. // "id": "compute.zones.list",
  136659. // "parameterOrder": [
  136660. // "project"
  136661. // ],
  136662. // "parameters": {
  136663. // "filter": {
  136664. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  136665. // "location": "query",
  136666. // "type": "string"
  136667. // },
  136668. // "maxResults": {
  136669. // "default": "500",
  136670. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  136671. // "format": "uint32",
  136672. // "location": "query",
  136673. // "minimum": "0",
  136674. // "type": "integer"
  136675. // },
  136676. // "orderBy": {
  136677. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  136678. // "location": "query",
  136679. // "type": "string"
  136680. // },
  136681. // "pageToken": {
  136682. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  136683. // "location": "query",
  136684. // "type": "string"
  136685. // },
  136686. // "project": {
  136687. // "description": "Project ID for this request.",
  136688. // "location": "path",
  136689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136690. // "required": true,
  136691. // "type": "string"
  136692. // }
  136693. // },
  136694. // "path": "{project}/zones",
  136695. // "response": {
  136696. // "$ref": "ZoneList"
  136697. // },
  136698. // "scopes": [
  136699. // "https://www.googleapis.com/auth/cloud-platform",
  136700. // "https://www.googleapis.com/auth/compute",
  136701. // "https://www.googleapis.com/auth/compute.readonly"
  136702. // ]
  136703. // }
  136704. }
  136705. // Pages invokes f for each page of results.
  136706. // A non-nil error returned from f will halt the iteration.
  136707. // The provided context supersedes any context provided to the Context method.
  136708. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  136709. c.ctx_ = ctx
  136710. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  136711. for {
  136712. x, err := c.Do()
  136713. if err != nil {
  136714. return err
  136715. }
  136716. if err := f(x); err != nil {
  136717. return err
  136718. }
  136719. if x.NextPageToken == "" {
  136720. return nil
  136721. }
  136722. c.PageToken(x.NextPageToken)
  136723. }
  136724. }